Mojira Archive
MC-198182

Container closing happens too late allowing item duplication

The bug

1.16.2, Mojang names

It appears closing of containers happens too late: Only the next tick instead of directly after the container is destroyed, see also this comment.
Or there should be an additional AbstractContainerMenu.stillValid(Player) before every menu interaction.

Due to net.minecraft.world.Containers.dropContents(Level, double, double, double, Container) not clearing the container this might allow item duplication:

  1. Player A accesses a container
  2. In the same tick:
    1. Another player (or possibly even the same player; modified client might be able to do that) destroys the container, dropping its content
    2. Player A removes an item from the container
      Item duplication
  3. Now Player A is ticked and AbstractContainerMenu.stillValid(Player) is checked
    Check happened too late

Note: This is so far only a theoretical problem and has not been verified yet.
This is related to MC-110498, but not the same issue because shulker boxes collect the items to store in the dropped shulker box in ShulkerBoxBlock.getDrops(BlockState, Builder).

Fixed

Marcono1234

2020-08-16, 07:27 PM

2022-08-23, 10:25 AM

2022-08-23, 10:25 AM

2

2

Plausible

Low

Items

1.16.2

22w24a