Klasse BossInstance
java.lang.Object
de.delinkedde.mobarenareborn.boss.BossInstance
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.
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungBossInstance(@NotNull MobArenaPlugin plugin, @NotNull BossDefinition definition, @NotNull LivingEntity entity, @NotNull Supplier<List<Player>> targets, @NotNull Consumer<Location> summonAdd, boolean showBar) -
Methodenübersicht
Modifizierer und TypMethodeBeschreibung@NotNull LivingEntityentity()voidRemoves a player as a viewer of the boss bar.booleanisDead()voidAdds a player as a viewer of the boss bar.voidstart()Starts the boss tick task.voidstop()Stops the boss tick task and removes the boss bar from every player it was shown to.
-
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 taskdefinition- the boss definitionentity- the spawned boss entitytargets- supplies the players currently in the roundsummonAdd- 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
- Gibt zurück:
- the boss entity
-
isDead
public boolean isDead()- Gibt zurück:
trueif the boss entity is dead or no longer valid
-
showTo
Adds a player as a viewer of the boss bar.- Parameter:
player- the player
-
hideFrom
Removes a player as a viewer of the boss bar.- Parameter:
player- the player
-