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.

On inventory open

Discussion in 'Skript' started by BrownMee, Apr 20, 2020.

Thread Status:
Not open for further replies.
  1. BrownMee

    BrownMee Active Member

    Joined:
    Apr 16, 2018
    Messages:
    126
    Likes Received:
    6
    How to check if player's open their own inventory?
    --- Double Post Merged, Apr 20, 2020, Original Post Date: Apr 20, 2020 ---
    Code (Text):
    1. on packet event play_client_client_command:
    2.     if "ClientCommand" penum 0 of event-packet is equal to "OPEN_INVENTORY_ACHIEVEMENT":
    3.         broadcast "s"
    using thatpacketaddon. No errors but doesn't work in 1.14 :emoji_frowning:
     
  2. xCoini

    xCoini Member

    Joined:
    Apr 19, 2019
    Messages:
    14
    Likes Received:
    0
    ummm for me works
    Code (Text):
    1. on inventory open:
    2.     broadcast "s"
     
  3. BrownMee

    BrownMee Active Member

    Joined:
    Apr 16, 2018
    Messages:
    126
    Likes Received:
    6
    I want it to open player's inventory only.
    Using the code you given will affect the chest as well
     
  4. blackid512

    blackid512 Member

    Joined:
    May 8, 2017
    Messages:
    23
    Likes Received:
    0
    Try to check the inventory name.
     
  5. BrownMee

    BrownMee Active Member

    Joined:
    Apr 16, 2018
    Messages:
    126
    Likes Received:
    6
    How do I do it with player inventory? I believe there's no name in player inventory
     
  6. blackid512

    blackid512 Member

    Joined:
    May 8, 2017
    Messages:
    23
    Likes Received:
    0
    Try this
    Code (Skript):
    1.  
    2. on inventory open:
    3.     if inventory name of player's current inventory is not set:
    4.         broadcast "s"
    5.  
     
  7. IDuckz_

    IDuckz_ Active Member

    Joined:
    Jul 25, 2019
    Messages:
    106
    Likes Received:
    2
    You can also do something like this if your creating gui's:

    Code (Text):
    1. on inventory open:
    2.     if name of event-inventory != "the gui name" or "2nd gui name if there is":
    3.         broadcast "this is the player's inventory!"
    4.        
     
  8. BrownMee

    BrownMee Active Member

    Joined:
    Apr 16, 2018
    Messages:
    126
    Likes Received:
    6
    Doesn't broadcast anything :emoji_frowning:
     
  9. blackid512

    blackid512 Member

    Joined:
    May 8, 2017
    Messages:
    23
    Likes Received:
    0
    Is in console or when reload the skript contains error?
     
  10. BrownMee

    BrownMee Active Member

    Joined:
    Apr 16, 2018
    Messages:
    126
    Likes Received:
    6
    no error
     
  11. blackid512

    blackid512 Member

    Joined:
    May 8, 2017
    Messages:
    23
    Likes Received:
    0
    Maybe you should try to set the inventory name to default inventory name (when you open your inventory).
    I'm sorry I don't know the default name, because I forget it + I'm not opening Minecraft right now.
     
  12. BrownMee

    BrownMee Active Member

    Joined:
    Apr 16, 2018
    Messages:
    126
    Likes Received:
    6
    I dont think there is name of default inventory of player. I can't find any ><
     
  13. novastosha

    novastosha Well-Known Member

    Joined:
    Jan 11, 2019
    Messages:
    344
    Likes Received:
    22
    The "on inventory open:" is not working it gets called when you close it lol
     
  14. IDuckz_

    IDuckz_ Active Member

    Joined:
    Jul 25, 2019
    Messages:
    106
    Likes Received:
    2
Thread Status:
Not open for further replies.

Share This Page

Loading...