I'm creating a custom potions plugin.
I have a potion with custom model data that if you consume, it sends a packet to all players (PacketPlayOutEntityEquipment, helmet to dragon head).
First, if you take it off, it should disappear, because it's not supposed to be in the inventory, it's just a packet. However, the player is able to take it off, it doesn't disappear (probably an NMS bug).
The is: when the InventoryClickEvent gets canceled, it dupes the item (stays in the slot, but gets added to the cursor). This only happens in creative mode.