Chest Event

  • 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!

Status
Not open for further replies.

rook1e

New Member
Apr 9, 2020
6
0
0
I'd like to know how to prevent items from being placed in the chest.
I want to make it exist only in the user's inventory.

How can I do this?
 
1. On inventory click event
2. check if the cursor slot of player is the item you want
3. Check if the event-inventory is a chest, if so cancel the event.
4. Set player's cursor slot to air
5. If the player has enough space for the item you are giving them, give them the item, or else drop it at the player's location.

EDIT: There are still ways of putting the item in a chest, though. Such as dropping it on top of a hopper that points to a chest.
 
Status
Not open for further replies.