Skip to content

Comparing type of two items, of the same type, with differing enchants fails #8144

@Dot0420

Description

@Dot0420

Skript/Server Version

Skript 2.12.1
Purpur 1.21.4

Bug Description

When an item has an enchantment, comparing its type with type of {_item} makes the enchanted item and the non-enchanted item be recognized as different items.

Expected Behavior

.

Steps to Reproduce

command /enchanttest:
    trigger:
        set {_left} to slot 0 of player's inventory
        set {_right} to slot 1 of player's inventory

        broadcast type of {_left}
        broadcast type of {_right}

        if type of {_left} = type of {_right}:
            broadcast "a"


At this point, if either the left or right item has an enchantment, they are recognized as different items.

Errors or Screenshots

No response

Other

When comparing like in the code below, the problem is resolved, but I’m leaving an issue for now.

set {_left} to plain slot 0 of player's inventory
set {_right} to plain slot 1 of player's inventory

Agreement

  • I have read the guidelines above and affirm I am following them with this report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn issue that needs to be fixed. Alternatively, a PR fixing an issue.priority: mediumIssues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions