Class RegisterClientTooltipComponentFactoriesEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.RegisterClientTooltipComponentFactoriesEvent
- All Implemented Interfaces:
net.neoforged.fml.event.IModBusEvent
public class RegisterClientTooltipComponentFactoriesEvent
extends net.neoforged.bus.api.Event
implements net.neoforged.fml.event.IModBusEvent
Allows users to register custom
ClientTooltipComponent
factories for their TooltipComponent
types.
This event is not cancellable, and does not
.
invalid reference
have a result
This event is fired on the mod-specific event bus, only on the logical client.
-
Field Summary
Modifier and TypeFieldDescriptionprivate final Map
<Class<? extends TooltipComponent>, Function<TooltipComponent, ClientTooltipComponent>> -
Constructor Summary
ConstructorDescriptionRegisterClientTooltipComponentFactoriesEvent
(Map<Class<? extends TooltipComponent>, Function<TooltipComponent, ClientTooltipComponent>> factories) -
Method Summary
Modifier and TypeMethodDescription<T extends TooltipComponent>
voidregister
(Class<T> type, Function<? super T, ? extends ClientTooltipComponent> factory) Registers aClientTooltipComponent
factory for aTooltipComponent
.
-
Field Details
-
factories
private final Map<Class<? extends TooltipComponent>,Function<TooltipComponent, factoriesClientTooltipComponent>>
-
-
Constructor Details
-
RegisterClientTooltipComponentFactoriesEvent
@Internal public RegisterClientTooltipComponentFactoriesEvent(Map<Class<? extends TooltipComponent>, Function<TooltipComponent, ClientTooltipComponent>> factories)
-
-
Method Details
-
register
public <T extends TooltipComponent> void register(Class<T> type, Function<? super T, ? extends ClientTooltipComponent> factory) Registers aClientTooltipComponent
factory for aTooltipComponent
.
-