Mojira Archive
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.

Duplicate

Fudgvilo

2023-08-09, 06:45 AM

2023-08-09, 01:00 PM

2023-08-09, 12:55 PM

0

0

Unconfirmed

1.20.12 Hotfix

-