Class ScenarioFailureEvent

java.lang.Object
org.bukkit.event.Event
dev.itsharshxd.zentrix.api.events.ZentrixEvent
dev.itsharshxd.zentrix.api.events.scenario.ScenarioFailureEvent

public final class ScenarioFailureEvent extends ZentrixEvent
A scenario misbehaved and Zentrix contained the damage.

Failures are counted per match. Once a scenario exceeds the configured limit it is deactivated for that match alone, with isIsolated() set, and everything else — the match, the other scenarios, every other arena — carries on untouched.

Since:
1.6.0
  • Constructor Details

    • ScenarioFailureEvent

      public ScenarioFailureEvent(@NotNull @NotNull String scenarioId, @Nullable @Nullable String runtimeId, @NotNull @NotNull String stage, @NotNull @NotNull String message, @Nullable @Nullable Throwable cause, int failureCount, boolean isolated)
  • Method Details

    • getScenarioId

      @NotNull public @NotNull String getScenarioId()
    • getRuntimeId

      @NotNull public @NotNull Optional<String> getRuntimeId()
      The match the failure happened in, empty for failures outside any match.
    • getStage

      @NotNull public @NotNull String getStage()
      Which part of the scenario failed, for example onActivate or a hook ID.
    • getMessage

      @NotNull public @NotNull String getMessage()
    • getCause

      @NotNull public @NotNull Optional<Throwable> getCause()
    • getFailureCount

      public int getFailureCount()
      How often this scenario has failed in this match so far.
    • isIsolated

      public boolean isIsolated()
      Whether this failure caused the scenario to be shut down for the match.
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Description copied from class: ZentrixEvent
      Gets the handler list for this event.
      Overrides:
      getHandlers in class ZentrixEvent
      Returns:
      The handler list
    • getHandlerList

      @NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList()