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
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<RaidIntentHandler<?>> static final net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<RaidIntentHandler<?>>> -
Method Summary
Modifier and TypeMethodDescriptionvoidApplies the typed intent to the given raid.default voidexecute(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
-
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
Gets the concrete intent class this handler supports.- Returns:
- The accepted intent class.
-
apply
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.
-