Skip to content

Machine Appearance

Frinn38 edited this page Jan 29, 2022 · 22 revisions

The Machine Appearance is what will define the in-game appearance (model/texture/sound) of the machine block and item.

A machine appearance can be defined for each status of the machine : idle, running, errored and paused independantly.

"appearance": {
    "property1": "defaultValue",
    "property2": 1,
    "idle": {
        "property1": "value",
        "property2": 42
    },
    "running": {
        "property1": "some_value",
        "property2": 23
    },
    "errored": {
        "property1": "another_value",
        "property2": 666
    },
    "paused": {
        "property1": "again_another_value",
        "property2": 56487
    }
}
  • If a property is not specified for a machine status, the property defined directly inside the appearance block is used as default.

  • Basically the properties defined for a specified machine status override the properties defined for the whole appearance, which themselves override the default values for this property.

All of the machine appearance properties are optionals and have default values.

Properties

Machine appearance currently have 10 optional properties :

  • block, define the appearance of the machine block.

  • item, define the appearance of the machine item.

  • sound, define the sound the machine will emmit.

  • light, define the light level the machine will emmit.

  • color, define a color that can be used in the custom machine model for elements using tint index of 4 (advanced model stuff).

  • hardness, a float used to calculate the machine block breaking speed. Default : 3.5

  • resistance, a float used to calculate the machine explosion resistance. Default : 3.5

  • tool_type, the required tool type to break the machine. The machine will still be breakable with other tools or bare hands but it will be much slower and will not drop the machine block (its contents will still be dropped). Default : pickaxe. Available values : shovel, pickaxe, axe, hoe, sword and hand.

  • mining_level, a positive integer that define which tier of the tool is required to break the machine. Default : 1 (stone). Available values : 0 (wood, gold), 1 (stone), 2 (iron), 3 (diamond), 4 (netherite).

tool_type and mining_level properties can be extended to other mod tools, if they use the vanilla system to register their tool type and level.

  • Shape, The collision shape of the machine. For entities, particles and interactions.

Default Machine Appearance

This is what will be used by default for properties that are not specified :

"appearance": {
    "block": "custommachinery:block/custom_machine_block",
    "item": "custommachinery:block/custom_machine_block",
    "sound": "",
    "lightlevel": 0,
    "color": 16777215,
    "hardness": 3.5,
    "resistance": 3.5,
    "tool": "pickaxe",
    "mininglevel": 1,
    "shape": [[0, 0, 0, 1, 1, 1]]
}

Example 1

"appearance": {
    "block": "minecraft:tnt",
    "sound": "minecraft:block.anvil.place",
    "lightlevel": 10
}

The machine whith this machine appearance will have the appearance of a TNT block and when running it will make the sound of an anvil and emmit a light level of 10.

Example 2

"appearance": {
    "block": "minecraft:furnace",
    "running": {
        "block": "minecraft:furnace[lit=true]",
        "lightmode": 15
    }
}

This machine will have the appearance of an unlit furnace when idle, errored or paused, and the appearance of a lit furnace and emmit light when running.

Clone this wiki locally