I need to change some nbt tags of a player item. How can this be done? I know there is a command /data but I could not do it.

For example, I need to change the author's tag from the written book that the player is holding in his hands

  • 1. The Minecraft wiki is your friend. 2. /data get entity @e[type=item,sort=nearest,limit=1] prints the NBT of the closest item. – Fabian Röling Dec 31 '18 at 11:03
  • @FabianRöling Good, but how can I change the name of the author book, I can not – MaximPro Dec 31 '18 at 11:34
  • I think you can do /data merge entity @e[type=item,sort=nearest,limit=1] {Item:{tag:{\"author\":\"<author\"}}}. I haven't tested this (it's from memory and I never use it) but this or some other variation works. – SpiceWeasel Dec 31 '18 at 19:00

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.