Interface FishHook
- All Superinterfaces:
Audience
,CommandSender
,Entity
,HoverEventSource<HoverEvent.ShowEntity>
,Metadatable
,Nameable
,Permissible
,PersistentDataHolder
,PersistentDataViewHolder
,Pointered
,Projectile
,ServerOperator
,Sound.Emitter
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
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 TypeMethodDescriptionboolean
Get whether the lure enchantment should be applied to reduce the wait time.double
Deprecated.has no effect in newer Minecraft versionsGet the entity hooked by this fish hook.float
Get the maximum angle (in degrees, 0 being positive Z 90 being negative X) of where a fish will appear after the wait time.int
Get the maximum number of ticks one has to wait for a fish to bite after appearing.int
Get the maximum number of ticks one has to wait for a fish appearing.float
Get the minimum angle (in degrees, 0 being positive Z 90 being negative X) of where a fish will appear after the wait time.int
Get the minimum number of ticks one has to wait for a fish to bite after appearing.int
Get the minimum number of ticks one has to wait for a fish appearing.getState()
Get the current state of this fish hook.@org.jetbrains.annotations.Range(from=0L, to=2147483647L) int
Get the number of ticks the fish has to swim until biting the hook.int
Get the number of ticks the hook needs to wait for a fish to bite.boolean
Check whether or not this fish hook is in open water.boolean
Whether or not wait and lure time will be impacted by rain.boolean
Whether or not wait and lure time will be impacted by direct sky access.boolean
Pull the hooked entity to the caster of this fish hook.void
Completely resets this fishing hook's fishing state, re-randomizing the time needed until a fish is lured and bites the 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 versionsvoid
setHookedEntity
(@Nullable Entity entity) Set the entity hooked by this fish hook.void
setLureAngle
(float min, float max) Set both the minimum (default 0) and maximum (default 360) angle of where a fish will appear after the wait time.void
setLureTime
(int min, int max) Set both the minimum (default 20) and maximum (default 80) amount of ticks one has to wait for a fish to bite after appearing.void
setMaxLureAngle
(float maxLureAngle) Set the maximum angle (in degrees, 0 being positive Z 90 being negative X) of where a fish will appear after the wait time.void
setMaxLureTime
(int maxLureTime) Set the maximum number of ticks one has to wait for a fish to bite after appearing.void
setMaxWaitTime
(int maxWaitTime) Set the maximum number of ticks one has to wait for a fish appearing.void
setMinLureAngle
(float minLureAngle) Set the minimum angle (in degrees, 0 being positive Z 90 being negative X) of where a fish will appear after the wait time.void
setMinLureTime
(int minLureTime) Set the minimum number of ticks one has to wait for a fish to bite after appearing.void
setMinWaitTime
(int minWaitTime) Set the minimum number of ticks one has to wait for a fish appearing.void
setRainInfluenced
(boolean rainInfluenced) Set whether or not wait and lure time will be impacted by rain.void
setSkyInfluenced
(boolean skyInfluenced) Set whether or not wait and lure time will be impacted by direct sky access.void
setTimeUntilBite
(@org.jetbrains.annotations.Range(from=1L, to=2147483647L) int ticks) Sets the number of ticks the fish has to swim until biting the hook.void
setWaitTime
(int ticks) Sets the number of ticks the hook needs to wait for a fish to bite.void
setWaitTime
(int min, int max) Set both the minimum (default 100) and maximum (default 600) amount of ticks one has to wait for a fish appearing.Methods inherited from interface net.kyori.adventure.audience.Audience
clearResourcePacks, clearTitle, deleteMessage, deleteMessage, filterAudience, forEachAudience, hideBossBar, openBook, openBook, playSound, playSound, playSound, removeResourcePacks, removeResourcePacks, removeResourcePacks, removeResourcePacks, removeResourcePacks, resetTitle, sendActionBar, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendPlayerListHeaderAndFooter, sendResourcePacks, sendResourcePacks, sendResourcePacks, sendTitlePart, showBossBar, showTitle, stopSound, stopSound
Methods inherited from interface org.bukkit.command.CommandSender
getName, name, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlainMessage, sendRichMessage, sendRichMessage
Methods inherited from interface org.bukkit.entity.Entity
addPassenger, addScoreboardTag, asHoverEvent, broadcastHurtAnimation, collidesAt, copy, copy, createSnapshot, eject, fromMobSpawner, getAsString, getBoundingBox, getChunk, getEntityId, getEntitySpawnReason, getFacing, getFallDistance, getFireTicks, getFreezeTicks, getHeight, getLastDamageCause, getLocation, getLocation, getMaxFireTicks, getMaxFreezeTicks, getNearbyEntities, getOrigin, getPassenger, getPassengers, getPistonMoveReaction, getPitch, getPortalCooldown, getPose, getScheduler, getScoreboardEntryName, getScoreboardTags, getServer, getSpawnCategory, getSwimHighSpeedSplashSound, getSwimSound, getSwimSplashSound, getTicksLived, getTrackedBy, getTrackedPlayers, getType, getUniqueId, getVehicle, getVelocity, getWidth, getWorld, getX, getY, getYaw, getZ, hasFixedPose, hasGravity, hasNoPhysics, isCustomNameVisible, isDead, isEmpty, isFreezeTickingLocked, isFrozen, isGlowing, isInBubbleColumn, isInLava, isInPowderedSnow, isInRain, isInsideVehicle, isInvisible, isInvulnerable, isInWater, isInWaterOrBubbleColumn, isInWaterOrRain, isInWaterOrRainOrBubbleColumn, isInWorld, isOnGround, isPersistent, isSilent, isSneaking, isTicking, isUnderWater, isValid, isVisibleByDefault, isVisualFire, leaveVehicle, lockFreezeTicks, playEffect, remove, removePassenger, removeScoreboardTag, setCustomNameVisible, setFallDistance, setFireTicks, setFreezeTicks, setGlowing, setGravity, setInvisible, setInvulnerable, setLastDamageCause, setNoPhysics, setPassenger, setPersistent, setPortalCooldown, setPose, setPose, setRotation, setSilent, setSneaking, setTicksLived, setVelocity, setVisibleByDefault, setVisualFire, spawnAt, spawnAt, spigot, teamDisplayName, teleport, teleport, teleport, teleport, teleport, teleport, teleportAsync, teleportAsync, teleportAsync, wouldCollideUsing
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
canHitEntity, doesBounce, getOwnerUniqueId, getShooter, hasBeenShot, hasLeftShooter, hitEntity, hitEntity, setBounce, setHasBeenShot, setHasLeftShooter, 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 appearing.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 appearing
-
setMinWaitTime
void setMinWaitTime(int minWaitTime) Set the minimum number of ticks one has to wait for a fish appearing.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 appearing
-
getMaxWaitTime
int getMaxWaitTime()Get the maximum number of ticks one has to wait for a fish appearing.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 appearing
-
setMaxWaitTime
void setMaxWaitTime(int maxWaitTime) Set the maximum number of ticks one has to wait for a fish appearing.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 appearing
-
setWaitTime
void setWaitTime(int min, int max) Set both the minimum (default 100) and maximum (default 600) amount of ticks one has to wait for a fish appearing.- Parameters:
min
- minimum ticks for a fish to appearmax
- maximum ticks for a fish to appear
-
getMinLureTime
int getMinLureTime()Get the minimum number of ticks one has to wait for a fish to bite after appearing.The default is 20 ticks (1 second).
Lure does not affect this value. This will also effect the radius (0.1 * lureTime) of where the fish will appear.- Returns:
- Minimum number of ticks one has to wait for a fish to bite
-
setMinLureTime
void setMinLureTime(int minLureTime) Set the minimum number of ticks one has to wait for a fish to bite after appearing.The default is 20 ticks (1 second).
Lure does not affect this value. This will also effect the radius (0.1 * lureTime) of where the fish will appear.- Parameters:
minLureTime
- Minimum number of ticks one has to wait for a fish to bite
-
getMaxLureTime
int getMaxLureTime()Get the maximum number of ticks one has to wait for a fish to bite after appearing.The default is 80 ticks (4 second).
Lure does not affect this value. This will also effect the radius (0.1 * lureTime) of where the fish will appear.- Returns:
- Maximum number of ticks one has to wait for a fish to bite
-
setMaxLureTime
void setMaxLureTime(int maxLureTime) Set the maximum number of ticks one has to wait for a fish to bite after appearing.The default is 80 ticks (4 second).
Lure does not affect this value. This will also effect the radius (0.1 * lureTime) of where the fish will appear.- Parameters:
maxLureTime
- Maximum number of ticks one has to wait for a fish to bite
-
setLureTime
void setLureTime(int min, int max) Set both the minimum (default 20) and maximum (default 80) amount of ticks one has to wait for a fish to bite after appearing.- Parameters:
min
- minimum ticks to wait for a bitemax
- maximum ticks to wait for a bite
-
getMinLureAngle
float getMinLureAngle()Get the minimum angle (in degrees, 0 being positive Z 90 being negative X) of where a fish will appear after the wait time.The default is 0 degrees.
- Returns:
- Minimum angle of where a fish will appear
-
setMinLureAngle
void setMinLureAngle(float minLureAngle) Set the minimum angle (in degrees, 0 being positive Z 90 being negative X) of where a fish will appear after the wait time.The default is 0 degrees.
- Parameters:
minLureAngle
- Minimum angle of where a fish may appear
-
getMaxLureAngle
float getMaxLureAngle()Get the maximum angle (in degrees, 0 being positive Z 90 being negative X) of where a fish will appear after the wait time.The default is 360 degrees.
- Returns:
- Maximum angle of where a fish will appear
-
setMaxLureAngle
void setMaxLureAngle(float maxLureAngle) Set the maximum angle (in degrees, 0 being positive Z 90 being negative X) of where a fish will appear after the wait time.The default is 360 degrees.
- Parameters:
maxLureAngle
- Maximum angle of where a fish may appear
-
setLureAngle
void setLureAngle(float min, float max) Set both the minimum (default 0) and maximum (default 360) angle of where a fish will appear after the wait time. 0 degrees is positive Z, 90 degrees is negative X.- Parameters:
min
- minimum angle in degreesmax
- maximum angle in degrees
-
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.has no effect in newer Minecraft versionsGets the chance of a fish biting.0.0 = No Chance.
1.0 = Instant catch.- Returns:
- chance the bite chance
-
setBiteChance
Deprecated.has no effect in newer Minecraft versionsSets 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
Get the entity hooked by this fish hook.- Returns:
- the hooked entity. null if none
-
setHookedEntity
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
-
isSkyInfluenced
boolean isSkyInfluenced()Whether or not wait and lure time will be impacted by direct sky access. True by default, causes a 50% time increase on average.- Returns:
- skylight access influences catch rate
-
setSkyInfluenced
void setSkyInfluenced(boolean skyInfluenced) Set whether or not wait and lure time will be impacted by direct sky access. True by default, causes a 50% time increase on average.- Parameters:
skyInfluenced
- if this hook is influenced by skylight access
-
isRainInfluenced
boolean isRainInfluenced()Whether or not wait and lure time will be impacted by rain. True by default, causes a 25% time decrease on average.- Returns:
- rain influences catch rate
-
setRainInfluenced
void setRainInfluenced(boolean rainInfluenced) Set whether or not wait and lure time will be impacted by rain. True by default, causes a 25% time decrease on average.- Parameters:
rainInfluenced
- if this hook is influenced by rain
-
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
-
getTimeUntilBite
@org.jetbrains.annotations.Range(from=0L, to=2147483647L) int getTimeUntilBite()Get the number of ticks the fish has to swim until biting the hook. ThegetWaitTime()
has to be zero or below for the fish to start the time until bite timer.- Returns:
- number of ticks. A value of one indicates that the fish bites the very next time the fish hook is ticked while a value of zero represents a fish that has already bitten the hook.
- See Also:
-
setTimeUntilBite
void setTimeUntilBite(@org.jetbrains.annotations.Range(from=1L, to=2147483647L) int ticks) throws IllegalArgumentException Sets the number of ticks the fish has to swim until biting the hook.- Parameters:
ticks
- number of ticks. One is the minimum that can be passed to this method and instructs the fish to bite the very next tick.- Throws:
IllegalArgumentException
- if the passed tick value is less than one.
-
resetFishingState
void resetFishingState()Completely resets this fishing hook's fishing state, re-randomizing the time needed until a fish is lured and bites the hook.This method takes all properties of the fishing hook into account when resetting said values, such as a lure enchantment.
-