mojira.dev
MC-233401

/item causes desyncs when used between a player and another entity.

Bug:
Using /item replace from an entity to a player can cause a desync, even in Singleplayer.

Reproduce:
1. Download the attached datapack.
2. Run /function desync:test
3. Now, throw an item of any kind.
4. Immediately remove the item from the head slot.

If you do the last 2 steps quick enough (within a second), repeating step 3 with the same item you've used before will not result in a new head being applied (which it should).

Why is this a desync?
If you relog now, the added head should reappear, as if step 4 didn't happened.

My thoughts:
This happens probably because from the server's perspective, the item is still on the player's head.
But the player on the client-side can't see it or do anything about it until they relog.
Desync in Singleplayer basically happened because of a particular change I can't remember of in 1.3.

Haven't tried Java, so don't take my word for it.

Final Words:
Please fix this, this affects all fun maps and datapacks that are using this technique to make awesome things for the community.
Knowing the datapacks installed, some people may use this to basically destroy servers that uses those datapacks with duped items until the bug gets resolved.

Linked issues

Attachments

Comments 2

Can confirm only in Creative mode. This may be due to less frequent synchronization of inventory with the server in creative mode.

Could you review MC-239935 and see if it happens to describe your issue? I tried to take a look through your datapack and see myself, but was unable to tell.

Lando Calrissian

(Unassigned)

Community Consensus

(Unassigned)

1.17.1

Retrieved