PaperMC / PaperMC/Paper

StonecutterInventory#setResult(ItemStack) is ignored in PlayerStonecutterRecipeSelectEvent

Open
#12,593 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Expected behavior

Since the PlayerStonecutterRecipeSelectEvent has a getStonecutterInventory method that returns a StonecutterInventory instance which has a setResult(ItemStack) method, I expect the result to be correctly set.

Observed/Actual behavior

The result is not set.

Steps/models to reproduce

Create a simple plugin with the PlayerStonecutterRecipeSelectEvent in use like this:

@EventHandler
public void onStoneCutter(PlayerStonecutterRecipeSelectEvent event) {
    StonecutterInventory inventory = event.getStonecutterInventory();
    StonecuttingRecipe recipe = event.getStonecuttingRecipe();
    ItemStack result = recipe.getResult();
    ItemStack newResult = result.withType(Material.BARRIER);
    inventory.setResult(newResult);
}

Notice that the result does not change.

Plugin and Datapack List

Just the plugin I am currently making, no datapacks.

Paper version

This server is running Paper version 1.21.5-101-main@a033e3b (2025-05-25T07:31:15Z) (Implementing API version 1.21.5-R0.1-SNAPSHOT)
You are running the latest version
Previous version: 1.21.5-94-b70bca6 (MC: 1.21.5)

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 at PlayerStonecutterRecipeSelectEvent and the StonecutterInventory#setResult(ItemStack) path, then reproduce the behavior with the plugin example against the stated Paper version. Trace how the selected recipe result is applied and verify that changing the inventory result changes the stonecutter output.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.