Klasse BossInstance

java.lang.Object
de.delinkedde.mobarenareborn.boss.BossInstance

public final class BossInstance extends Object
The live state of a boss during a round.

The instance owns a dedicated per-tick task that keeps the boss bar in sync with the boss's remaining health, resolves the active BossPhase from that health, and casts one of the phase's abilities every BossPhase.intervalTicks() ticks. The boss entity itself is tracked by the wave engine as a normal arena mob, so the wave clears when the boss (and any adds) die.

  • Konstruktordetails

    • BossInstance

      public BossInstance(@NotNull @NotNull MobArenaPlugin plugin, @NotNull @NotNull BossDefinition definition, @NotNull @NotNull LivingEntity entity, @NotNull @NotNull Supplier<List<Player>> targets, @NotNull @NotNull Consumer<Location> summonAdd, boolean showBar)
      Parameter:
      plugin - the owning plugin, used to schedule the boss task
      definition - the boss definition
      entity - the spawned boss entity
      targets - supplies the players currently in the round
      summonAdd - a sink that spawns a supporting mob at a location
  • Methodendetails

    • start

      public void start()
      Starts the boss tick task. Call once after spawning.
    • stop

      public void stop()
      Stops the boss tick task and removes the boss bar from every player it was shown to. Idempotent.
    • entity

      @NotNull public @NotNull LivingEntity entity()
      Gibt zurück:
      the boss entity
    • isDead

      public boolean isDead()
      Gibt zurück:
      true if the boss entity is dead or no longer valid
    • showTo

      public void showTo(@NotNull @NotNull Player player)
      Adds a player as a viewer of the boss bar.
      Parameter:
      player - the player
    • hideFrom

      public void hideFrom(@NotNull @NotNull Player player)
      Removes a player as a viewer of the boss bar.
      Parameter:
      player - the player