[SPIGOT-5589] Shift-clicking a custom item set in PrepareItemCraftEvent doesn't create the right amount of items Created: 19/Feb/20  Updated: 20/Feb/20  Resolved: 20/Feb/20

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Anky Y Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: crafting, event, spigot

Issue Links:
Duplicate
duplicates SPIGOT-3526 PrepareItemCraftEvent#getInventory().... Open
Version: CraftBukkit git-Spigot-c574e08-918061b | MC 1.15.2 | API 1.15.2-R0.1-SNAPSHOT
Guidelines Read: Yes

 Description   

When setting a custom item in the result during the PrepareItemCraftEvent by calling event.getInventory().setResult(), then shift-clicking the custom item set, the amount of items produced is incorrect.

 

Example code:

@EventHandler
public void prepareItem(PrepareItemCraftEvent e) {
    e.getInventory().setResult(new ItemStack(Material.DIAMOND));
}

When placing, for example, a stack of Stone, and shift-clicking the Diamond produced, you receive 27 Diamonds instead of 64, but the whole stack of Stone is used. 



 Comments   
Comment by md_5 [ 19/Feb/20 ]

This event is not designed for changing crafting recipes, the recipe API is

Generated at Tue Apr 22 05:09:37 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.