Class RegisterCauldronInteractionEvent.Interaction
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.RegisterCauldronInteractionEvent
net.neoforged.neoforge.event.RegisterCauldronInteractionEvent.Interaction
- All Implemented Interfaces:
IModBusEvent
- Enclosing class:
RegisterCauldronInteractionEvent
public static final class RegisterCauldronInteractionEvent.Interaction
extends RegisterCauldronInteractionEvent
Fired to allow mods to register cauldron interactions to existing dispatchers. You can register to specific dispatchers or to all dispatchers at once.
The event is fired on the mod bus
-
Nested Class Summary
Nested classes/interfaces inherited from class RegisterCauldronInteractionEvent
RegisterCauldronInteractionEvent.Dispatcher, RegisterCauldronInteractionEvent.Interaction -
Field Summary
Fields inherited from class RegisterCauldronInteractionEvent
idMapper -
Constructor Summary
ConstructorsConstructorDescription -
Method Summary
Modifier and TypeMethodDescriptionvoidregister(Identifier dispatcherId, TagKey<Item> itemTag, CauldronInteraction interaction) Registers a cauldron interaction for the specified item tag within the dispatcher associated with the given identifier.voidregister(Identifier dispatcherId, Item item, CauldronInteraction interaction) Registers a cauldron interaction for the specified item within the dispatcher associated with the given identifier.voidregisterToAll(TagKey<Item> itemTag, CauldronInteraction interaction) Registers a cauldron interaction for the specified item tag across all existing dispatchers.voidregisterToAll(Item item, CauldronInteraction interaction) Registers a cauldron interaction for the specified item across all existing dispatchers.
-
Constructor Details
-
Interaction
@Internal public Interaction(ExtraCodecs.LateBoundIdMapper<String, CauldronInteraction.Dispatcher> idMapper)
-
-
Method Details
-
register
Registers a cauldron interaction for the specified item within the dispatcher associated with the given identifier.- Parameters:
dispatcherId- The unique identifier of the dispatcher where the interaction should be registered.item- The item that will trigger the cauldron interaction.interaction- The cauldron interaction to be registered for the specified item.- Throws:
IllegalArgumentException- If no dispatcher is found for the given identifier.
-
register
public void register(Identifier dispatcherId, TagKey<Item> itemTag, CauldronInteraction interaction) Registers a cauldron interaction for the specified item tag within the dispatcher associated with the given identifier.- Parameters:
dispatcherId- The identifier of the dispatcher to register the interaction with.itemTag- The tag key of the item that will trigger the cauldron interaction.interaction- The cauldron interaction to be registered for the specified item tag.- Throws:
IllegalArgumentException- If no dispatcher is found with the given identifier,
-
registerToAll
Registers a cauldron interaction for the specified item across all existing dispatchers.- Parameters:
item- The item that will trigger the cauldron interaction.interaction- The cauldron interaction to be registered for the specified item.
-
registerToAll
Registers a cauldron interaction for the specified item tag across all existing dispatchers.- Parameters:
itemTag- The tag key of the items that will trigger the cauldron interaction.interaction- The cauldron interaction to be registered for items associated with the specified tag.
-