If hotbar contains

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

ConLudi

Member
Jan 23, 2020
43
0
0
45
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!
 
I think you can use:
Code:
if slot 37 of current inventory of player is %your item%:
I think it should work like that:
Inventory-slots.png

But if you're in a different inventory, it will not be the same:
Chest-slots.png

(I found these images on google - minecraft inventory id)
 
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:
on join:
    set slot 0 of player to compass with no nbt named "&eGame Selector"

on right click:
    if item is compass with no nbt named "&eGame Selector":
        make player execute command "game"


every 1 second:
    loop all players:
        if slot 35 of current inventory of loop-player is a compass:
            broadcast "Test"
            stop
[doublepost=1593239334,1593023624][/doublepost]Bump!
[doublepost=1593500840][/doublepost]Bumpppp
 
I think you can use:
Code:
if slot 37 of current inventory of player is %your item%:
I think it should work like that:
Inventory-slots.png

But if you're in a different inventory, it will not be the same:
Chest-slots.png

(I found these images on google - minecraft inventory id)
these slots numbers are wrong
 
Status
Not open for further replies.