Discord Thread Skript shulker in inventory

  • 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 community!

    Now, what are you waiting for? Join the community now!

This thread came from the skUnity Discord. You can't reply to it here but if you join the skUnity Discord, you'll be able to post a reply there. The thread link is part of the thread's message.
Status
Not open for further replies.

skUnity Discord

Site Manager
Aug 5, 2023
12,749
1
0
The skUnity Discord
discord.gg
code_language.skript:
on join:
    if "%player%" is "NAME":
        loop all items in inventory of player:
            log "%loop-item%" to "fix/NAME.log"
            if "%loop-item%" is "normal shulker box":
                loop %loop-item%'s' inventory:
                    log "%loop-value% was in shulker and had a lore of %loop-value's lore%" to "NAME/test.log"
                wait 0.5 seconds
                remove loop-item from the player

ERRORS:
line 6
cant under stand this loop

Posted by: elijahtheguy from the skUnity Discord. View the thread on skUnity Discord here
 
Oh so you're trying to get the items in the shulker boxs and give it to the player?

Posted by: eult from the skUnity Discord.
 
Lemme explain from the start, 1 second
There is a player who does SOmething idk what it is with a shulker box (im assuming filling it with something) it makes me have to remove the shulker box from his inv with skript.
Thats this part
code_language.skript:
on join:
    if "%player%" is "NAME":
        loop all items in inventory of player:
            if "%loop-item%" is "normal shulker box":
                remove loop-item from the player


That makes him able to join again

but i want to know whats in that shulker by using
log 
thats what this part is 

 loop %loop-item%'s inventory:
                    log "%loop-value% was in shulker and had a lore of %loop-value's lore%" to "NAME/test.log"
This part does not work
skript doesnt understand im trying to log what is in the shulkers inventory
It throws out
Can't understand this loop: loop %loop-item%'s inventory

Posted by: elijahtheguy from the skUnity Discord.
 
code_language.skript:
function BSBvalueBlockEntityTag(p: player, item: item):
    set {_nbt} to (nbt compound of {_item})
    set {_items::*} to (compound list tag "BlockEntityTag;Items" of {_nbt})
    set {_gui} to shulker box inventory with name "&8︱ &r%name of {_item} ? "Shulker box"%"
    loop {_items::*}:
        set {_s} to tag "Slot" of loop-value
        set slot {_s} of {_gui} to (nbt item from loop-value)
    open {_gui} to {_p}
Here's a function that's give you the item value of your shulker box
{_items::*} is a list of the items in the shulker box

Posted by: eult from the skUnity Discord.
 
Change on it and I will help you further later when I am home
I'm soon home so I'll ping you

Posted by: eult from the skUnity Discord.
 
Ok! i will try some things

Also if its a book will i be able to see whats written in it?
1 had random shit in it
[6/18/23, 1:29 AM] normal shulker box was in shulker and had a lore of <none>
[6/18/23, 1:29 AM] normal shulker box was in shulker and had a lore of <none>
code_language.skript:
function BSBvalueBlockEntityTag(p: player, item: item):
    set {_nbt} to (nbt compound of {_item})
    set {_items::*} to (compound list tag "BlockEntityTag;Items" of {_nbt})
    set {_gui} to shulker box inventory with name "&8︱ &r%name of {_item} ? "Shulker box"%"
    loop {_items::*}:
        set {_s} to tag "Slot" of loop-value
        set slot {_s} of {_gui} to (nbt item from loop-value)
    open {_gui} to {_p}

on join:
    if "%player%" is "meingame":
        loop all items in inventory of player:
            log "%loop-item%" to "Ltest/all.log"
            if "%loop-item%" is "normal shulker box":
                BSBvalueBlockEntityTag(player, loop-item)
                loop {_items::*}:
                    log "%loop-value-2% was in shulker and had a lore of %{loop-value's lore}%" to "Ltest/shulker.log"
                wait 0.5 seconds
                #remove loop-item from the player
All.log is the only one that went
the shulker wont work! ?

Posted by: elijahtheguy from the skUnity Discord.
 
Status
Not open for further replies.