When a player is holding a carrot on a stick on the client while riding a saddled pig, the client fully takes control over the pig’s movement. This naturally causes desyncs between the client and server if the player is holding a “ghosted”/desynced item, which in themselves aren’t that harmful as long as the players and pigs position are always resolved back to the server state. However, if the player quickly switches to holding another carrot on a stick which isn’t desynced, then the server will acknowledge the client as being authorative and will teleport the player/pig on the server to their current position on the client. This can also further be abused by holding a charged spear in the offhand, which causes the player to deal very high amounts of damage due to the extremely high server velocity.
Reproduction:
Step 1: Summon a pig (preferrably with NoAI:1) and equip it with a saddle.
Step 2: Put a carrot on a stick into your hotbar (just make sure there's an empty slot before the slot it is in) and switch into survival mode.
Step 3: Hover the carrot on a stick in your hotbar, then press the keybind to drop items at the same time as pressing the keybind to switch hotbar slot to some different one (same process as MC-154881).
Step 4: Pick up the dropped carrot on a stick (you should now have two of them in your hotbar).
Step 5: Start riding the pig while holding the carrot on a stick that is still in it’s original slot (NOT the one you just picked up from the ground).
Step 6: Either get off the pig to get teleported back to your original position before starting to ride to pig, or switch hotbar slots from the desynced carrot on a stick to the proper one to get teleported to your current position on the server and one-hit everything if also holding a charged spear.
Further notes:
I already previously adressed the issue of “ghost”/desynced items in my recent report MC-310906. It is mostly caused by the client not sending an updated Set Carried Item packet in case of dropping items or using the keybind to switch them with your offhand, and the bug MC-310906 itself. Ghost items are incredibly hard to deal with for multiplayer servers and especially AntiCheat-developers, as there is currently no way to actually know for sure what item a player is holding in a certain slot at any time, making a lot of item components practically unusable. I believe a lot of players would appreciate to finally have a fix for these desyncs and probably even more players would appreciate a fix of MC-310906, so I also wanted to kindly ask you to maybe consider reopening it.
I apologize for the delayed audio in my attachments.
Thank you for helping us improve Minecraft! We saved your files: