/clear does not clear items held in the "cursor"
Verification builds: 1.2.11 (Release_694520)
Summary:
/clear looks in inventory slots to find items to delete. But if playing in classic ui, the player can pick up and item without putting it down in their inventory. The clear command will not realize this.
Impact:
Makes it difficult to implement anti-cheating measures and prevent game-breaking bugs. In our map we have a chest that auto-refills with tnt after clearing you of tnt. With this bug, the player can just hold onto the item and wait for the clear command to pass.
Repro Steps:
1. Place down a chest with a block of tnt in it.
2. Put on a repeating clock: /clear @a tnt
3. Pick up the tnt in the chest without placing it down in your inventory.
Observed Results:
The tnt will only disappear after you place it down in an inventory slot.
Expected Results:
The tnt will disappear from your "cursor" as soon as the clear command is run.