Interface IAnimal<T extends net.minecraft.entity.passive.EntityAnimal>

  • Type Parameters:
    T - the underlying Minecraft EntityAnimal type.
    All Superinterfaces:
    IEntity<T>, IEntityLiving<T>, IEntityLivingBase<T>
    All Known Subinterfaces:
    IPixelmon<T>

    public interface IAnimal<T extends net.minecraft.entity.passive.EntityAnimal>
    extends IEntityLiving<T>
    Represents an animal entity with additional behavior such as breeding, following, and mating.
    • Method Detail

      • isBreedingItem

        boolean isBreedingItem​(IItemStack itemStack)
        Checks whether the specified item can be used to breed this animal. (e.g. wheat, carrots or seeds depending on the animal type)
        Parameters:
        itemStack - the item to test.
        Returns:
        true if the item is a breeding item; false otherwise.
      • interact

        boolean interact​(IPlayer player)
        Called when a player interacts with the animal. For example, this might return true if the player milks a cow or saddles a pig.
        Parameters:
        player - the interacting player.
        Returns:
        true if the interaction was handled; false otherwise.
      • setFollowPlayer

        void setFollowPlayer​(IPlayer player)
        Sets the specified player as the one to follow.
        Parameters:
        player - the player to follow.
      • followingPlayer

        IPlayer followingPlayer()
        Returns the player that this animal is currently following.
        Returns:
        the following player, or null if not following anyone.
      • isInLove

        boolean isInLove()
        Checks if the animal is currently in a "love" state, indicating readiness to mate.
        Returns:
        true if the animal is in love; false otherwise.
      • resetInLove

        void resetInLove()
        Resets the animal's love state.
      • canMateWith

        boolean canMateWith​(IAnimal animal)
        Checks if this animal can mate with another animal.
        Parameters:
        animal - the other animal.
        Returns:
        true if mating is possible; false otherwise.