Magic allows to pick up items even if EntityPickupItemEvent is cancelled
4L0N50asd opened this issue ยท 3 comments
I'm using Skript and i created a code to protect an item. It's just too simple, if you search on Skript docs (https://skriptlang.github.io/Skript/events.html) you can see that you're able to use almost all events and create conditions.
So i created an item and protected it by using PickUp Event and cancelled the event for players who doesn't have an specific permission. But you can pick up that item if you open your Spell Inventory with any wand (default pressing Q) and you let it opened, you can pick that item which has PickUp event cancelled.
I think this is happening because you created a "mirror" inventory for players when they have its Spell Inventory open, and every time they pick up an item, it gets saved in that mirror inventory while the Spell Inventory is opened, so when they close the Spell inventory, they get back their normal inventory + the items they picked up when Spell Inventory was opened. I think that this "fake/mirror" PickUp Event (when S. Inventory opened) doesn't consider if PickUp Event is cancelled.
Here i leave a video where you can see what i mean with all this. The Skript-Code created for this video is:
on pickup of compass:
cancel event
This may be a priority issue, my handlers ignore cancelled events. I have my EntityPickupItemEvent
handler at HIGHEST priority, any idea what Skript uses?
I can set up in the config of Skript which priority i want, which is HIGHEST even before i installed Magic on my server, here's a screenshot to see how is the config https://i.imgur.com/Bk53Z2x.png