Mojira Archive
MC-172272

/clear removes all items from crafting grid regardless of item type

This was caused by the fix for MC-75328.

How to reproduce

  1. Insert the following command in a repeating command block and power it
    clear @p diamond 
  2. Go into survival
  3. Get any other item in your inventory and move it into the crafting slots
     The item gets cleared even though it is not a diamond

Code analysis

The reason for this is that the method net.minecraft.server.commands.ClearInventoryCommand#clearInventory(CommandSourceStack, Collection, Predicate, int) simply calls InventoryMenu#clearCraftingContent() without making use of the ItemPredicateArgument or the maxCount properties.

Fixed

[Helper] Misode

[Mojang] Matthew Gatland

2020-02-15, 03:54 AM

2020-05-28, 01:36 PM

2020-05-25, 03:47 PM

52

23

Confirmed

Important

Commands

20w07a - 20w21a20w07a, 20w08a, 20w09a, 20w10a, 20w12a, 20w13b, 20w14a, 20w15a, 20w16a, 20w17a, 20w18a, 20w19a, 20w20a, 20w20b, 20w21a

20w22a