Class RegisterCapabilitiesEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.common.capabilities.RegisterCapabilitiesEvent
All Implemented Interfaces:
IModBusEvent

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

    Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event

    net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.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.minecraftforge.eventbus.api.Event

    getListenerList, getParentListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup

    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