I'm trying to print some block data to the chat with /tell, /say, or /tellraw, but I can't figure out how to get the data from one command to the other.
The exact scenario is that I have a lectern with a book on it, and I want to print whatever text is on the book's first page to the chat.
I can get the data with
/data get block ~1 ~ ~ Book.tag.pages[0]
but I can't figure out how to get the result to print out to the chat. Please help
You could store the book's text in an armor stand's name, then display its name using tellraw, but the name of an entity has different syntax, so it won't work. You could just force everyone or someone to run that command (/data get block ~1 ~ ~ Book.tag.pages[0]) to display it for them, but I don't think other things are possible.
I'm trying to print some block data to the chat with /tell, /say, or /tellraw, but I can't figure out how to get the data from one command to the other.
The exact scenario is that I have a lectern with a book on it, and I want to print whatever text is on the book's first page to the chat.
I can get the data with
but I can't figure out how to get the result to print out to the chat. Please help
You could store the book's text in an armor stand's name, then display its name using tellraw, but the name of an entity has different syntax, so it won't work. You could just force everyone or someone to run that command (/data get block ~1 ~ ~ Book.tag.pages[0]) to display it for them, but I don't think other things are possible.
Command FAQ
Minecraft Randomizer DataPack (by Me)