NeoForge icon indicating copy to clipboard operation
NeoForge copied to clipboard

Cancelling BlockEvent.EntityPlaceEvent causes itemstack desync

Open moonfather1 opened this issue 2 years ago • 1 comments

MC 1.20.4, NF 20.4.0-beta

if i cancel BlockEvent.EntityPlaceEvent (server-only event for placing blocks), blockitem count is shrunk on client (block disappears from hotbar if there was only one piece). opening inventory and moving items around fixes hotbar (block reappears on client).

moonfather1 avatar Dec 13 '23 13:12 moonfather1

I'm not sure this event will ever be able to provide such behavior. You may want to look into using the UseItemOnBlockEvent, which fires on both sides, to cancel block placement.

Shadows-of-Fire avatar May 18 '24 04:05 Shadows-of-Fire

If this event cannot be reasonable canceled, it should just not be cancelable.

KnightMiner avatar May 18 '24 07:05 KnightMiner