Skip to content
KnightMiner edited this page Jul 24, 2020 · 2 revisions

This page details the Mantle fallback model loader, registered as mantle:fallback.

Loader

The fallback model loader is used to load the first model with a valid loader from a list. The first model with a loaded mod ID will be used. Mod ID will either be the key fallback_mod_id, or the namespace from loader. If neither is set, model always loads.

Format

  • Object: Base object
    • models (array): Array of model objects options
      • A model (object): A single model object.
        • loader (string): Model loader name (optional). If unset, uses vanilla model loader.
        • fallback_mod_id (string): Required mod ID to use this model. If unset, defaults to the namespace from loader. If loader is unset, model always loads.
        • All keys from the relevant loader

Example

The following JSON produces a connected model if Tinkers Construct is loaded, and a vanilla model otherwise. Note that if fallback_mod_id was not specified, the dependency for the first model would be Mantle.

{
  "loader": "mantle:fallback",
  "models": [
    {
      "fallback_mod_id": "tconstruct",
      "loader": "mantle:connected",
      "parent": "block/cube_all",
      "textures": {
        "all": "block/glass"
      },
      "connection": {
        "textures": { "all": "cornerless_full" }
      }
    },
    {
      "parent": "block/cube_all",
      "textures": {
        "all": "block/glass"
      }
    }
  ]
}
Clone this wiki locally