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

Advancement reward function creates ghost item


    • Confirmed
    • (Unassigned)

      I wanted to use the /item command to switch the item in the offhand to the players mainhand. I wanted to use an advancement reward with an inventory_changed trigger and thought at first that the /item command itself doesn't work. As it turns out, the commands will work (if there are no syntax errors, heh), it's just that the item it's supposed to switch is still deleted.

      • To reproduce the Isse, I have an advancement called "offhand" which will trigger when there is either a carrot, a stick, a stone or a carrot on a stick in the players offhand and no item in the mainhand. So essentially, get an item in the mainhand and press the button to switch it to your offhand. The function is called: "switch_items". I attached a data pack with the function and the advancement file. 
      item entity @s weapon.mainhand copy entity @s weapon.offhand
      item entity @s weapon.offhand replace minecraft:air 1
      advancement revoke @s only item:offhand


      As soon as any of those 4 items are in the offhand they disappear when you're in creative. When you're in survival, the item becomes a ghost item. you can recover it by clicking on free slots in your inventory.



            Unassigned Unassigned
            Elemend Elemend
            1 Vote for this issue
            1 Start watching this issue