Skip to content

Machine Appearance

Frinn38 edited this page Nov 11, 2021 · 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": {
    "idle": {
        "property1": "value",
        "property2": 42
    },
    "running": {
        "property1": "some_value",
        "property2": 23
    },
    "errored": {
        "property1": "another_value",
        "property2": 666
    },
    "paused": {
        "property1": "again_another_value",
        "property2": 56487
    }
}
  • The idle status is considered as the default, if one of the other status is not specified the idle one will be used.
  • If the idle status is not specified the machine will use the default machine model when idle and for all other non-specified status.

If you want the machine appearance to be always the same you can directly put the properties inside the appearance block :

"appearance": {
    "property1": "value",
    "property2": 42
}

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

Properties

Machine appearance currently have 5 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, 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.

  • mininglevel, 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 and mininglevel properties can be extended to other mod tools, if they use the vanilla system to register their tool type and level.

Default Machine Appearance

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

{
    "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
}

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": {
    "idle": {
        "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