1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Inventory pickup not detecting player?

Discussion in 'Skript' started by Kaii, Feb 20, 2023.

Tags:
Thread Status:
Not open for further replies.
  1. Kaii

    Kaii Member

    Joined:
    Feb 11, 2023
    Messages:
    1
    Likes Received:
    0
    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
     
  2. Best Answer:
    Post #2 by MultiverShaun, Feb 20, 2023
  3. MultiverShaun

    MultiverShaun Member

    Joined:
    Aug 8, 2022
    Messages:
    27
    Likes Received:
    3
    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.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...