Class CustomPhase
java.lang.Object
me.gamercoder215.mobchip.ai.enderdragon.CustomPhase
- All Implemented Interfaces:
DragonPhase, Keyed
Represents a custom Ender Dragon Phase.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final EnderDragonThe Dragon that this phase is attached to.protected final NamespacedKeyThe unique ID of this phase. -
Constructor Summary
ConstructorsConstructorDescriptionCustomPhase(@NotNull EnderDragon dragon, @NotNull NamespacedKey key) Constructs a new CustomPhase. -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled every tick during the phase between the first and last.final @NotNull EnderDragonFetches the Dragon associated with this Custom Phase.floatFetches the current flying speed of the dragon.final @NotNull NamespacedKeygetKey()Fetches the unique ID of this phase.booleanWhether the Ender Dragon is currently sitting.voidonCrystalDestroyed(EnderCrystal c, EntityDamageEvent.DamageCause cause, @Nullable Player p) Called when an End Crystal is destroyed during this phase.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.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface DragonPhase
getTargetLocation
-
Field Details
-
dragon
The Dragon that this phase is attached to. -
key
The unique ID of this phase.
-
-
Constructor Details
-
CustomPhase
public CustomPhase(@NotNull @NotNull EnderDragon dragon, @NotNull @NotNull NamespacedKey key) throws IllegalArgumentException Constructs a new CustomPhase.- Parameters:
dragon- Ender Dragon to use.key- The unique ID of this phase.- Throws:
IllegalArgumentException- if dragon or key is null
-
-
Method Details
-
getKey
Fetches the unique ID of this phase. -
getDragon
Description copied from interface:DragonPhaseFetches the Dragon associated with this Custom Phase.- Specified by:
getDragonin interfaceDragonPhase- Returns:
- EnderDragon used in this phase
-
stop
public void stop()Description copied from interface:DragonPhaseCalled when the Phase ends on the last tick.- Specified by:
stopin interfaceDragonPhase
-
start
public void start()Description copied from interface:DragonPhaseCalled when the Phase starts on the first tick.- Specified by:
startin interfaceDragonPhase
-
serverTick
public void serverTick()Description copied from interface:DragonPhaseCalled every tick during the phase between the first and last.
Use this method to handle server logic (e.g. movements).- Specified by:
serverTickin interfaceDragonPhase
-
clientTick
public void clientTick()Description copied from interface:DragonPhaseCalled every tick during the phase between the first and last.
Use this method to handle client logic (e.g. packets, particles).- Specified by:
clientTickin interfaceDragonPhase
-
onCrystalDestroyed
public void onCrystalDestroyed(EnderCrystal c, EntityDamageEvent.DamageCause cause, @Nullable @Nullable Player p) Description copied from interface:DragonPhaseCalled when an End Crystal is destroyed during this phase.- Specified by:
onCrystalDestroyedin interfaceDragonPhase- Parameters:
c- Crystal Destroyedcause- Damage Cause that destroyed the Crystalp- Player that destroyed the crystal, can be null
-
onDamage
Description copied from interface:DragonPhaseCalled when the Dragon is damaged during this phase.- Specified by:
onDamagein interfaceDragonPhase- Parameters:
cause- Damage Cause that damaged the Dragonamount- Amount of damage that was dealt- Returns:
- the new damage amount
-
isSitting
public boolean isSitting()Description copied from interface:DragonPhaseWhether the Ender Dragon is currently sitting.- Specified by:
isSittingin interfaceDragonPhase- Returns:
- true if sitting, else false
-
getFlyingSpeed
public float getFlyingSpeed()Description copied from interface:DragonPhaseFetches the current flying speed of the dragon. Defaults to 0.6F.- Specified by:
getFlyingSpeedin interfaceDragonPhase- Returns:
- Flying Speed
-