Skip to content

Virtual Block State

A virtual block state is a modified vanilla block state file placed at <namespace>/catharsis/virtual_block_states/<id>.json.

A virtual block state is used in combination with a block replacement to replace all properties of a block, and allowing changes based on the blocks state.

Example

Things that happen in this example

  • Replaces the targeted block with diamond_block
  • Replaces bedrock that appeared in the place for the targeted block with gold_block
  • Changes the place_sound to minecraft:block.chorus_flower.grow
  • Changes the blend mode to translucent
json
{
  "variants": {
    "": {
      "model": "minecraft:block/diamond_block"
    }
  },
  "overrides": {
    "minecraft:bedrock": {
      "variants": {
        "": {
          "model": "minecraft:block/gold_block"
        }
      }
    }
  },
  "blend": "translucent",
  "sounds": {
    "place_sound": "minecraft:block.chorus_flower.grow"
  }
}
A Virtual Block State object
  • blend: (Optional) Changes the blending mode used for the block.
    • One of DEFAULT, SOLID, CUTOUT_MIPPED, CUTOUT, TRANSLUCENT
  • sounds: (Optional) Changes the sound that is played for interactions.
    •  hit: (Optional) The sound that is used when hitting the block.
      • The identifier of the sound to play. You can find a list of sounds here
      • An object describing the sound to play.
        • sound: The identifier of the sound to play. You can find a list of sounds here
        • range
    •  break: (Optional) The sound that is used when the block is broken.
      • The identifier of the sound to play. You can find a list of sounds here
      • An object describing the sound to play.
        • sound: The identifier of the sound to play. You can find a list of sounds here
        • range
    •  step: (Optional) The sound that is used when something steps on the block.
      • The identifier of the sound to play. You can find a list of sounds here
      • An object describing the sound to play.
        • sound: The identifier of the sound to play. You can find a list of sounds here
        • range
    •  place: (Optional) The sound that is used when the block is placed.
      • The identifier of the sound to play. You can find a list of sounds here
      • An object describing the sound to play.
        • sound: The identifier of the sound to play. You can find a list of sounds here
        • range
    •  fall: (Optional) The sound that is used when something falls on the block.
      • The identifier of the sound to play. You can find a list of sounds here
      • An object describing the sound to play.
        • sound: The identifier of the sound to play. You can find a list of sounds here
        • range
  • overrides: (Optional) A map of block id to vanilla block state definitions.
    • <block_id>: The block id that is replaced e.g. minecraft:bedrock.
      • A vanilla block state as defined here
  • ignore_original_offset: (Optional) Whether to reverse the vanilla block offset, used for things like sunflowers.
  • A vanilla block state as defined here