mojira.dev
MC-197012

clearing an item from an advancement reward function doesn't remove it

 

 

I have a custom advancement that detects if the player has a knowledge book with a specific

recipe (using the inventory_changed criteria)

"criteria": {
"book": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [

{ "item": "minecraft:knowledge_book", "nbt": "

{Recipes:[\"minecraft:bow\"]}

"
}
]
}
}
},

this advancement triggers a function 

"rewards":

{ "function": "aaa:got_bow_recipe" }

,

and inside the function are the following 2 commands:

recipe give @s minecraft:bow
clear @s minecraft:knowledge_book{Recipes:["minecraft:bow"]}

despite running a clear command, the item doesn't leave the players inventory, but also doesn't exist, until the player updates their inventory

Running the command /data get entity @s SelectedItem says that there's no selected item

[media]

Running a general /data get entity @s also says that the item isn't in the inventory

[media]

Linked issues

Attachments

Comments 1

Thank you for your report!
We're tracking this issue in MC-187281, so this ticket is being resolved and linked as a duplicate.

If you would like to add a vote and any extra information to the main ticket it would be appreciated.

If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.

Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – ✍️ Feedback and Suggestions – 📖 Game Wiki
-- I am a bot. This action was performed automatically! Please report any issues in Discord or Reddit

Justin Brenneman

(Unassigned)

Unconfirmed

(Unassigned)

advancement-criteria, advancement-reward, clear

1.16.1

Retrieved