Interface FishHook

All Superinterfaces:
CommandSender, Entity, Metadatable, Nameable, Permissible, PersistentDataHolder, Projectile, ServerOperator

public interface FishHook extends Projectile
Represents a fishing hook.
  • Method Details Link icon

    • getMinWaitTime Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 appear
      max - maximum ticks for a fish to appear
    • getMinLureTime Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 bite
      max - maximum ticks to wait for a bite
    • getMinLureAngle Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 degrees
      max - maximum angle in degrees
    • getApplyLure Link icon

      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 Link icon

      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 Link icon

      @Deprecated(since="1.9.2") 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 Link icon

      @Deprecated(since="1.9.2") 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 Link icon

      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 Link icon

      @Nullable Entity getHookedEntity()
      Get the entity hooked by this fish hook.
      Returns:
      the hooked entity. null if none
    • setHookedEntity Link icon

      void setHookedEntity(@Nullable Entity entity)
      Set the entity hooked by this fish hook.
      Parameters:
      entity - the entity to set, or null to unhook
    • pullHookedEntity Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

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