Keep Gameplay State Server Authoritative
A common desync occurs when a client changes inventory or world state locally while the server rejects or never receives that change: the UI briefly shows success, then snaps back or diverges from nearby players. Route state-changing intent to the server, validate it there, and replicate the accepted result; keep client prediction limited to presentation that can be reconciled. For debugging, compare the same state at client and server around the action and identify which side first diverges; exact packet and synchronization APIs depend on Minecraft version, loader, and mappings.
When the server rejects an action, send the authoritative state back to that client so its display is corrected immediately. Otherwise the rejected result stays on screen until the next full sync. If you have hit a variant of this, share it below.