Class Creeper

All Implemented Interfaces:
CommandSource, SyncedDataHolder, Attackable, EquipmentUser, Leashable, Enemy, PowerableMob, Targeting, EntityAccess, Nameable, ScoreHolder, IAttachmentHolder, IEntityExtension, ILivingEntityExtension, INBTSerializable<CompoundTag>

public class Creeper extends Monster implements PowerableMob
  • Field Details

    • DATA_SWELL_DIR

      private static final EntityDataAccessor<Integer> DATA_SWELL_DIR
    • DATA_IS_POWERED

      private static final EntityDataAccessor<Boolean> DATA_IS_POWERED
    • DATA_IS_IGNITED

      private static final EntityDataAccessor<Boolean> DATA_IS_IGNITED
    • oldSwell

      private int oldSwell
    • swell

      private int swell
    • maxSwell

      private int maxSwell
    • explosionRadius

      private int explosionRadius
    • droppedSkulls

      private int droppedSkulls
  • Constructor Details

  • Method Details

    • registerGoals

      protected void registerGoals()
      Overrides:
      registerGoals in class Mob
    • createAttributes

      public static AttributeSupplier.Builder createAttributes()
    • getMaxFallDistance

      public int getMaxFallDistance()
      Overrides:
      getMaxFallDistance in class Mob
    • causeFallDamage

      public boolean causeFallDamage(float pFallDistance, float pMultiplier, DamageSource pSource)
      Overrides:
      causeFallDamage in class LivingEntity
    • defineSynchedData

      protected void defineSynchedData(SynchedEntityData.Builder pBuilder)
      Overrides:
      defineSynchedData in class Mob
    • addAdditionalSaveData

      public void addAdditionalSaveData(CompoundTag pCompound)
      Overrides:
      addAdditionalSaveData in class Mob
    • readAdditionalSaveData

      public void readAdditionalSaveData(CompoundTag pCompound)
      (abstract) Protected helper method to read subclass entity data from NBT.
      Overrides:
      readAdditionalSaveData in class Mob
    • tick

      public void tick()
      Overrides:
      tick in class Mob
    • setTarget

      public void setTarget(@Nullable LivingEntity pTarget)
      Sets the active target the Goal system uses for tracking
      Overrides:
      setTarget in class Mob
    • getHurtSound

      protected SoundEvent getHurtSound(DamageSource pDamageSource)
      Overrides:
      getHurtSound in class Monster
    • getDeathSound

      protected SoundEvent getDeathSound()
      Overrides:
      getDeathSound in class Monster
    • dropCustomDeathLoot

      protected void dropCustomDeathLoot(ServerLevel pLevel, DamageSource pDamageSource, boolean pRecentlyHit)
      Overrides:
      dropCustomDeathLoot in class Mob
    • doHurtTarget

      public boolean doHurtTarget(Entity pEntity)
      Overrides:
      doHurtTarget in class Mob
    • isPowered

      public boolean isPowered()
      Specified by:
      isPowered in interface PowerableMob
    • getSwelling

      public float getSwelling(float pPartialTicks)
      Params: (Float)Render tick. Returns the intensity of the creeper's flash when it is ignited.
    • getSwellDir

      public int getSwellDir()
    • setSwellDir

      public void setSwellDir(int pState)
      Sets the state of creeper, -1 to idle and 1 to be 'in fuse'
    • thunderHit

      public void thunderHit(ServerLevel pLevel, LightningBolt pLightning)
      Overrides:
      thunderHit in class Entity
    • mobInteract

      protected InteractionResult mobInteract(Player pPlayer, InteractionHand pHand)
      Overrides:
      mobInteract in class Mob
    • explodeCreeper

      private void explodeCreeper()
    • spawnLingeringCloud

      private void spawnLingeringCloud()
    • isIgnited

      public boolean isIgnited()
    • ignite

      public void ignite()
    • canDropMobsSkull

      public boolean canDropMobsSkull()
    • increaseDroppedSkulls

      public void increaseDroppedSkulls()