Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-174110

Hasitem Command Attribute Fails To Correctly Identify Data Values on Tools

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 1.20.12 Hotfix
    • None
    • Unconfirmed
    • Xbox

      Steps to reproduce

      1. /give @s wooden_sword 1 1 --> Gives yourself a wooden sword of -1 durability from full, aka 1 wooden sword of data value 1.
      2. /testfor @s[hasitem=\{item=wooden_sword,data=1}] --> Runs a test to see if you have a wooden sword of data value 1

      Expected result

      The testfor command should come up positive because you have given yourself a wooden sword of data value 1.

      Observed result

      The testfor command comes up negative.

      Explanation

      The hasitem command is claiming that all swords no matter their data value/durability has a data value of 0, which is full durability when the sword is clearly damaged.

      Reasoning

      I'm trying to make a command execute when a player's sword is damaged to perform a function and then mend the sword back to full durability, which I wouldn't want the command to run if the player's sword is at full durability.

            Fudgvilo Fudgvilo
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: