ArmorEquipEvent icon indicating copy to clipboard operation
ArmorEquipEvent copied to clipboard

Items lost in creative mode

Open zastrixarundell opened this issue 5 years ago • 0 comments

When I try to directly put an item or try to shift click it to equip it and cancel the event, the item is lost. This is not present while in survival.

Edit: This is paper 1.14.4 (I saw another issue and I saw the Armor event in paper but the javadocs say that the event does exist but is never called).

Edit 2: I just saw this thread and it explained this:

When in creative, most inventory actions fire an InventoryCreativeEvent instead because the client basically tells the server what it's spawning where.

If you do want to support creative armor changes, the click fired is always left, cursor is always the item being created/placed, and the current item is always the item being replaced. All you have to do is check if the current slot is the chest slot, then handle the old/new items accordingly.

So that's most likely the reason why this is happening.

zastrixarundell avatar Sep 26 '19 00:09 zastrixarundell