fabric
fabric copied to clipboard
PlayerBlockBreakEvents cannot prevent render changes on client side
Within PlayerBlockBreakEvents
it is stated that PlayerBlockBreakEvents.BEFORE
is called "before a block is broken" and "only called on the server, however updates are synced with the client". The issue is, only awaiting client-server sync still leaves render artifacts as the client calls world.setBlockState
within ClientPlayerInteractionManager.breakBlock
. So registering a callback to PlayerBlockBreakEvents.BEFORE
with the intention of canceling the block break results in the block flickering on the client side since the client breaks it anyways and it isn't until syncing with the server afterwards that it is updated to the original value.