Arqade Asked by Helpmepls on January 6, 2021
I have no problem giving a player an item with a custom tag, and I have no problem detecting that item with the specific tag, my issue is running the clear command for that specific item AFTER detecting the item in the player’s inventory.
Here is the command to give the player the item:
/give @a minecraft:written_book{LostBoy:1b,title:"Quest: Lost Boy",author:"Easy Quest",generation:0,pages:['{"text":"=====LOST BOY=====nnEdgar's son has gone missing! He was last seen heading to the coal mine West of town. nnObjective: Investigate the coal mine West of the CrestGaurd slums."}']} 1
Here is the command I’m having issues with, the first part is detecting the book (I’ve confirmed this through testing with “say” outputs), but the “clear” command will not clear the specific book!
execute as @a[nbt={Inventory:[{id:"minecraft:written_book",tag:{LostBoy:1b},Count:1b}]}] run clear @a minecraft:written_book{tag:{LostBoy:1b}}
The correct command would be:
execute as @a[nbt={Inventory:[{id:"minecraft:written_book",tag:{LostBoy:1b},Count:1b}]}] run clear @a minecraft:written_book{LostBoy:1b}
You only include a tag
tag when testing for items, not when giving or clearing them.
Answered by pppery on January 6, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP