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
If you want to monitor a fishhooks state transition, you can use FishHookStateChangeEvent.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAn enum to specify the state of the fishingNested classes/interfaces inherited from class Event
Event.Result -
Field Summary
Fields inherited from class PlayerEvent
player -
Constructor Summary
ConstructorsConstructorDescriptionPlayerFishEvent(@NotNull Player player, @Nullable Entity entity, @NotNull FishHook hookEntity, @NotNull PlayerFishEvent.State state) PlayerFishEvent(@NotNull Player player, @Nullable Entity entity, @NotNull FishHook hookEntity, @Nullable EquipmentSlot hand, @NotNull PlayerFishEvent.State state) -
Method Summary
Modifier 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 @NotNull 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 PlayerEvent
getPlayerMethods inherited from class Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PlayerFishEvent
-
PlayerFishEvent
-
-
Method Details
-
getCaught
-
getHook
-
getHand
Get the hand that was used in this event.The hand used is only present for player interactions. This means it will be
nullif state is set toPlayerFishEvent.State.BITEorPlayerFishEvent.State.FAILED_ATTEMPT.- Returns:
- the hand
-
getState
Gets the state of the fishing- Returns:
- A State detailing the state of the fishing
-
getExpToDrop
public 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
-
setExpToDrop
public 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
-
isCancelled
public 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 interfaceCancellable- Returns:
trueif this event is cancelled
-
setCancelled
public 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 interfaceCancellable- Parameters:
cancel-trueif you wish to cancel this event
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-