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

Items containing a block tag in can_place_on or can_break components become unable to stack after data is reloaded

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.21.2 Pre-Release 3, 1.21.2 Pre-Release 4, 1.21.2 Pre-Release 5, 1.21.2 Release Candidate 1, 1.21.2 Release Candidate 2, 1.21.2, 24w44a, 1.21.3, 24w45a, 24w46a, 1.21.4 Pre-Release 1, 1.21.4 Pre-Release 2, 1.21.4 Pre-Release 3, 1.21.4 Release Candidate 3, 1.21.4
    • None
    • Community Consensus
    • Commands, Items
    • Important
    • Platform

      If the player's inventory contains an item with a block tag in its can_place_on or can_destroy fields, and the /reload command is run (even if only the vanilla datapack is present), any subsequent copy of that item given to the player will be treated as different and be unable to stack with the original item, despite the two appearing identical from a data perspective.

      Once the player's inventory is updated (by opening a container, etc.) the two items become stackable again.

      Steps to reproduce:

      • /give @s stone[can_place_on={predicates: [{blocks:"#minecraft:dirt"}]}]
      • /reload
      • Again,
        /give @s stone[can_place_on={predicates: [{blocks:"#minecraft:dirt"}]}]
      • Note the items do not enter the same inventory slot and cannot stack, despite no changes being made to the command.
      • For flavor,
        /data get entity @s Inventory

        and compare the two items' data - the data will appear identical but the stacks still will not combine.

      • Open a chest, shift-click both items into it; now they stack.

        1. 2024-10-12_17.27.15.png
          2024-10-12_17.27.15.png
          1.75 MB
        2. 2024-10-12_17.27.20.png
          2024-10-12_17.27.20.png
          1.74 MB
        3. 2024-10-12 17-37-17.mov
          9.35 MB

            Unassigned Unassigned
            KirbAvion Kirven Avion
            Votes:
            6 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              CHK: