#Nbt data from book pages (1.21.10)

1 messages · Page 1 of 1 (latest)

cinder lagoon
#

The issue im having is that i wish to get the written numerical value in the book, but its giving me the page count when stored in a scoreboard. but adding anything deeper than "pages" returns a error. if i have written on the 1st page "12" i want it to store "12" in the scoreboard chosen
execute store result score justaGremlin Dummy run data get entity @s SelectedItem.components.minecraft:writable_book_content.pages

tidal atlas
#

What are you trying after pages that's giving the error?

cinder lagoon
#

well i believed raw would do something as it seems to be the only thing left in that nbt path

tidal atlas
#

pages is a list

cinder lagoon
#

would that require an array?

tidal atlas
#

It would require doing pages[x] to target index value X

cinder lagoon
#

see on the console its returning the target page, but on the scoreboard its returning just "1"

#

its like its storing the having found a result as a 1, but not storing what that result was

#

yeh if the page has no text it returns a 0

tidal atlas
#

Well I would expect the result of the page is a text component, so yeah you're gonna get just a number trying to store the page directly to a score

#

You'll need to store it to storage to do something useful with it

cinder lagoon
#

damn, ive tried using storage but when servers get so many people, its awkward to make a dynamic storage path, that doesnt muggle them all up, and keeps every string unique to the person who wrote it/holding the item stored from

spice scrollBOT