Class EnderDragon

All Implemented Interfaces:
CommandSource, Attackable, Enemy, Targeting, EntityAccess, Nameable, ScoreHolder, ICapabilityProvider, ICapabilityProviderImpl<Entity>, ICapabilitySerializable<CompoundTag>, IForgeEntity, IForgeLivingEntity, INBTSerializable<CompoundTag>

public class EnderDragon extends Mob implements Enemy
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • DATA_PHASE

      public static final EntityDataAccessor<Integer> DATA_PHASE
    • CRYSTAL_DESTROY_TARGETING

      private static final TargetingConditions CRYSTAL_DESTROY_TARGETING
    • GROWL_INTERVAL_MIN

      private static final int GROWL_INTERVAL_MIN
      See Also:
    • GROWL_INTERVAL_MAX

      private static final int GROWL_INTERVAL_MAX
      See Also:
    • SITTING_ALLOWED_DAMAGE_PERCENTAGE

      private static final float SITTING_ALLOWED_DAMAGE_PERCENTAGE
      See Also:
    • DRAGON_DEATH_TIME_KEY

      private static final String DRAGON_DEATH_TIME_KEY
      See Also:
    • DRAGON_PHASE_KEY

      private static final String DRAGON_PHASE_KEY
      See Also:
    • positions

      public final double[][] positions
    • posPointer

      public int posPointer
    • subEntities

      private final EnderDragonPart[] subEntities
    • neck

      private final EnderDragonPart neck
    • body

      private final EnderDragonPart body
    • tail1

      private final EnderDragonPart tail1
    • tail2

      private final EnderDragonPart tail2
    • tail3

      private final EnderDragonPart tail3
    • wing1

      private final EnderDragonPart wing1
    • wing2

      private final EnderDragonPart wing2
    • oFlapTime

      public float oFlapTime
    • flapTime

      public float flapTime
    • inWall

      public boolean inWall
    • dragonDeathTime

      public int dragonDeathTime
    • yRotA

      public float yRotA
    • nearestCrystal

      @Nullable public EndCrystal nearestCrystal
    • dragonFight

      @Nullable private EndDragonFight dragonFight
    • fightOrigin

      private BlockPos fightOrigin
    • phaseManager

      private final EnderDragonPhaseManager phaseManager
    • growlTime

      private int growlTime
    • sittingDamageReceived

      private float sittingDamageReceived
    • nodes

      private final Node[] nodes
    • nodeAdjacency

      private final int[] nodeAdjacency
    • openSet

      private final BinaryHeap openSet
    • unlimitedLastHurtByPlayer

      @Nullable private @Nullable Player unlimitedLastHurtByPlayer
  • Constructor Details

  • Method Details

    • setId

      public void setId(int p_20235_)
      Overrides:
      setId in class Entity
    • setDragonFight

      public void setDragonFight(EndDragonFight p_287736_)
    • setFightOrigin

      public void setFightOrigin(BlockPos p_287665_)
    • getFightOrigin

      public BlockPos getFightOrigin()
    • createAttributes

      public static AttributeSupplier.Builder createAttributes()
    • isFlapping

      public boolean isFlapping()
      Overrides:
      isFlapping in class Entity
    • onFlap

      public void onFlap()
      Overrides:
      onFlap in class Entity
    • defineSynchedData

      protected void defineSynchedData()
      Overrides:
      defineSynchedData in class Mob
    • getLatencyPos

      public double[] getLatencyPos(int p_31102_, float p_31103_)
    • aiStep

      public void aiStep()
      Overrides:
      aiStep in class Mob
    • tickPart

      private void tickPart(EnderDragonPart p_31116_, double p_31117_, double p_31118_, double p_31119_)
    • getHeadYOffset

      private float getHeadYOffset()
    • checkCrystals

      private void checkCrystals()
    • knockBack

      private void knockBack(List<Entity> p_31132_)
    • hurt

      private void hurt(List<Entity> p_31142_)
    • rotWrap

      private float rotWrap(double p_31165_)
    • checkWalls

      private boolean checkWalls(AABB p_31140_)
    • hurt

      public boolean hurt(EnderDragonPart p_31121_, DamageSource p_31122_, float p_31123_)
    • hurt

      public boolean hurt(DamageSource p_31113_, float p_31114_)
      Overrides:
      hurt in class LivingEntity
    • reallyHurt

      protected boolean reallyHurt(DamageSource p_31162_, float p_31163_)
    • kill

      public void kill()
      Overrides:
      kill in class LivingEntity
    • tickDeath

      protected void tickDeath()
      Overrides:
      tickDeath in class LivingEntity
    • findClosestNode

      public int findClosestNode()
    • findClosestNode

      public int findClosestNode(double p_31171_, double p_31172_, double p_31173_)
    • findPath

      @Nullable public Path findPath(int p_31105_, int p_31106_, @Nullable Node p_31107_)
    • reconstructPath

      private Path reconstructPath(Node p_31129_, Node p_31130_)
    • addAdditionalSaveData

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

      public void readAdditionalSaveData(CompoundTag p_31134_)
      Overrides:
      readAdditionalSaveData in class Mob
    • checkDespawn

      public void checkDespawn()
      Overrides:
      checkDespawn in class Mob
    • getSubEntities

      public EnderDragonPart[] getSubEntities()
    • isPickable

      public boolean isPickable()
      Overrides:
      isPickable in class LivingEntity
    • getSoundSource

      public SoundSource getSoundSource()
      Overrides:
      getSoundSource in class Entity
    • getAmbientSound

      protected SoundEvent getAmbientSound()
      Overrides:
      getAmbientSound in class Mob
    • getHurtSound

      protected SoundEvent getHurtSound(DamageSource p_31154_)
      Overrides:
      getHurtSound in class LivingEntity
    • getSoundVolume

      protected float getSoundVolume()
      Overrides:
      getSoundVolume in class LivingEntity
    • getHeadPartYOffset

      public float getHeadPartYOffset(int p_31109_, double[] p_31110_, double[] p_31111_)
    • getHeadLookVector

      public Vec3 getHeadLookVector(float p_31175_)
    • onCrystalDestroyed

      public void onCrystalDestroyed(EndCrystal p_31125_, BlockPos p_31126_, DamageSource p_31127_)
    • onSyncedDataUpdated

      public void onSyncedDataUpdated(EntityDataAccessor<?> p_31136_)
      Overrides:
      onSyncedDataUpdated in class LivingEntity
    • getPhaseManager

      public EnderDragonPhaseManager getPhaseManager()
    • getDragonFight

      @Nullable public EndDragonFight getDragonFight()
    • addEffect

      public boolean addEffect(MobEffectInstance p_182394_, @Nullable Entity p_182395_)
      Overrides:
      addEffect in class LivingEntity
    • canRide

      protected boolean canRide(Entity p_31169_)
      Overrides:
      canRide in class Entity
    • canChangeDimensions

      public boolean canChangeDimensions()
      Overrides:
      canChangeDimensions in class LivingEntity
    • isMultipartEntity

      public boolean isMultipartEntity()
      Description copied from interface: IForgeEntity
      This is used to specify that your entity has multiple individual parts, such as the Vanilla Ender Dragon. See EnderDragon for an example implementation.
      Specified by:
      isMultipartEntity in interface IForgeEntity
      Returns:
      true if this is a multipart entity.
    • getParts

      public PartEntity<?>[] getParts()
      Description copied from interface: IForgeEntity
      Gets the individual sub parts that make up this entity. The entities returned by this method are NOT saved to the world in nay way, they exist as an extension of their host entity. The child entity does not track its server-side(or client-side) counterpart, and the host entity is responsible for moving and managing these children. Only used if IForgeEntity.isMultipartEntity() returns true. See EnderDragon for an example implementation.
      Specified by:
      getParts in interface IForgeEntity
      Returns:
      The child parts of this entity. The value to be returned here should be cached.
    • recreateFromPacket

      public void recreateFromPacket(ClientboundAddEntityPacket p_218825_)
      Overrides:
      recreateFromPacket in class LivingEntity
    • canAttack

      public boolean canAttack(LivingEntity p_149576_)
      Overrides:
      canAttack in class LivingEntity
    • getPassengerAttachmentPoint

      protected org.joml.Vector3f getPassengerAttachmentPoint(Entity p_297265_, EntityDimensions p_299373_, float p_297229_)
      Overrides:
      getPassengerAttachmentPoint in class Entity