Class RegisterLootContextParamsEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.RegisterLootContextParamsEvent
All Implemented Interfaces:
IModBusEvent

public class RegisterLootContextParamsEvent extends net.neoforged.bus.api.Event implements IModBusEvent

Fired to register ContextKeys for use in loot context param set ContextKeySets. Params registered can then be used and queried within the loot context.

Fires on both physical sides on the mod-specific event bus.

  • Field Details

  • Constructor Details

  • Method Details

    • register

      public void register(ContextKey<?> lootContextParam)
      Registers a ContextKey for use as a loot context param.
      Parameters:
      lootContextParam - The ContextKey to register.
      Throws:
      IllegalArgumentException - If the param provided is in the vanilla namespace or has already been registered.