PaperMC / PaperMC/Paper

Changes on EntityPickupItemEvent not reflected

Open
#10,065 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: accepted type: bug version: 1.20.2
Dominant language
Java
Stars
12.7k
Forks
3.5k
Avg merge
3d 13h
Merged PRs (30d)
11

Description

Expected behavior

Changes done in the event to the item stack associated with the event should be reflected on the actual picked up item.

Observed/Actual behavior

The changes are not reflected and are ignored.

Steps/models to reproduce

Example code: https://code.lewds.de/BQ7OpU

Output showing that even though the item was changed it didnt end up in the inventory
image

The whole process is:

  • I drop a diamond to a zombie
  • When picking up an item I set a key inside the pdc.
  • I check whether the key is actually there. It is.
  • I check after two ticks if the item in the hand. It is not.
  • The zombie gets killed after 20 ticks
  • The zombie drops a diamond without any pdc keys set.
  • I pick the diamond up. The key is added again and present in my inventory.
  • I drop the now tagged item to a zombie again.
  • The zombie picks up my item and the key is now actually there
Plugin and Datapack List

Only the example plugin above.

Paper version

1This server is running Paper version git-Paper-318 (MC: 1.20.2) (Implementing API version 1.20.2-R0.1-SNAPSHOT) (Git: 9271ee7)
You are running the latest version
Previous version: git-Paper-196 (MC: 1.20.1)

Other

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the EntityPickupItemEvent handling and the linked example code, then reproduce the reported item-stack change and follow how the picked-up item is transferred. Done means changes made to the event's item stack are reflected in the item received by the entity and the reported reproduction no longer occurs.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend-api-design
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.