-
Bug
-
Resolution: Duplicate
-
None
-
1.20.12 Hotfix
-
None
-
Unconfirmed
-
Xbox
Steps to reproduce
- /give @s wooden_sword 1 1 --> Gives yourself a wooden sword of -1 durability from full, aka 1 wooden sword of data value 1.
- /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.
- duplicates
-
MCPE-159409 Hasitem/data argument does not on items that use data as "damage"
- Resolved