Class InteractionEvent

java.lang.Object
com.pixelmonmod.pixelmon.api.npc.interaction.event.InteractionEvent

public class InteractionEvent extends Object
This represents the entry point for all interaction pipelines in Pixelmon.
These are created by datapack, and reference InteractionEventLogic to determine how the interaction is triggerred.
If you use an EmptyInteractionEvent then you will need to trigger the interaction manually using trigger(StoredContext).
  • Field Details

    • DIRECT_CODEC

      public static final com.mojang.serialization.Codec<InteractionEvent> DIRECT_CODEC
    • CODEC

      public static final com.mojang.serialization.Codec<net.minecraft.core.Holder<InteractionEvent>> CODEC
    • RESOURCE_KEY_LIST_CODEC

      public static final com.mojang.serialization.Codec<List<net.minecraft.resources.ResourceKey<InteractionEvent>>> RESOURCE_KEY_LIST_CODEC
  • Constructor Details

  • Method Details

    • trigger

      public boolean trigger(StoredContext context)
      Triggers the interaction using the provided context for the NPC found in the context
      Parameters:
      context - The interaction context
    • createContext

      public StoredContext createContext(net.minecraft.world.entity.Entity entity)
      Creates a basic StoredContext using the provided entity
      Parameters:
      entity - the entity
      Returns:
      the created context