Interface SchoolableFish

All Superinterfaces:
Attributable, Audience, Bucketable, CommandSender, Creature, Damageable, Entity, Fish, Frictional, HoverEventSource<HoverEvent.ShowEntity>, LivingEntity, Lootable, Metadatable, Mob, Nameable, Permissible, PersistentDataHolder, Pointered, ProjectileSource, ServerOperator, Sound.Emitter, WaterMob
All Known Subinterfaces:
Cod, Salmon, TropicalFish

public interface SchoolableFish extends Fish
Represents a fish that can school with other fish.
  • Method Details

    • startFollowing

      void startFollowing(@NotNull @NotNull SchoolableFish leader)
      Forces this fish to follow the given fish.
      Parameters:
      leader - fish to follow
    • stopFollowing

      void stopFollowing()
      Causes the fish to stop following their current leader.
    • getSchoolSize

      int getSchoolSize()
      Gets the amount of fish currently following this fish.
      Returns:
      school size
    • getMaxSchoolSize

      int getMaxSchoolSize()
      Gets the maximum number of fish that will naturally follow this fish.
      Returns:
      max school size
    • getSchoolLeader

      Gets the fish that this entity is currently following.
      Returns:
      following fish