Skip to content

Block replacements

In Catharsis, we allow for retexturing and remodelling of blocks. This allows you to change the look of the same block in different regions of the game.

Definition

Definitions are placed in a block replacement definition file located at assets/<block namespace>/catharsis/block_replacements/<block id>.json

The definition follows the following scheme

A block replacement object
  • type: One of the block replacement definition types defined below
  • Additional fields depending on the value of type, see the respective block replacement type documentation for more details.

Supported Types

Redirect (catharsis:redirect)

A simple redirect, replacing one block state with another one.

Example

Always replaces the block with gold.

json
{
  "type": "redirect",
  "virtual_state": "your_name_space:gold"
}
Root redirect object
  • type: catharsis:redirect
  • virtual_state: A virtual block state reference

Random (catharsis:random)

Allows for random block replacements.
The random is seeded based on the blocks position, meaning, while it's random it is consistent for each block. Resource pack ordering may affect the result!

Example

Replaces the block based on a random noice with either gold or diamond.
In this example it's roughly a 3/4 ratio.

json
{
  "type": "random",
  "min": 0,
  "max": 20,
  "threshold": 15,
  "definition": {
    "type": "redirect",
    "virtual_state": "your_name_space:diamond"
  },
  "fallback": {
    "type": "redirect",
    "virtual_state": "your_name_space:gold"
  }
}
Root random object
  • type: catharsis:random
  • min: The min value of the random
  • min: The max value of the random
  • threshold: The min amount to reach to pass the check
  • definition: The block replacement definition to use if the check passes.
  • fallback: (Optional) The block replacement definition to use if the check fails.

Per Area (catharsis:per_area)

Allows for having a different block per area.

Example

Replaces the block with diamond if it is inside the area.

json
{
  "type": "per_area",
  "entries": {
    "your_name_space:simple": {
      "type": "redirect",
      "virtual_state": "your_name_space:diamond"
    }
  }
}
Root per area object
  • type: catharsis:per_area
  • entries: An object of area to block replacement definition.

Conditional (catharsis:conditional)

Allows you to change a block based on some conditions, you can find a list of conditions here.

Example

Replaces the block with gold if the block under it is equal to grass or dirt.

json
{
  "type": "conditional",
  "definition": {
    "type": "redirect",
    "virtual_state": "furfsky:mithril_tier0"
  },
  "condition": {
    "type": "relative",
    "offset": "0:-1:0",
    "condition": {
      "type": "id",
      "block": [
        "minecraft:grass_block",
        "minecraft:dirt"
      ]
    }
  }
}
Root conditional object

Select (catharsis:select)

Allows you to have multiple block replacements for the same block, and uses the first one that replaces the block.

Example

Replaces the block with gold if the block under it is netherrack, or replaces it with emerald if its deepslate.

json
{
  "type": "select",
  "definitions": [
    {
      "type": "conditional",
      "definition": {
        "type": "redirect",
        "virtual_state": "furfsky:gold"
      },
      "condition": {
        "type": "relative",
        "offset": "0:-1:0",
        "condition": {
          "type": "id",
          "block": "minecraft:netherrack"
        }
      }
    },
    {
      "type": "conditional",
      "definition": {
        "type": "redirect",
        "virtual_state": "furfsky:emerald"
      },
      "condition": {
        "type": "relative",
        "offset": "0:-1:0",
        "condition": {
          "type": "id",
          "block": "minecraft:deepslate"
        }
      }
    }
  ]
}
Root select object