mojira.dev
MC-239935

Client-side desyncs can still occur when using the "/item" or "/give" commands repeatedly

The Bug:

Client-side desyncs can still occur when using the "/item" command repeatedly.

It appears that MC-219018 wasn't fully fixed as you can still reproduce this when placing blocks.

Steps to Reproduce:

  1. Summon a repeating command block that will constantly replace the first slot in your hotbar with dirt by using the command provided below.

    /setblock ~ ~ ~ minecraft:repeating_command_block{Command:"/item replace entity @p hotbar.0 with minecraft:dirt",auto:1b}
  2. Switch into survival mode and place down the dirt.

  3. Take note as to whether or not a new piece of dirt can be visually seen in your first hotbar slot.

  4. Check to see if any dirt is present in your inventory by using the command provided below.

    /data get entity @s Inventory
  5. Take note as to whether or not client-side desyncs can still occur when using the "/item" command repeatedly.

Observed Behavior:

Client-side desyncs can still occur.

Expected Behavior:

Client-side desyncs would not occur.

Linked issues

MC-132923 Giving an item on the same tick it's placed causes desync for the item stack Resolved MC-174842 Eating/Drinking only succeeds client-side if item is replaced with identical item Resolved MC-190336 Deleting a turtle helmet you were wearing shortly after wearing it causes the water breathing effect to be stuck at 0 Resolved MC-220040 Execute unless entity selector nbt inventory slot bug Resolved MC-233401 /item causes desyncs when used between a player and another entity. Resolved

Attachments

Comments 11

Correct me if I'm wrong but I believe this issue clones MC-219018 as it wasn't fully fixed.

Can confirm. The ghost item can be updated by clicking in the slot it should be (the same behaviour as MC-219018)

The only difference now seems to be that the player doesn't need to drop the item to 'trigger' the bug

@MMK21 You don't need to drop an item in order for either of them to work. Dropping an item is (I believe) only done as a demonstration, since the observed behavior happens when the block is placed, regardless of previous actions.

These issues are identical, so this report clones MC-219018.

Affects 1.18.2

Turns out I reproduced this glitch without even knowing.

1 more comments

Can confirm in 1.20.3 Release Candidate 1

Can confirm in 1.20.4 Release Candidate 1

Can confirm in 24w12a

 

In this snapshot, with the addition of the food item component, which allows to detect right-clicks in a versatile and easy-to-implement way, this bug becomes more pressing. When re-filling a slot from an item that has been eaten, the item given using /item replace of /give is always a ghost item.

Steps to reproduce:

  1. Install the datapack provided

[media]
  1. Give yourself an item with
    /give @s minecraft:arrow[minecraft:food={"saturation_modifier":0,"nutrition":0,"can_always_eat":true,"eat_seconds":0.05},minecraft:max_stack_size=1]

  2. Right click this item

  3. Observe that even though the item gets refilled server-side by the datapack, it does not re-appear client-side

Since this bug happens even when the item command is not being spammed/run on repeat, but rather just when the command is used in general, it is a separate issue from the other bug report. The description should be updated to reflect that information to make it more clear that it's a separate issue despite the outcome of both being the same (ghost items being created).

Can reproduce in 1.21.1 with a datapack:

function called from tick.json:

execute as @a[nbt=!{Inventory:[{id:"minecraft:dirt"}]}] run function datapack:give

give.mcfunction:

give @s minecraft:dirt

When dropping the dirt, a new one correctly appears in the inventory, when placing it, the new one is invisible.

Avoma

(Unassigned)

Confirmed

Platform

Normal

Commands, Networking

Minecraft 1.12.2, Minecraft 1.13-pre6, Minecraft 1.13, Minecraft 1.13.1, 1.15.2, ..., 1.21 Pre-Release 3, 1.21, 1.21.1, 24w34a, 1.21.4

Retrieved