1.12 Item module configuration - mickelus/tetra GitHub Wiki

Modular items have several slots into which the player can put modules of different types and variations. The available modules are defined in json files located in the modules resource folder.

Each of the module configuration files can be replaced by placing a file with the same name in the config folder. E.g. heavy_blade.json can be replaced by creating the file config/tetra/modules/sword/heavy_blade.json in the minecraft folder.

There are two different types of module slots: major and minor. Modules that go in the major slots use larger glyphs (16x16 vs 9x9), but there are no differences between stats and effects provided by modules put in the different slots.

The module configuration files contain arrays of json objects, fields and values within those json objects affect which stats and behaviours the module will add to the item. For more details about available fields and what they do, see ModuleData.java or take a look at the json files in the modules resource folder for examples.

Major module slots can also hold improvements, they are configured in the same way as modules but have a few additional fields (see ImprovementData.java) and are located in folders named improvements. The name of the improvement configuration file is the same as the module which it's applicable for, with the exception of blade_enchants.json. Improvements defined in blade_enchants.json are valid for all blades.

For information regarding module capabilities see Capability.java and for item effects see ItemEffect.java.

The module configuration files only defines which modules exist, schema definitions are then used to define how, in which slots, and under which conditions players can craft a module.

When adding a new module (or a new variation of an existing module e.g. a wheat shortblade) the following assets have to be created/updated:

  • a texture placed in the textures folder with it's name matching the key field from the definition of the new module (in a resource pack)
  • Localization entries matching the module key (module name, item name + prefix if desired)