Interface PlayerPrepareCraftEvent
- All Superinterfaces:
Event, PlayerEvent
Fired each time the crafting grid of a player changes, once the server has looked for a matching
recipe and before the result slot is shown.
Setting the result to ItemStack.EMPTY hides it, so the craft cannot happen. Setting
another item shows that one instead; the ingredients taken stay those of the
match.
- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescriptioninput()Returns the crafting grid.match()Returns the recipe found,nullwhen none matches.result()Returns what the result slot shows,ItemStack.EMPTYfor nothing.voidChanges what the result slot shows.Methods inherited from interface PlayerEvent
player
-
Method Details
-
input
-
match
@Nullable CraftingMatch match()Returns the recipe found,nullwhen none matches.- Returns:
- the recipe found,
nullwhen none matches - Since:
- 0.1.0
-
result
ItemStack result()Returns what the result slot shows,ItemStack.EMPTYfor nothing.- Returns:
- what the result slot shows,
ItemStack.EMPTYfor nothing - Since:
- 0.1.0
-
setResult
Changes what the result slot shows. Ignored when no recipe matches: there would be nothing to take from the grid.- Parameters:
result- the item to show,ItemStack.EMPTYto block the craft- Since:
- 0.1.0
-