The bug
Usage of selectors in books don't work, unless the player being given the book is an operator. Basically, let's say you have such a command:
/give @a written_book[written_book_content={title:"Example",author:"someone",pages:['{"selector":"@s"}']}] 1
When the command block is powered, a player who is an operator will receive a book, which on its first page will have their IGN printed. A player who is NOT an operator will receive a book with an empty first page.
Linked issues
is duplicated by 5
relates to 3
Attachments
Comments 22
Can you please clarify what you mean by that?
What I'm saying is, in a situation where a non-operator player is given a book that makes use of selectors, they don't work. I don't believe this is an invalid report, would you kindly review it again?
The player executes the command. If the player does not have permissions to use selectors the command will not be executed properly. This is working by design. You can use /trigger to work around this limitation.
Having not read the description until now (sorry!), does MC-73054 describe your issue?
No, the player does NOT execute the command. The command is executed by the command block. It is also not possible to use /trigger to work around this limitation. I want to display the player's NAME in the book.
In the case of a command
/give @r written_book 1 0 {pages:["[\"\",{\"selector\":\"@p\"}]"],title:Book,author:Me}
, if the player randomly selected by @r is an OPERATOR, then it will display his name correctly on the first page. If the player randomly selected by @r is NOT an operator, then the first page will be blank.
No commands are run by any non-operator, this behaviour is just inconsistent and does not work. How does this work as intended?
Still in 1.16.5 :
typing :
/give @a minecraft:written_book{title:"Example",author:"someone",pages:["{\"selector\":\"@s\"}"]}
The op user get a book with his name but non-op user get a bookt with text : {"selector":"@s"}
Yes. The player executes the command.