Interface RaidIntentHandler<T extends RaidIntent>

Type Parameters:
T - The concrete intent this handler accepts.
All Known Implementing Classes:
CatchRaidIntentHandler, MultiplayerRaidIntentHandler, QuitRaidIntentHandler, SelectedPokemonIntentHandler, StartMultiplayerRaidIntentHandler, StartSoloRaidIntentHandler

public interface RaidIntentHandler<T extends RaidIntent>
Server-side behavior for a specific RaidIntent class.

Handlers are registered independently from RaidIntentType. The intent type controls network serialization, while a raid type chooses the handler that should process a received intent. This allows custom raid types to reuse the same client intent payloads while replacing the server behavior.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<RaidIntentHandler<?>>
     
    static final net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<RaidIntentHandler<?>>>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    apply(net.minecraft.server.level.ServerPlayer sender, RaidData raid, T intent)
    Applies the typed intent to the given raid.
    default void
    execute(net.minecraft.server.level.ServerPlayer sender, RaidData raid, RaidIntent intent)
    Validates and applies an untyped intent.
    Gets the concrete intent class this handler supports.
  • Field Details

    • CODEC

      static final com.mojang.serialization.Codec<RaidIntentHandler<?>> CODEC
    • REGISTRY

      static final net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<RaidIntentHandler<?>>> REGISTRY
  • Method Details

    • execute

      default void execute(net.minecraft.server.level.ServerPlayer sender, RaidData raid, RaidIntent intent)
      Validates and applies an untyped intent.
      Parameters:
      sender - The player who sent the intent.
      raid - The raid data receiving the intent.
      intent - The intent to process.
    • getIntentClass

      Class<T> getIntentClass()
      Gets the concrete intent class this handler supports.
      Returns:
      The accepted intent class.
    • apply

      void apply(net.minecraft.server.level.ServerPlayer sender, RaidData raid, T intent)
      Applies the typed intent to the given raid.
      Parameters:
      sender - The player who sent the intent.
      raid - The raid data receiving the intent.
      intent - The typed intent to process.