Interface DragonPhase
- All Superinterfaces:
Keyed
- All Known Implementing Classes:
CustomPhase
Represents a Dragon Phase
-
Method Summary
Modifier and TypeMethodDescriptionvoidCalled every tick during the phase between the first and last.@NotNull EnderDragonFetches the Dragon associated with this Custom Phase.floatFetches the current flying speed of the dragon.@NotNull LocationFetches the target location of the Ender Dragon during this Phase.booleanWhether the Ender Dragon is currently sitting.default voidonCrystalDestroyed(EnderCrystal c, EntityDamageEvent.DamageCause cause, @Nullable Player p) Called when an End Crystal is destroyed during this phase.default floatonDamage(EntityDamageEvent.DamageCause cause, float amount) Called when the Dragon is damaged during this phase.voidCalled every tick during the phase between the first and last.voidstart()Called when the Phase starts on the first tick.voidstop()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
-