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

Function reward removing the item an advancement detected creates a ghost item

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 20w22a, 1.16 Pre-release 1, 1.16 Pre-release 2, 1.16 Release Candidate 1, 1.16, 1.16.1, 1.16.2, 1.16.4, 20w51a, 1.16.5, 1.20.1, 23w40a, 1.20.4
    • None
    • Confirmed
    • Advancements, Commands, Data Packs, Networking
    • Normal
    • Platform

      The bug

      When a function reward of an advancement that triggers on inventory_changed removes the item, the advancement detected, the item is left behind has a ghost item on the client.
      Presumably, that happens because of when in the tick the advancement triggers. It is likely, that the advancement triggers before the item is being send to the client, and then the inventory updates are send in the wrong order.

      How to reproduce

      1. Download the example datapack: Advancement Ghost Item Bug.zip
      2. Put the datapack into your world's datapack directory
      3. Give yourself a vine
      4. Make sure you are in survival mode (in creative the ghost item will behave like a regular item)
        You now have a ghost vine in your inventory

            Unassigned Unassigned
            Schortan [Mod] NeunEinser
            Votes:
            19 Vote for this issue
            Watchers:
            19 Start watching this issue

              Created:
              Updated:
              CHK: