-
Bug
-
Resolution: Duplicate
-
None
-
1.19.60 (Bedrock)
-
None
-
Unconfirmed
-
Bedrock
/give @s diamond_sword 1 50
The above command will yield a Diamond Sword with minus 50 durability.
/clear @s diamond_sword 50 1
The above command removes a diamond sword with minus 50 durability from the wielder if the wielder has one.
/clear @s[hasitem=
{item=diamond_sword,data=50}] diamond_sword 50 1The above command SHOULD remove a diamond sword with minus 50 durability from the wielder if the wielder has one. However it does not because "[hasitem={item=diamond_sword,data=50}
]" will return false no matter what.
An example of a practical use for this would be:
/replaceitem entity @a[hasitem=
] slot.weapon.mainhand 0 diamond_sword 1 0
This would make it so that if a player fully repairs an iron sword, it would transform into a diamond sword. My applications are more complex, but even basic things such as this are undoable with the current Data function not behaving within the hasitem condition
- duplicates
-
MCPE-151920 The command does not evaluate the selector argument "hasitem" -> data.
- Reopened