Skip to content

Creating Custom Machines

Frinn38 edited this page Apr 28, 2022 · 8 revisions

The json file

Custom Machines jsons should be located in datapacks/(my_datapack)/data/(some_namespace)/machines/(my_machine).json

The machine name should be all lowercase with no spaces or any other characters than letters and numbers but you can use "_" or "/"

Each machines loaded in the game should have a different ID, in the example above the machine Id is : namespace:my_machine

You can put any number of machines under the same namespace or separate them.

You can also use subfolders like : datapacks/(my_datapack)/data/(some_namespace)/machines/tier1/(my_machine).json so the machine ID will be namespace:tier1/my_machine

Just remember that all the machines jsons should be under the machines folder.^

Machine properties

The machine json has 2 mandatory properties and 5 optional properties.

Mandatory properties

Name

Name : name

Description :

The name of the machine, not to be confused with the ID of the machine (which is the path to the machine json). It will be the name of both the machine item and the jei category for this machine recipes. It will also be displayed in The One Probe when the player is pointing the machine block. The specified name must be a string, any characters are allowed (as long as minecraft can parse it), it can also be a lang key or a Text Component to add more customization options.

Examples :

//Raw string
"name": "My cool machine"

//Lang key
"name": "machine.example.cool"

//Text component
"name": {
    "text": "My cool machine",
    "color": "red"
}

Appearance

Optional properties

Tooltips

Name : tooltips

Description :

A list of tooltips that will be displayed when the player cursor hover the machine item in a gui. The tooltips can be a raw string or a Text Component. Each tooltips of the list will be displayed in a new line.

Examples :

//Raw string
"tooltips": "That machine is really cool"

//List of strings
"tooltips": ["That machine is really cool", "Try it and see"]

//Text component
"tooltips": {
    "text": "That machine is really cool",
    "color": "red"
}

//List of text components
"tooltips": [
    {
        "text": "That machine is really cool",
        "color": "red"
    },
    {
        "text": "Try it and see",
        "bold": true
    }
]

Components

Gui

Jei

Catalysts

Empty template

An empty template of a machine json with all it's properties.

{
    "name": "",
    "appearance": {},
    "tooltips": [],
    "components": [],
    "gui": [],
    "jei": [],
    "catalysts": []
}

Examples

See a few examples of custom machines in the test datapack.

Clone this wiki locally