Package org.bukkit.entity

# Interface FishHook

All Superinterfaces:
  `Audience`, `CommandSender`, `Entity`, `HoverEventSource<HoverEvent.ShowEntity>`, `Metadatable`, `Nameable`, `Permissible`, `PersistentDataHolder`, `Pointered`, `Projectile`, `ServerOperator`, `Sound.Emitter`

public interface FishHook extends Projectile
Represents a fishing hook.

## Nested Class Summary

Nested Classes
Modifier and Type
Interface
Description
`static enum`
`FishHook.HookState`
Represents a state in which a fishing hook may be.

## Nested classes/interfaces inherited from interface org.bukkit.entity.Entity

`Entity.Spigot`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`getApplyLure()`
Get whether the lure enchantment should be applied to reduce the wait time.
`double`
`getBiteChance()`
Deprecated.
has no effect in newer Minecraft versions
`@Nullable Entity`
`getHookedEntity()`
Get the entity hooked by this fish hook.
`int`
`getMaxWaitTime()`
Get the maximum number of ticks one has to wait for a fish biting.
`int`
`getMinWaitTime()`
Get the minimum number of ticks one has to wait for a fish biting.
`@NotNull FishHook.HookState`
`getState()`
Get the current state of this fish hook.
`int`
`getWaitTime()`
Get the number of ticks the hook needs to wait for a fish to bite.
`boolean`
`isInOpenWater()`
Check whether or not this fish hook is in open water.
`boolean`
`pullHookedEntity()`
Pull the hooked entity to the caster of this fish hook.
`void`
`setApplyLure(boolean applyLure)`
Set whether the lure enchantment should be applied to reduce the wait time.
`void`
`setBiteChance(double chance)`
Deprecated.
has no effect in newer Minecraft versions
`void`
`setHookedEntity(@Nullable Entity entity)`
Set the entity hooked by this fish hook.
`void`
`setMaxWaitTime(int maxWaitTime)`
Set the maximum number of ticks one has to wait for a fish biting.
`void`
`setMinWaitTime(int minWaitTime)`
Set the minimum number of ticks one has to wait for a fish biting.
`void`
`setWaitTime(int ticks)`
Sets the number of ticks the hook needs to wait for a fish to bite.

### Methods inherited from interface net.kyori.adventure.audience.Audience

`clearTitle, filterAudience, forEachAudience, hideBossBar, openBook, openBook, playSound, playSound, playSound, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, sendTitlePart, showBossBar, showTitle, stopSound, stopSound`

### Methods inherited from interface org.bukkit.command.CommandSender

`getName, name, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage`

### Methods inherited from interface org.bukkit.entity.Entity

`addPassenger, addScoreboardTag, asHoverEvent, eject, fromMobSpawner, getBoundingBox, getChunk, getEntityId, getEntitySpawnReason, getFacing, getFallDistance, getFireTicks, getFreezeTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getMaxFreezeTicks, getNearbyEntities, getOrigin, getPassenger, getPassengers, getPistonMoveReaction, getPortalCooldown, getPose, getScoreboardTags, getServer, getSpawnCategory, getTicksLived, getTrackedPlayers, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, hasGravity, isCustomNameVisible, isDead, isEmpty, isFreezeTickingLocked, isFrozen, isGlowing, isInBubbleColumn, isInLava, isInPowderedSnow, isInRain, isInsideVehicle, isInvulnerable, isInWater, isInWaterOrBubbleColumn, isInWaterOrRain, isInWaterOrRainOrBubbleColumn, isOnGround, isPersistent, isSilent, isTicking, isValid, isVisualFire, leaveVehicle, lockFreezeTicks, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setFreezeTicks, setGlowing, setGravity, setInvulnerable, setLastDamageCause, setPassenger, setPersistent, setPortalCooldown, setRotation, setSilent, setTicksLived, setVelocity, setVisualFire, spawnAt, spawnAt, spigot, teamDisplayName, teleport, teleport, teleport, teleport, teleportAsync, teleportAsync`

### Methods inherited from interface net.kyori.adventure.text.event.HoverEventSource

`asHoverEvent`

### Methods inherited from interface org.bukkit.metadata.Metadatable

`getMetadata, hasMetadata, removeMetadata, setMetadata`

### Methods inherited from interface org.bukkit.Nameable

`customName, customName, getCustomName, setCustomName`

