批注接口 Mod.EventBusSubscriber

封闭类:
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.
另请参阅:
  • 嵌套类概要

    嵌套类
    修饰符和类型
    说明
    static enum 
     
  • 可选元素概要

    可选元素
    修饰符和类型
    可选元素
    说明
    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.
  • 元素详细资料

    • 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.
      返回:
      an array of Dist to load this event subscriber on
      默认值:
      {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.
      返回:
      a modid
      默认值:
      ""
    • bus

      Specify an alternative bus to listen to
      返回:
      the bus you wish to listen to
      默认值:
      FORGE