I'm trying to have a lectern teleport me when I place the correctly named book on its top. So far, I've tried using this command:

/execute if data block 50005 10 50009 Book.tag[{title:"Bookname"}] run tp 100 10 100

If I remove the last part of the path specifying the string, the last "run" command does execute, so I'm getting the feeling that "execute if data" only checks if the target has a Tag, rather than checking if the said tag has the requested value. Am I using the wrong command or the wrong selector?

I'm running version: 1.14.4

1 Answer 1


The "Book" block does not exist in Minecraft. You should write this command for lentern block and check its nbt data instead. The correct command is:

/execute if data block 50005 10 50009 minecraft:lectern{Book: {tag: {title: "Bookname"}}} run tp 100 10 100

Also you can use the official Minecraft wiki to view nbt path of block. For example, nbt data of lentern.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .