DynIMC

About

Sends Inter Mod Communication (IMC) messages to other mods by reading configuration files. IMC is a feature of Forge Mod Loader that allows mods to send messages to each other. This is particularly useful when trying to add support for mod A to mod B (for example, adding axes/shears from Redstone Arsenal to Treecapitator or adding saplings from Natura to MineFactory Reloaded’s Planter/Harvester).

Format

[
  {
    "modid": "-modid-",
    "string": {
      "key1": [
        "message1",
        "message2",
        "message3",
        ...
      ],
      "key2": ...,
      ...
    },
    "itemstack": {
      "key1": [
        **itemstack1**,
        **itemstack2**,
        **itemstack3**,
        ...
      ],
      "key2": ...,
      ...
    },
    "nbt": {
      "key1": [
        **nbttagcompound1**,
        **nbttagcompound2**,
        **nbttagcompound3**,
        ...
      ],
      "key2": ...,
      ...
    }
  },
  {
    ...
  }
  ...
]

ItemStack

{
  "block": "blockname",
  "stackSize": 1,
  "itemDamage": 0
}

{
  "item": "itemname",
  "stackSize": 1,
  "itemDamage": 0
}

In both cases stackSize and itemDamage are optional and default to 1 and 0 respectively.

NBTTagCompund

There are several types that can be used.

  • boolean (true/false)
  • byte
  • short - if a string is provided it will resolve to a block/item ID (minecraft:dirt => 3)
  • int - same as short
  • long
  • float
  • double
  • string
  • byte[]
  • int[]
  • list
  • compound

All of the above types use the following format:

{ "**nbttype**:**propertyname**": **value** }

The value is a primitive (boolean, number, string) for all tags except for byte[], int[], list and compound where the value is an array. This array contains primitives for byte[] and int[] and a list of objects with the format above for list and compound.

Example: int[]

{ "int[]:numbers": [1, 44, 523, 9001] }

Example: compound

{
  "compound:numbers": [
    { "string:swordname": "The Beheader" },
    { "int:damage": 6 }
  ]
}

Examples

Thermal Expansion

Using Thermal Expansion’s IMC API you can add a smelting recipe that converts dirt into diamonds by using 500 RF.

ThermalExpansion.json

[
  {
    "modid": "ThermalExpansion",
    "string": {},
    "itemstack": {},
    "nbt": {
      "FurnaceRecipe": [
        {
          "compound:": [
            { "int:energy": 500 },
            {
              "compound:input": [
                { "short:id": "minecraft:dirt" },
                { "byte:Count": 1 },
                { "short:Damage": 0 }
              ]
            },
            {
              "compound:output": [
                { "short:id": "minecraft:diamond" },
                { "byte:Count": 1 },
                { "short:Damage": 0 }
              ]
            }
          ]
        }
      ]
    }
  }
]

Treecapitator

Registers a diamond sword as an axe, a diamond hoe as shears and a dirt tree (dirt as logs, grass as leaves).

TreeCapitator.json

[
  {
    "modid": "TreeCapitator",
    "string": {},
    "itemstack": {},
    "nbt": {
      "ThirdPartyModConfig": [
        {
          "compound:": [
            { "string:modID": "DynIMC" },
            { "string:axeIDList": "minecraft:diamond_sword" },
            { "string:shearsIDList": "minecraft:diamond_hoe" },
            {
              "list:trees": [
                {
                  "compound:": [
                    { "string:treeName": "dirt" },
                    { "string:logs": "minecraft:dirt" },
                    { "string:leaves": "minecraft:grass" },
                    { "boolean:requireLeafDecayCheck": false }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  }
]