Class EntityAnimal

All Implemented Interfaces:
IAnimals
Direct Known Subclasses:
EntityChicken, EntityPig, EntitySheep, EntityTameable, KickingAnimal

public abstract class EntityAnimal extends EntityAgeable implements IAnimals
  • Field Details

    • STARVING_SPEED_MODIFIER_UUID

      protected static final UUID STARVING_SPEED_MODIFIER_UUID
    • FAMISHED_SPEED_MODIFIER_UUID

      protected static final UUID FAMISHED_SPEED_MODIFIER_UUID
    • starvingSpeedModifier

      protected static final AttributeModifier starvingSpeedModifier
    • famishedSpeedModifier

      protected static final AttributeModifier famishedSpeedModifier
    • breeding

      protected int breeding
      This is representation of a counter for reproduction progress. (Note that this is different from the inLove which represent being in Love-Mode)
    • uncomfortableTick

      protected int uncomfortableTick
    • HUNGER_LEVEL_DATA_WATCHER_ID

      protected static final int HUNGER_LEVEL_DATA_WATCHER_ID
      See Also:
    • IN_LOVE_DATA_WATCHER_ID

      protected static final int IN_LOVE_DATA_WATCHER_ID
      See Also:
    • WEARING_BREEDING_HARNESS_DATA_WATCHER_ID

      protected static final int WEARING_BREEDING_HARNESS_DATA_WATCHER_ID
      See Also:
    • FULL_HUNGER_COUNT

      public static final int FULL_HUNGER_COUNT
      See Also:
    • LEVEL_UP_HUNGER_COUNT

      public static final int LEVEL_UP_HUNGER_COUNT
      See Also:
    • MAX_HEALING_COUNT

      public static final int MAX_HEALING_COUNT
      See Also:
    • hungerCountdown

      public int hungerCountdown
    • healingCountdown

      public int healingCountdown
    • BASE_GRAZE_FOOD_VALUE

      public static final int BASE_GRAZE_FOOD_VALUE
      See Also:
    • m_iDelayBetweenEatLoose

      public static final int m_iDelayBetweenEatLoose
      See Also:
    • DELAY_BETWEEN_EAT_LOOSE_VARIANCE

      public static final int DELAY_BETWEEN_EAT_LOOSE_VARIANCE
      See Also:
    • eatLooseCooldownCounter

      public int eatLooseCooldownCounter
    • grazeProgressCounter

      public int grazeProgressCounter
  • Constructor Details

    • EntityAnimal

      public EntityAnimal(World par1World)
  • Method Details

    • updateAITick

      protected void updateAITick()
      main AI tick function, replaces updateEntityActionState
      Overrides:
      updateAITick in class EntityLivingBase
    • onLivingUpdate

      public void onLivingUpdate()
      Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use this to react to sunlight and start to burn.
      Overrides:
      onLivingUpdate in class EntityAgeable
    • attackEntity

      protected void attackEntity(Entity par1Entity, float par2)
      Basic mob attack. Default to touch of death in EntityCreature. Overridden by each mob to define their attack.
      Overrides:
      attackEntity in class EntityCreature
    • attackEntityFrom

      public boolean attackEntityFrom(DamageSource par1DamageSource, float par2)
      // +++START EDIT+++ // ---END EDIT--- Called when the entity is attacked.
      Overrides:
      attackEntityFrom in class EntityLivingBase
    • findPlayerToAttack

      protected Entity findPlayerToAttack()
      // +++START EDIT+++ // ---END EDIT--- Finds the closest player within 16 blocks to attack, or null if this Entity isn't interested in attacking (Animals, Spiders at day, peaceful PigZombies).
      Overrides:
      findPlayerToAttack in class EntityCreature
    • getCanSpawnHere

      public boolean getCanSpawnHere()
      Checks if the entity's current position is a valid location to spawn this entity.
      Overrides:
      getCanSpawnHere in class EntityCreature
    • getTalkInterval

      public int getTalkInterval()
      Get number of ticks, at least during which the living entity will be silent.
      Overrides:
      getTalkInterval in class EntityLiving
    • canDespawn

      protected boolean canDespawn()
      Determines if an entity can be despawned, used on idle far away entities
      Overrides:
      canDespawn in class EntityLiving
    • getExperiencePoints

      protected int getExperiencePoints(EntityPlayer par1EntityPlayer)
      Get the experience points the entity currently has.
      Overrides:
      getExperiencePoints in class EntityLiving
    • isBreedingItem

      public boolean isBreedingItem(ItemStack par1ItemStack)
      Checks if the parameter is an item which this animal can be fed to breed it (wheat, carrots or seeds depending on the animal type)
    • isInLove

      public boolean isInLove()
      // +++START EDIT+++ Returns if the entity is currently in 'love mode'. // ---END EDIT---
    • resetInLove

      public void resetInLove()
    • canMateWith

      public boolean canMateWith(EntityAnimal par1EntityAnimal)
      Returns true if the mob is currently able to mate with the specified mob.
    • interact

      public boolean interact(EntityPlayer player)
      Description copied from class: EntityAgeable
      Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
      Overrides:
      interact in class EntityAgeable
    • entityInit

      protected void entityInit()
      Overrides:
      entityInit in class EntityAgeable
    • writeEntityToNBT

      public void writeEntityToNBT(NBTTagCompound tag)
      Description copied from class: EntityAgeable
      (abstract) Protected helper method to write subclass entity data to NBT.
      Overrides:
      writeEntityToNBT in class EntityAgeable
    • readEntityFromNBT

      public void readEntityFromNBT(NBTTagCompound tag)
      Description copied from class: EntityAgeable
      (abstract) Protected helper method to read subclass entity data from NBT.
      Overrides:
      readEntityFromNBT in class EntityAgeable
    • modSpecificOnLivingUpdate

      protected void modSpecificOnLivingUpdate()
      Overrides:
      modSpecificOnLivingUpdate in class EntityCreature
    • handleHealthUpdate

      @Environment(CLIENT) public void handleHealthUpdate(byte bUpdateType)
      Overrides:
      handleHealthUpdate in class EntityLivingBase
    • jump

      public void jump()
      Description copied from class: EntityLivingBase
      Causes this entity to do an upwards motion (jumping).
      Overrides:
      jump in class EntityLivingBase
    • onDeath

      public void onDeath(DamageSource damageSource)
      Description copied from class: EntityLivingBase
      Called when the mob's health reaches 0.
      Overrides:
      onDeath in class EntityCreature
    • updateEntityActionState

      protected void updateEntityActionState()
      Overrides:
      updateEntityActionState in class EntityCreature
    • checkForScrollDrop

      public void checkForScrollDrop()
      Overrides:
      checkForScrollDrop in class EntityLivingBase
    • func_110196_bT

      public void func_110196_bT()
    • getSoundPitch

      protected float getSoundPitch()
      Description copied from class: EntityLivingBase
      Gets the pitch of living sounds in living entities.
      Overrides:
      getSoundPitch in class EntityLivingBase
    • setRevengeTarget

      public void setRevengeTarget(EntityLivingBase targetEntity)
      Overrides:
      setRevengeTarget in class EntityLivingBase
    • getBlockPathWeight

      public float getBlockPathWeight(int i, int j, int k)
      Description copied from class: EntityCreature
      Takes a coordinate in and returns a weight to determine how likely this creature will try to path to the block. Args: x, y, z
      Overrides:
      getBlockPathWeight in class EntityCreature
    • isSecondaryTargetForSquid

      public boolean isSecondaryTargetForSquid()
      Overrides:
      isSecondaryTargetForSquid in class Entity
    • onFlungBySquidTentacle

      public void onFlungBySquidTentacle(BTWSquidEntity squid)
      Overrides:
      onFlungBySquidTentacle in class EntityLiving
    • onHeadCrabbedBySquid

      public void onHeadCrabbedBySquid(BTWSquidEntity squid)
      Overrides:
      onHeadCrabbedBySquid in class EntityLiving
    • attemptToPossessNearbyCreatureOnDeath

      protected void attemptToPossessNearbyCreatureOnDeath()
      Overrides:
      attemptToPossessNearbyCreatureOnDeath in class EntityCreature
    • canChildGrow

      public boolean canChildGrow()
      Overrides:
      canChildGrow in class EntityAgeable
    • canLoveJuiceRegenerate

      public boolean canLoveJuiceRegenerate()
      Overrides:
      canLoveJuiceRegenerate in class EntityAgeable
    • getTicksForChildToGrow

      public int getTicksForChildToGrow()
      Overrides:
      getTicksForChildToGrow in class EntityAgeable
    • onSpawnWithEgg

      public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData)
      Overrides:
      onSpawnWithEgg in class EntityLiving
    • getInLove

      public int getInLove()
    • setInLove

      public void setInLove(int iInLove)
    • getWearingBreedingHarness

      public boolean getWearingBreedingHarness()
    • setWearingBreedingHarness

      public void setWearingBreedingHarness(boolean bWearingHarness)
    • checkForIntersectingBreedingHarnesses

      public void checkForIntersectingBreedingHarnesses()
    • panicNearbyAnimals

      public void panicNearbyAnimals(DamageSource damageSource)
    • onNearbyAnimalAttacked

      public void onNearbyAnimalAttacked(EntityAnimal attackedAnimal, EntityLivingBase attackSource)
    • onNearbyFireStartAttempt

      public void onNearbyFireStartAttempt(EntityPlayer player)
    • onNearbyPlayerBlockAddOrRemove

      public void onNearbyPlayerBlockAddOrRemove(EntityPlayer player)
    • onNearbyPlayerStartles

      protected void onNearbyPlayerStartles(EntityPlayer player)
    • procreate

      protected void procreate(EntityAnimal targetMate)
    • getNestSize

      public int getNestSize()
    • giveBirthAtTargetLocation

      protected void giveBirthAtTargetLocation(EntityAnimal targetMate, double dChildX, double dChildY, double dChildZ)
    • resetMatingStateOfBothParents

      protected void resetMatingStateOfBothParents(EntityAnimal targetMate)
    • spawnBirthHeartParticles

      protected void spawnBirthHeartParticles()
    • initHungerWithVariance

      public void initHungerWithVariance()
    • getHungerLevel

      public int getHungerLevel()
    • setHungerLevel

      public void setHungerLevel(int iHungerLevel)
    • isFullyFed

      public boolean isFullyFed()
    • isFamished

      public boolean isFamished()
    • isStarving

      public boolean isStarving()
    • onBecomeFamished

      public void onBecomeFamished()
    • onBecomeStarving

      public void onBecomeStarving()
    • onStarvingCountExpired

      public void onStarvingCountExpired()
    • isSubjectToHunger

      public boolean isSubjectToHunger()
    • updateHungerState

      public void updateHungerState()
    • resetHungerCountdown

      public void resetHungerCountdown()
    • addToHungerCount

      public void addToHungerCount(int iAddedHunger)
    • getGrazeHungerGain

      public int getGrazeHungerGain()
    • getFoodValueMultiplier

      public int getFoodValueMultiplier()
    • onGrazeBlock

      public void onGrazeBlock(int i, int j, int k)
    • shouldNotifyBlockOnGraze

      public boolean shouldNotifyBlockOnGraze()
    • playGrazeFX

      public void playGrazeFX(int i, int j, int k, int iBlockID)
    • getGrazeDuration

      public int getGrazeDuration()
    • isHungryEnoughToGraze

      public boolean isHungryEnoughToGraze()
    • isHungryEnoughToForceMoveToGraze

      public boolean isHungryEnoughToForceMoveToGraze()
    • isTooHungryToGrow

      public boolean isTooHungryToGrow()
    • isTooHungryToHeal

      public boolean isTooHungryToHeal()
    • canGrazeMycelium

      public boolean canGrazeMycelium()
    • getDisruptsEarthOnGraze

      public boolean getDisruptsEarthOnGraze()
    • canGrazeOnRoughVegetation

      public boolean canGrazeOnRoughVegetation()
    • getGrazeBlockForPos

      public BlockPos getGrazeBlockForPos()
      Returns null if no valid graze block exists at location
    • shouldStayInPlaceToGraze

      public boolean shouldStayInPlaceToGraze()
    • canGrazeOnBlock

      public boolean canGrazeOnBlock(int i, int j, int k)
    • getHungerSpeedModifier

      public AttributeModifier getHungerSpeedModifier()
    • updateHungerSpeedModifier

      protected void updateHungerSpeedModifier()
    • isTemptingItem

      public boolean isTemptingItem(ItemStack stack)
      Overrides:
      isTemptingItem in class EntityAgeable
    • isEdibleItem

      public boolean isEdibleItem(ItemStack stack)
    • isHungryEnoughToEatLooseFood

      public boolean isHungryEnoughToEatLooseFood()
    • isReadyToEatBreedingItem

      public boolean isReadyToEatBreedingItem()
    • getItemFoodValue

      public int getItemFoodValue(ItemStack stack)
    • attemptToEatItemForBreeding

      public boolean attemptToEatItemForBreeding(ItemStack stack)
    • onEatBreedingItem

      public void onEatBreedingItem()
    • attemptToEatItem

      public boolean attemptToEatItem(ItemStack stack)
    • attemptToBeHandFedItem

      public boolean attemptToBeHandFedItem(ItemStack stack)
    • attemptToEatLooseItem

      public boolean attemptToEatLooseItem(ItemStack stack)
    • isReadyToEatLooseFood

      public boolean isReadyToEatLooseFood()
    • isReadyToEatLooseItem

      public boolean isReadyToEatLooseItem(ItemStack stack)
    • checkForLooseFood

      public void checkForLooseFood()
    • entityAnimalInteract

      public boolean entityAnimalInteract(EntityPlayer player)
    • getTicksToRegenerateLoveJuice

      public int getTicksToRegenerateLoveJuice()
    • getGrazeHeadVerticalOffset

      public float getGrazeHeadVerticalOffset(float fPartialTick)
    • getGrazeHeadRotation

      public float getGrazeHeadRotation(float fPartialTick)
    • getGrazeHeadRotationMagnitudeDivisor

      public float getGrazeHeadRotationMagnitudeDivisor()
    • getGrazeHeadRotationRateMultiplier

      public float getGrazeHeadRotationRateMultiplier()
    • updateHealing

      public void updateHealing()
    • resetHealingCountdown

      public void resetHealingCountdown()
    • breakLeash

      public void breakLeash()