Interface InteractionEventLogic

All Known Implementing Classes:
ActivateShrineInteractionEventLogic, BattleThrowPokeBallInteractionEventLogic, BreakBlockInteractionEventLogic, CapturePokemonInteractionEventLogic, ChangeDimensionInteractionEventLogic, CraftItemInteractionEventLogic, DefeatRaidInteractionEventLogic, DefeatTrainerInteractionEventLogic, DynamaxInteractionEventLogic, EatCakeInteractionEventLogic, EmptyInteractionEvent, EnterWildBattleInteractionEventLogic, EvolvePokemonInteractionEventLogic, FillShrineOrbInteractionEventLogic, FindStructureInteractionEventLogic, FirstJoinInteractionEventLogic, GigantamaxInteractionEventLogic, HarvestCropInteractionEventLogic, HatchEggInteractionEventLogic, HitWithPokeBallInteractionEventLogic, JoinInteractionEventLogic, KnockoutPokemonInteractionEventLogic, LeftClickEntityInteractionEventLogic, LevelPokemonInteractionEventLogic, ListeningEventLogic, MegaEvolveInteractionEventLogic, OpenGiftInteractionEventLogic, PickApricornInteractionEventLogic, PickBerryInteractionEventLogic, PickUpItemInteractionEventLogic, PlayerTickInteractionEventLogic, PokedexPokemonInteractionEventLogic, PokemonDropItemInteractionEventLogic, RaidDropItemInteractionEventLogic, ReleasePokemonInteractionEventLogic, RightClickEntityInteractionEventLogic, SelectStarterInteractionEventLogic, SpinPokeStopInteractionEventLogic, TradePokemonInteractionEventLogic, UltraBurstInteractionEventLogic, UseBattleItemInteractionEventLogic, UseLureInteractionEventLogic

public sealed interface InteractionEventLogic permits EmptyInteractionEvent, ListeningEventLogic
This represents an entry point for the NPC logic flow.
Implementations of this class should not dictate when the logic executes, just pass the relevant context through to listeners using ListeningEventLogic
All contexts should be created using the
invalid @link
{@link this#createContext(Entity)
} as it provides a set of default contexts from the NPC that will likely be used later in the control flow.
To register interaction event logic look at the PixelmonRegistry class.
  • Field Details

  • Method Details

    • type

      The type of this interaction event logic.
      Returns:
      the type of this interaction event logic
    • codec

      com.mojang.serialization.MapCodec<? extends InteractionEventLogic> codec()
      The codec for this interaction event logic.
      Returns:
      the codec for this interaction event logic
    • addListener

      default void addListener(Predicate<StoredContext> listener)
      Adds a listener to this interaction event logic.
      Parameters:
      listener - the listener to add
    • createContext

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