Class Creeper

All Implemented Interfaces:
DataComponentGetter, SyncedDataHolder, Attackable, EquipmentUser, Leashable, Enemy, Targeting, EntityAccess, UniquelyIdentifyable, Nameable, ScoreHolder, Waypoint, WaypointTransmitter, IAttachmentHolder, IEntityExtension, ILivingEntityExtension

public class Creeper extends Monster
  • 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
    • DEFAULT_IGNITED

      private static final boolean DEFAULT_IGNITED
      See Also:
    • DEFAULT_POWERED

      private static final boolean DEFAULT_POWERED
      See Also:
    • DEFAULT_MAX_SWELL

      private static final short DEFAULT_MAX_SWELL
      See Also:
    • DEFAULT_EXPLOSION_RADIUS

      private static final byte DEFAULT_EXPLOSION_RADIUS
      See Also:
    • 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(double pFallDistance, float pDamageMultiplier, DamageSource pDamageSource)
      Overrides:
      causeFallDamage in class LivingEntity
    • defineSynchedData

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

      protected void addAdditionalSaveData(ValueOutput pOutput)
      Overrides:
      addAdditionalSaveData in class Mob
    • readAdditionalSaveData

      protected void readAdditionalSaveData(ValueInput pInput)
      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(ServerLevel pLevel, Entity pSource)
      Overrides:
      doHurtTarget in class Mob
    • isPowered

      public boolean isPowered()
    • 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()