Annotation Interface Mod.EventBusSubscriber

Enclosing class:
Mod

@Retention(RUNTIME) @Target(TYPE) public static @interface Mod.EventBusSubscriber
Annotate a class which will be subscribed to an Event Bus at mod construction time. Defaults to subscribing the current modid to the MinecraftForge#EVENT_BUS on both sides.
See Also:
Mod.EventBusSubscriber.Bus
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
     
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Specify an alternative bus to listen to
    Optional value, only necessary if this annotation is not on the same class that has a @Mod annotation.
    net.minecraftforge.api.distmarker.Dist[]
    Specify targets to load this event subscriber on.
  • Element Details

    • value

      net.minecraftforge.api.distmarker.Dist[] value
      Specify targets to load this event subscriber on. Can be used to avoid loading Client specific events on a dedicated server, for example.
      Returns:
      an array of Dist to load this event subscriber on
      Default:
      {CLIENT, DEDICATED_SERVER}
    • modid

      String modid
      Optional value, only necessary if this annotation is not on the same class that has a @Mod annotation. Needed to prevent early classloading of classes not owned by your mod.
      Returns:
      a modid
      Default:
      ""
    • bus

      Specify an alternative bus to listen to
      Returns:
      the bus you wish to listen to
      Default:
      FORGE