Interface RaidStrategy

All Known Subinterfaces:
AttackRaidStrategy, BattleAIRaidStrategy, BattleEndRaidStrategy, BossTierRaidStrategy, CheerRaidStrategy, GimmickRaidStrategy, PokemonModifierRaidStrategy, ReviveRaidStrategy, ShieldRaidStrategy, ShockwaveRaidStrategy
All Known Implementing Classes:
DynamaxAttackRaidStrategy, DynamaxBattleAIRaidStrategy, DynamaxBossTierRaidStrategy, DynamaxCheerRaidStrategy, DynamaxGimmickRaidStrategy, DynamaxPokemonModifierRaidStrategy, DynamaxProgressRaidStrategy, DynamaxReviveRaidStrategy, DynamaxShieldRaidStrategy, DynamaxShockwaveStrategy, GigantamaxGimmickRaidStrategy, GigantamaxPokemonModifierRaidStrategy, RaidStrategySet, TeraAttackRaidStrategy, TeraBattleAIRaidStrategy, TeraBossActionRaidStrategy, TeraBossTierRaidStrategy, TeraChargeRaidStrategy, TeraCheerRaidStrategy, TeraGimmickRaidStrategy, TeraPokemonModifierRaidStrategy, TeraProgressRaidStrategy, TeraReviveRaidStrategy, TeraShieldRaidStrategy

public interface RaidStrategy
A single unit of battle-time raid behavior.

Raid strategies are deliberately narrow: each implementation should own one rule or concern, such as shields, revive timing, boss action selection, raid progress, or Pokemon setup. A raid type composes multiple strategies to produce a complete raid mode.

The default methods are no-ops so implementations only need to override the lifecycle hooks they actually participate in. Hooks that return boolean use true to indicate that the strategy handled or blocked the action and later strategies should usually not run for that same action. Damage hooks return the damage value to pass to the next strategy.

  • Field Details

    • CODEC

      static final com.mojang.serialization.Codec<RaidStrategy> CODEC
      Codec for datapack-defined raid strategies. The registered RaidStrategyType chooses the concrete strategy codec.
  • Method Details

    • type

      RaidStrategyType<?> type()
      Gets the registered type used to serialize and deserialize this strategy.
      Returns:
      The strategy type.
    • onRaidStart

      default void onRaidStart(BattleParticipant boss)
      Called when the raid boss participant is initialized for battle.

      Use this hook for battle-local setup such as boss modification, applying gimmicks, initializing context state, or preparing cached values.

      Parameters:
      boss - The raid boss participant.
    • update

      default void update(BattleParticipant boss)
      Called from the raid boss participant tick.

      Use this for real-time behavior that is not tied to turn boundaries, such as Tera Raid timers or delayed revival.

      Parameters:
      boss - The raid boss participant.
    • onTurnEnd

      default void onTurnEnd(BattleParticipant boss)
      Called when a battle turn ends for the raid boss participant.
      Parameters:
      boss - The raid boss participant.
    • onBossDamaged

      default float onBossDamaged(BattleParticipant boss, PixelmonWrapper attacker, float damage, DamageTypeEnum damageType)
      Called when the raid boss is about to take damage.

      The returned value is the damage that should continue through the battle damage flow. Composite strategy dispatch passes the returned value from one strategy into the next.

      Parameters:
      boss - The raid boss participant.
      attacker - The Pokemon that caused the damage.
      damage - The incoming damage amount.
      damageType - The kind of damage being applied.
      Returns:
      The damage amount to apply after this strategy has handled it.
    • onPokemonFainted

      default void onPokemonFainted(BattleParticipant boss, PixelmonWrapper fainted)
      Called when a Pokemon on the opposing side faints during the raid.
      Parameters:
      boss - The raid boss participant.
      fainted - The Pokemon that fainted.
    • shouldKeepFaintedPokemon

      default boolean shouldKeepFaintedPokemon(BattleParticipant boss, BattleParticipant opponent, PixelmonWrapper fainted)
      Called when an opponent faints and the battle controller is deciding whether the fainted Pokemon should remain active instead of being removed.
      Parameters:
      boss - The raid boss participant.
      opponent - The participant whose Pokemon fainted.
      fainted - The fainted Pokemon.
      Returns:
      true if the fainted Pokemon should remain active.
    • shouldSkipTurnAgainstOpponent

      default boolean shouldSkipTurnAgainstOpponent(BattleParticipant boss, BattleParticipant opponent, PixelmonWrapper bossPokemon)
      Called when the raid boss's lane participant is deciding whether to skip its turn against a specific opponent.
      Parameters:
      boss - The raid boss participant.
      opponent - The opposing lane participant.
      bossPokemon - The boss Pokemon in that lane.
      Returns:
      true if the boss should skip this lane turn.
    • onRaidEnd

      default void onRaidEnd(BattleParticipant boss, BattleEndCause cause)
      Called when the raid battle ends.
      Parameters:
      boss - The raid boss participant.
      cause - The battle end cause.
    • onPokemonSwitchIn

      default void onPokemonSwitchIn(BattleParticipant boss, PixelmonWrapper entering)
      Called when the raid boss switches in or is re-applied as the active Pokemon.
      Parameters:
      boss - The raid boss participant.
      entering - The Pokemon entering battle.
    • onBossAttack

      default void onBossAttack(BattleParticipant boss, PixelmonWrapper bossPokemon)
      Called when the raid boss participant is asked to use its attack for the current action.
      Parameters:
      boss - The raid boss participant.
      bossPokemon - The active boss Pokemon.
    • onUseAttackOther

      default boolean onUseAttackOther(BattleParticipant boss, BattleParticipant user, PixelmonWrapper attacker, Attack attack)
      Called when another participant attempts to use an attack while the raid boss is present.

      Return true when the strategy handled or blocked the attack. This prevents later strategies in the composite from also handling the same attack.

      Parameters:
      boss - The raid boss participant.
      user - The participant using the attack.
      attacker - The Pokemon using the attack.
      attack - The attack being used.
      Returns:
      Whether this strategy handled or blocked the attack.
    • onTargeted

      default boolean onTargeted(BattleParticipant boss, PixelmonWrapper user, Attack attack)
      Called when the raid boss is targeted by an attack.
      Parameters:
      boss - The raid boss participant.
      user - The Pokemon targeting the raid boss.
      attack - The attack being used.
      Returns:
      true if targeting should be blocked.
    • onAddStatus

      default boolean onAddStatus(BattleParticipant boss, PixelmonWrapper user, PixelmonWrapper target, StatusBase status)
      Called when a status is about to be applied while the raid boss is involved.
      Parameters:
      boss - The raid boss participant.
      user - The Pokemon applying the status.
      target - The Pokemon receiving the status.
      status - The status being applied.
      Returns:
      true if the status should be blocked.
    • onTakeTurn

      default boolean onTakeTurn(BattleParticipant boss)
      Called when the raid boss participant is asked whether it wants to take a special turn action.
      Parameters:
      boss - The raid boss participant.
      Returns:
      true if this strategy handled the turn action.
    • onBattleAction

      default boolean onBattleAction(BattleParticipant boss, BattleParticipant actor, BattleAction action)
      Called when an opposing participant selects a battle action that the raid boss may handle.
      Parameters:
      boss - The raid boss participant.
      actor - The participant selecting the action.
      action - The selected action.
      Returns:
      true if this strategy handled the action.
    • onUseAttackPost

      default void onUseAttackPost(BattleParticipant boss, Attack attack)
      Called after the raid boss uses an attack.
      Parameters:
      boss - The raid boss participant.
      attack - The attack that was used.