Description:
While the shulker box keeps NBT components when broken directly by the player (mined), some components like damage_resistant or custom_model_data are lost, when the shulkerbox is broken by tnt or pistons. Interestingly, other components like lock do not seem to be affected by this.
Steps to reproduce:
run following command to aquire shulkerbox:
/give @p shulker_box[damage_resistant={types:"#minecraft:is_fire"}] 1
place shulkerbox down, and let a piston or tnt break shulkerbox
inspect dropped shulkerbox item eg. using command:
/data get entity @e[type=item,limit=1]
notice damage_resistant component of new item is missing
(Optional) repeat steps 1-4 but break the shulkerbox by mining it instead and notice damage_resistant component of new Item is still present
Expected behavior:
shulker box keeps all NBT components when broken by pistons, tnt or player
Actual behavior:
shulker box looses some NBT components when broken by pistons or tnt, while keeping them when mined by a player
This issue is already being tracked in MC-270180.