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.

If hotbar contains

Discussion in 'Skript' started by ConLudi, Jun 24, 2020.

  1. ConLudi

    ConLudi Member

    Joined:
    Jan 23, 2020
    Messages:
    17
    Likes Received:
    0
    Hello, I was wondering if there is a way to check "if slot 1 of player's hotbar is grass", I can't figure this out!
    I've been trying to figure it out for 20-30 minutes and I can't!
     
  2. Nikd0

    Nikd0 Well-Known Member

    Joined:
    May 30, 2020
    Messages:
    81
    Likes Received:
    7
    I think you can use:
    Code (Text):
    1. if slot 37 of current inventory of player is %your item%:
    I think it should work like that:
    [​IMG]
    But if you're in a different inventory, it will not be the same:
    [​IMG]
    (I found these images on google - minecraft inventory id)
     
  3. ConLudi

    ConLudi Member

    Joined:
    Jan 23, 2020
    Messages:
    17
    Likes Received:
    0
    Yes, thank you, but I need something else. I'm making a Skript to see if an item is not in a slot. Here's my code:

    So I need it to check if it's not in a slot.

    Code (Text):
    1.  
    2. on join:
    3.     set slot 0 of player to compass with no nbt named "&eGame Selector"
    4.  
    5. on right click:
    6.     if item is compass with no nbt named "&eGame Selector":
    7.         make player execute command "game"
    8.  
    9.  
    10. every 1 second:
    11.     loop all players:
    12.         if slot 35 of current inventory of loop-player is a compass:
    13.             broadcast "Test"
    14.             stop
    --- Double Post Merged, Jun 27, 2020, Original Post Date: Jun 24, 2020 ---
    Bump!
    --- Double Post Merged, Jun 30, 2020 ---
    Bumpppp
     
  4. Dave

    Dave Well-Known Member

    Joined:
    Jul 20, 2018
    Messages:
    218
    Likes Received:
    7
    these slots numbers are wrong
     
Loading...