mojira.dev
MC-120371

Data types and formatting are not corrected within items' tag NBT

The item data type (byte, int, short, float, double, string, long, int array, byte array, long array) are not corrected within item data's tag tag.

Using

/give @s minecraft:diamond_sword{Unbreakable:1}

should correct the Unbreakable tag to a byte (1b), but it instead just saves it as an integer (it will still function correctly though).

This affects every tag within item's tag tag.
This should be solvable without breaking custom item tags.

Steps to reproduce:

  1. Use

    /give @s minecraft:diamond_sword{Unbreakable:1}
  2. Use

    /say @s[nbt={Inventory:[{tag:{Unbreakable:1b}}]}]
  3. Notice failing command

  4. Use

    /say @s[nbt={Inventory:[{tag:{Unbreakable:1}}]}]
  5. Notice successful command

  6. Remove the diamond sword

  7. Use

    /give @s minecraft:diamond_sword{Unbreakable:1b}
  8. Use

    /say @s[nbt={Inventory:[{tag:{Unbreakable:1b}}]}]
  9. Notice successful command

  10. Use

    /say @s[nbt={Inventory:[{tag:{Unbreakable:1}}]}]
  11. Notice failing command

  12. Even though it's the exact same tag, the commands fail/succeed depending on the give command, unlike testing for tags outside of the tag tag

Linked issues

Comments 4

Confirmed for 1.13.1-pre1

Confrimed for 19w44a.

Can confirm that this issue is still present in 20w51a.

Can confirm in 21w03a.

user-f2760

(Unassigned)

Confirmed

(Unassigned)

Minecraft 1.12, Minecraft 1.12.1 Pre-Release 1, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 17w47b, ..., 20w51a, 21w03a, 21w05a, 1.17, 1.17.1

Retrieved