• Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

ghkhgkajtgfhjkcbg

New Member
Mar 6, 2023
7
0
1
is there a way I can stop people from moving an item from their inventory into a chest/echest/shulker/barrel
I tried this
on inventory change:
if item is example item:
cancel event
but that didn't work and I checked in the parser and it said it wouldn't work
I tried several other things but none of them worked either
 
Try using the event org.bukkit.event.inventory.InventoryDragEvent using the addon skript-reflect
This event check when a player is moving an item from his inventory to a another slot
Here's a little example


Code:
import:
    org.bukkit.event.inventory.InventoryDragEvent


on InventoryDragEvent:
    send event.getInventorySlots() to player

If you want more info, you can check the classes on spigot website for minecraft java classes