#Lists in data
1 messages · Page 1 of 1 (latest)
as in how would I find the first thing in the list or the 3rd
/data get … the_list[index]?
Would I be able to use it in a macro
so list[n] gives the (n+1)th thing in the list
Yea
Yep
right and how would I find the length of a list
I can put it in storage and read from there but are there easier methods?
you also have the posibillity to use compounds as the entries, that way you can search for data directly without knowing the index.
?
Data: [{name:"steve",health:10},{name:"alex",health:20}]
data get ... list[{name:"alex"}].health returns 20
execute store ... run data get ... list[]
what do you mean?
well the options are byte int double etc
actually wait nvm
anyway thank you for the help
why would you need anything else than int if you want to store the length?