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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRegisterLootContextParamsEvent(Map<Identifier, ContextKey<?>> lootContextParams) -
Method Summary
Modifier and TypeMethodDescriptionvoidregister(ContextKey<?> lootContextParam) Registers aContextKeyfor use as a loot context param.
-
Field Details
-
lootContextParams
-
-
Constructor Details
-
RegisterLootContextParamsEvent
-
-
Method Details
-
register
Registers aContextKeyfor use as a loot context param.- Parameters:
lootContextParam- TheContextKeyto register.- Throws:
IllegalArgumentException- If the param provided is in the vanilla namespace or has already been registered.
-