PaperMC / PaperMC/Paper

Feature request: add a way to get the picked block/entity on creative

Open
#13,797 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: needs triage
Dominant language
Java
Stars
12.7k
Forks
3.5k
Avg merge
3d 13h
Merged PRs (30d)
11

Description

Is your feature request related to a problem?

Currently there is no way to get the ItemStack that is created when a player picks a block in creative with CTRL + MIDDLE CLICK. It would be very nice to have it, since the NMS ItemStack exists, the NMS block can return it, but it is not passed on the PlayerPickBlockEvent.

Image Image
Describe the solution you'd like.

A PlayerPickItemEvent#getPickedItem() and PlayerPickItemEvent#setPickedItem(ItemStack) methods for us to manipulate the result. A BlockState#getPickItemStack() would be cool too.

Describe alternatives you've considered.

The only thing that comes to mind if using the NMS or trying to emulate the pick system

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 PlayerPickBlockEvent, PlayerPickItemEvent, BlockState, and the NMS ItemStack flow described in the issue. Determine where the picked item is created and how it reaches the event, then compare the requested getter/setter and BlockState#getPickItemStack() scope. Done means the picked item can be inspected and modified through the API for creative block or entity picking.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.