Solved Inventory pickup not detecting player?

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

    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.

Kaii

Member
Feb 11, 2023
1
0
1
21
Hi, I need help with a simple Skript.

On one of my servers, I have a suggestion box. It is a hopper that connects to a chest below. However, I have an issue with players placing a lot of stuff other than books and quills. I would like a Skript that makes it so if anything other than a signed book is placed into the hopper, they are automatically kicked. (A little strict I know, but they definitely do it on purpose, there are signs that clearly say)

Attempted code:

on inventory pickup:
if type of event-inventory is hopper:
if event-item is not a written book:
make console execute command "/kick %event-player% Only place signed books into the hopper!"

The event player is not being detected, in the command it just says "<none>" where the name of the player should be.

Skript version: 2.6.4
Skript author: Me
Minecraft version: 1.19.3
Reload is always successful
 
I’m pretty sure that the event-player will only be set during a drop event, but not during a pickup event, as the item isn’t really tied to any player after it is dropped.

upload_2023-2-20_12-23-47.png


You may have to settle with cancelling the picking up instead.
 
Status
Not open for further replies.