Class EntityMob

All Implemented Interfaces:
IAnimals, IMob
Direct Known Subclasses:
EntityBlaze, EntityCreeper, EntityEnderman, EntityGiantZombie, EntitySilverfish, EntitySkeleton, EntitySpider, EntityWitch, EntityWither, EntityZombie

public abstract class EntityMob extends EntityCreature implements IMob
  • Constructor Details

    • EntityMob

      public EntityMob(World par1World)
  • Method Details

    • 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 EntityLiving
    • entityMobOnLivingUpdate

      public void entityMobOnLivingUpdate()
    • onUpdate

      public void onUpdate()
      Called to update the entity's position/logic.
      Overrides:
      onUpdate in class EntityLiving
    • findPlayerToAttack

      protected Entity findPlayerToAttack()
      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
    • attackEntityFrom

      public boolean attackEntityFrom(DamageSource par1DamageSource, float par2)
      Called when the entity is attacked.
      Overrides:
      attackEntityFrom in class EntityLivingBase
    • entityMobAttackEntityFrom

      public boolean entityMobAttackEntityFrom(DamageSource par1DamageSource, float par2)
    • 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
    • entityMobAttackEntity

      protected void entityMobAttackEntity(Entity par1Entity, float par2)
    • getBlockPathWeight

      public float getBlockPathWeight(int par1, int par2, int par3)
      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
    • isValidLightLevel

      protected boolean isValidLightLevel()
      Checks to make sure the light is not too bright where the mob is spawning
    • getCanSpawnHere

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

      protected void applyEntityAttributes()
      Overrides:
      applyEntityAttributes in class EntityLiving
    • getMeleeAttackStrength

      public int getMeleeAttackStrength(Entity target)
      Overrides:
      getMeleeAttackStrength in class EntityLivingBase
    • canSpawnOnBlockBelow

      protected boolean canSpawnOnBlockBelow()
    • canSpawnOnBlock

      protected boolean canSpawnOnBlock(int x, int y, int z)
    • checkForCatchFireInSun

      protected void checkForCatchFireInSun()