Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-197012

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

XMLWordPrintable

    • Unconfirmed
    • Creative
    • (Unassigned)

       

       

      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

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

            Unassigned Unassigned
            Randoomer Justin Brenneman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: