The bug
When running a /clear
command on a player to remove all their items, they're still able to prevent some items to be cleared simply by putting them in the crafting area in their inventory.
Comments 14
teleporting a player doesn't close his inventory. You could teleport him to a nether portal though, for some reason a nether portal closes UIs. But it's a bit of a weird workaround
Might be intended because the items in none of the other GUIs are cleared (for example enchanting table) (in Minecraft 1.8)
This is not fixed for crafting tables, anvils, enchanting tables, looms, grindstones or cartography tables where the items are technically still in the player's inventory.
As this might be seen as a separate issue, I've created a separate bug report for it: MC-172496
If you want to resolve this problem right now you can teleport the player right at his position and then right after clear his inventory. The teleportation make the players close their inventory, so they'll never have the time to put stuff in their crafting grid. I might be wrong, sorry, but if it's the case you have your solution.