Skip to content

Machine Appearance

Frinn38 edited this page Apr 16, 2021 · 22 revisions

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

Each machine should have a Machine Appearance defined in their json like this :

"appearance": { //Put appearance properties here }

All of the machine appearance properties are optionals. If you don't put any properties in the appearance the machine will still load and use a wonderful pink and black texture for the block and the item.

Item (Not Implemented Yet)

By default the machine item will have the same appearance that the machine block, you can change it by using the Item Property.

Using the Item Property you can set the item to use any texture loaded in the game as the machine item texture.

The texture should be a PNG file, ideally a square picture 16px wide but any size can be used (note that larger sizes can and will impact performances and render weirdly)

The texture must be loaded in-game using either a ResourcePack or a Resource Loader mod like Open Loader.

Example : A texture located in assets/my_mod/textures/machine/my_machine_item.png should be defined as my_mod:my_machine_item, the texture loader will search for files in the textures folder and it's subfolders and will also add the .png at the end of the location so you don't have to.

The property must be defined as such : "item": "namespace:texture_location"

Sound

You can also define a running sound for your machine. The sound will be played endlessly while the machine is running.

The sound must be a OGG file and must be loaded in-game. Sounds are differents than models and textures and must be registered to be usable so for using custom sounds you will have either to use a mod that let you add sounds to the game or replace an existing sound with a resource pack and use it's name in the property.

The property must be defined as such : "sound": "namespace:sound_location"

Notes

All of the above properties are optionals but the Machine Appearance can use only one of block/blockstate/model property, the priority order is :

Blockstate > Block > Model so the machine will first try to use the blockstate then the block then the model property.

Setting more of one of those three properties is pointless but if you really want to but don't want to have the above priority you can use a Type property to set which property you want the machine to use : "type": "block" will make the machine use the block property even if the blockstate one is set.

If neither of those three properties are set the appearance will be a pink and black cube.

If no Item property is set the item will just use the machine block appearance.

If no sound property is set the machine will just make no sound while running.

Example

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

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

Clone this wiki locally