Skip to content
This repository has been archived by the owner on Oct 24, 2020. It is now read-only.

Items lost in creative mode #20

Open
zastrixarundell opened this issue Sep 26, 2019 · 0 comments
Open

Items lost in creative mode #20

zastrixarundell opened this issue Sep 26, 2019 · 0 comments

Comments

@zastrixarundell
Copy link

zastrixarundell commented Sep 26, 2019

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant