TransWikia.com

Run a command, when a player has turned a certain page in a book

Arqade Asked by Dalavar on August 22, 2021

I want an command to be executed in minecraft 1.15.2 [Java-Edition] when a player has turned a certain page in a book. I am currently using the following command for this in a repeating command block that is always active.

execute if entity @p[nbt={SelectedItem:{id:"minecraft:written_book",tag:{pages:["generator"]}}}] run say You opened the page with the word "generator"!

However, this command does not work and there is no error message.

One Answer

Books don't store the currently looked-at page. As far as I know, it's not even known to the server which page you look at.

If you want to trigger something when a player turns to a page in a book, you need a lectern. And then you can simply use a comparator or read the Page tag in NBT.

Correct answer by Fabian Röling on August 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP