Interface DragonBattle

public interface DragonBattle
Represents a dragon battle state for a world with an end environment.
  • Method Details

    • getEnderDragon

      @Nullable @Nullable EnderDragon getEnderDragon()
      Get the EnderDragon active in this battle.
      Will return null if the dragon has been slain.
      the ender dragon. null if dead
    • getBossBar

      @NotNull @NotNull BossBar getBossBar()
      Get the boss bar to be displayed for this dragon battle.
      the boss bar
    • getEndPortalLocation

      @Nullable @Nullable Location getEndPortalLocation()
      Get the location of the end portal.
      This location will be at the center of the base (bottom) of the portal.
      the end portal location or null if not generated
    • generateEndPortal

      boolean generateEndPortal(boolean withPortals)
      Generate the end portal.
      withPortals - whether end portal blocks should be generated
      true if generated, false if already present
    • hasBeenPreviouslyKilled

      boolean hasBeenPreviouslyKilled()
      Check whether the first dragon has been killed already.
      true if killed before, false otherwise
    • setPreviouslyKilled

      void setPreviouslyKilled(boolean previouslyKilled)
      Sets whether the first dragon has been killed already.
      If the dragon has not previously been killed, a portal will be generated when it is finally killed.
      previouslyKilled - true if the dragon has been killed before, false otherwise
    • initiateRespawn

      void initiateRespawn()
      Try to initiate a respawn sequence to summon the dragon as though a player has placed 4 end crystals on the portal.
    • initiateRespawn

      boolean initiateRespawn(@Nullable @Nullable Collection<EnderCrystal> enderCrystals)
      Try to initiate a respawn sequence to summon the dragon.
      enderCrystals - the EnderCrystals to use in the respawn, or a null or empty list to render the respawn sequence uncancellable. null entries or crystals that do not reside in the same world as this dragon battle will be ignored.
      true if the respawn was initiated, false otherwise.
    • getRespawnPhase

      Get this battle's current respawn phase.
      the current respawn phase.
    • setRespawnPhase

      boolean setRespawnPhase(@NotNull @NotNull DragonBattle.RespawnPhase phase)
      Set the dragon's respawn phase.
      This method will is unsuccessful if a dragon respawn is not in progress.
      phase - the phase to set
      true if successful, false otherwise
      See Also:
    • resetCrystals

      void resetCrystals()
      Reset the crystals located on the obsidian pillars (remove their beam targets and invulnerability).
    • getGatewayCount

      int getGatewayCount()
      Gets the number of gateways tracked by this DragonBattle. This starts out at 0 and will increase to 20, once for each kill of the EnderDragon.
      the number of gateways around the end island tracked by this
    • spawnNewGateway

      boolean spawnNewGateway()
      Tries to spawn a new end gateway using default game mechanics.
      true if successful, false if there is already the maximum.
    • spawnNewGateway

      void spawnNewGateway(@NotNull Position position)
      Spawns a new end gateway at the specified position. This will spawn regardless of the number of gateways already present.
      position - position for the new gateway
    • getRespawnCrystals

      @NotNull @Unmodifiable List<EnderCrystal> getRespawnCrystals()
      Gets the EnderCrystals being used to respawn the dragon. If no respawn is ongoing, the list will be empty.
      the respawn crystals
    • getHealingCrystals

      @NotNull @Unmodifiable List<EnderCrystal> getHealingCrystals()
      Gets the EnderCrystals on top of the pillars that heal the dragon.
      the healing crystals