Interface FishingContext
- All Superinterfaces:
EffectContext
Context for fishing-related enchantment effects.
Provides access to player, fishing rod, fish hook, caught items/entities, and fishing mechanics data during fishing events.
- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.entity.EntityGets the caught entity, if any.@Nullable org.bukkit.entity.ItemGets the caught item, if any.@NotNull org.bukkit.inventory.ItemStackGets the fishing rod item.@NotNull org.bukkit.entity.FishHookgetHook()Gets the fish hook entity.@NotNull org.bukkit.LocationGets the location of the hook.intGets the current lure speed.@NotNull org.bukkit.entity.PlayerGets the player fishing.intGets the current wait time.booleanChecks if an entity has been caught.booleanChecks if an item has been caught.booleanChecks if lure effects are being applied.booleanisBite()Checks if a fish has bitten.booleanisCast()Checks if the player is casting the line.booleanisReel()Checks if the player is reeling in.voidsetApplyLure(boolean apply) Sets whether lure enchantment effects apply.voidsetLureSpeed(int speed) Sets the lure speed modifier.voidsetWaitTime(int ticks) Sets the wait time for fish bite in ticks.Methods inherited from interface io.artificial.enchantments.api.context.EffectContext
getEnchantment, getLevel, getScaledValue, isCancellable, isCancelled, tryCancel
-
Method Details
-
getPlayer
@NotNull @NotNull org.bukkit.entity.Player getPlayer()Gets the player fishing.- Returns:
- the fishing player
-
getFishingRod
@NotNull @NotNull org.bukkit.inventory.ItemStack getFishingRod()Gets the fishing rod item.- Returns:
- the fishing rod
-
getHook
@NotNull @NotNull org.bukkit.entity.FishHook getHook()Gets the fish hook entity.- Returns:
- the fish hook
-
getLocation
@NotNull @NotNull org.bukkit.Location getLocation()Gets the location of the hook.- Returns:
- the hook location
-
getCaughtItem
@Nullable @Nullable org.bukkit.entity.Item getCaughtItem()Gets the caught item, if any.- Returns:
- the caught item, or null
-
getCaughtEntity
@Nullable org.bukkit.entity.Entity getCaughtEntity()Gets the caught entity, if any.- Returns:
- the caught entity, or null
-
isCast
boolean isCast()Checks if the player is casting the line.- Returns:
- true if casting
-
isReel
boolean isReel()Checks if the player is reeling in.- Returns:
- true if reeling
-
isBite
boolean isBite()Checks if a fish has bitten.- Returns:
- true if fish biting
-
hasCaughtItem
boolean hasCaughtItem()Checks if an item has been caught.- Returns:
- true if caught item
-
hasCaughtEntity
boolean hasCaughtEntity()Checks if an entity has been caught.- Returns:
- true if caught entity
-
setWaitTime
void setWaitTime(int ticks) Sets the wait time for fish bite in ticks.- Parameters:
ticks- the wait time
-
getWaitTime
int getWaitTime()Gets the current wait time.- Returns:
- the wait time in ticks
-
setLureSpeed
void setLureSpeed(int speed) Sets the lure speed modifier.- Parameters:
speed- the lure speed
-
getLureSpeed
int getLureSpeed()Gets the current lure speed.- Returns:
- the lure speed
-
setApplyLure
void setApplyLure(boolean apply) Sets whether lure enchantment effects apply.- Parameters:
apply- true to apply lure
-
isApplyLure
boolean isApplyLure()Checks if lure effects are being applied.- Returns:
- true if lure applies
-