mojira.dev
MCPE-174110

Hasitem Command Attribute Fails To Correctly Identify Data Values on Tools

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.

Linked issues

Comments 1

Thank you for your report!
We're tracking this issue in MCPE-159409, so this ticket is being resolved and linked as a duplicate.

If you would like to add a vote and any extra information to the main ticket it would be appreciated.

If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
-- I am a bot. This action was performed automatically! The ticket was resolved by one of our moderators, and I left this message to give more information to you.

Fudgvilo

(Unassigned)

Unconfirmed

Xbox

Xbox Series X

1.20.12 Hotfix

Retrieved