ItemStack instance duplication (item shadowing)
When swapping items through regular clicks in a chest storage screen. In ScreenHandler.java internalOnSlotClick
slot.setStack(itemStack52)
this.setCursorStack(itemStack5)
The slot.setStack takes a direct reference to the stack in your cursor, instead of first copying it to a new instance, and sets it to the slot. The routine then replaces the cursor with the item previously in the slot. Since slot.setStack can be suppressed the same way as in 1.17's instance duplicating bug this can also be used to duplicate ItemStack instances.
Steps in video:
Suppress clicking item stack 1. The client will visually put the slime in your cursor, though the server will retain the sand stack.
Suppress clicking item stack 2. The client will visually put the visually held slime into the slime stack. The client will visually show no item in the cursor.
Use number key to swap one of the items in the chest to your hotbar.
Server will update the client with the true state of the world, three cloned sand ItemStacks.
Closing the chest or placing the cursor stack into an inventory at this point will desync the clones. Throw the extra stack away so you can use the number keeps to retrieve the duplicated ItemStack instance.
https://www.youtube.com/watch?v=dSwe2vQtefs
2022-03-26, 04:30 PM
2022-03-29, 10:32 AM
2022-03-29, 10:32 AM
1
2