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

Crash when spawning item with can_break/can_place_on component containing unknown/invalid tag

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 24w10a
    • 24w09a
    • None
    • Plausible
    • Commands, Crash
    • Very Important
    • Platform

      Loading an item with a minecraft:can_break or minecraft:can_place_on component containing a tag which does not exist in the current world crashes the game with the error "java.lang.IllegalStateException: Missing tag TagKey[minecraft:block / <invalid tag name>]", where "<invalid tag name>" is the name of the nonexistent tag in question.

      This can be fairly troublesome if, say, one has custom items containing datapack-specific tags in their saved hotbars and tries to open that tab in a world without the pack installed. Or just if your finger slips while typing in a command. And, of course, once the item is spawned, the world becomes inaccessible as it will crash every time it attempts to load the item in question. In some cases it seems even trying to paste the command into chat will force-quit the game; I'm not currently able to diagnose this any further on account of, you know, the constant crashing.

      Likely a reprisal of MC-129254.

      Steps to reproduce:

      • Run
        /give @s stone[can_place_on={blocks:'#minecraft:stone'}]
      • Crash.

            gegy1000 [Mojang] Gegy
            KirbAvion Kirven Avion
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: