mojira.dev
MC-272908

The nbt field in can_break/can_place_on data components sometimes does not work

The bug:

The nbt field in the can_break/can_place_on data component does not match the nbt of some container blocks without Ctrl + Pick.

Steps to reproduce:

  1. Give a tool which can break a decorated pot containing only one stick.

    /give @s diamond_sword[minecraft:can_break={predicates:[{blocks:"minecraft:decorated_pot",nbt:'{item:{count:1,id:"minecraft:stick"}}'}]}]
  2. Place a empty decorated pot and put a stick in it.

  3. Ctrl + Pick the decorated pot and place it aside. You can verify that these blocks have the same NBT tags.

  4. Switch to adventure mode.

  5. Break them all with the sword.

Observed Behavior:

Step #1 pot is broken but Step #2 pot is not broken.

A further test: After saving and reloading the world, Step #2 pot can be broken.

Note: It seems that the bug exists in other container blocks as well. I have tested the chiseled bookshelf and the shulker box, and their behavior matches the Step #1-5 but still can't be broken after reloading.

Expected Behavior:

Both decorated pots can be break.

Linked issues

Attachments

Comments 2

Added video where it works really strange

CaN2crow987

(Unassigned)

Community Consensus

Platform

Normal

Commands

1.20.6, 1.21 Pre-Release 2, 1.21 Pre-Release 3, 1.21 Pre-Release 4, 1.21, ..., 1.21.2, 24w44a, 1.21.3, 1.21.5, 25w18a

Retrieved