#skript yaml help

1 messages · Page 1 of 1 (latest)

bold dagger
#

does anyone know how to correctly do this? I am trying to take a string from my yml and make it into an item but the item becomes unset after parsing it from a string.

        set {_keys::*} to yaml list "genlist_keys" from "genfile"
        loop {_keys::*}:
            set {_rawItem} to yaml value "genitems.%loop-value%" from "genfile" parsed as an itemstack
            if all:
                player is sneaking
                {_rawItem} is set

            then:
                cancel event

the yml in question:

genitems:
  lime_terracotta: lime terracotta named "&aZombie Generator"
prisma briar
#

parse it as an itemtype i think, idk parsed as itemtype

#

also enclose your yaml expression with () to make it easier to read and increases parse time at some point

Ex.
yaml list "genlist_keys" from "genfile" -> (yaml list "genlist_keys" from "genfile")

bold dagger
#

oh my gosh that mjight work i didnt know there was a difference let me check thank you for replying!

prisma briar
#

it might not work honestly

#

i recommend you split up your yaml

bold dagger
#

it didnt work

#

i was about to send the whole skript

are you meaning

genitems:
item: xxx
name: xxxxxx

prisma briar
#

ex.

genitems:
    lime_terracotta:
        item: lime terracotta
        name: "&aZombie Generator"
        lore:
        - ""
        - ""
bold dagger
#

im new to skript yml so i shall see if i can figure this out thank you

prisma briar
#

good luck, dw it'll be easy, if you need any help just send your concerns here and i'll answer