程序包 org.bukkit.boss

# 接口 DragonBattle

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

- ## 嵌套类概要

  嵌套类
  修饰符和类型
  接口
  说明
  `static enum`
  `DragonBattle.RespawnPhase`
  Represents a phase in the dragon respawn process.

- ## 方法概要

  修饰符和类型
  方法
  说明
  `boolean`
  `generateEndPortal(boolean withPortals)`
  Generate the end portal.
  `@NotNull BossBar`
  `getBossBar()`
  Get the boss bar to be displayed for this dragon battle.
  `@Nullable EnderDragon`
  `getEnderDragon()`
  Get the `EnderDragon` active in this battle.
  `@Nullable Location`
  `getEndPortalLocation()`
  Get the location of the end portal.
  `@NotNull DragonBattle.RespawnPhase`
  `getRespawnPhase()`
  Get this battle's current respawn phase.
  `boolean`
  `hasBeenPreviouslyKilled()`
  Check whether the first dragon has been killed already.
  `void`
  `initiateRespawn()`
  Try to initiate a respawn sequence to summon the dragon as though a player has placed 4 end crystals on the portal.
  `boolean`
  `initiateRespawn(@Nullable Collection<EnderCrystal> enderCrystals)`
  Try to initiate a respawn sequence to summon the dragon.
  `void`
  `resetCrystals()`
  Reset the crystals located on the obsidian pillars (remove their beam targets and invulnerability).
  `void`
  `setPreviouslyKilled(boolean previouslyKilled)`
  Sets whether the first dragon has been killed already.
  `boolean`
  `setRespawnPhase(@NotNull DragonBattle.RespawnPhase phase)`
  Set the dragon's respawn phase.

- ## 方法详细资料

  - ### 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

    @NotNull @NotNull DragonBattle.RespawnPhase 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
    另请参阅:
      - `initiateRespawn()`

  - ### resetCrystals

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