cpw.mods.fml.common

## Annotation Type Mod

-     @Retention(value=RUNTIME)
      @Target(value=TYPE)
      public @interface Mod

  This defines a Mod to FML. Any class found with this annotation applied will be loaded as a Mod. The instance that is loaded will represent the mod to other Mods in the system. It will be sent various subclasses of `FMLEvent` at pre-defined times during the loading of the game, based on where you have applied the `Mod.EventHandler` annotation. This annotation is usually paired with a second annotation `NetworkMod`, which declares the network related properties of this mod.

  This is a simple example of a Mod. It has the modId of "MyModId", the name of "My example mod", it is version 1.0, and depends on FML being loaded. It has the `NetworkMod` annotation as well, declaring it uses channel "MyModChannel" and `IPacketHandler` class PacketHandler.

      package mymod;
       // Declare that this is a mod with modId "MyModId", name "My example mod", version "1.0" and dependency on FML.
       {@literal @}Mod(modId="MyModId",name="My example mod",version="1.0",dependencies="required-after:FML")
       // Declare that this is a network mod using the {@link Packet250CustomPayload} channel "MyModChannel", required on the client if it's present
       // on the server, with {@link IPacketHandler} class PacketHandler.
       {@literal @}NetworkMod(channels = { "MyModChannel" }, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class)
       public class MyMod {
            // Populate this field with the instance of the mod created by FML
            {@literal @}Instance("MyModId")
            public MyMod instance;

            // Mark this method for receiving an {@link FMLEvent} (in this case, it's the {@link FMLPreInitializationEvent})
            {@literal @}EventHandler public void preInit(FMLPreInitializationEvent event)
            {
                // Do stuff in pre-init phase (read config, create blocks and items, register them)
            }
       }

  Author:
    cpw

- - ### Required Element Summary

    Required Elements
    Modifier and Type | Required Element and Description
    --- | ---
    `String` | `modid` The unique mod identifier for this mod

  - ### Optional Element Summary

    Optional Elements
    Modifier and Type | Optional Element and Description
    --- | ---
    `String` | `acceptedMinecraftVersions` The acceptable range of minecraft versions that this mod will load and run in The default ("empty string") indicates that only the current minecraft version is acceptable.
    `String` | `asmHookClass` Deprecated.
    `String` | `bukkitPlugin` An optional bukkit plugin that will be injected into the bukkit plugin framework if this mod is loaded into the FML framework and the bukkit coremod is present.
    `String` | `certificateFingerprint` Specifying this field allows for a mod to expect a signed jar with a fingerprint matching this value.
    `Mod.CustomProperty[]` | `customProperties` A list of custom properties for this mod.
    `String` | `dependencies` A simple dependency string for this mod (see modloader's "priorities" string specification)
    `String` | `modExclusionList` Deprecated.
    `String` | `modLanguage` The language the mod is authored in.
    `String` | `name` A user friendly name for the mod
    `boolean` | `useMetadata` Whether to use the mcmod.info metadata by default for this mod.
    `String` | `version` A version string for this mod

- - ### Element Detail

    - #### modid

          public abstract String modid

      The unique mod identifier for this mod

    - #### name

          public abstract String name

      A user friendly name for the mod
      Default:
        ""

    - #### version

          public abstract String version

      A version string for this mod
      Default:
        ""

    - #### dependencies

          public abstract String dependencies

      A simple dependency string for this mod (see modloader's "priorities" string specification)
      Default:
        ""

    - #### useMetadata

          public abstract boolean useMetadata

      Whether to use the mcmod.info metadata by default for this mod. If true, settings in the mcmod.info file will override settings in these annotations.
      Default:
        false

    - #### acceptedMinecraftVersions

          public abstract String acceptedMinecraftVersions

      The acceptable range of minecraft versions that this mod will load and run in The default ("empty string") indicates that only the current minecraft version is acceptable. FML will refuse to run with an error if the minecraft version is not in this range across all mods.
      Returns:
        A version range as specified by the maven version range specification or the empty string
      Default:
        ""

    - #### bukkitPlugin

          public abstract String bukkitPlugin

      An optional bukkit plugin that will be injected into the bukkit plugin framework if this mod is loaded into the FML framework and the bukkit coremod is present. Instances of the bukkit plugin can be obtained via the `BukkitPluginRef` annotation on fields. This may be implemented by a bukkit integration. It is not provided with vanilla FML or MinecraftForge.
      Returns:
        The name of the plugin to load for this mod
      Default:
        ""

    - #### modExclusionList

          @Deprecated
          public abstract String modExclusionList

      Deprecated.
      NOT YET IMPLEMENTED. Mods that this mod will not load with. An optional comma separated string of (+|-)(*|modid[@value]) which specify mods that this mod will refuse to load with, resulting in the game failing to start. Entries can be prefixed with a + for a positive exclusion assertion, or - for a negative exclusion assertion. Asterisk is the wildcard and represents all mods. The only mods that cannot be excluded are FML and MCP, trivially. Other special values:
      - +f indicates that the mod will accept a minecraft forge environment.
      - -* indicates that the mod will not accept any other mods.
      Some examples:
      - -*,+f,+IronChest: Will run only in a minecraft forge environment with the mod IronChests. The -* forces all mods to be excluded, then the +f and +IronChest add into the "allowed list".
      - +f,-IC2: Will run in a minecraft forge environment but will not run if IndustrialCraft 2 (IC2) is loaded alongside.
      - -*: Will not run if any othe mod is loaded except MCP/FML itself.
      If a mod is present on the excluded list, the game will stop and show an error screen. If the class containing the `Mod` annotation has a "getCustomErrorException" method, it will be called to retrieve a custom error message for display in this case. If two mods have a declared exclusion which is matched, the screen that is shown is indeterminate.
      Returns:
        A string listing modids to exclude from loading with this mod.
      Default:
        ""

    - #### certificateFingerprint

          public abstract String certificateFingerprint

      Specifying this field allows for a mod to expect a signed jar with a fingerprint matching this value. The fingerprint should be SHA-1 encoded, lowercase with ':' removed. An empty value indicates that the mod is not expecting to be signed. Any incorrectness of the fingerprint, be it missing or wrong, will result in the `FMLFingerprintViolationEvent` event firing prior to any other event on the mod.
      Returns:
        A certificate fingerprint that is expected for this mod.
      Default:
        ""

    - #### modLanguage

          public abstract String modLanguage

      The language the mod is authored in. This will be used to control certain compatibility behaviours for this mod. Valid values are currently "java", "scala"
      Returns:
        The language the mod is authored in
      Default:
        "java"

    - #### asmHookClass

          @Deprecated
          public abstract String asmHookClass

      Deprecated.
      NOT YET IMPLEMENTED. An optional ASM hook class, that can be used to apply ASM to classes loaded from this mod. It is also given the ASM tree of the class declaring `Mod` to do with what it will.
      Returns:
        The name of a class to be loaded and executed. Must implement `IASMHook`.
      Default:
        ""

    - #### customProperties

          public abstract Mod.CustomProperty[] customProperties

      A list of custom properties for this mod. Completely up to the mod author if/when they want to put anything in here.
      Returns:
        an optional list of custom properties
      Default:
        {}