### Methods inherited from interface org.bukkit.permissions.Permissible

`addAttachment, addAttachment, addAttachment, addAttachment, getEffectivePermissions, hasPermission, hasPermission, isPermissionSet, isPermissionSet, permissionValue, permissionValue, recalculatePermissions, removeAttachment`

### Methods inherited from interface org.bukkit.persistence.PersistentDataHolder

`getPersistentDataContainer`

### Methods inherited from interface net.kyori.adventure.pointer.Pointered

`get, getOrDefault, getOrDefaultFrom, pointers`

### Methods inherited from interface org.bukkit.entity.Projectile

`doesBounce, getShooter, setBounce, setShooter`

### Methods inherited from interface org.bukkit.permissions.ServerOperator

`isOp, setOp`

## Method Details

### getMinWaitTime

int getMinWaitTime()
Get the minimum number of ticks one has to wait for a fish biting.

The default is 100 ticks (5 seconds).
Note that this is before applying lure.

Returns:
  Minimum number of ticks one has to wait for a fish biting

### setMinWaitTime

void setMinWaitTime(int minWaitTime)
Set the minimum number of ticks one has to wait for a fish biting.

The default is 100 ticks (5 seconds).
Note that this is before applying lure.

Parameters:
  `minWaitTime` - Minimum number of ticks one has to wait for a fish biting

### getMaxWaitTime

int getMaxWaitTime()
Get the maximum number of ticks one has to wait for a fish biting.

The default is 600 ticks (30 seconds).
Note that this is before applying lure.

Returns:
  Maximum number of ticks one has to wait for a fish biting

### setMaxWaitTime

void setMaxWaitTime(int maxWaitTime)
Set the maximum number of ticks one has to wait for a fish biting.

The default is 600 ticks (30 seconds).
Note that this is before applying lure.

Parameters:
  `maxWaitTime` - Maximum number of ticks one has to wait for a fish biting

### getApplyLure

boolean getApplyLure()
Get whether the lure enchantment should be applied to reduce the wait time.

The default is true.
Lure reduces the wait time by 100 ticks (5 seconds) for each level of the enchantment.

Returns:
  Whether the lure enchantment should be applied to reduce the wait time

### setApplyLure

void setApplyLure(boolean applyLure)
Set whether the lure enchantment should be applied to reduce the wait time.

The default is true.
Lure reduces the wait time by 100 ticks (5 seconds) for each level of the enchantment.

Parameters:
  `applyLure` - Whether the lure enchantment should be applied to reduce the wait time

### getBiteChance

@Deprecated double getBiteChance()
Deprecated.
has no effect in newer Minecraft versions
Gets the chance of a fish biting.

0.0 = No Chance.
1.0 = Instant catch.

Returns:
  chance the bite chance

### setBiteChance

@Deprecated void setBiteChance(double chance) throws IllegalArgumentException
Deprecated.
has no effect in newer Minecraft versions
Sets the chance of a fish biting.

0.0 = No Chance.
1.0 = Instant catch.

Parameters:
  `chance` - the bite chance
Throws:
  `IllegalArgumentException` - if the bite chance is not between 0 and 1

### isInOpenWater

boolean isInOpenWater()
Check whether or not this fish hook is in open water.

Open water is defined by a 5x4x5 area of water, air and lily pads. If in open water, treasure items may be caught.

Returns:
  true if in open water, false otherwise

### getHookedEntity

@Nullable @Nullable Entity getHookedEntity()
Get the entity hooked by this fish hook.

Returns:
  the hooked entity. null if none

### setHookedEntity

void setHookedEntity(@Nullable @Nullable Entity entity)
Set the entity hooked by this fish hook.

Parameters:
  `entity` - the entity to set, or null to unhook

### pullHookedEntity

boolean pullHookedEntity()
Pull the hooked entity to the caster of this fish hook. If no entity is hooked, this method has no effect.

Returns:
  true if pulled, false if no entity is hooked

### getState

@NotNull @NotNull FishHook.HookState getState()
Get the current state of this fish hook.

Returns:
  the fish hook state

### getWaitTime

int getWaitTime()
Get the number of ticks the hook needs to wait for a fish to bite.

Returns:
  Number of ticks

### setWaitTime

void setWaitTime(int ticks)
Sets the number of ticks the hook needs to wait for a fish to bite.

Parameters:
  `ticks` - Number of ticks