Package org.bukkit.event.player
Class PlayerRecipeBookClickEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
org.bukkit.event.player.PlayerRecipeBookClickEvent
Called when a player clicks a recipe in the recipe book.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Field Summary
Fields inherited from class org.bukkit.event.player.PlayerEvent
player
-
Constructor Summary
ConstructorDescriptionPlayerRecipeBookClickEvent
(Player player, Recipe recipe, boolean shiftClick) -
Method Summary
Modifier and TypeMethodDescriptionstatic HandlerList
Gets the original recipe the player was trying to craft.Gets the recipe the player is trying to craft.boolean
If true the game will attempt to move the ingredients for as many copies of this recipe as possible into the appropriate slots, otherwise only 1 copy will be moved.void
Set the recipe that will be used.void
setShiftClick
(boolean shiftClick) Sets if the game will attempt to move the ingredients for as many copies of this recipe as possible into the appropriate slots.Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayer
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
PlayerRecipeBookClickEvent
-
-
Method Details
-
getOriginalRecipe
Gets the original recipe the player was trying to craft.
This will not reflect any changes made withsetRecipe(org.bukkit.inventory.Recipe)
.- Returns:
- the original recipe
-
getRecipe
Gets the recipe the player is trying to craft.
This will reflect changes made withsetRecipe(org.bukkit.inventory.Recipe)
.- Returns:
- the recipe
-
setRecipe
Set the recipe that will be used.
The game will attempt to move the ingredients for this recipe into the appropriate slots.If the original recipe is a
CraftingRecipe
the provided recipe must also be aCraftingRecipe
, otherwise the provided recipe must be of the same type as the original recipe.- Parameters:
recipe
- the recipe to be used
-
isShiftClick
public boolean isShiftClick()If true the game will attempt to move the ingredients for as many copies of this recipe as possible into the appropriate slots, otherwise only 1 copy will be moved.- Returns:
- whether as many copies as possible should be moved
-
setShiftClick
public void setShiftClick(boolean shiftClick) Sets if the game will attempt to move the ingredients for as many copies of this recipe as possible into the appropriate slots.- Parameters:
shiftClick
- whether as many copies as possible should be moved
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-