Package org.bukkit.event.player
Class PlayerFishEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
org.bukkit.event.player.PlayerFishEvent
- All Implemented Interfaces:
- Cancellable
Thrown when a player is fishing
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumAn enum to specify the state of the fishingNested classes/interfaces inherited from class org.bukkit.event.EventEvent.Result
- 
Field SummaryFields inherited from class org.bukkit.event.player.PlayerEventplayer
- 
Constructor SummaryConstructorsConstructorDescriptionPlayerFishEvent(Player player, Entity entity, FishHook hookEntity, PlayerFishEvent.State state) PlayerFishEvent(Player player, Entity entity, FishHook hookEntity, EquipmentSlot hand, PlayerFishEvent.State state) 
- 
Method SummaryModifier and TypeMethodDescriptionGets the entity caught by the player.intGets the amount of experience received when fishing.getHand()Get the hand that was used in this event.static HandlerListgetHook()Gets the fishing hook.getState()Gets the state of the fishingbooleanGets the cancellation state of this event.voidsetCancelled(boolean cancel) Sets the cancellation state of this event.voidsetExpToDrop(int amount) Sets the amount of experience received when fishing.Methods inherited from class org.bukkit.event.player.PlayerEventgetPlayerMethods inherited from class org.bukkit.event.EventgetEventName, isAsynchronous
- 
Constructor Details- 
PlayerFishEventpublic PlayerFishEvent(@NotNull Player player, @Nullable Entity entity, @NotNull FishHook hookEntity, @Nullable EquipmentSlot hand, @NotNull PlayerFishEvent.State state) 
- 
PlayerFishEvent
 
- 
- 
Method Details- 
getCaughtGets the entity caught by the player.If player has fished successfully, the result may be cast to Item.- Returns:
- Entity caught by the player, Entity if fishing, and null if bobber has gotten stuck in the ground or nothing has been caught
 
- 
getHookGets the fishing hook.- Returns:
- the entity representing the fishing hook/bobber.
 
- 
isCancelledpublic boolean isCancelled()Description copied from interface:CancellableGets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins- Specified by:
- isCancelledin interface- Cancellable
- Returns:
- true if this event is cancelled
 
- 
setCancelledpublic void setCancelled(boolean cancel) Description copied from interface:CancellableSets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.- Specified by:
- setCancelledin interface- Cancellable
- Parameters:
- cancel- true if you wish to cancel this event
 
- 
getExpToDroppublic int getExpToDrop()Gets the amount of experience received when fishing.Note: This value has no default effect unless the event state is PlayerFishEvent.State.CAUGHT_FISH.- Returns:
- the amount of experience to drop
 
- 
setExpToDroppublic void setExpToDrop(int amount) Sets the amount of experience received when fishing.Note: This value has no default effect unless the event state is PlayerFishEvent.State.CAUGHT_FISH.- Parameters:
- amount- the amount of experience to drop
 
- 
getHandGet the hand that was used in this event.The hand used is only present when the event state is PlayerFishEvent.State.FISHING. In all other states, the hand is null.- Returns:
- the hand
 
- 
getStateGets the state of the fishing- Returns:
- A State detailing the state of the fishing
 
- 
getHandlers- Specified by:
- getHandlersin class- Event
 
- 
getHandlerList
 
-