-
Bug
-
Resolution: Fixed
-
Minecraft 13w48b, Minecraft 1.7.10, Minecraft 14w30c, Minecraft 14w32a, Minecraft 1.8-pre1, Minecraft 1.8-pre2, Minecraft 1.8, Minecraft 1.8.2-pre6, Minecraft 15w34c, Minecraft 15w44b, Minecraft 15w45a, Minecraft 1.8.9, Minecraft 16w04a, Minecraft 16w05b, Minecraft 1.9 Pre-Release 1, Minecraft 1.9 Pre-Release 2, Minecraft 1.9, Minecraft 1.9.2, Minecraft 1.10, Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w32b, Minecraft 16w33a, Minecraft 16w36a, Minecraft 16w39b, Minecraft 16w39c, Minecraft 16w42a, Minecraft 1.11 Pre-Release 1, Minecraft 1.11.2, Minecraft 17w17b, Minecraft 1.12 Pre-Release 2, Minecraft 1.12, Minecraft 1.12.2, Minecraft 18w05a, Minecraft 18w06a, Minecraft 18w10c, Minecraft 18w15a, Minecraft 18w19a, Minecraft 18w21b, Minecraft 18w22c, Minecraft 1.13-pre1, Minecraft 1.13-pre2, Minecraft 1.13-pre3, Minecraft 1.13-pre4, Minecraft 1.13-pre5, Minecraft 1.13-pre6, Minecraft 1.13-pre8, Minecraft 1.13, Minecraft 18w30b, Minecraft 18w31a, Minecraft 1.13.1-pre1, Minecraft 1.13.1-pre2, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 18w43b, Minecraft 18w43c, Minecraft 18w44a, Minecraft 18w45a, Minecraft 18w48a, Minecraft 18w48b, Minecraft 18w49a, Minecraft 18w50a, Minecraft 19w02a, Minecraft 19w03c, Minecraft 19w04b, Minecraft 19w05a, Minecraft 19w06a
-
Confirmed
The bug
Using /clear while an inventory is open and you are holding an item with your mouse causes an inventory desync and turns this item into a "ghost" item. You can place it in your inventory, but using it will fail in Creative mode and in Adventure and Survival mode additionally removes the item.
Expected would be that /clear successfully clears the held item client-side as well.
How to reproduce
- Put a repeating command block down with
/clear @p torch
- Switch to Creative mode
/gamemode creative
- Grab a stack of torches for example from your Creative inventory and put it in your hotbar
- Try placing down torches
→ The torches are not placed
Code analysis (outdated for 1.13+)
The following is based on a decompiled version of Minecraft 1.8 using MCP. All method and class names are the ones used in the decompiled version.
The reason for this is a piece of code in the public void processCommand(ICommandSender sender, String[] args) method of the net.minecraft.command.CommandClearInventory class that only updates the held item once the /clear command was used, if the player is not in Creative mode:
public void processCommand(ICommandSender sender, String[] args) throws CommandException { EntityPlayerMP var3 = args.length == 0 ? getCommandSenderAsPlayer(sender) : getPlayer(sender, args[0]); // ... if (args.length >= 2 && var4 == null) { throw new CommandException("commands.clear.failure", new Object[] {var3.getName()}); } else { int var8 = var3.inventory.func_174925_a(var4, var5, var6, var7); var3.inventoryContainer.detectAndSendChanges(); //This prevents the update if (!var3.capabilities.isCreativeMode) { var3.updateHeldItem(); } //... } }
- is duplicated by
-
MC-49863 Item Clearing
- Resolved
-
MC-51893 /clear not working in 14w11b
- Resolved
-
MC-52112 /clear command can be buggy
- Resolved
-
MC-68868 Clear on a super fast clock leaves 'ghost' items
- Resolved
-
MC-72438 Inventory visually not updating when quickly changing it
- Resolved
-
MC-73777 /clear does not affect cursor
- Resolved
-
MC-86907 Clear Command Issue
- Resolved
-
MC-96420 /clear doesn't clear - only creates Ghost Items
- Resolved
-
MC-98098 Command Doesn't Work
- Resolved
-
MC-98797 /clear command returns successful but the item isn't removed at all.
- Resolved
-
MC-98799 While running a 1 give command per second, you can dupe items.
- Resolved
-
MC-99295 /give the same tick as losing that item fails on creative mode
- Resolved
-
MC-103039 Command /clear bug
- Resolved
-
MC-106575 /clear does not clear golden swords
- Resolved
-
MC-107994 /clear does not work propely
- Resolved
-
MC-108266 Item malfunction glitch with /clear command
- Resolved
-
MC-112233 Using /testfor with SelectedItem tag sometimes fails
- Resolved
-
MC-117336 /clear command fails when being put in a command block
- Resolved
-
MC-117484 Clear Command
- Resolved
-
MC-118781 Items such as written books don't get cleared properly when /clear is quickly executed after updating written book in same tick
- Resolved
-
MC-124689 clear command in chest Gui
- Resolved
-
MC-125164 Ghost Items
- Resolved
-
MC-126971 /clear leaves ghost item in curser
- Resolved
-
MC-128649 Ghost Block/Item after /clear in your mouse cursor
- Resolved
-
MC-130309 Clear doesn't work well
- Resolved
-
MC-130966 /clear @a minecraft:allitems
- Resolved
-
MC-132562 command /clear or "Item-ghost"
- Resolved
-
MC-134482 Extremely glitchy block behavior
- Resolved
-
MC-136036 Ghost Items in 1.13
- Resolved
-
MC-137064 "Ghost Items" remain in inventory when cleared.
- Resolved
- relates to
-
MC-29318 Client misses inventory updates while player is manipulating items - causes invisible items
- Resolved
-
MC-146244 /clear removes item in cursor in creative mode even if it's not the item that should be cleared
- Resolved
-
MC-86994 Fake map item by clearing filled_map from inventory
- Resolved
-
MC-141883 Some shortcuts don't work in the "Survival Inventory" tab of the creative inventory
- Resolved
-
MC-146043 Inventory and /give bad syncing
- Resolved