When you hover over stacks of items in the creative inventory and drop them using either ctrl + q
over multiple stacks, or press and hold q
over single item stacks, some items will be deleted. This does not occur for survival, or adventure mode.
Steps to Reproduce:
Fill your inventory with stacks of items
Hold down either
q
orctrl + q
In quick succession, hover over the item stacks in your inventory
Observed Behavior:
A majority of the items will be deleted.
Expected Result:
None of the items would be deleted, and all would be dropped.
Screenshots/Videos:
[media]
Code Analysis:
(by @unknown)
The reason for this appears to be the ServerGamePacketListenerImpl.dropSpamTickCount. If the threshold is reached the server simply does not not drop an item, however it does not inform the client of that.
(24w18a, Mojang mapping names)
public void handleSetCreativeModeSlot(ServerboundSetCreativeModeSlotPacket var1) {
PacketUtils.ensureRunningOnSameThread(var1, this, (ServerLevel)this.player.serverLevel());
if (this.player.gameMode.isCreative()) {
boolean var2 = var1.slotNum() < 0;
ItemStack var3 = var1.itemStack();
if (!var3.isItemEnabled(this.player.level().enabledFeatures())) {
return;
}
. . .
boolean var7 = var1.slotNum() >= 1 && var1.slotNum() <= 45;
boolean var8 = var3.isEmpty() || var3.getCount() <= var3.getMaxStackSize();
if (var7 && var8) {
this.player.inventoryMenu.getSlot(var1.slotNum()).setByPlayer(var3);
this.player.inventoryMenu.broadcastChanges();
} else if (var2 && var8 && this.dropSpamTickCount < 200) {
this.dropSpamTickCount += 20;
this.player.drop(var3, true);
}
}
}
Original Description:
[media]The bug
When you hover over an item in your creative inventory and hold
Q
to drop those items (fast drop, because you holdQ
), some items disappear, but when you are in survival (gamemode 0) zero items get deleted.Example
Here is an example in video:
Code analysis
20w09a, Mojang names
The reason for this appears to be the
ServerGamePacketListenerImpl.dropSpamTickCount
. If the threshold is reached the server simply does not not drop an item, however it does not inform the client.
Linked issues
is duplicated by
relates to
Attachments
Comments


This "fast drop" might not be a feature, see MC-118107.
I can imagine the reason for this bug being the item throw cooldown of Creative mode, but this is only speculation.

@marcono1234 In creative when you have a stack of items in your hand (not looking in your inventory) and start throwing them by holding 'Q' no items are deleted (tested this in 1.13 PRE-8). It is just that when you are inside the inventory the items somehow get deleted (by holding 'Q' to throw them).


@@unknown I always have problems with mentions, sometimes they work and sometimes they don't and that time it didn't work, tried it like 4 times with no success (and now it works of course).

Still in 20w29a
Still in 1.16.2. This was pretty frustrating, thinking my redstone was somehow deleting items until I figured out it was this creative mode bug...
Still exists in 1.16.4.
Can confirm it hasn't been fixed, made a report of my own, but this still does not happen in survival luckily.
Can confirm in 1.18.2, 1.18.1 and 1.18 - Other players can see the items but the player that throwed it cannot.
Server hosters such has aternos and more hasn't fixed this but mojang is already working on it.

Can confirm in 23w07a.
still on latest snapshot

Can confirm in 1.20.5 pre4.

Can confirm in 1.20.5.
I've written a new description to better describe this issue:
When you hover over stacks of items in the creative inventory and drop them using either {{ctrl + q}} over multiple stacks or press and hold {{q}} over single stacks, some items will be deleted.
This does not occur for survival, or adventure mode.
h3. Steps to Reproduce:
# (In creative) Fill your inventory with stacks of items
# Hold down either {{q}} or {{ctrl + q}}
# In quick succession, hover over all the items in your inventory
h3. Observed Behavior:
A majority of the items dropped will be deleted.
h3. Expected Result:
None of the items would be deleted, and all would be dropped.
h3. Screenshots/Videos:
[^Minecraft_116618.mp4]
h3. Code analysis
The reason for this appears to be the ServerGamePacketListenerImpl.dropSpamTickCount. If the threshold is reached the server simply does not not drop an item, however it does not inform the client.
(24w18a, Mojang mapping names)
{code:java}
public void handleSetCreativeModeSlot(ServerboundSetCreativeModeSlotPacket var1) {
PacketUtils.ensureRunningOnSameThread(var1, this, (ServerLevel)this.player.serverLevel());
if (this.player.gameMode.isCreative()) {
boolean var2 = var1.slotNum() < 0;
ItemStack var3 = var1.itemStack();
if (!var3.isItemEnabled(this.player.level().enabledFeatures())) {
return;
}
CustomData var4 = (CustomData)var3.getOrDefault(DataComponents.BLOCK_ENTITY_DATA, CustomData.EMPTY);
if (var4.contains("x") && var4.contains("y") && var4.contains("z")) {
BlockPos var5 = BlockEntity.getPosFromTag(var4.getUnsafe());
if (this.player.level().isLoaded(var5)) {
BlockEntity var6 = this.player.level().getBlockEntity(var5);
if (var6 != null) {
var6.saveToItem(var3, this.player.level().registryAccess());
}
}
}
boolean var7 = var1.slotNum() >= 1 && var1.slotNum() <= 45;
boolean var8 = var3.isEmpty() || var3.getCount() <= var3.getMaxStackSize();
if (var7 && var8) {
this.player.inventoryMenu.getSlot(var1.slotNum()).setByPlayer(var3);
this.player.inventoryMenu.broadcastChanges();
} else if (var2 && var8 && this.dropSpamTickCount < 200) {
this.dropSpamTickCount += 20;
this.player.drop(var3, true);
}
}
}
{code}
Considering the original reporter has not touched the issue in three years, I would like to request ownership of it to add the new description I've outlined in my last comment, and also add future affected versions.

This appears to have been fixed in 24w38a through MC-276373.
Can confirm in 1.13-pre5.
Please keep the ticket up to date.