Interface DragonPhase
- All Superinterfaces:
Keyed
- All Known Implementing Classes:
CustomPhase
Represents a Dragon Phase
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Called every tick during the phase between the first and last.Fetches the Dragon associated with this Custom Phase.float
Fetches the current flying speed of the dragon.Fetches the target location of the Ender Dragon during this Phase.boolean
Whether the Ender Dragon is currently sitting.default void
Called when an End Crystal is destroyed during this phase.default float
onDamage
(EntityDamageEvent.DamageCause cause, float amount) Called when the Dragon is damaged during this phase.void
Called every tick during the phase between the first and last.void
start()
Called when the Phase starts on the first tick.void
stop()
Called when the Phase ends on the last tick.
-
Method Details
-
getDragon
Fetches the Dragon associated with this Custom Phase.- Returns:
- EnderDragon used in this phase
-
getTargetLocation
Fetches the target location of the Ender Dragon during this Phase.- Returns:
- Target Location during Phase
-
start
void start()Called when the Phase starts on the first tick. -
stop
void stop()Called when the Phase ends on the last tick. -
clientTick
void clientTick()Called every tick during the phase between the first and last.
Use this method to handle client logic (e.g. packets, particles). -
serverTick
void serverTick()Called every tick during the phase between the first and last.
Use this method to handle server logic (e.g. movements). -
isSitting
boolean isSitting()Whether the Ender Dragon is currently sitting.- Returns:
- true if sitting, else false
-
getFlyingSpeed
float getFlyingSpeed()Fetches the current flying speed of the dragon. Defaults to 0.6F.- Returns:
- Flying Speed
-
onCrystalDestroyed
default void onCrystalDestroyed(EnderCrystal c, EntityDamageEvent.DamageCause cause, @Nullable @Nullable Player p) Called when an End Crystal is destroyed during this phase.- Parameters:
c
- Crystal Destroyedcause
- Damage Cause that destroyed the Crystalp
- Player that destroyed the crystal, can be null
-
onDamage
Called when the Dragon is damaged during this phase.- Parameters:
cause
- Damage Cause that damaged the Dragonamount
- Amount of damage that was dealt- Returns:
- the new damage amount
-