OK, i have this code line. The “pasture” is inside the “entities”. I am not sure how i display that in the code, it seems that the “pasture” is inside “alpaca” instead… the same go for frog… any help?
{
"entities" : {
"critters" : {
"alpaca" : {
"display_name" : "A alpaca",
"description" : "So fluffy!",
"unripe_description" : "This alpaca is still quite naked.",
"alpaca_young" : {
"display_name" : "A alpaquita",
"description" : "Awww!"
},
"renewable_harvest_status_text" : "shearing alpaca",
"species" : "alpaca"
},
"frog": {
"display_name" : "Frog",
"description" : "Ew ew ew",
"frog_jerky" : {
"display_name" : "Frog legs"
},
"species" : "frog"
},
"pasture"{
"alpaca_pasture_name" : "Alpaca Pasture",
"alpaca_pasture_description" : "Alpaca produce wool, used by the weaver. Slaughtering alpaca will produce mutton, a raw cooking ingredient"
"frog_pasture_name" : "Frog Nest",
"frog_pasture_description" : "Frogs reproduce quickly and can be slaughtered for legs and eyes",
},
}
}
}
I’ve edited your post so that the code whitespace is preserved, to make it easier to read. The "pasture"
block is inside "critters"
which is inside "entities"
. So to refer to it by path you’d use entities.critters.pasture
. Note that only the braces denote structure. The spacing is just to make it easier to read for us humans.
That said, you are missing a colon after "pasture"
, which makes this code invalid, and the indentation is slightly wrong, which makes it harder to read. Here’s a fixed version:
{
"entities" : {
"critters" : {
"alpaca" : {
"display_name" : "A alpaca",
"description" : "So fluffy!",
"unripe_description" : "This alpaca is still quite naked.",
"alpaca_young" : {
"display_name" : "A alpaquita",
"description" : "Awww!"
},
"renewable_harvest_status_text" : "shearing alpaca",
"species" : "alpaca"
},
"frog": {
"display_name" : "Frog",
"description" : "Ew ew ew",
"frog_jerky" : {
"display_name" : "Frog legs"
},
"species" : "frog"
},
"pasture": {
"alpaca_pasture_name" : "Alpaca Pasture",
"alpaca_pasture_description" : "Alpaca produce wool, used by the weaver. Slaughtering alpaca will produce mutton, a raw cooking ingredient"
"frog_pasture_name" : "Frog Nest",
"frog_pasture_description" : "Frogs reproduce quickly and can be slaughtered for legs and eyes"
}
}
}
}
2 Likes
What would i have to change to put the “pasture” block insite only entities, not “critters” ?
Thank you for the replay
Here’s how you would put pasture under "entities"
.
{
"entities" : {
"critters" : {
"alpaca" : {
"display_name" : "A alpaca",
"description" : "So fluffy!",
"unripe_description" : "This alpaca is still quite naked.",
"alpaca_young" : {
"display_name" : "A alpaquita",
"description" : "Awww!"
},
"renewable_harvest_status_text" : "shearing alpaca",
"species" : "alpaca"
},
"frog": {
"display_name" : "Frog",
"description" : "Ew ew ew",
"frog_jerky" : {
"display_name" : "Frog legs"
},
"species" : "frog"
}
},
"pasture": {
"alpaca_pasture_name" : "Alpaca Pasture",
"alpaca_pasture_description" : "Alpaca produce wool, used by the weaver. Slaughtering alpaca will produce mutton, a raw cooking ingredient"
"frog_pasture_name" : "Frog Nest",
"frog_pasture_description" : "Frogs reproduce quickly and can be slaughtered for legs and eyes"
}
}
}
You may find Small intro to JSON useful.
1 Like
HAHA i tried that before, but without the colon… thank you… i am reading the guide!