PaperMC / PaperMC/Paper

Add GrindstoneItemEvent

Open
#13,900 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?

related to #13575

The grindstone and the anvil are the only workbenches who don't have a 'use' event related to their 'PrepareResultEvent' event.
e.g. PrepareSmithingEvent has SmithItemEvent, PrepareItemEnchantEvent has EnchantItemEvent, etc.

I require this functionality to be able to award skill xp for a progression system, for example.

Describe the solution you'd like.

Add GrindstoneItemEvent, (and AnvilUseEvent #13575), so that these actions can be properly detected,
or a more generic CompleteResultEvent, that would apply to all PrepareResultEvent events, when a result is completed.

Describe alternatives you've considered.

Listening to the InventoryClickEvent, but this requires hacky prediction of whether the item will actually leave the result slot.

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 by tracing the existing PrepareResultEvent implementations, especially PrepareSmithingEvent and PrepareItemEnchantEvent, alongside SmithItemEvent and EnchantItemEvent. Compare how result-completion events are exposed and review InventoryClickEvent as the current workaround. Done means grindstone use can be detected through the proposed event API, with the relationship to AnvilUseEvent #13575 or a generic CompleteResultEvent resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
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.