Block compression shulker

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

Bomby_5

New Member
Jan 11, 2022
5
0
1
63
hi, im trying to make it so if you put 9 iron ingots in a light blue shulker box, then it removes them and places an iron block in the shulker, this is what i have so far but im getting hung up on actually getting the contents of the box

Code:
on place light blue shulker box:
    add event-location to {locations::*}
command /test:
    trigger:
        set {locnum} to size of {locations::*}
        if block at location {locations::locnum} is light blue shulker box:
            send "test"
        send "%{locnum}%" to player
command /resetloc:
    trigger:
        set {locnum} to 0
        clear {locations::*}
 
I did something similar to this but with the contents player's inventory instead of a container:

Code:
on inventory open:
    loop 36 times:
        add slot loop-number of player's inventory to {_items::*}

This code adds all the contents of the player's inventory into a list.
 
I did something similar to this but with the contents player's inventory instead of a container:

Code:
on inventory open:
    loop 36 times:
        add slot loop-number of player's inventory to {_items::*}

This code adds all the contents of the player's inventory into a list.
and how would i check for emeralds/iron/whatever
 
and how would i check for emeralds/iron/whatever
You could loop through the list and use an if to check for the type of the item:

Code:
on inventory open:
    loop 26 times: #shulker box has 27 slots and the first slot is 0 but the first value of loop-number is 1
        add slot loop-number of player's inventory to {_items::*}
    loop {_items::*}:
        if type of loop-value is emerald:
            #do something
 
Last edited:
You could loop through the list and use an if to check for the type of the item:

Code:
on inventory open:
    loop 26 times: #shulker box has 27 slots and the first slot is 0 but the first value of loop-number is 1
        add slot loop-number of player's inventory to {_items::*}
    loop {_items::*}:
        if type of loop-value is emerald:
            #do something
geometry dash meltdown

Thanks you support. It worked.
 
Status
Not open for further replies.