Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-87252

Optional tags gets removed when set to false/0/empty

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 15w35b, Minecraft 1.10.2, Minecraft 16w43a, Minecraft 16w44a, Minecraft 1.11.2, Minecraft 17w14a, Minecraft 17w15a, Minecraft 1.12.2, Minecraft 17w50a, 19w42a, 1.15.2, 1.16 Release Candidate 1, 1.16, 1.16.1, 1.16.4, 20w51a, 21w06a, 1.17.1, 21w38a, 1.18.1, 22w05a, 1.18.2, 22w19a, 1.20.4
    • Confirmed
    • (Unassigned)

      The Bug

      When the CustomNameVisible tag is set to false (0b) the game automatically removes the tag from the NBT data of the Entity. This also affects newly summoned Entities which do not have it by default if it is not true.
      This is a big problem as you cannot test for it then.

      Steps to Reproduce

      • Summon a husk with its "CustomNameVisible" tag set to "0b".
         /summon minecraft:husk ~ ~ ~ {CustomNameVisible:0b}
        
      • Use the data command on the husk to inspect the value of its "CustomNameVisible" tag.
        /data get entity @e[type=minecraft:husk,limit=1,sort=nearest] CustomNameVisible
        

        → Notice how the error message, "Found no elements matching CustomNameVisible" is displayed in the chat, therefore indicating that optional NBT data tags get removed when set to "0", "false", or "empty".

      Expected Behavior

      The expected behavior would be that optional NBT data tags would not get removed when set to "0", "false", or "empty".

        1. MC-87252.mp4
          3.23 MB
        2. MC-87252.png
          MC-87252.png
          589 kB

            Unassigned Unassigned
            marcono1234 Marcono1234
            Votes:
            9 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              CHK: