I'm currently working on a project that includes custom loot tables with semi-custom items. So far it's been working perfectly with all sorts of items, but when I tried to add a written book with nbt data, things stopped working. I ran the code for the loot table through a (json editor) and it checked out but it clearly doesn't work - Whenever the book is included in the loot table, nothing generates at all.

Here's the snippet that causes all the issues:

(...){"type":"item","name":"minecraft:written_book","weight":1,"quality":12,"functions":[{"function":"set_nbt","tag":"{pages:['{\\\"text\\\":\\\"SMITE\\\"}'],title:\\\"Tome of Smiting\\\",author:\\\"Bryuf\\\"}"}]},(...)

(The ellipses are just to indicate that this was taken from a wider context involving the correct start and end parameters for loot tables)

Can anyone figure out what I'm missing to make this work?


1 Answer 1


In your snippet, you use three backslashes in a row (\\\) to escape the double quotes ("). Use 1 instead.

  • That did the trick, thanks a lot! I used 3 backslahses for all the other items with NBT in the loot table and they still work so I assumed that wasn't the issue but fixing it made it work
    – Bryuf
    Commented Jun 29, 2021 at 14:30

You must log in to answer this question.

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