mojira.dev
MC-187444

"thrown_item_picked_up_by_entity" advancement trigger is triggered when a player drops an item and the same player picks it back up

The bug

Although the thrown_item_picked_up_by_entity advancement trigger now works for players, it is triggered when a player drops an item and the same player picks it back up.

The bug is caused by the fix for MC-185095.

How to reproduce

  1. Download and then install the data pack below for easier reproduction.

  2. Observe the following advancements and functions below:

    {
      "criteria": {
        "thrown_item_picked_up_by_entity": {
          "trigger": "thrown_item_picked_up_by_entity"
        }
      },
      "rewards": {
        "function": "game:thrown_item_picked_up_by_entity"
      }
    }
    {
      "criteria": {
        "thrown_item_picked_up_by_entity": {
          "trigger": "thrown_item_picked_up_by_entity"
        }
      },
      "rewards": {
        "function": "game:thrown_item_picked_up_by_entity"
      }
    }
    advancement revoke @s only game:thrown_item_picked_up_by_entity
    tellraw @s ["",{"selector":"@s"}," picked up an item"]
    advancement revoke @s only game:thrown_item_picked_up_by_entity
    tellraw @s ["",{"selector":"@s"}," picked up an item"]
  3. Drop any item and then pick it back up.
    → ❌ You will notice that the advancement is granted even if you are the same player that dropped the item.

Fix

A suggested fix would be to check if the UUID of the player that picks up the item matches that of the Thrower NBT tag of the item entity if any. If it does, then the advancement trigger should not be triggered for the player that drops the item.

Linked issues

Attachments

Comments 2

On our Discord the original reprter requested to mark it as such, for the following reason:

MC-187444 should be Invalid since the player who drops the item is a valid entity who can pick it up, and certain steps can be used to control that anyway.

user-a4a49

(Unassigned)

Unconfirmed

Advancements

Advancements, advancement, thrown_item_picked_up_by_entity, trigger

1.16 Pre-release 1, 1.16 Pre-release 2

Retrieved