The bug
When placing a painting with NBT in survival mode if the space you're trying to place it on is too small the painting will disappear from your inventory. You can get it back by either clicking on the slot in your inventory or reloading the world
To reproduce
Give yourself a painting item with NBT:
/give @p painting[entity_data={id:"minecraft:painting",variant:"minecraft:creebet"}] 1
Try to place it on a block.
Observed result
The item "disappears" from the inventory, reappearing when the slot is clicked from the inventory.
Expected result
The placement would fail completely.
Code analysis (as of 24w18a)
Through the use of Spongepowered Mixins, I was able to come up with a fix, and that is to move line 75 (the "remove 1 from stack" line) of HangingEntityItem.java up a couple of lines into the "if is not client" code block where the placement sound is played
Linked issues
is duplicated by 6
Attachments
Comments 4
Said the item would disappear with item, although I have proof (cant find it though), it's worked on trees barriers, heck, on grass. I am in 23w51b right now as we speak. And it's multiplayer (lan -id/port: 2014).
Confirmed in 1.19.4 pre-release 3.