Class CustomPhase

java.lang.Object
me.gamercoder215.mobchip.ai.enderdragon.CustomPhase
All Implemented Interfaces:
DragonPhase, Keyed

public abstract class CustomPhase extends Object implements DragonPhase
Represents a custom Ender Dragon Phase.
  • Field Details

    • dragon

      protected final EnderDragon dragon
      The Dragon that this phase is attached to.
    • key

      protected final NamespacedKey key
      The unique ID of this phase.
  • Constructor Details

  • Method Details

    • getKey

      @NotNull public final @NotNull NamespacedKey getKey()
      Fetches the unique ID of this phase.
      Specified by:
      getKey in interface Keyed
      Returns:
      NamespacedKey of this CustomPhase
    • getDragon

      @NotNull public final @NotNull EnderDragon getDragon()
      Description copied from interface: DragonPhase
      Fetches the Dragon associated with this Custom Phase.
      Specified by:
      getDragon in interface DragonPhase
      Returns:
      EnderDragon used in this phase
    • stop

      public void stop()
      Description copied from interface: DragonPhase
      Called when the Phase ends on the last tick.
      Specified by:
      stop in interface DragonPhase
    • start

      public void start()
      Description copied from interface: DragonPhase
      Called when the Phase starts on the first tick.
      Specified by:
      start in interface DragonPhase
    • serverTick

      public void serverTick()
      Description copied from interface: DragonPhase
      Called every tick during the phase between the first and last.

      Use this method to handle server logic (e.g. movements).
      Specified by:
      serverTick in interface DragonPhase
    • clientTick

      public void clientTick()
      Description copied from interface: DragonPhase
      Called every tick during the phase between the first and last.

      Use this method to handle client logic (e.g. packets, particles).
      Specified by:
      clientTick in interface DragonPhase
    • onCrystalDestroyed

      public void onCrystalDestroyed(EnderCrystal c, EntityDamageEvent.DamageCause cause, @Nullable @Nullable Player p)
      Description copied from interface: DragonPhase
      Called when an End Crystal is destroyed during this phase.
      Specified by:
      onCrystalDestroyed in interface DragonPhase
      Parameters:
      c - Crystal Destroyed
      cause - Damage Cause that destroyed the Crystal
      p - Player that destroyed the crystal, can be null
    • onDamage

      public float onDamage(EntityDamageEvent.DamageCause cause, float amount)
      Description copied from interface: DragonPhase
      Called when the Dragon is damaged during this phase.
      Specified by:
      onDamage in interface DragonPhase
      Parameters:
      cause - Damage Cause that damaged the Dragon
      amount - Amount of damage that was dealt
      Returns:
      the new damage amount
    • isSitting

      public boolean isSitting()
      Description copied from interface: DragonPhase
      Whether the Ender Dragon is currently sitting.
      Specified by:
      isSitting in interface DragonPhase
      Returns:
      true if sitting, else false
    • getFlyingSpeed

      public float getFlyingSpeed()
      Description copied from interface: DragonPhase
      Fetches the current flying speed of the dragon. Defaults to 0.6F.
      Specified by:
      getFlyingSpeed in interface DragonPhase
      Returns:
      Flying Speed