Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-116618

Dropping items rapidly inside the "Survival Inventory" tab in creative mode deletes items

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 24w38a
    • Minecraft 1.11.2, Minecraft 17w16b, Minecraft 1.12 Pre-Release 1, Minecraft 1.12 Pre-Release 2, Minecraft 1.12 Pre-Release 3, Minecraft 1.12 Pre-Release 5, Minecraft 1.12 Pre-Release 6, Minecraft 1.12 Pre-Release 7, Minecraft 1.12, Minecraft 1.12.1, Minecraft 1.12.2 Pre-Release 1, Minecraft 1.12.2 Pre-Release 2, Minecraft 17w45a, Minecraft 17w47a, Minecraft 17w48a, Minecraft 18w01a, Minecraft 18w07a, Minecraft 18w08b, Minecraft 18w09a, Minecraft 18w10a, Minecraft 18w11a, Minecraft 18w14a, Minecraft 18w15a, Minecraft 18w16a, Minecraft 18w19b, Minecraft 18w20c, Minecraft 1.13-pre1, Minecraft 1.13-pre2, Minecraft 1.13-pre5, Minecraft 1.13-pre8, Minecraft 1.13-pre9, Minecraft 1.13-pre10, Minecraft 1.13, Minecraft 18w31a, Minecraft 18w32a, Minecraft 1.13.1-pre1, Minecraft 1.13.1, Minecraft 1.13.2-pre1, Minecraft 1.13.2-pre2, Minecraft 1.13.2, Minecraft 18w43a, Minecraft 18w43b, Minecraft 18w43c, Minecraft 18w44a, Minecraft 18w45a, Minecraft 18w46a, Minecraft 18w47b, Minecraft 18w48a, Minecraft 18w48b, Minecraft 18w49a, Minecraft 18w50a, Minecraft 19w02a, Minecraft 19w03a, Minecraft 19w03b, Minecraft 19w03c, Minecraft 19w04a, Minecraft 19w04b, Minecraft 19w05a, Minecraft 19w06a, Minecraft 19w07a, Minecraft 19w08a, Minecraft 19w08b, Minecraft 19w09a, Minecraft 19w11a, Minecraft 1.14.2, 1.14.4, 19w34a, 19w37a, 19w39a, 19w41a, 19w42a, 1.15 Pre-release 1, 1.15 Pre-Release 2, 1.15, 1.15.1, 1.15.2, 20w06a, 20w09a, 20w10a, 20w11a, 20w13a, 20w18a, 1.16 Pre-release 2, 1.16 Pre-release 5, 1.16 Pre-release 7, 1.16 Pre-release 8, 1.16 Release Candidate 1, 1.16, 1.16.1, 20w27a, 20w28a, 20w29a, 20w30a, 1.16.2 Pre-release 1, 1.16.2 Release Candidate 1, 1.16.2 Release Candidate 2, 1.16.2, 1.16.3 Release Candidate 1, 1.16.3, 1.16.4 Pre-release 1, 1.16.4 Pre-release 2, 1.16.4 Release Candidate 1, 1.16.4, 20w46a, 20w48a, 20w51a, 21w03a, 1.16.5, 21w05a, 21w05b, 21w06a, 21w07a, 21w11a, 21w18a, 1.17 Pre-release 2, 1.17, 1.17.1, 1.18 Pre-release 1, 1.18 Pre-release 6, 1.18, 1.18.1, 1.18.2, 1.19, 1.19.2, 22w42a, 1.19.3, 23w07a, 1.20.2, 23w45a, 1.20.5 Pre-Release 4, 1.20.5, 1.20.6, 24w19b, 24w21b, 1.21
    • Confirmed
    • Creative
    • Inventory
    • Normal
    • Gameplay

      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:

      1. Fill your inventory with stacks of items
      2. Hold down either q or ctrl + q
      3. 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:

      Minecraft_116618.mp4

      Code Analysis:

      (by tomudding)
      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:

      The bug

      When you hover over an item in your creative inventory and hold Q to drop those items (fast drop, because you hold Q), some items disappear, but when you are in survival (gamemode 0) zero items get deleted.

      Example

      Here is an example in video: Minecraft_116618.mp4

      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.

            Unassigned Unassigned
            Jingy [Helper] Jiingy
            Votes:
            46 Vote for this issue
            Watchers:
            28 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: