Paper
Paper copied to clipboard
ItemMeta CanPlaceOn and CanDestroy lose block state/tile state info
Expected behavior
The CanPlaceOn and CanDestroy NBT values on itemstacks support more than just material keys, or material tag keys, they also support block state (mojangs name)/block data (bukkits name) and tile state info. Like minecraft:chest[waterlogged=true]{Contents:...}. That extra block info should be preserved.
Observed/Actual behavior
When an itemstack goes through the nms -> bukkit -> nms path, that extra block data is lost.
Steps/models to reproduce
- Place 4 chests, each facing a different direction
- Enter Adventure mode
- Give your self one of these
/minecraft:give @s minecraft:diamond_pickaxe{CanDestroy:["minecraft:chest[facing=north]"]}- Don't move it in your inventory
- Try to break each of the chests, you can only break the one facing north (correct behavior).
- Move the pick to a different slot in your hotbar
- You can now break any of the chests
Verify with /paper dumpitem that the pickaxe has lost the extra [facing=north] bit.
Plugin and Datapack List
None
Paper version
1.17.1 304
Other
No response