Class RegisterCapabilitiesEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.common.capabilities.RegisterCapabilitiesEvent
All Implemented Interfaces:
net.neoforged.fml.event.IModBusEvent

public final class RegisterCapabilitiesEvent extends net.neoforged.bus.api.Event implements net.neoforged.fml.event.IModBusEvent
This event fires when it is time to register your capabilities.
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class net.neoforged.bus.api.Event

    net.neoforged.bus.api.Event.HasResult, net.neoforged.bus.api.Event.Result
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <T> void
    register(Class<T> type)
    Registers a capability to be consumed by others.

    Methods inherited from class net.neoforged.bus.api.Event

    getResult, hasResult, setResult

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RegisterCapabilitiesEvent

      public RegisterCapabilitiesEvent()
  • Method Details

    • register

      public <T> void register(Class<T> type)
      Registers a capability to be consumed by others. APIs who define the capability should call this. To retrieve the Capability instance, use the @CapabilityInject annotation.
      Parameters:
      type - The type to be registered