Interface Animal

All Superinterfaces:
Ageable, Entity, HoverEventSource<HoverEvent.ShowEntity>, LivingEntity, Mob, SchedulerSource, Sound.Emitter, Sound.Source.Provider
All Known Subinterfaces:
Chicken, Cow, Mooshroom, Pig, Sheep

public interface Animal extends Ageable
An animal that breeds: fed its food, it falls in love and looks for a partner of its kind, and the two have a baby.

Like every entity, change it from the region thread owning its chunk.

Since:
0.1.0
  • Field Details

    • LOVE_TICKS

      static final int LOVE_TICKS
      How long an animal stays in love, in ticks.
      Since:
      0.1.0
      See Also:
  • Method Details

    • isFood

      boolean isFood(ItemStack stack)
      Returns true if this animal eats an item.: fed to it, the item makes it fall in love or a baby grow up faster
      Parameters:
      stack - the item
      Returns:
      true if this animal eats an item
      Since:
      0.1.0
    • isInLove

      boolean isInLove()
      Returns true while this animal is in love and looks for a partner.
      Returns:
      true while this animal is in love and looks for a partner
      Since:
      0.1.0
    • inLoveTime

      int inLoveTime()
      Returns how many ticks this animal stays in love, 0 if it is not.
      Returns:
      how many ticks this animal stays in love, 0 if it is not
      Since:
      0.1.0
    • setInLove

      void setInLove(@Nullable Player cause)
      Makes this animal fall in love for 600 ticks, hearts rising above it.
      Parameters:
      cause - the player who fed it, credited for the baby; null for none
      Since:
      0.1.0
    • resetLove

      void resetLove()
      Makes this animal stop looking for a partner.
      Since:
      0.1.0
    • loveCause

      @Nullable UUID loveCause()
      Returns the player who made this animal fall in love last, null if unknown.
      Returns:
      the player who made this animal fall in love last, null if unknown
      Since:
      0.1.0
    • isPanicking

      boolean isPanicking()
      Returns true while this animal runs away from what hurt it.; it breeds with no one meanwhile
      Returns:
      true while this animal runs away from what hurt it
      Since:
      0.1.0