# Table of Contents - [Welcome | Custom Machinery 1.21](#welcome-custom-machinery-1-21) - [Creating a custom machine with datapack | Custom Machinery 1.21](#creating-a-custom-machine-with-datapack-custom-machinery-1-21) - [Creating an upgraded machine | Custom Machinery 1.21](#creating-an-upgraded-machine-custom-machinery-1-21) - [Block appearance | Custom Machinery 1.21](#block-appearance-custom-machinery-1-21) - [Item appearance | Custom Machinery 1.21](#item-appearance-custom-machinery-1-21) - [Machine appearance | Custom Machinery 1.21](#machine-appearance-custom-machinery-1-21) - [Sound (Ambient) | Custom Machinery 1.21](#sound-ambient-custom-machinery-1-21) - [Sound (Interaction) | Custom Machinery 1.21](#sound-interaction-custom-machinery-1-21) - [Hardness | Custom Machinery 1.21](#hardness-custom-machinery-1-21) - [Color | Custom Machinery 1.21](#color-custom-machinery-1-21) - [Light | Custom Machinery 1.21](#light-custom-machinery-1-21) - [Machine components | Custom Machinery 1.21](#machine-components-custom-machinery-1-21) - [Resistance | Custom Machinery 1.21](#resistance-custom-machinery-1-21) - [Requires tool | Custom Machinery 1.21](#requires-tool-custom-machinery-1-21) - [Mining level | Custom Machinery 1.21](#mining-level-custom-machinery-1-21) - [Shape | Custom Machinery 1.21](#shape-custom-machinery-1-21) - [Tool type | Custom Machinery 1.21](#tool-type-custom-machinery-1-21) - [Keep inventory | Custom Machinery 1.21](#keep-inventory-custom-machinery-1-21) - [Contraption component (Create) | Custom Machinery 1.21](#contraption-component-create-custom-machinery-1-21) - [Chunkload component | Custom Machinery 1.21](#chunkload-component-custom-machinery-1-21) - [Energy component | Custom Machinery 1.21](#energy-component-custom-machinery-1-21) - [Catalysts | Custom Machinery 1.21](#catalysts-custom-machinery-1-21) - [JEI Recipe GUI | Custom Machinery 1.21](#jei-recipe-gui-custom-machinery-1-21) - [Craft | Custom Machinery 1.21](#craft-custom-machinery-1-21) - [Processor | Custom Machinery 1.21](#processor-custom-machinery-1-21) - [Machine | Custom Machinery 1.21](#machine-custom-machinery-1-21) - [Experience component | Custom Machinery 1.21](#experience-component-custom-machinery-1-21) - [Heat component (Mekanism) | Custom Machinery 1.21](#heat-component-mekanism-custom-machinery-1-21) - [Upgrade | Custom Machinery 1.21](#upgrade-custom-machinery-1-21) - [Pressure component (PNC) | Custom Machinery 1.21](#pressure-component-pnc-custom-machinery-1-21) - [Energy | Custom Machinery 1.21](#energy-custom-machinery-1-21) - [PNC Heat component (PNC) | Custom Machinery 1.21](#pnc-heat-component-pnc-custom-machinery-1-21) - [Fluid | Custom Machinery 1.21](#fluid-custom-machinery-1-21) - [Result | Custom Machinery 1.21](#result-custom-machinery-1-21) - [KubeJS | Custom Machinery 1.21](#kubejs-custom-machinery-1-21) - [Redstone component | Custom Machinery 1.21](#redstone-component-custom-machinery-1-21) - [Filter | Custom Machinery 1.21](#filter-custom-machinery-1-21) - [Crafttweaker (deprecated) | Custom Machinery 1.21](#crafttweaker-deprecated-custom-machinery-1-21) - [Craft recipe | Custom Machinery 1.21](#craft-recipe-custom-machinery-1-21) - [Fuel | Custom Machinery 1.21](#fuel-custom-machinery-1-21) - [Machine GUI | Custom Machinery 1.21](#machine-gui-custom-machinery-1-21) - [Machine recipe | Custom Machinery 1.21](#machine-recipe-custom-machinery-1-21) - [Fluid component | Custom Machinery 1.21](#fluid-component-custom-machinery-1-21) - [Custom Block/Item | Custom Machinery 1.21](#custom-block-item-custom-machinery-1-21) - [Upgrades | Custom Machinery 1.21](#upgrades-custom-machinery-1-21) - [Chemical component (Mekanism) | Custom Machinery 1.21](#chemical-component-mekanism-custom-machinery-1-21) - [Crafting your machine | Custom Machinery 1.21](#crafting-your-machine-custom-machinery-1-21) - [Item component | Custom Machinery 1.21](#item-component-custom-machinery-1-21) - [Text component | Custom Machinery 1.21](#text-component-custom-machinery-1-21) - [Requirement display info | Custom Machinery 1.21](#requirement-display-info-custom-machinery-1-21) - [Range | Custom Machinery 1.21](#range-custom-machinery-1-21) - [Empty element | Custom Machinery 1.21](#empty-element-custom-machinery-1-21) - [Upgrades | Custom Machinery 1.21](#upgrades-custom-machinery-1-21) - [Datapack | Custom Machinery 1.21](#datapack-custom-machinery-1-21) - [Toggle Config | Custom Machinery 1.21](#toggle-config-custom-machinery-1-21) - [Chunkload | Custom Machinery 1.21](#chunkload-custom-machinery-1-21) - [Comparator | Custom Machinery 1.21](#comparator-custom-machinery-1-21) - [Sky | Custom Machinery 1.21](#sky-custom-machinery-1-21) - [Background element | Custom Machinery 1.21](#background-element-custom-machinery-1-21) - [Button | Custom Machinery 1.21](#button-custom-machinery-1-21) - [Component modifier | Custom Machinery 1.21](#component-modifier-custom-machinery-1-21) - [Item filter | Custom Machinery 1.21](#item-filter-custom-machinery-1-21) - [Chemical (Mekanism) | Custom Machinery 1.21](#chemical-mekanism-custom-machinery-1-21) - [Radiation (Mekanism) | Custom Machinery 1.21](#radiation-mekanism-custom-machinery-1-21) - [Function | Custom Machinery 1.21](#function-custom-machinery-1-21) - [Core modifier | Custom Machinery 1.21](#core-modifier-custom-machinery-1-21) - [Contraption (Create) | Custom Machinery 1.21](#contraption-create-custom-machinery-1-21) - [Experience | Custom Machinery 1.21](#experience-custom-machinery-1-21) - [Heat (Mekanism) | Custom Machinery 1.21](#heat-mekanism-custom-machinery-1-21) - [Structure | Custom Machinery 1.21](#structure-custom-machinery-1-21) - [Upgrades | Custom Machinery 1.21](#upgrades-custom-machinery-1-21) - [Recipe modifier | Custom Machinery 1.21](#recipe-modifier-custom-machinery-1-21) - [I/O Config | Custom Machinery 1.21](#i-o-config-custom-machinery-1-21) - [Config element | Custom Machinery 1.21](#config-element-custom-machinery-1-21) - [Context | Custom Machinery 1.21](#context-custom-machinery-1-21) - [Dump element | Custom Machinery 1.21](#dump-element-custom-machinery-1-21) - [Component modifiers | Custom Machinery 1.21](#component-modifiers-custom-machinery-1-21) - [Chemical element (Mekanism) | Custom Machinery 1.21](#chemical-element-mekanism-custom-machinery-1-21) - [Bar element | Custom Machinery 1.21](#bar-element-custom-machinery-1-21) - [Reset element | Custom Machinery 1.21](#reset-element-custom-machinery-1-21) - [Fluid element | Custom Machinery 1.21](#fluid-element-custom-machinery-1-21) - [PNC Heat element (PNC) | Custom Machinery 1.21](#pnc-heat-element-pnc-custom-machinery-1-21) - [Pressure element (PNC) | Custom Machinery 1.21](#pressure-element-pnc-custom-machinery-1-21) - [Fuel element | Custom Machinery 1.21](#fuel-element-custom-machinery-1-21) - [Machine | Custom Machinery 1.21](#machine-custom-machinery-1-21) - [Energy element | Custom Machinery 1.21](#energy-element-custom-machinery-1-21) - [Experience element | Custom Machinery 1.21](#experience-element-custom-machinery-1-21) - [Player inventory element | Custom Machinery 1.21](#player-inventory-element-custom-machinery-1-21) - [Text element | Custom Machinery 1.21](#text-element-custom-machinery-1-21) - [Button element | Custom Machinery 1.21](#button-element-custom-machinery-1-21) - [Status element | Custom Machinery 1.21](#status-element-custom-machinery-1-21) - [Slot element | Custom Machinery 1.21](#slot-element-custom-machinery-1-21) - [Heat element (Mekanism) | Custom Machinery 1.21](#heat-element-mekanism-custom-machinery-1-21) - [Texture element | Custom Machinery 1.21](#texture-element-custom-machinery-1-21) - [Progress bar element | Custom Machinery 1.21](#progress-bar-element-custom-machinery-1-21) - [Split element | Custom Machinery 1.21](#split-element-custom-machinery-1-21) - [Recipe modifiers | Custom Machinery 1.21](#recipe-modifiers-custom-machinery-1-21) - [Requirements | Custom Machinery 1.21](#requirements-custom-machinery-1-21) - [Biome | Custom Machinery 1.21](#biome-custom-machinery-1-21) - [Chunkload | Custom Machinery 1.21](#chunkload-custom-machinery-1-21) - [Dimension | Custom Machinery 1.21](#dimension-custom-machinery-1-21) - [Sky | Custom Machinery 1.21](#sky-custom-machinery-1-21) - [Fuel | Custom Machinery 1.21](#fuel-custom-machinery-1-21) - [Light | Custom Machinery 1.21](#light-custom-machinery-1-21) - [Contraption requirement (Create) | Custom Machinery 1.21](#contraption-requirement-create-custom-machinery-1-21) - [Redstone | Custom Machinery 1.21](#redstone-custom-machinery-1-21) - [Button | Custom Machinery 1.21](#button-custom-machinery-1-21) - [PNC Temperature (PNC) | Custom Machinery 1.21](#pnc-temperature-pnc-custom-machinery-1-21) - [Command | Custom Machinery 1.21](#command-custom-machinery-1-21) - [Loot table | Custom Machinery 1.21](#loot-table-custom-machinery-1-21) - [Radiation (Mekanism) | Custom Machinery 1.21](#radiation-mekanism-custom-machinery-1-21) --- # Welcome | Custom Machinery 1.21 circle-exclamation This is the wiki for the 1.21 version of Custom Machinery. For the 1.19 version go [herearrow-up-right](https://frinn.gitbook.io/custom-machinery-1.19) . For the 1.18 version go [herearrow-up-right](https://frinn.gitbook.io/custom-machinery-1.18/) . For the 1.16 version go [herearrow-up-right](https://frinn.gitbook.io/custom-machinery-1.16/) . ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21#creating-a-custom-machine) Creating a custom machine circle-info Since 1.21 Custom Machinery now features a nice editor gui to let you create and edit machines on the fly. Open the game, join a world, type **/cm create** and begin the creation of your own custom machine. Custom machines can also be created in json files (datapack). [Creating custom machineschevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-a-custom-machine-with-datapack) ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21#creating-machine-recipes) Creating machine recipes There are 3 ways to create custom machine recipes : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21#json-datapack) Json (datapack) [Machine recipechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21#javascript-kubejs) Javascript (KubeJS) [Recipeschevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21#deprecated-zenscript-crafttweaker) _Deprecated -_ Zenscript (Crafttweaker) circle-exclamation Crafttweaker support is deprecated in 1.21, it is recommended to switch to KubeJS instead. [Recipeschevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes) ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21#crafting-your-machine) Crafting your machine [Crafting your machinechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/misc/crafting-your-machine) ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21#datapacks) Datapacks Custom machinery make heavy use of datapacks, if you're not familiar about datapacks see : [Datapackchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/misc/datapack) [NextCreating a custom machine with datapackchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-a-custom-machine-with-datapack) Last updated 18 days ago --- # Creating a custom machine with datapack | Custom Machinery 1.21 ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-a-custom-machine-with-datapack#the-json-file) The json file Custom Machines json files should be located in `datapacks//data//machine/.json` * : The name of your datapack, can be whatever you want. * : The namespace of your machine, must be lowercase without spaces or special characters. * : The id of your machine, must be lowercase without spaces or special characters except "\_" and "/". Each machines loaded in the game should have a different ID, in the example above the machine Id is : `namespace:machine` You can put any number of machines under the same namespace or separate them. You can also use subfolders like : `datapacks/datapack/data/namespace/machine/tier1/machine.json` so the machine ID will be `namespace:tier1/machine` Just remember that all the machines json files should be under the `machine` folder. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-a-custom-machine-with-datapack#machine-properties) Machine properties The machine json has 1 mandatory property and 7 optional properties. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-a-custom-machine-with-datapack#mandatory-properties) Mandatory properties chevron-rightName[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-a-custom-machine-with-datapack#name) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-a-custom-machine-with-datapack#name-name) Name : `name` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-a-custom-machine-with-datapack#description) 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](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) to add more customization options. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-a-custom-machine-with-datapack#examples) Examples : Copy //Raw string "name": "My cool machine" //Lang key "name": "machine.example.cool" //Text component "name": { "text": "My cool machine", "color": "red" } #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-a-custom-machine-with-datapack#optional-properties) Optional properties [Machine appearancechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance) chevron-rightTooltips[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-a-custom-machine-with-datapack#tooltips) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-a-custom-machine-with-datapack#name-tooltips) Name : `tooltips` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-a-custom-machine-with-datapack#description-1) 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](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) . Each tooltips of the list will be displayed in a new line. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-a-custom-machine-with-datapack#examples-1) Examples : [Machine componentschevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components) [Machine GUIchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui) [JEI Recipe GUIchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/jei-recipe-gui) [Catalystschevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/catalysts) [Processorchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor) ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-a-custom-machine-with-datapack#empty-template) Empty template An empty template of a machine json with all it's properties. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-a-custom-machine-with-datapack#examples-2) Examples circle-info You can download the test datapack [herearrow-up-right](https://download-directory.github.io/?url=https%3A%2F%2Fgithub.com%2FFrinn38%2FCustom-Machinery%2Ftree%2F1.21%2Ftest_datapack) . See a few examples of custom machines in [the test datapackarrow-up-right](https://github.com/Frinn38/Custom-Machinery/tree/1.21/test_datapack/data/custommachinery/machine) . [PreviousWelcomechevron-left](https://frinn.gitbook.io/custom-machinery-1.21) [NextCreating an upgraded machinechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-an-upgraded-machine) Last updated 1 year ago * [The json file](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-a-custom-machine-with-datapack#the-json-file) * [Machine properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-a-custom-machine-with-datapack#machine-properties) * [Empty template](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-a-custom-machine-with-datapack#empty-template) * [Examples](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-a-custom-machine-with-datapack#examples-2) sun-brightdesktopmoon Copy //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\ }\ ] machine.json Copy { "name": "", "appearance": {}, "tooltips": [], "components": [], "gui": [], "jei": [], "catalysts": [] } sun-brightdesktopmoon --- # Creating an upgraded machine | Custom Machinery 1.21 Upgraded machines are a type of custom machine that inherit all properties from another existing custom machine. circle-exclamation The "parent" machine (which serves as the basis for the upgraded machine) must be an existing custom machine, from the Custom Machinery mod. You can't make an upgraded machine out of vanilla or other mods machines. To define an upgraded machine, simply add `"parent": "namespace:machine_id"` in the upgraded machine json. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-an-upgraded-machine#base-example) Base example This is the full content of an upgraded machine json file, that inherit all properties from the machine with id `custommachinery:power_crusher`. Copy { "parent": "custommachinery:power_crusher" } If not overridden the machine name will show as "Upgraded " where `` is the name of its parent machine, in the example above the upgraded machine's name will be "Upgraded Power Crusher". ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-an-upgraded-machine#overriding-properties) Overriding properties Upgraded machines can override properties of its parent machine, by specifying the same property in the upgraded machine json. In the following example the upgraded machine will **not** inherit the `gui` property from its parent machine. Copy { "parent": "custommachinery:power_crusher", "gui": [\ //put some gui elements here\ ] } All properties from the parent machine can be overridden, a list of all properties that a custom machine can have is available [here](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-a-custom-machine-with-datapack) . ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-an-upgraded-machine#recipe-modifiers) Recipe modifiers Upgraded machines can include a list of recipe modifiers, that will be automatically applied when the machine is processing a recipe. In the example below all recipes processed by the upgraded machine will require 1.5x more energy but half the time to complete the recipe. More info about recipe modifiers can be found [here](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers) . ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-an-upgraded-machine#about-recipes) About recipes By default all recipes that can be processed by the parent machine can also be processed by the upgraded machine. This can be disabled by adding the following property in the upgraded machine json : circle-info If you want to make a recipe that is processable by only the upgraded machine, simply use the upgraded machine id in the recipe json/script instead of the parent machine id. [PreviousCreating a custom machine with datapackchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-a-custom-machine-with-datapack) [NextMachine appearancechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance) Last updated 1 year ago * [Base example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-an-upgraded-machine#base-example) * [Overriding properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-an-upgraded-machine#overriding-properties) * [Recipe modifiers](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-an-upgraded-machine#recipe-modifiers) * [About recipes](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-an-upgraded-machine#about-recipes) sun-brightdesktopmoon Copy { "parent": "custommachinery:power_crusher", "modifiers": [\ {\ "requirement": "custommachinery:speed",\ "mode": "input",\ "operation": "multiplication",\ "modifier": 0.5\ },\ {\ "requirement": "custommachinery:energy_per_tick",\ "mode": "input",\ "operation": "multiplication",\ "modifier": 1.5\ }\ ] } Copy "allow_parent_recipes": false sun-brightdesktopmoon --- # Block appearance | Custom Machinery 1.21 Machine block appearance is defined using the `block` property inside the `appearance` property. This property is optional and will use the default machine model if not specified. There is 2 way of using this property : ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/block-appearance#using-a-blockstate) Using a blockstate The `block` property can take a blockstate using the format : `namespace:block_id[state1=value,state2=value...]` The blockstates properties are optional, you can just use `namespace:block_id` and the machine will use that block default state. You don't have to use all the block's state properties, if some are not specified their default value will be used instead. Example : Copy "appearance": { "block": "minecraft:furnace[lit=true]" } That way the machine will use the appearance of a vanilla lit furnace. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/block-appearance#using-a-custom-model) Using a custom model If you don't want to mimic an existing block you can use the block property to point a custom model that the machine will use. The model must be a Minecraft type json model, if you are not familiar with this type of model see the official MC Wiki (note : you need only the model and texture file but not the blockstates file) The model **MUST** be loaded in-game using either a ResourcePack or a Resource Loader mod like Open Loader. The model **MUST** be located in `assets/namespace/models/machine` any other model location such as assets/namespace/models/block will not work. Example : A model located in `assets/namespace/models/machine/my_machine.json` must be defined as `namespace:machine/my_machine`, the model loader will search for files in the models folder and it's subfolders and will also add the .json so you don't have to. Example : That way the machine will use the file located in `assets/custommachinery/models/machine/my_model.json` as the machine model. circle-exclamation **Adding a new custom model inside that directory will require a game restart** ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/block-appearance#notes) Notes If you use a custom minecraft json model for your machine you can color some faces using the `tintIndex` property (inside the json model). Available `tintIndex` values are: * 1 : color the face using the biome water color * 2 : color the face using the biome grass color * 3 : color the face using the biome foliage color * 4 : color the face using the Machine Appearance color property value If you don't specify a tintIndex in the json model the face will use it's texture and not color it. [PreviousMachine appearancechevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance) [NextItem appearancechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/item-appearance) * [Using a blockstate](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/block-appearance#using-a-blockstate) * [Using a custom model](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/block-appearance#using-a-custom-model) * [Notes](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/block-appearance#notes) sun-brightdesktopmoon Copy "appearance": { "block": "custommachinery:machine/my_model" } sun-brightdesktopmoon --- # Item appearance | Custom Machinery 1.21 By default the machine item will have the same appearance that the machine block, you can change it by using the Item Property. There is 2 way of using the `item` property : ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/item-appearance#using-an-item) Using an item The `item` property can take an item using the format : `namespace:item_id` and will mimic its model and textures. Example : Copy "appearance": { "item": "minecraft:diamond" } That way the machine item will show as a vanilla diamond. Note: for items with animated textures (bow/compass/watch...) that may not work or cause issues. For items with more complex rendering (trident, chest, armor stand...) that will just not works. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/item-appearance#using-a-custom-model) Using a custom model If you don't want to mimic an existing item you can use the `item` property to point a custom model that the machine will use. The model must be a Minecraft type json model, if you are not familiar with this type of model see the official MC Wiki. The model MUST be loaded in-game using either a ResourcePack or a Resource Loader mod like Open Loader. The model MUST be located in assets/namespace/models/machine any other model location such as assets/namespace/models/item will not work. Example : A model located in assets/namespace/models/machine/my\_machine.json must be defined as namespace:machine/my\_machine, the model loader will search for files in the models folder and it's subfolders and will also add the .json so you don't have to. Example : That way the machine will use the file located in assets/custommachinery/models/machines/my\_model.json as the machine item model. circle-exclamation **Adding a new custom model inside that directory will require a game restart.** [PreviousBlock appearancechevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/block-appearance) [NextSound (Ambient)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient) * [Using an item](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/item-appearance#using-an-item) * [Using a custom model](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/item-appearance#using-a-custom-model) sun-brightdesktopmoon Copy "appearance": { "item": "custommachinery:machines/my_model" } sun-brightdesktopmoon --- # Machine appearance | Custom Machinery 1.21 The machine appearance is what will define the in-game appearance (model/texture/sound/etc) of the machine block and item. A machine appearance can be defined for each status of the machine : `idle`, `running`, `errored` and `paused` independantly. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance#json-structure) Json structure circle-info All properties are optional and have default values. Copy "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 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. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance#properties) Properties Machine appearance currently have 10 optional properties : [Block appearancechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/block-appearance) [Item appearancechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/item-appearance) [Sound (Ambient)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient) [Sound (Interaction)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-interaction) [Lightchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/light) [Colorchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/color) [Hardnesschevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/hardness) [Resistancechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/resistance) [Tool typechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/tool-type) [Mining levelchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/mining-level) [Requires toolchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/requires-tool) [Shapechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/shape) ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance#default-machine-appearance) Default machine appearance This is what will be used by default for properties that are not specified : ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance#examples) Examples chevron-rightExample 1[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance#example-1) The machine with this machine appearance will have the appearance of a TNT block and when running it will make the sound of an anvil and emit a light level of 10. chevron-rightExample 2[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance#example-2) This machine will have the appearance of an unlit furnace when idle, errored or paused, and the appearance of a lit furnace and emit light when running. [PreviousCreating an upgraded machinechevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/creating-an-upgraded-machine) [NextBlock appearancechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/block-appearance) Last updated 1 year ago * [Json structure](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance#json-structure) * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance#properties) * [Default machine appearance](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance#default-machine-appearance) * [Examples](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance#examples) sun-brightdesktopmoon Copy "appearance": { "block": "custommachinery:block/custom_machine_block", "item": "custommachinery:block/custom_machine_block", "ambient_sound": "", "interaction_sound": "minecraft:iron_block", "light": 0, "color": 16777215, "hardness": 3.5, "resistance": 3.5, "tool_type": "minecraft:mineable/pickaxe", "mining_level": "minecraft:needs_iron_tool", "requires_tool": true, "shape": [[0, 0, 0, 1, 1, 1]] } Copy "appearance": { "block": "minecraft:tnt", "sound": "minecraft:block.anvil.place", "light": 10 } Copy "appearance": { "block": "minecraft:furnace", "running": { "block": "minecraft:furnace[lit=true]", "light": 15 } } sun-brightdesktopmoon --- # Sound (Ambient) | Custom Machinery 1.21 You can define a sound that will play when the machine is in a specific status (corresponding of where you put the property in the appearance json). The sound must be a OGG file and must be loaded in-game. Sounds are different 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. circle-info If no sound property is set the machine will just make no sound. Ambient sound has 1 mandatory property and can be configured with 7 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#mandatory-property) Mandatory property : chevron-rightSound[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#sound) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#name-sound) Name : `sound` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#description) Description : The id of the sound to play while the machine is in the specified status. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#example) Example : Use the vanilla furnace sound : Copy "ambient_sound" : { "sound": "minecraft:block.furnace.fire_crackle" } #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#optional-properties) Optional properties : chevron-rightVolume[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#volume) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#name-volume) Name : `volume` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#description-1) Description : A positive float value used to calculate the volume of the played sound. Values higher than 1.0 will increase the volume and values between 0.0 and 1.0 will lower it. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#default-1.0) Default : `1.0` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#example-1) Example : The sound's volume will be doubled : Copy "ambient_sound": { "volume": 2.0 } chevron-rightPitch[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#pitch) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#name-pitch) Name : `pitch` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#description-2) Description : A positive float value used to calculate the pitch of the played sound. Values higher than 1.0 will increase the pitch and values between 0.0 and 1.0 will lower it. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#default-1.0-1) Default : `1.0` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#example-2) Example : The sound's pitch will be doubled : Copy "ambient_sound": { "pitch": 2.0 } chevron-rightSource[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#source) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#name-source) Name : source #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#description-3) Description : One of Minecraft sound sources : * master * music * record * weather * block * hostile * neutral * player * ambient * voice The player can adjust any of these sound sources in sound options. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#default-block) Default : `block` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#example-3) Example : The machine's ambient sound will be played as "music" source : Copy "ambient_sound": { "source": "music" } chevron-rightLoop[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#loop) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#name-loop) Name : `loop` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#description-4) Description : A boolean value which set if the sound should be looped or not. If set to false the machine will still play the sound continuously but there will be a short blank between each loop. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#default-true) Default : `true` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#example-4) Example : Set the loop to false : chevron-rightAttenuation[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#attenuation) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#name-attenuation) Name : `attenuation` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#description-5) Description : A boolean value which set if the sound should be attenuated or not. If set to true, the sound's volume will decrease as the player moves away the machine. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#default-true-1) Default : `true` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#example-5) Example : Set the attenuation to false : chevron-rightDelay[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#delay) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#name-delay) Name : `delay` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#description-6) Description : A positive integer value that sets the amount (in game ticks) that will be waited before playing the sound. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#default-0) Default : `0` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#example-6) Example : Set the delay to 20 ticks (1 second) : chevron-rightRelative[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#relative) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#name-relative) Name : `relative` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#description-7) Description : Not sure of what this property does. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#default-false) Default : `false` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#example-7) Example : Set the relative to true : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient#example-8) Example : Simply add an ambient sound to the machine : Add a configured ambient sound : [PreviousItem appearancechevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/item-appearance) [NextSound (Interaction)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-interaction) Last updated 11 months ago sun-brightdesktopmoon Copy "ambient_sound": { "loop": false } Copy "ambient_sound": { "attenuation": false } Copy "ambient_sound": { "delay": 20 } Copy "ambient_sound": { "relative": true } Copy { "ambient_sound": "namespace:sound_location" } Copy { "ambient_sound": { "sound": "namespace:sound_location", "volume": 2.0, "pitch": 2.0, "source": "music" } } sun-brightdesktopmoon --- # Sound (Interaction) | Custom Machinery 1.21 The `interaction_sound` property can be used to customize which sound the machine will make when the player place/break/hit/step on/fell on it. There are 2 ways of using this property : ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-interaction#copying-another-block) Copying another block Simply specify a block id to the property and the machine will copy all sounds it make. You can also use the `namespace:block[property1=value1,property2=value2]` syntax here as some blocks may have different sounds depending on their state. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-interaction#example) Example This machine will make the same sound than a netherite block. Copy "appearance": { "interaction_sound": "minecraft:netherite_block" } ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-interaction#tweaking-sounds-individually) Tweaking sounds individually The 5 interaction sounds `break`, `place`, `hit`, `fall` and `step` can be defined independently. You can define them using either : * A block : `namespace:block_id` * A blockstate : `namespace:block_id[property=value, property2=value2]` * A sound : `namespace:sound_id` circle-info Look at the suggestions given by the `/playsound` command in game to see all available sound ids. You can also add your own sounds. You can also specify a `volume` and `pitch` that will be used when playing the sound. Default value for both `volume` and `pitch` is 1.0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-interaction#example-1) Example This machine will have the sound of the stone when placed, the grass when broken, and the npc hurt sound when step on. [PreviousSound (Ambient)chevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient) [NextLightchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/light) Last updated 11 months ago * [Copying another block](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-interaction#copying-another-block) * [Tweaking sounds individually](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-interaction#tweaking-sounds-individually) sun-brightdesktopmoon Copy "appearance": { "interaction_sound": { "volume": 1.0, "pitch": 1.0, "place": "minecraft:stone", "break": "minecraft:grass", "step": "minecraft:entity.villager.hurt" } } sun-brightdesktopmoon --- # Hardness | Custom Machinery 1.21 Hardness is a float value used to calculate the breaking speed of the machine block. The higher the hardness the longer the breaking time. The default hardness is 3.5. circle-info A hardness of -1 will make the block unbreakable (like bedrock). Some comparisons with vanilla blocks : * Wool : 0.8 * Stone : 1.5 * Dirt : 0.5 * Obsidian : 50 * Netherrack : 0.4 * End stone : 3 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/hardness#example) Example Copy "appearance": { "hardness": 42 } [PreviousColorchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/color) [NextResistancechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/resistance) sun-brightdesktopmoon sun-brightdesktopmoon --- # Color | Custom Machinery 1.21 You can specify a color property to apply to a custom machine model. This property must be specified inside the `appearance` property. The color must be an integer of type: 0xRRGGBB: go [herearrow-up-right](https://www.shodor.org/stella2java/rgbint.html) if you don't know how to calculate an integer color from RGB values. The color will only be applied to faces of the model that have `"tintIndex": 4` specified, all other faces will be ignored and not be colored. circle-info You can find some infos about `tintIndex` face property on the [Minecraft Wikiarrow-up-right](https://minecraft.fandom.com/wiki/Model#Block_models) Default : 16777215 Full white color, this will not change the texture color. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/color#example) Example: This will apply a full red color to all faces of the machine model that have `"tintIndex": 4` property. Copy { "appearance": { "color": 16711680 } } [PreviousLightchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/light) [NextHardnesschevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/hardness) sun-brightdesktopmoon sun-brightdesktopmoon --- # Light | Custom Machinery 1.21 Custom machines support light emission, to make your machine emit light you will need to define the `light` property inside the machine `appearance` property. The `light` property define the light the machine will be emitting. The light level must be an integer between 0 and 15 (defined by vanilla, a torch emit 14 and a redstone torch 7 for example). Example : Copy "appearance": { "light": 15 } circle-info The default light is 0. [PreviousSound (Interaction)chevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-interaction) [NextColorchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/color) sun-brightdesktopmoon sun-brightdesktopmoon --- # Machine components | Custom Machinery 1.21 Machine components are what allow the machine to use the different systems the game provide. These components must be defined in the machine json, under the `component` property. circle-info There is no limit to how many components you can add. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components#available-components) Available components There are currently 4 available components : [Energy componentchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component) [Fluid componentchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component) [Item componentchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component) [Redstone componentchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component) ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components#template) Template Copy { "name": "Machine", "appearance": {}, "components": [\ {\ //First component\ }, \ {\ //Second component\ }\ ] } circle-info Machine Components are optional, if you don't want it just don't put it in the machine json. [PreviousKeep inventorychevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/keep-inventory) [NextChemical component (Mekanism)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism) * [Available components](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components#available-components) * [Template](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components#template) sun-brightdesktopmoon sun-brightdesktopmoon --- # Resistance | Custom Machinery 1.21 Resistance is a float value used to calculate the explosion resistance of the machine block. Blocks with higher resistance won't be destroyed when near an explosion. The default resistance is 3.5. Some comparisons with vanilla blocks : * Wool : 0.8 * Stone : 6 * Dirt : 0.5 * Obsidian : 1200 * Netherrack : 0.4 * End stone : 9 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/resistance#example) Example Copy "appearance": { "resistance": 42 } [PreviousHardnesschevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/hardness) [NextTool typechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/tool-type) sun-brightdesktopmoon sun-brightdesktopmoon --- # Requires tool | Custom Machinery 1.21 The `requires_tool` property define whether the player need the tool defined in the [Tool type](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/tool-type) property to harvest the machine. If set to true, the machine block will drop only when broken by the defined tool. Otherwise the machine will be destroyed and won't drop. If set to false, the machine block will always drop when broken, even by hand. Tools specified in the `tool_type` property will still be faster to break the machine than other tools. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/requires-tool#default-true) Default : true #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/requires-tool#example) Example : Copy "appearance": { "requires_tool": false } [PreviousMining levelchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/mining-level) [NextShapechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/shape) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Mining level | Custom Machinery 1.21 The required mining level to break the machine block can be defined using the `mining_level` property. The machine will still be breakable with lower tools or bare hands but it will be much slower and will not drop the machine block (its contents will still be dropped). The specified mining level must be a block tag. Default : `minecraft:needs_stone_tool` Available values : * `minecraft:needs_stone_tool` * `minecraft:needs_iron_tool` * `minecraft:needs_diamond_tool` * `forge:needs_netherite_tool` circle-info If a mod or a datapack add another mining level tag, it can be used here. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/mining-level#example) Example Copy "appearance": { "mining_level": "minecraft:needs_diamond_tool" } [PreviousTool typechevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/tool-type) [NextRequires toolchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/requires-tool) sun-brightdesktopmoon sun-brightdesktopmoon --- # Shape | Custom Machinery 1.21 The machine shape is used for collisions with entities and particles, as well as to define the clickable area of the block (for using or mining). The default machine shape is 1 full block. A custom machine shape shouldn't be bigger than 1 block. circle-info You can use `"shape_collision"` instead of `"shape"` to only change the collision shape of the machine block. There are 2 way of defining a custom machine shape : ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/shape#mimic-the-shape-of-another-block) Mimic the shape of another block Use : Copy "appearance": { "shape": "mod:block[property1=value1,property2=value2]" } to mimic the shape of another block, the \[\] is used to specify block properties and can be omitted. Example : Copy "appearance": { "shape": "minecraft:repeater" } The machine shape will be the same as the vanilla repeater. **NOTE :** Not every block shape can be used, for some advanced blocks that don't have a consistent shape, defined by their block properties it just won't work. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/shape#making-the-shape-yourself) Making the shape yourself You can specify an array of box, defined by their min and max values on the 3 axis. The resulting shape will be the addition of all these box. A box is defined like this : `[minX, minY, minZ, maxX, maxY, maxZ]` All the box values must be between 0.0 and 1.0, a full block box is \[0, 0, 0, 1, 1, 1\]. Example : A lower slab shape. [PreviousRequires toolchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/requires-tool) [NextKeep inventorychevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/keep-inventory) * [Mimic the shape of another block](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/shape#mimic-the-shape-of-another-block) * [Making the shape yourself](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/shape#making-the-shape-yourself) sun-brightdesktopmoon Copy "appearance": { "shape": [[0.0, 0.0, 0.0, 1.0, 0.5, 1.0]] } sun-brightdesktopmoon --- # Tool type | Custom Machinery 1.21 The required tool type to break the machine can be defined using the `tool_type` property. 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 unless the `requires_tool` property is set to false (its contents will still be dropped). The specified tool type must be a block tag. You can specify a list of tags to make several tools able to break the machine. Default : `minecraft:mineable/pickaxe` Available values : * `minecraft:mineable/shovel` * `minecraft:mineable/pickaxe` * `minecraft:mineable/axe` * `minecraft:mineable/hoe` circle-info If a mod or a datapack add another tool type tag, it can be used here. circle-info If you want the machine to be breakable by hand (and drop itself) you must put the [Requires Tool](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/requires-tool) property to false. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/tool-type#example) Example Only axe will be able to break the machine. Copy "appearance": { "tool_type": "minecraft:mineable/axe" } Both axe and hoe will be able to break the machine. [PreviousResistancechevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/resistance) [NextMining levelchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/mining-level) Last updated 1 year ago sun-brightdesktopmoon Copy "appearance": { "tool_type": ["minecraft:mineable/axe", "minecraft:mineable/axe"] } sun-brightdesktopmoon --- # Keep inventory | Custom Machinery 1.21 The `keep_inventory` property define whether the machine will keep its inventory when broken, or will drop it on ground. If set to true, everything stored inside the machine (items, fluids, energy, xp, addons components...) will be saved inside the machine item when the machine block is broken by a player. circle-exclamation If the `requires_tool` property is set to true and player breaking the machine doesn't use the correct tool defined in the `tool_type` and `mining_level` properties, the machine won't drop and everything will be lost. circle-info Machines with a saved inventory won't stack with other machines. If set to false, only items and xp will drop on ground, everything else will be lost. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/keep-inventory#default-false) Default: false #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/keep-inventory#example) Example: Copy "appearance": { "keep_inventory": true } [PreviousShapechevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/shape) [NextMachine componentschevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Contraption component (Create) | Custom Machinery 1.21 circle-exclamation This component requires [Custom Machinery Createarrow-up-right](https://www.curseforge.com/minecraft/mc-mods/custom-machinery-create) to be installed. The contraption machine component is used to customize which sides of the machine are able to connect with Create kinetic network (shafts, gears, motors etc...). This component is fully optional, if not present the machine will still be able to interact with Create kinetic network on all sides. This component can also be used to make the machine bring a kinetic stress impact on the network by default when the machine is idle, errored or paused. If the machine is running the kinetic stress impact defined on the recipe takes priority over the value defined in this component. circle-info Only one contraption component must be added per machine. Contraption component is defined with `"type": "custommachinery:contraption"` in the json. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/contraption-component-create#properties) Properties The contraption component has 1 mandatory property and 2 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/contraption-component-create#mandatory-property) Mandatory property Copy "type": "custommachinery:contraption" //Mandatory to define a contraption component. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/contraption-component-create#optional-properties) Optional properties chevron-rightStress impact[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/contraption-component-create#stress-impact) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/contraption-component-create#name-stress_impact) Name : `stress_impact` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/contraption-component-create#description) Description : A positive decimal value that define the kinetic stress impact the machine will bring to the network when idle, errored or paused. If the machine is running the kinetic stress impact defined on the recipe takes priority over the value defined in this component. Note : if the machine currently has a rotation speed of 64 rpm and a stress impact of 2 that means it will take a total of 64 \* 2 = 128 SU from the kinetic network, of course if the network doesn't have enouh SU capacity it will overstress and stop rotating. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/contraption-component-create#default-0) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/contraption-component-create#example) Example : The machine will add a kinetic stress impact of 2 by default : Copy "stress_impact": 2 chevron-rightConfig[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/contraption-component-create#config) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/contraption-component-create#name-config) Name : `config` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/contraption-component-create#description-1) Description : An I/O side config specified the same as any other sided components (item, fluid, energy...). See [its dedicated wiki page](https://frinn.gitbook.io/custom-machinery-1.21/misc/i-o-config) for more info about usage and syntax. The difference here is that input, output and both modes does exactly the same. As long as the side mode is not "none" the machine will accept kinetic network on that side. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/contraption-component-create#default) Default : The "both" side mode will be used as default on all sides, which mean the machine will accept kinetic network on all sides by default. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/contraption-component-create#example-1) Example : The machine will accept kinetic network only on the top side : Copy "config": { "default": "none", "top": "both" } ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/contraption-component-create#example-2) Example An example of a contraption component that will allow the machine to interact with a create shaft only on the left and right sides and bring a kinetic stress impact of 4. You just have to put that in the `components` array in the machine json. [PreviousChunkload componentchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chunkload-component) [NextEnergy componentchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component) * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/contraption-component-create#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/contraption-component-create#example-2) sun-brightdesktopmoon Copy { "type": "custommachinery:contraption", "config": { "default": "none", "left": "both", "right": "both" }, "stress_impact": 4 } sun-brightdesktopmoon --- # Chunkload component | Custom Machinery 1.21 The chunkload component can be used to make the machine always load an area around it. The chunkloaded area will be a square of chunks, centered around the chunk that contains the machine block. The radius of the chunkload area is limited to 32 chunks max (which means a square of 63 chunks on each sides, or 3969 loaded chunks). The chunks will be loaded as long as the machine block is placed, when removed the chunks will be unloaded (unless something else load them). circle-info You can also make the machine chunkload an area **only if** a recipe is processing. See [Chunkload requirement](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/chunkload) . Chunkload component is defined with `"type": "custommachinery:chunkload"` in the json. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chunkload-component#properties) Properties The chunkload component only has 1 mandatory property and 1 optional property : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chunkload-component#mandatory-property) Mandatory property Copy "type": "custommachinery:chunkload" //Mandatory to define a chunkload component. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chunkload-component#optional-property) Optional property chevron-rightRadius[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chunkload-component#radius) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chunkload-component#name-radius) Name : `radius` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chunkload-component#description) Description : The radius (in chunks) of the chunkloading area. The radius include the center chunk (where the machine is placed) so a radius of 2 means an area of 3x3 chunks. Must be between 1 and 32. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chunkload-component#default-1) Default : `1` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chunkload-component#example) Example : The machine will chunkload an area of 3x3 chunks. Copy "radius": 2 ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chunkload-component#example-1) Example A machine with this chunkload requirement will always chunkload an area of 3x3 chunks around it : [PreviousChemical component (Mekanism)chevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism) [NextContraption component (Create)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/contraption-component-create) Last updated 1 year ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chunkload-component#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chunkload-component#example-1) sun-brightdesktopmoon Copy { "type": "custommachinery:chunkload", "radius": 2 } sun-brightdesktopmoon --- # Energy component | Custom Machinery 1.21 This is the component that let your machine interact with the Forge Energy system, it is compatible with most modern mods (IC2 excluded) so any mods that use FE or RF will be able to insert or extract energy to and from your machine. circle-exclamation Energy component is defined as a **unique** machine component, meaning that you can only have 1 per machine. If you try to define more than 1 energy component only the last will be used. Energy component is defined with `"type": "custommachinery:energy"` in the json. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#properties) Properties The energy component has 2 mandatory property and 5 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#mandatory-properties) Mandatory properties Copy "type": "custommachinery:energy" //Mandatory to define an energy component. chevron-rightCapacity[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#capacity) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#name-capacity) Name : `capacity` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#description) Description : A positive long that represent the amount of energy the machine can store. Max value : 9,223,372,036,854,775,807 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#example) Example : Copy "capacity": 10000 //The machine can store 10000FE. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#optional-properties) Optional properties chevron-rightMax input[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#max-input) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#name-maxinput) Name : `maxInput` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#description-1) Description : A positive integer that represent the max FE that can be input in the machine during a single tick. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#default) Default : The `capacity` of the machine. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#example-1) Example : Copy "maxInput": 1000 //The machine can accept 1000FE/tick. chevron-rightMin input[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#min-input) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#name-mininput) Name : `minInput` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#description-2) Description : A positive integer that represent the min FE that can be input in the machine during a single tick. If something (a pipe or the machine's auto-input) try to insert less than the specified amount the transfer will fail and nothing will be inserted. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#default-0) Default : `0` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#example-2) Example : chevron-rightMax output[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#max-output) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#name-maxoutput) Name : `maxOutput` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#description-3) Description : A positive integer that represent the max FE that can be output from the machine during a single tick. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#default-1) Default : The `capacity` of the machine. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#example-3) Example : chevron-rightMin output[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#min-output) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#name-minoutput) Name : `minOutput` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#description-4) Description : A positive integer that represent the min FE that can be output from the machine during a single tick. If something (a pipe or the machine's auto-output) try to extract less than the specified amount the transfer will fail and nothing will be extracted. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#default-0-1) Default : `0` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#example-4) Example : [I/O Configchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/misc/i-o-config) ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#example-5) Example An example of an Energy Component that will allow the machine to store 100000FE, input 1000FE and output 666FE. You just have to put that in the `components` array in the machine json. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#notes) Notes The energy generated/consumed by a recipe is not counted in the maxInput/maxOutput value and will bypass it. Only energy inserted/extracted by a cable or another machine will be counted. If the `maxOutput` property is greater than 0 the machine will try to send its stored energy to any energy receiver next to it. [PreviousContraption component (Create)chevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/contraption-component-create) [NextExperience componentchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component) Last updated 7 months ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#example-5) * [Notes](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component#notes) sun-brightdesktopmoon Copy "minInput": 1000 //The machine will accept at least 1000FE/tick. Copy "maxOutput": 1000 //The machine can give 1000FE/tick. Copy "minOutput": 1000 //The machine will extract at least 1000FE/tick. Copy { "type": "custommachinery:energy", "capacity": 100000, "maxInput": 1000, "maxOutput": 666 } sun-brightdesktopmoon --- # Catalysts | Custom Machinery 1.21 The machine json have a `catalysts` property, used to tell jei that other machines can craft the same recipes that this machine. This is only used for display and navigating through the jei recipe gui. The machines must be specified by their ID, a machine json located in `data/mymod/machines/mymachine.json` will have an ID of `mymod:mymachine`. The `catalysts` can be 1 machine ID or an array. circle-info The current machine is already specified by default, you don't need to put it again in that list. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/catalysts#example) Example Add the following property to the Power Crusher in the test datapack, now when checking a Power Crusher recipe jei will also display the Stone Generator and Magic Spawner at the left of the GUI. Copy { "catalysts": ["custommachinery:magic_spawner", "custommachinery:stone_generator"] } ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2Fgithub.com%2FFrinn38%2FCustom-Machinery%2Fraw%2F1.16.5%2Fwiki%2Fcatalysts.png&width=768&dpr=3&quality=100&sign=6004319c&sv=2) example [PreviousJEI Recipe GUIchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/jei-recipe-gui) [NextProcessorchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor) sun-brightdesktopmoon sun-brightdesktopmoon --- # JEI Recipe GUI | Custom Machinery 1.21 All your machines recipe are displayed in jei without you having to do anything (beside the machine and recipe json). The jei recipe gui will be a copy of the [Machine Gui](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui) you created. circle-info A few types of elements such as text and texture are not displayed in jei unless their own "jei" property is set to true. But in some cases you may want to have a different gui for your recipes than the machine one, with more or less elements. To do that you can make your own jei recipe gui. By simply using the `"jei"` property in the machine json and putting here a list of elements you want to be displayed in jei. The syntax and elements are exactly the same as in the `"gui"` property : Copy "jei": [\ {\ "type": "custommachinery:slot",\ "x": 0,\ "y": 0\ },\ {\ "type": "custommachinery:progress",\ "x": 20,\ "y": 20\ }\ ] **NOTE** : As soon as you use the `"jei"` property in the machine json, all elements defined in the `"gui"` property will not be used by the jei recipe gui. You have to copy the elements you want to keep. The machine gui itself will not change if you use this property, only the jei one will be affected. [PreviousTexture elementchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element) [NextCatalystschevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/catalysts) sun-brightdesktopmoon sun-brightdesktopmoon --- # Craft | Custom Machinery 1.21 The craft processor is used to make the machine process [Craft recipes](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe) . ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/craft#properties) Properties There is no additional properties for this processor. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/craft#example) Example Make the machine use the craft processor instead of the machine processor : Copy { "name": "Name of the machine", "appearance": {}, "processor": { "type": "custommachinery:craft" } } [PreviousMachinechevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/machine) [NextMachine recipechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe) * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/craft#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/craft#example) sun-brightdesktopmoon sun-brightdesktopmoon --- # Processor | Custom Machinery 1.21 A processor is the part of the machine that process recipes. Each processor type target a specific recipe type. Specifying a processor is optional, if not specified the `machine` processor will be used. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor#available-processors) Available processors [Machinechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/machine) [Craftchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/craft) ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor#default) Default Default processor, if the property is not specified : Copy "processor": { "type": "custommachinery:machine" } ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor#example) Example If you want to use the [Craft processor](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/craft) instead : Copy "processor": { "type": "custommachinery:craft" } [PreviousCatalystschevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/catalysts) [NextMachinechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/machine) * [Available processors](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor#available-processors) * [Default](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor#default) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor#example) sun-brightdesktopmoon sun-brightdesktopmoon --- # Machine | Custom Machinery 1.21 The machine processor is used by default to process [Machine recipes](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe) . If the `"processor"` property is not specified in the machine json, this processor will be used by default. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/machine#properties) Properties There are 2 optional properties for this processor : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/machine#optional-properties) Optional properties chevron-rightAmount[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/machine#amount) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/machine#name-amount) Name : `amount` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/machine#description) Description : A positive integer that define the amount of cores the processor can use. Each core will be able to process a recipe in parallel, so the amount of cores define the amount of recipes that can be processed at a time by the machine. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/machine#default-1) Default : `1` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/machine#example) Example : The machine will be able to process 2 machines at the same time : Copy "amount": 2 chevron-rightCooldown[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/machine#cooldown) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/machine#name-cooldown) Name : `cooldown` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/machine#description-1) Description : The time in ticks between two recipe checks for a machine. When a machine using this processor fail to find a recipe to process (in idle mode) the machine will wait for a bit of time before checking the recipes again. Decreasing this cooldown will make the machine start the process faster, but can also increase the lag generated by idle machines. Use with caution. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/machine#default-20-ticks-1-second) Default : 20 ticks (1 second) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/machine#example-1) Example : The machine will now check recipes every ticks instead of every second : Copy "cooldown": 1 ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/machine#example-2) Example Make the machine use the machine processor with 4 cores : Copy { "name": "Name of the machine", "appearance": {}, "processor": { "type": "custommachinery:machine", "amount": 4 } } [PreviousProcessorchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor) [NextCraftchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/craft) Last updated 1 year ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/machine#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/machine#example-2) sun-brightdesktopmoon sun-brightdesktopmoon --- # Experience component | Custom Machinery 1.21 The experience machine component can be used to make a machine able to store xp. circle-exclamation This component must be unique, as there is only one "type" of xp in vanilla Minecraft it wouldn't make sense to have several storage of xp in the same machine. If you try to add more than 1 experience component only the last will be used. There are 3 ways to change the amount of xp stored in an experience component : * Using a recipe with an experience requirement. * From the machine GUI by using an [experience gui element](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element) . * By setting the `"retrieve"` property (see below) to true a player will receive all the stored xp when taking an item out the specified slots (like in a vanilla furnace). Experience component is defined with `"type": "custommachinery:experience"` in the json. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component#properties) Properties The experience component has 2 mandatory properties and 2 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component#mandatory-properties) Mandatory properties Copy "type": "custommachinery:experience" //Mandatory to define an experience component. chevron-rightCapacity[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component#capacity) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component#name-capacity) Name : `capacity` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component#description) Description : An integer positive value that define the amount of xp points that can be stored in the machine's buffer. This value is in literral xp points instead of xp levels, you can go [herearrow-up-right](https://minecraftxpcalculator.com/) to convert levels to xp values. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component#example) Example : The machine will be able to store 100 levels worth of xp. Copy "capacity": 30970 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component#optional-properties) Optional properties chevron-rightRetrieve[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component#retrieve) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component#name-retrieve) Name : `retrieve` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component#description-1) Description : A boolean value (true/false) that define if the player will get all the stored xp when taking an item from a slot in the machine gui, like it does in a vanilla furnace. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component#default-false) Default : `false` The player will not recieve the stored xp when taking an item from any slots of the machine. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component#example-1) Example : The player will get all the stored xp when taking xp from an item slot in the machine gui. chevron-rightslots[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component#slots) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component#name-slots) Name : `slots` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component#description-2) Description : A single or list of slot id(s) that will make the player get all the stored xp when taking an item out of one of these slots. Only if the `retrieve` property is set to true. An empty list mean any slot will be valid. The slot id must be exactly the same as defined in the [item component](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component) `id` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component#default-empty) Default : `empty` Any slots can give the stored xp to the player. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component#example-2) Example : Only the slot named "output" will give the xp to the player. Both "output1" and "output2" slots will give the xp to the player. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component#examples) Examples A very basic experience component that can store 100 levels worth of xp. An experience component that can store 100 levels worth of xp and will give all the stored xp when the player take an item from the slot with id "output". [PreviousEnergy componentchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component) [NextFluid componentchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component) Last updated 11 months ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component#properties) * [Examples](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component#examples) sun-brightdesktopmoon Copy "retrieve": true Copy "slots": "output" Copy "slots": ["output1", "output2"] Copy { "type": "custommachinery:experience", "capacity": 30970 } Copy { "type": "custommachinery:experience", "capacity": 30970, "retrieve": true, "slots": "output" } sun-brightdesktopmoon --- # Heat component (Mekanism) | Custom Machinery 1.21 circle-exclamation This component requires [Custom Machinery Mekanismarrow-up-right](https://www.curseforge.com/minecraft/mc-mods/custom-machinery-mekanism) to be installed. This is the component that let your machine interact with the Mekanism heat system, it is also compatible with any mods that make use of Mekanism heat. circle-exclamation Heat component is defined as a **unique** machine component, meaning that you can only have 1 per machine. If you try to define more than 1 heat component only the first will be used. The heat component make use of the Config property (same as items, fluid, energy, gas etc...) to configure which sides of the machine can transfer heat. By default all sides of the machine will be in `enabled` mode. Heat component is defined with `"type": "custommachinery:heat"` in the json. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#properties) Properties The heat component has only 1 mandatory property and 5 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#mandatory-properties) Mandatory properties Copy "type": "custommachinery:heat" //Mandatory to define a heat component. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#optional-properties) Optional properties chevron-rightCapacity[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#capacity) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#name-capacity) Name : `capacity` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#description) Description : A positive double that represent the amount of heat (in Kelvin) needed to heat up the machine from 1K. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#default-1.0k) Default : 1.0K #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#example) Example : Copy "capacity": 10 //The machine need 10 heat to heat up 1K. chevron-rightBase temperature[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#base-temperature) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#name-base_temp) Name : `base_temp` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#description-1) Description : The ambient temperature (in Kelvin) of the machine, if the machine is not heated nor cooled its temperature will slowly return to this value. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#default-300k-27-c) Default : 300K (27°C) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#example-1) Example : The machine ambient temperature will be 373K or 100°C Copy "base_temp": 373 chevron-rightInverse conduction coefficient[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#inverse-conduction-coefficient) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#name-conduction) Name : `conduction` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#description-2) Description : I don't really know what it does, so here is the definition from Mekanism API : _"This value defines how much heat is allowed to be dissipated. The larger the number the less heat can dissipate. The trade-off is that it also allows for lower amounts of heat to be inserted."_ It's a decimal value that must be greater than 0. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#default-1) Default : 1 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#example-2) Example : The machine's inverse conduction coefficient will be 0.5 chevron-rightInverse insulation coefficient[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#inverse-insulation-coefficient) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#name-insulation) Name : `insulation` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#description-3) Description : I don't really know what it does, so here is the definition from Mekanism API : _"The larger the value the less heat dissipates into the environment."_ It's a decimal value. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#default-0) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#example-3) Example : The machine's inverse insulation coefficient will be 1 [Toggle Configchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/misc/toggle-config) ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#example-4) Example The most basic heat component : A heat component that will allow transfer heat on all sides but front : [PreviousFluid componentchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component) [NextItem componentchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component) Last updated 6 months ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism#example-4) sun-brightdesktopmoon Copy "conduction": 0.5 Copy "insulation": 1 Copy { "type": "custommachinery:heat" } Copy { "type": "custommachinery:heat", "config": { "default": "enabled", "front": "disabled" } } sun-brightdesktopmoon --- # Upgrade | Custom Machinery 1.21 Use this variant to make an upgrade slot. The slot will be able to hold [Machine upgrades](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades) and apply them to recipes. circle-exclamation The ["mode"](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#name-mode) property of an item component with upgrade variant must be `"input"` or `"both"` to let the player place upgrade items inside the slot. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/upgrade#id) ID Copy "type": "custommachinery:item_upgrade" ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/upgrade#accepted-items) Accepted items Any item that are defined as machine upgrade and match the filter defined in the item component "whitelist" and "blacklist" properties. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/upgrade#example) Example A simple upgrade slot : Copy { "type": "custommachinery:item_upgrade", "id": "upgrade", "mode": "input" } [PreviousFuelchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/fuel) [NextResultchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/result) Last updated 1 year ago * [ID](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/upgrade#id) * [Accepted items](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/upgrade#accepted-items) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/upgrade#example) sun-brightdesktopmoon sun-brightdesktopmoon --- # Pressure component (PNC) | Custom Machinery 1.21 circle-exclamation This component requires [Custom Machinery Pneumaticcraftarrow-up-right](https://www.curseforge.com/minecraft/mc-mods/custom-machinery-pneumaticcraft) to be installed. This is the component that let your machine interact with the PneumaticCraft pressure system, it is also compatible with any mods that make use of PneumaticCraft pressure. circle-exclamation Pressure component is defined as a **unique** machine component, meaning that you can only have 1 per machine. If you try to define more than 1 pressure component only the first will be used. The pressure component make use of the `config` property to configure which sides of the machine can handle pressure. By default all sides will enable pressure. Pressure component is defined with `"type": "custommachinery:pressure"` in the json. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pressure-component-pnc#properties) Properties The pressure component has 4 mandatory properties and 1 optional property : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pressure-component-pnc#mandatory-properties) Mandatory properties Copy "type": "custommachinery:pressure" //Mandatory to define a pressure component. chevron-rightVolume[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pressure-component-pnc#volume) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pressure-component-pnc#name-volume) Name : `volume` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pressure-component-pnc#description) Description : An positive integer property that define the air volume available in the machine. PneumaticCraft calculate the pressure using the amount of air stored in the defined volume. The higher the volume, the longer it will take to increase or decrease pressure. Note : The machine can store an unlimited amount of compressed air, if the stored amount is over the specified volume then the pressure will increase. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pressure-component-pnc#example) Example : Set the volume to 10000mL. Copy "volume": 10000 chevron-rightDanger[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pressure-component-pnc#danger) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pressure-component-pnc#name-danger) Name : `danger` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pressure-component-pnc#description-1) Description : A positive decimal value, between 0.0bar and 25.0bar. The start of the "red" pressure on the gauge, if the machine reach a pressure higher than this danger pressure it has a chance to explode. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pressure-component-pnc#example-1) Example : Set the danger pressure to 3bar. Copy "danger": 3.0 chevron-rightCritical[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pressure-component-pnc#critical) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pressure-component-pnc#name-critical) Name : `critical` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pressure-component-pnc#description-2) Description : A positive decimal value, between 0.0bar and 25.0bar. The highest pressure on the gauge, if the machine reach this danger pressure it will explode. For practical reasons the critical pressure must be superior to the danger pressure. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pressure-component-pnc#example-2) Example : Set the danger pressure to 3bar. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pressure-component-pnc#optional-property) Optional property [Toggle Configchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/misc/toggle-config) ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pressure-component-pnc#example-3) Example A basic pressure component : [PreviousPNC Heat component (PNC)chevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pnc-heat-component-pnc) [NextRedstone componentchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component) Last updated 1 year ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pressure-component-pnc#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pressure-component-pnc#example-3) sun-brightdesktopmoon Copy "danger": 3.0 Copy { "type": "custommachinery:pressure", "volume": 10000, "danger": 3, "critical": 5 } sun-brightdesktopmoon --- # Energy | Custom Machinery 1.21 Use this variant to make the slot able to fill/drain energy from the machine internal buffer to/from an energy container item placed in that slot. The fill/drain behavior is determined by the "mode" property of the item component : * "input" will transfer the energy from the item to the machine buffer. * "output" will transfer the energy from the machine buffer to the item. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/energy#id) ID Copy "type": "custommachinery:item_energy" ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/energy#accepted-items) Accepted items Any energy container items (most mods cells or batteries) that match the filter defined in the item component "whitelist" and "blacklist" properties. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/energy#example) Example A simple energy slot that transfer the energy from the item to the machine internal buffer : Copy { "type": "custommachinery:item_energy", "id": "energyInput", "mode": "input" } [PreviousFluidchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/fluid) [NextFilterchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/filter) Last updated 1 year ago * [ID](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/energy#id) * [Accepted items](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/energy#accepted-items) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/energy#example) sun-brightdesktopmoon sun-brightdesktopmoon --- # PNC Heat component (PNC) | Custom Machinery 1.21 circle-exclamation This component requires [Custom Machinery Pneumaticcraftarrow-up-right](https://www.curseforge.com/minecraft/mc-mods/custom-machinery-pneumaticcraft) to be installed. This is the component that let your machine interact with the Pneumaticcraft heat system, it is also compatible with any mods that make use of Pneumaticcraft heat. circle-exclamation Heat component is defined as a **unique** machine component, meaning that you can only have 1 per machine. If you try to define more than 1 heat component only the first will be used. The heat component make use of the Config property (same as items, fluid, energy, gas etc...) to configure which sides of the machine can transfer heat. By default all sides of the machine will be in `enabled` mode. Heat component is defined with `"type": "custommachinery:pnc_heat"` in the json. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pnc-heat-component-pnc#properties) Properties The heat component has only 1 mandatory property and 3 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pnc-heat-component-pnc#mandatory-properties) Mandatory properties Copy "type": "custommachinery:pnc_heat" //Mandatory to define a PNC heat component. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pnc-heat-component-pnc#optional-properties) Optional properties chevron-rightCapacity[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pnc-heat-component-pnc#capacity) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pnc-heat-component-pnc#name-capacity) Name : `capacity` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pnc-heat-component-pnc#description) Description : A positive double that represent the amount of heat the machine needs to store to heat 1°C Increasing that value means that the machine will need more heat to heat, and also will takes more time to cool down. Most of Pneumaticcraft machines use **100** here. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pnc-heat-component-pnc#default-1) Default : 1 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pnc-heat-component-pnc#example) Example : Copy "capacity": 100 //The machine heat capacity will be 100 chevron-rightResistance[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pnc-heat-component-pnc#resistance) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pnc-heat-component-pnc#name-resistance) Name : `resistance` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pnc-heat-component-pnc#description-1) Description : A positive double, here is the description of what it does (copied from PNC code): `The higher the thermal resistance, the slower the heat disperses. The effective resistance is the sum of this resistance plus the neighbour's resistance; if both exchangers have a resistance of 1, heat will equalize in a single tick under normal circumstances.` In PNC the refinery and etching tanks use **10**. The advanced compressor use **200**. Machine that needs to transmit their heat instantly, like the vortex tube use **0.01**. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pnc-heat-component-pnc#default-1-1) Default : 1 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pnc-heat-component-pnc#example-1) Example : The machine resistance will be 10. Copy "resistance": 10 [Toggle Configchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/misc/toggle-config) ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pnc-heat-component-pnc#example-2) Example The most basic PNC heat component : A heat component that will allow transfer heat on all sides but front : [PreviousFilterchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/filter) [NextPressure component (PNC)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pressure-component-pnc) Last updated 7 months ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pnc-heat-component-pnc#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pnc-heat-component-pnc#example-2) sun-brightdesktopmoon Copy { "type": "custommachinery:pnc_heat" } Copy { "type": "custommachinery:pnc_heat", "config": { "default": "enabled", "front": "disabled" } } sun-brightdesktopmoon --- # Fluid | Custom Machinery 1.21 Use this variant to make the slot able to fill/drain fluid from one or many machine's internal tanks to/from a tank item (including buckets) placed in that slot. The fill/drain behavior is determined by the "mode" property of the item component : * "input" will drain the fluid container item content to the machine internal tank. * "output" will fill the fluid container item from the machine internal tank. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/fluid#id) ID Copy "type": "custommachinery:item_fluid" ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/fluid#optional-property) Optional property A `"tanks"` property can be specified directly inside the item component json. This property can define a tank id or an array of tank id that the item can be filled/drained from/to. The id of the tanks must be the same as defined in the [fluid component "id" property](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#name-id) . If the `"tanks"` property is not specified the item will be filled/drained from/to all the machine internal tanks. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/fluid#accepted-items) Accepted items Any fluid container items (including buckets) that match the filter defined in the item component "whitelist" and "blacklist" properties. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/fluid#example) Example A simple fluid slot that transfer the fluid from the item to the machine internal tank : A fluid slot that transfer the fluid from the machine internal tank with id "water" to the item : [PreviousResultchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/result) [NextEnergychevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/energy) Last updated 1 year ago * [ID](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/fluid#id) * [Optional property](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/fluid#optional-property) * [Accepted items](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/fluid#accepted-items) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/fluid#example) sun-brightdesktopmoon Copy { "type": "custommachinery:item_fluid", "id": "fluidInput", "mode": "input", } Copy { "type": "custommachinery:item_fluid", "id": "fluidOutput", "mode": "output", "tanks": "water" } sun-brightdesktopmoon --- # Result | Custom Machinery 1.21 Use this variant to make a craft recipe result slot. A machine using the [craft processor](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/craft) to process [craft recipes](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe) must have at least one result slot. When a craft recipe is processed its result item will appear in the result slot, and the player will be able to take it like in any crafting table. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/result#id) ID Copy "type": "custommachinery:item_result" ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/result#accepted-items) Accepted items No items can be put in that slot, hoppers/pipes can't interact with it either. Only a player can take the item outside this slot to process a craft recipe. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/result#example) Example A simple result slot : Copy { "type": "custommachinery:item_result", "id": "result" } [PreviousUpgradechevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/upgrade) [NextFluidchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/fluid) Last updated 1 year ago * [ID](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/result#id) * [Accepted items](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/result#accepted-items) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/result#example) sun-brightdesktopmoon sun-brightdesktopmoon --- # KubeJS | Custom Machinery 1.21 Custom machinery include complete [KubeJSarrow-up-right](https://www.curseforge.com/minecraft/mc-mods/kubejs) integration for creating machine recipes and upgrades using JS scripts. [Recipeschevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes) [Upgradeschevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/upgrades) [PreviousUpgradeschevron-left](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/upgrades) [NextCustom Block/Itemchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/custom-block-item) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Redstone component | Custom Machinery 1.21 Redstone component let you interact with the vanilla redstone logic system. It doesn't store anything on the machine, instead it can be used to define the redstone behavior of the machine. This component is fully optional, if not added the machine won't react or emit redstone signal. circle-exclamation Redstone component is defined as a **unique** machine component, meaning that you can only have 1 per machine. If you try to add more than 1 redstone component only the last will be used. circle-info Use the `config` property to specify which sides will input or output redstone signal. Redstone component is defined with `"type": "custommachinery:redstone"` in the machine json. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#properties) Properties The redstone component has 1 mandatory property and 7 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#mandatory-property) Mandatory property Copy "type": "custommachinery:redstone" //Mandatory to define a redstone component. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#optional-property) Optional property chevron-rightPower to pause[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#power-to-pause) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#name-powertopause) Name : `powertopause` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#description) Description : Define the redstone signal power needed to pause the machine. Put a number greater than 15 if you want the machine to never pause on redstone signal (since vanilla max redstone power is 15). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#default-1) Default : 1 The machine will pause at any redstone signal. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#example) Example : The machine will pause if a redstone signal of 5 or more is applied to it. Copy "powertopause": 5 chevron-rightCrafting power output[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#crafting-power-output) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#name-craftingpoweroutput) Name : `craftingpoweroutput` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#description-1) Description : Define the redstone signal power emitted when the machine is processing a recipe. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#default-0) Default : 0 The machine never emit redstone signal. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#example-1) Example : The machine will emit a redstone signal of 15 when processing. Copy "craftingpoweroutput": 15 chevron-rightIdle power output[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#idle-power-output) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#name-idlepoweroutput) Name : `idlepoweroutput` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#description-2) Description : Define the redstone signal power emitted when the machine is idle. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#default-0-1) Default : 0 The machine never emit redstone signal. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#example-2) Example : The machine will emit a redstone signal of 15 when idle. chevron-rightErrored power output[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#errored-power-output) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#name-erroredpoweroutput) Name : `erroredpoweroutput` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#description-3) Description : Define the redstone signal power emitted when the machine is errored. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#default-0-2) Default : 0 The machine never emit redstone signal. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#example-3) Example : The machine will emit a redstone signal of 15 when errored. chevron-rightComparator input type[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#comparator-input-type) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#name-comparatorinputtype) Name : `comparatorinputtype` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#description-4) Description : A component type that will be used to determine the redstone signal emitted by a vanilla comparator. All currently supported component types are : * `custommachinery:item` Will output a signal corresponding to the item in it's slot, the same way the vanilla chest does. * `custommachinery:fluid` Will output a signal corresponding to the amount of fluid in it's tank, 0 empty, 15 full, 8 half... * `custommachinery:energy` Will output a signal corresponding to the amount of energy in it's buffer, 0 empty, 15 full, 8 half... #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#default-custommachinery-energy) Default : `custommachinery:energy` The comparator will output a redstone signal based on the machine energy buffer (if present), or 0 if the machine doesn't have an energy component. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#example-4) Example : The comparator will output a redstone signal based on one of the machine internal fluid tank. Define the used fluid tank with the `comparatorinputid` property. chevron-rightComparator input id[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#comparator-input-id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#name-comparatorinputid) Name : `comparatorinputid` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#description-5) Description : Used with the `comparatorinputtype` property, define which component will be used in case of the component type specified is not single (so for items and fluid). The id provided must be the same than the id defined in the component json. If no component can be found for this type and with this id, the comparator will output a redstone signal of 0. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#default-nothing) Default : nothing #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#example-5) Example : The comparator will search for a component of the type defined in the `comparatorinputtype` property and with the id `input` and if found, will output a redstone signal based on this component. [I/O Configchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/misc/i-o-config) ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#example-6) Example A redstone component that will make the machine : * Output a redstone signal of 0 when idle * Output a redstone signal of 7 when crafting * Output a redstone signal of 14 when errored * Pause when a redstone signal of 15 is received * Nearby comparators will output a signal based on an item in a slot with id "input" [PreviousPressure component (PNC)chevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pressure-component-pnc) [NextMachine GUIchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui) Last updated 1 year ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component#example-6) sun-brightdesktopmoon Copy "idlepoweroutput": 15 Copy "erroredpoweroutput": 15 Copy "comparatorinputtype": "custommachinery:fluid" Copy "comparatorinputid": "input" Copy { "type": "custommachinery:redstone", "powertopause": 15, "craftingpoweroutput": 7, "erroredpoweroutput": 14, "comparatorinputtype": "custommachinery:item", "comparatorinputid": "input" } sun-brightdesktopmoon --- # Filter | Custom Machinery 1.21 A filter slot is a slot that can be set to a specific item by clicking on it with the item. The items won't be placed in the slot and will remain in the player inventory, instead the slot will display a ghost (transparent) version of the item. Clicking the slot with an empty mouse cursor will clear it. The "mode" property of a filter item component doesn't matter. circle-info To make a recipe requires the filter slot to be set to a specific item use an [Item filter](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/item-filter) requirement. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/filter#id) ID Copy "type": "custommachinery:item_filter" ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/filter#accepted-items) Accepted items Any items that match the filter defined in the item component "whitelist" and "blacklist" properties. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/filter#example) Example Copy { "type": "custommachinery:item_filter", "id": "filter1" } [PreviousEnergychevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/energy) [NextPNC Heat component (PNC)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pnc-heat-component-pnc) Last updated 1 year ago * [ID](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/filter#id) * [Accepted items](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/filter#accepted-items) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/filter#example) sun-brightdesktopmoon sun-brightdesktopmoon --- # Crafttweaker (deprecated) | Custom Machinery 1.21 Custom machinery include complete [Crafttweakerarrow-up-right](https://www.curseforge.com/minecraft/mc-mods/crafttweaker) integration for creating machine recipes and upgrades using CT scripts. [Recipeschevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes) [Upgradeschevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/upgrades) [PreviousComponent modifierschevron-left](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers) [NextRecipeschevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes) sun-brightdesktopmoon sun-brightdesktopmoon --- # Craft recipe | Custom Machinery 1.21 ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#description) Description Custom craft recipes can be used to make the machine behave like a crafting table. The machine must have one Item Component with `"type": "custommachinery:item_result"`. When all requirements checks, like time, weather, biome etc... are passed, the output item will appear in the result slot. When the output item is taken out of the result slot by a player (this can't be automated) all requirements are processed, i.e. energy/fluid/items are consumed etc... circle-exclamation All "per\_tick" requirements can't be used with this recipe type. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#location) Location Custom craft recipe jsons must be located in `(my_datapack)/data/(namespace)/recipe/` (the same place as the vanilla recipes). The (namespace) is a folder that can have any name, but must be all lowercase without spaces or special characters. The machine name must be all lowercase with no spaces or any other characters than letters and numbers but you can use "\_" or "/". The file must be a .json file. Example : `my_datapack/data/namespace/recipe/my_recipe.json` Each recipes loaded in the game must have a different ID, in the example above the recipe Id is : namespace:my\_recipe You can put any number of recipes under the same namespace or separate them. You can also use subfolders like : `(my_datapack)/data/(namespace)/recipe/machine1/my_recipe.json` so the recipe ID will be `namespace:machine1/my_recipe` Just remember that all the recipe json should be under the recipes folder. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#properties) Properties The recipe json has 3 mandatory properties and 5 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#mandatory-properties) Mandatory properties chevron-rightMachine[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#machine) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#name-machine) Name : `machine` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#description-1) Description : The machine this recipe is for. You can set only one machine here so if you want the same recipe to work for different machines you must write the recipe for each machine and change this property. **You must use here the Machine ID and not the machine name.** If the machine ID is wrong or the machine doesn't exist the recipe will still load but it will be unusable in-game. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#example) Example : This recipe will be set for the machine with ID "namespace:my\_machine". Reminder : "namespace:my\_machine" is the machine located in `(datapack)/data/namespace/machines/my_machine.json` chevron-rightOutput[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#output) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#name-output) Name : `output` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#description-2) Description : The item that will be output by this recipe. This can just be the id of the item to output, or an object with both the `id` and the `Count` of items to craft. A `tag` property can also be added to define the nbt of the output item. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#example-1) Example : The recipe will output 1 vanilla diamond. The recipe will output 4 vanilla gold ingots. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#optional-properties) Optional properties [Requirementschevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements) chevron-rightJei[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#jei) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#name-jei) Name : `jei` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#description-3) Description : An array of Requirements. The requirements are specified exactly as in the `requirements` property above. Requirements specified here will not be processed by the machine, they will just display in the jei recipe. **The requirements specified here will override the requirements specified in the "requirements" property, so if this property is specified only its requirements will show in jei**. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#default-empty) Default : `empty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#example-2) Example : Define 2 recipe requirements that won't be processed by the recipe, but will be the only 2 shown in the jei recipe gui. chevron-rightPriority[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#priority) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#name-priority) Name : `priority` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#description-4) Description : An integer between -2147483648 and 2147483647 that define which recipe will be used by the machine if several recipes pass all requirement checks. The recipe with the highest priority will be used. If several recipes pass the requirement checks and have the same priority the first loaded recipe will be used, this depends of the datapack order and can be a bit random so if you want to be sure of which recipe will be used first you must use the priority property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#default-0) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#example-3) Example : This recipe will be loaded before any recipe with a priority < 1000. chevron-rightJei priority[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#jei-priority) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#name-jeipriority) Name : `jeiPriority` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#description-5) Description : An integer between -2147483648 and 2147483647 that define which recipe will show first in jei, recipes with higher values will show before recipes with lower values. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#default-0-1) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#example-4) Example : This recipe will show in jei before any recipes with a priority < 1000. chevron-rightHidden[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#hidden) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#name-hidden) Name : `hidden` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#description-6) Description : If true the recipe will be hidden in JEI recipe gui. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#default-false) Default : `false` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#example-5) Example : The recipe will be hidden in JEI : ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#template) Template A default recipe template with all properties specified : ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#example-6) Example A recipe that takes 64 coals and 1000FE and output a diamond : [PreviousMachine recipechevron-left](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe) [NextRequirementschevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements) Last updated 1 year ago * [Description](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#description) * [Location](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#location) * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#properties) * [Template](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#template) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe#example-6) sun-brightdesktopmoon Copy "type": "custommachinery:custom_craft" //Mandatory for defining a custom craft recipe. Copy "machine": "namespace:my_machine" Copy "output": "minecraft:diamond" Copy "output": { "id": "minecraft:gold_ingot", "Count": 4 } Copy "jei": [\ {\ "type": "requirement1",\ "mode": "input"\ },\ {\ "type": "requirement2",\ "mode": "output"\ }\ ] Copy "priority": 1000 Copy "jeiPriority": 1000 Copy "hidden": true Copy { "type": "custommachinery:custom_craft", "machine": "namespace:my_machine", "output": "item_id", "requirements": [], "jei": [], "priority": 1000, "jeiPriority": 1000 } Copy { "type": "custommachinery:custom_craft", "machine": "custommachinery:my_machine", "output": "minecraft:diamond", "requirements": [\ {\ "type": "custommachinery:item",\ "mode": "input",\ "item": "minecraft:coal",\ "amount": 64\ },\ {\ "type": "custommachinery:energy",\ "mode": "input",\ "amount": 1000\ }] } sun-brightdesktopmoon --- # Fuel | Custom Machinery 1.21 Use this item component variant to make the slot a fuel slot. A fuel slot will burn the items inside it to process recipes that have a [Fuel requirement](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/fuel) . circle-exclamation The ["mode"](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#name-mode) property of an item component with fuel variant must be `"input"` or `"both"` to let the player place fuel items inside the slot. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/fuel#id) ID Copy "type": "custommachinery:item_fuel" ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/fuel#accepted-items) Accepted items Any item that have a burn time (like wood and coal) and match the filter defined in the item component "whitelist" and "blacklist" properties. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/fuel#example) Example A simple fuel slot : Copy { "type": "custommachinery:item_fuel", "id": "fuel", "mode": "input" } [PreviousItem componentchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component) [NextUpgradechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/upgrade) Last updated 1 year ago * [ID](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/fuel#id) * [Accepted items](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/fuel#accepted-items) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/fuel#example) sun-brightdesktopmoon sun-brightdesktopmoon --- # Machine GUI | Custom Machinery 1.21 The Machine GUI is the main tool to interact with the machine in-world. It will be used to display the current status of the machine as well as the different components and their contents. A machine GUI is not mandatory, if you don't want it just don't put it in the machine json. A Machine GUI is composed of various GUI Elements, there is no limit of how many elements you can put. The Machine GUI and it's Elements must be defined as such in the machine json : Copy "gui": [\ {\ //Element 1\ },\ {\ //Element 2\ }\ ] circle-info By default the machine gui has no background, to change that and/or change the size of the gui see the [background element](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element) wiki page. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui#gui-elements) GUI Elements There are currently 17 available GUI elements : [Background elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element) [Bar elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element) [Button elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element) [Config elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element) [Dump elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element) [Empty elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/empty-element) [Energy elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element) [Experience elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element) [Fluid elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element) [Fuel elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element) [Player inventory elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element) [Progress bar elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element) [Reset elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element) [Split elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element) [Slot elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element) [Status elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element) [Text elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element) [Texture elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element) [PreviousRedstone componentchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/redstone-component) [NextBackground elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Machine recipe | Custom Machinery 1.21 Custom machine recipe jsons must be located in `(my_datapack)/data/(namespace)/recipe/` (the same place as the vanilla recipes). The (namespace) is a folder that can have any name, but must be all lowercase without spaces or special characters. The machine name must be all lowercase with no spaces or any other characters than letters and numbers but you can use "\_" or "/". The file must be a .json file. Example : `my_datapack/data/namespace/recipe/my_recipe.json` Each recipes loaded in the game must have a different ID, in the example above the recipe Id is : namespace:my\_recipe You can put any number of recipes under the same namespace or separate them. You can also use subfolders like : `(my_datapack)/data/(namespace)/recipe/machine1/my_recipe.json` so the recipe ID will be `namespace:machine1/my_recipe` Just remember that all the recipe json should be under the recipes folder. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#recipe-properties) Recipe properties The recipe json has 3 mandatory properties and 10 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#mandatory-properties) Mandatory properties Copy "type": "custommachinery:custom_machine" //Mandatory for defining a custom machine recipe. chevron-rightMachine[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#machine) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#name-machine) Name : `machine` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#description) Description : The machine this recipe is for. You can set only one machine here so if you want the same recipe to work for different machines you must write the recipe for each machine and change this property. **You must use here the Machine ID and not the machine name.** If the machine ID is wrong or the machine doesn't exist the recipe will still load but it will be unusable in-game. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#example) Example : Copy "machine": "namespace:my_machine" This recipe will be set for the machine with ID "namespace:my\_machine". Reminder : "namespace:my\_machine" is the machine located in `(datapack)/data/namespace/machines/my_machine.json` chevron-rightTime[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#time) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#name-time) Name : `time` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#description-1) Description : A positive integer that define the duration of the recipe **in ticks**. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#example-1) Example : Copy "time": 200 The recipe will takes 10 seconds to be completed since there is 20 ticks in 1 second (if the server doesn't lag). Note : Increasing the recipe time will increase any per-ticks input costs and outputs. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#optional-properties) Optional properties [Requirementschevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements) chevron-rightJei[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#jei) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#name-jei) Name : `jei` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#description-2) Description : An array of Requirements. The requirements are specified exactly as in the `requirements` property above. Requirements specified here will not be processed by the machine, they will just display in the jei recipe. **The requirements specified here will override the requirements specified in the "requirements" property, so if this property is specified only its requirements will show in jei**. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#default-empty) Default : `empty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#example-2) Example : Define 2 recipe requirements that won't be processed by the recipe, but will be the only 2 shown in the jei recipe gui. chevron-rightPriority[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#priority) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#name-priority) Name : `priority` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#description-3) Description : An integer between -2147483648 and 2147483647 that define which recipe will be used by the machine if several recipes pass all requirement checks. The recipe with the highest priority will be used. If several recipes pass the requirement checks and have the same priority the first loaded recipe will be used, this depends of the datapack order and can be a bit random so if you want to be sure of which recipe will be used first you must use the priority property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#default-0) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#example-3) Example : This recipe will be loaded before any recipe with a priority < 1000. chevron-rightJei priority[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#jei-priority) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#name-jeipriority) Name : `jeiPriority` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#description-4) Description : An integer between -2147483648 and 2147483647 that define which recipe will show first in jei, recipes with higher values will show before recipes with lower values. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#default-0-1) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#example-4) Example : This recipe will show in jei before any recipes with a priority < 1000. chevron-rightError[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#error) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#name-error) Name : `error` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#description-5) Description : A boolean that determine whether the recipe will error, or reset the machine when a requirement of the recipe cannot be fulfilled. Note : When the machine reset its inventory remains the same but all already consumed inputs are lost. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#default-true) Default : `true` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#example-5) Example : The machine will be reset if any requirement error. chevron-rightHidden[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#hidden) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#name-hidden) Name : `hidden` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#description-6) Description : If true the recipe will be hidden in JEI recipe gui. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#default-false) Default : `false` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#example-6) Example : The recipe will be hidden in JEI : chevron-rightAppearance[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#appearance) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#name-appearance) Name : `appearance` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#description-7) Description : Allows to set a custom [Machine appearance](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance) , such as a block model, light, hardness... while this recipe is processing. All appearance properties specified here will override the default "running" properties specified in the machine json but only while this recipe is processing. Once the recipe process finish or is stopped the machine appearance will revert to its default values. This is only available for machine recipes and not craft recipes as their process is instantaneous. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#default) Default : No custom appearance specified, fallback to the "running" appearance specified in the machine json. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#example-7) Example : The machine will look like a bedrock block and be unbreakable while this recipe is processing : chevron-rightGui[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#gui) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#name-gui) Name : `gui` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#description-8) Description : Allows to set some recipe specific gui elements, this can be an array or a single element. Any gui element from CM and its addons can be used here. When a machine process this recipe, all gui elements defined here will be added to the machine gui. If a gui element defined here has the same id than another element defined in the machine json then it will replace it. It is impossible to remove a gui element defined in the machine json, but you can replace it with an [empty gui element](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/empty-element) instead. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#default-empty-1) Default : empty #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#example-8) Example : Change the position of a slot gui element with id "input1", and replace the gui element with id "texture" by an empty gui element : chevron-rightCores[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#cores) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#name-cores) Name : `cores` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#description-9) Description : A list of cores that can run this recipes, in case the machine processor for this machine has more than 1 core. If this list is empty the recipe will be able to run on any cores of the processor. Each core is defined by an integer, 1 being the first core and being the last core. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#default-empty-2) Default : `empty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#example-9) Example : The recipe will run only on the first core : chevron-rightSingle core[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#single-core) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#name-single_core) Name : `single_core` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#description-10) Description : A boolean value (true/false). If set to true the recipe will run only on one core of the machine processor at a time. The recipe will still run only on the cores specified using the "cores" property (see above) but only on 1 core at a time. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#default-false-1) Default : `false` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#example-10) Example : Make the recipe run on only 1 core at a time : ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#template) Template A default recipe template with all properties specified : ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#example-11) Example A recipe that takes a diamond and turn it into energy : circle-info See more recipe examples in the [test datapackarrow-up-right](https://github.com/Frinn38/Custom-Machinery/tree/1.21/test_datapack/data/custommachinery/recipe) . [PreviousCraftchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/craft) [NextCraft recipechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe) Last updated 1 year ago * [Recipe properties](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#recipe-properties) * [Template](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#template) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe#example-11) sun-brightdesktopmoon Copy "jei": [\ {\ "type": "requirement1",\ "mode": "input"\ },\ {\ "type": "requirement2",\ "mode": "output"\ }\ ] Copy "priority": 1000 Copy "jeiPriority": 1000 Copy "error": false Copy "hidden": true Copy "appearance": { "block": "bedrock", "hardness": -1 } Copy "gui": [\ {\ "type": "custommachinery:slot",\ "x": 10,\ "y": 10,\ "id": "input1"\ },\ {\ "type": "custommachinery:empty",\ "id": "texture"\ } \ ] Copy "cores": [1] Copy "single_core": true Copy { "type": "custommachinery:custom_machine", "machine": "namespace:my_machine", "time": 200, "requirements": [], "jei": [], "priority": 1000, "jeiPriority": 1000, "error": true, "hidden": false, "appearance": [], "gui": [], "cores": [], "single_core": false } Copy { "type": "custommachinery:custom_machine", "machine": "custommachinery:my_machine", "time": 1000, "requirements": [\ {\ "type": "custommachinery:item",\ "mode": "input",\ "item": "minecraft:diamond",\ "amount": 1\ },\ {\ "type": "custommachinery:energy",\ "mode": "output",\ "amount": 1000\ }] } sun-brightdesktopmoon --- # Fluid component | Custom Machinery 1.21 This is the component that will let your machine interact with the Forge Fluid system (like tanks, pipes and so). It is compatible with any other mods that use the same system (so about all of them) so any pipes will be able to pump fluids in and out of the machine. Basically adding this component to the machine json will add a fluid tank to the machine. circle-info You can add as much as you want fluid components to your machine. Each component will act as a separate fluid tank. Fluid component is defined with `"type": "custommachinery:fluid"` in the json. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#properties) Properties The fluid component has 3 mandatory properties and 9 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#mandatory-properties) Mandatory properties Copy "type": "custommachinery:fluid" //Mandatory to define a fluid component. chevron-rightCapacity[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#capacity) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#name-capacity) Name : `capacity` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#description) Description : A positive integer value that define the amount of fluid that can be stored in the tank (Volume in Forge mB, with 1000mB being 1 Bucket of fluid) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#example) Example : Copy "capacity": 10000 //This component will be able to store 10000mB. chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#desccription) Desccription : A string that define the id of the tank (used in the gui element and recipes), the String must be all lowercase with letters and numbers only (no spaces or special characters). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#example-1) Example : Copy "id": "tank1" #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#optional-properties) Optional properties chevron-rightMax input[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#max-input) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#name-maxinput) Name : `maxInput` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#description-1) Description : A positive integer that represent the max mB that can be input in the tank during a single tick. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#default) Default : The `capacity` of the tank. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#example-2) Example : chevron-rightMin input[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#min-input) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#name-mininput) Name : `minInput` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#description-2) Description : A positive integer that represent the min mB that can be input in the tank during a single tick. If something (a pipe or the machine's auto-input) try to insert less than the specified amount the transfer will fail and nothing will be inserted. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#default-0) Default : `0` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#example-3) Example : chevron-rightMax output[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#max-output) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#name-maxoutput) Name : `maxOutput` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#description-3) Description : A positive integer that represent the max mB that can be output from the tank during a single tick. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#default-1) Default : The `capacity` of the tank. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#example-4) Example : chevron-rightMin output[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#min-output) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#name-minoutput) Name : `minOutput` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#description-4) Description : A positive integer that represent the min mB that can be output from the tank during a single tick. If something (a pipe or the machine's auto-output) try to extract less than the specified amount the transfer will fail and nothing will be extracted. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#default-0-1) Default : `0` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#example-5) Example : chevron-rightWhitelist[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#whitelist) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#name-whitelist) Name : `whitelist` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#description-5) Description : A list of fluids that the tank can accept. The fluids must be referenced by their registry name like `minecraft:water` or `minecraft:lava`. By default the blacklist is empty so all fluids are accepted. You can also use tag here with the # prefix like `#c:water` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#default-2) Default : No filter, so all fluids are accepted by the tank. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#example-6) Example : chevron-rightBlacklist[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#blacklist) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#name-blacklist) Name : `blacklist` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#description-6) Description : A blacklist of fluids that the tank can't accept. The fluids must be referenced by their registry name like `minecraft:water` or `minecraft:lava`. By default the blacklist is empty so all fluids are accepted. You can also use tag here with the # prefix like `#c:water` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#default-3) Default : No filter, so all fluids are accepted by the tank. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#example-7) Example : chevron-rightMode[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#mode) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#name-mode) Name : `mode` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#description-7) Description : The IO mode of the tank, used only by recipes to know which tanks are inputs and outputs. Available modes are (input/output/both/none). While crafting the machine will search for fluids to consume in input tanks and put the recipe results in the output tanks. For changing I/O mode of a tank for external interaction, such as buckets and pipes see the [Config](https://frinn.gitbook.io/custom-machinery-1.21/misc/i-o-config) property below. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#default-both) Default : `both` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#example-8) Example : [I/O Configchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/misc/i-o-config) chevron-rightUnique[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#unique) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#name-unique) Name : `unique` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#description-8) Description : A boolean property (true/false) that define if the fluid component can accept a fluid that is already in another fluid component in the same machine. If the component is set as "unique" a player won't be able to insert a fluid that is already in another tank, even if that tank is full (basically prevent overfill). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#default-false) Default : `false` The fluid component won't care if the fluid is already in another tank. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#example-9) Example : The fluid component won't accept fluids that already are in another component. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#example-10) Example An example of Fluid Component that can store 10000mB of lava only, send 1000mB/tick and receive 666mB/tick. [PreviousExperience componentchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component) [NextHeat component (Mekanism)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism) Last updated 7 months ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#example-10) sun-brightdesktopmoon Copy "maxInput": 1000 //The machine can accept 1000mB/tick. Copy "minInput": 1000 //The machine will accept at least 1000mB/tick. Copy "maxOutput": 1000 //The machine can give 1000mB/tick. Copy "minOutput": 1000 //The machine will extract at least 1000mB/tick. Copy "whitelist": "#c:water" //The tank will accept all fluids that are not in the water tag. Copy "blacklist": "#c:water" //The tank will accept all fluids that are not in the vanilla water tag. Copy "mode": "input" //Set the tank as an input tank. Copy "unique": true Copy { "type": "custommachinery:fluid", "capacity": 10000, "id": "lavatank", "maxInput": 666, "maxOutput": 1000, "filter": ["minecraft:lava"], "whitelist": true } sun-brightdesktopmoon --- # Custom Block/Item | Custom Machinery 1.21 By default all machines share the same block (id: `custommachinery:custom_machine_block`) and the same item (id: `custommachinery:custom_machine_item`) and are differentiated by their NBT tag (like enchanted books for example). This can cause issue when some mod can't differentiate blocks/items by NBT (questing mods, guidebook, ponders...). However you can use [KubeJSarrow-up-right](https://www.curseforge.com/minecraft/mc-mods/kubejs) to create a custom block and custom item for the machine. circle-exclamation The following script MUST be put on the `startup_scripts` folder and be the same on both the server and the client. Copy //Subscribe to the block registry event. //No need to use the item registry event, the item will be created automatically. StartupEvents.registry('block', event => { //Syntax : event.create("namespace:block_id", "custommachinery:custom_machine").machine("namespace:machine_id) event.create("kubejs:stone_generator", "custommachinery:custom_machine").machine("custommachinery:stone_generator") //If the block id is the same than the machine id you don't have to use .machine() event.create("custommachinery:power_crusher", "custommachinery:custom_machine") //Add .occlude() to make the machine block full opaque (block light) //This may cause rendering issues event.create("custommachinery:power_crusher", "custommachinery:custom_machine").occlude() }) [PreviousKubeJSchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs) [NextRecipeschevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes) Last updated 5 months ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Upgrades | Custom Machinery 1.21 Custom Machine upgrades can be made with Crafttweaker. Create a .zs file in the script folder (ex: custom\_machine\_upgrades.zs) and look at the example below to see all the available methods to create a Custom Machine upgrade with Crafttweaker. If you're not familiar about custom machine upgrades see [the wiki pagearrow-up-right](https://github.com/Frinn38/Custom-Machinery/wiki/Machine-Upgrade-Items) . ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/upgrades#creating-custom-machine-upgrade-with-crafttweaker) Creating custom machine upgrade with Crafttweaker Copy //Create the upgrade builder and give it the item that will act as upgrade and the max amount of this upgrade that can be used in a machine. mods.custommachinery.CMUpgradeBuilder.create(Item item) //If maxAmount is not specified the default is 64. mods.custommachinery.CMUpgradeBuilder.create(Item item, int maxAmount) //Add a machine or a list of machines that will accept this upgrade, //the machine ID must be "namespace:id" like "custommachinery:my_machine" if the json is located in (my_datapack)/data/custommachinery/machines/my_machine.json .machine(String... machineID) //You can add a custom tooltip to the machine upgrade item. .tooltip(String... tooltips) //Use component for more formatting options, //See https://docs.blamejared.com/1.18/en/vanilla/api/text/Component .tooltip(Component... tooltips) //Add a modifier to this upgrade. //See below for modifier syntax. .modifier(CMRecipeModifierBuilder modifier) //Finish (don't forget the semicolon ';') .build(); ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/upgrades#making-a-modifier) Making a modifier See below the various methods used to build a recipe modifier and pass it to the upgrade. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/upgrades#zenscript-syntax) Zenscript syntax circle-info Find all requirement types and targets that can be modified [here](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#list-of-properties-that-can-be-modified) . * If not specified the target will be empty and the chance will be 1.0 * CTRequirementType is specified with: `` ex: `` ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/upgrades#example) Example A gold ingot put inside the Power Crusher will double it's energy consumption with a maximum of 1000FE but also half its duration time with a minimum of 100 ticks. [PreviousStructurechevron-left](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/structure) [NextKubeJSchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs) * [Creating custom machine upgrade with Crafttweaker](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/upgrades#creating-custom-machine-upgrade-with-crafttweaker) * [Making a modifier](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/upgrades#making-a-modifier) * [Zenscript syntax](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/upgrades#zenscript-syntax) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/upgrades#example) sun-brightdesktopmoon Copy //Import the modifier builder class as a constant for convenience. import mods.custommachinery.CMRecipeModifierBuilder as Builder; //Create a modifier that add/multiply a value to any input/output requirement of the specified type. //requirement must be specified using brackets : //Value can be any numerical value. //Pick one of the 6 methods below : Builder.addInput(requirement, value) Builder.mulInput(requirement, value) Builder.expInput(requirement, value) Builder.addOutput(requirement, value) Builder.mulOutput(requirement, value) Builder.expOutput(requirement, value) //All methods below are optional //Specify a target, in case the requirement have several values that can be modified. //Only 1 target can be defined for a modifier, default is none. .target(String target) //Specify a chance for this modifier to be applied. //Must be a value between 0 and 1, 0 is never applied and 1 is 100% chance to be applied. //Default is 1. .chance(double chance) //Specify the maximum value that can be obtained after applying this modifier. //It can be any numerical value. //Default is POSITIVE_INFINITY. .max(double max) //Specify the minimum value that can be obtained after applying this modifier. //It can be any numerical value. //Default is NEGATIVE_INFINITY. .min(double max) //Change the tooltip displayed when holding shift while hovering the upgrade item. //Default : a short string that describe the effect of this modifier. .tooltip(String tooltip) //Use a component for more formating options. .tooltip(Component tooltip) Copy import mods.custommachinery.CMRecipeModifierBuilder as Builder; mods.custommachinery.CMUpgradeBuilder.create() .machine("custommachinery:power_crusher") .modifier(Builder.mulInput(, 2).max(1000)) .modifier(Builder.mulInput(, 0.5).min(100)) .build(); sun-brightdesktopmoon --- # Chemical component (Mekanism) | Custom Machinery 1.21 circle-exclamation This component requires [Custom Machinery Mekanismarrow-up-right](https://www.curseforge.com/minecraft/mc-mods/custom-machinery-mekanism) to be installed. This components is used to make the machine able to hold Mekanism chemicals. It is compatible with Mekanism pressurized pipes and any other mods that use the same system. Basically adding this component to the machine json will add a chemical tank to the machine. circle-info You can add as much as you want chemical components to your machine. Each component will act as a separate chemical tank. circle-info Starting from 1.21.1 all 4 Mekanism chemicals (gas, infusion, slurry and pigment) are now merged into a single "chemical" type. Chemical component is defined with `"type": "custommachinery:chemical"` in the json. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#properties) Properties The chemical component has 3 mandatory properties and 10 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#mandatory-properties) Mandatory properties Copy "type": "custommachinery:chemical" //Mandatory to define a chemical component. chevron-rightCapacity[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#capacity) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#name-capacity) Name : `capacity` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#description) Description : A positive integer value that define the amount of chemical that can be stored in the tank (Volume in Forge mB, with 1000mB being 1 Bucket) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#example) Example : Copy "capacity": 10000 //This component will be able to store 10000mB. chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#desccription) Desccription : A string that define the id of the tank (used in the gui element and recipes), the String must be all lowercase with letters and numbers only (no spaces or special characters). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#example-1) Example : Copy "id": "tank1" #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#optional-properties) Optional properties chevron-rightMax input[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#max-input) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#name-maxinput) Name : `maxInput` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#description-1) Description : A positive integer that represent the max mB that can be input in the tank during a single tick. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#default) Default : The `capacity` of the tank. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#example-2) Example : chevron-rightMin input[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#min-input) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#name-mininput) Name : `minInput` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#description-2) Description : A positive integer that represent the min mB that can be input in the tank during a single tick. If something (a pipe or the machine's auto-input) try to insert less than the specified amount the transfer will fail and nothing will be inserted. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#default-0) Default : `0` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#example-3) Example : chevron-rightMax output[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#max-output) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#name-maxoutput) Name : `maxOutput` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#description-3) Description : A positive integer that represent the max mB that can be output from the tank during a single tick. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#default-1) Default : The `capacity` of the tank. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#example-4) Example : chevron-rightMin output[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#min-output) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#name-minoutput) Name : `minOutput` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#description-4) Description : A positive integer that represent the min mB that can be output from the tank during a single tick. If something (a pipe or the machine's auto-output) try to extract less than the specified amount the transfer will fail and nothing will be extracted. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#default-0-1) Default : `0` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#example-5) Example : chevron-rightWhitelist[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#whitelist) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#name-whitelist) Name : `whitelist` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#description-5) Description : A list of chemicals that the component can accept. The chemicals must be referenced by their registry name like `mekanism:steam` or `mekanism:redstone`. You can also use a tag here using the # prefix like `#mekanism:dirty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#default-empty) Default : empty All chemicals are accepted by the component. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#example-6) Example : The component will accept only steam gas and chemicals in the mekanism:dirty tag. Note : The blacklist (see below) takes priority over the whitelist. If a chemical is in both the blacklist and whitelist it won't be accepted by the component. chevron-rightBlacklist[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#blacklist) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#name-blacklist) Name : `blacklist` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#description-6) Description : A blacklist of chemicals that the component can't accept. The chemicals must be referenced by their registry name like `mekanism:steam` or `mekanism:redstone`. You can also use a tag here using the # prefix like `#mekanism:dirty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#default-empty-1) Default : empty All chemicals are accepted by the component. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#example-7) Example : The slot will accept all chemicals but steam gas and chemicals in the mekanism:dirty tag. Note : The blacklist takes priority over the whitelist (see above). If a chemical is in both the blacklist and whitelist it won't be accepted by the component. chevron-rightMode[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#mode) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#name-mode) Name : `mode` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#description-7) Description : The IO mode of the tank, used only by recipes to know which tanks are inputs and outputs. Available modes are (input/output/both/none). While crafting the machine will search for chemicals to consume in input tanks and put the recipe results in the output tanks. For changing I/O mode of a tank for external interaction, such as buckets and pipes see the [Config](https://frinn.gitbook.io/custom-machinery-1.21/misc/i-o-config) property below. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#default-both) Default : `both` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#example-8) Example : [I/O Configchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/misc/i-o-config) chevron-rightUnique[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#unique) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#name-unique) Name : `unique` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#description-8) Description : A boolean property (true/false) that define if the chemical component can accept a chemical that is already in another chemical component in the same machine. If the component is set as "unique" a player won't be able to insert a chemical that is already in another tank, even if that tank is full (basically prevent overfill). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#default-false) Default : `false` The chemical component won't care if the fluid is already in another tank. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#example-9) Example : The chemical component won't accept chemical that already are in another component. chevron-rightRadiations[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#radiations) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#name-radiations) Name : `radiations` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#description-9) Description : A boolean property (true/false) that define if the chemical component will emit radiations when the machine is broken. If set to true, radiations will be emitted when the machine is broken only if that chemical component contains a radioactive chemical. The amount of radiations released depends of the chemical and the amount stored. It works the same as when a Mekanism tank/pipe/machine is broken while containing radioactive chemicals. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#default-false-1) Default : `false` The radioactive chemicals will be voided without releasing radiations. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#example-10) Example : ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#example-11) Example An example of gas chemical component that can store 10000mB of sulfuric acid only, send 1000mB/tick and receive 666mB/tick. [PreviousMachine componentschevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components) [NextChunkload componentchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chunkload-component) Last updated 5 months ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism#example-11) sun-brightdesktopmoon Copy "maxInput": 1000 //The machine can accept 1000mB/tick. Copy "minInput": 1000 //The machine will accept at least 1000mB/tick. Copy "maxOutput": 1000 //The machine can give 1000mB/tick. Copy "minOutput": 1000 //The machine will extract at least 1000mB/tick. Copy "whitelist": ["mekanism:steam", "#mekanism:dirty"] Copy "blacklist": ["mekanism:steam", "#mekanism:dirty"] Copy "mode": "input" //Set the tank as an input tank. Copy "unique": true Copy "radiations": true Copy { "type": "custommachinery:chemical", "capacity": 10000, "id": "tank1", "maxInput": 666, "maxOutput": 1000, "whitelist": "mekanism:sulfuric_acid" } sun-brightdesktopmoon --- # Crafting your machine | Custom Machinery 1.21 All the machines share the same item, with Id : `custommachinery:custom_machine_item` the machine the item will be linked to is defined with an item component (new system from Minecraft 1.21 that replace old nbt system). The component id is `custommachinery:machine` and its value should be the machine id like: `custommachinery:power_crusher` (the namespace should always be included). Vanilla json recipes, KubeJS have different ways to handle items components so I will put an example of each below. The recipe will be: ![recipe](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2Fgithub.com%2FFrinn38%2FCustom-Machinery%2Fraw%2F1.16.5%2Fwiki%2Fmachine_recipe.png&width=300&dpr=3&quality=100&sign=1458ffb2&sv=2) Forge json KubeJS script recipe.json Copy { "type": "minecraft:crafting_shaped", "pattern": [\ "xxx",\ "x x",\ "xxx"\ ], "key": { "x": { "item": "minecraft:diamond" } }, "result": { "id": "custommachinery:custom_machine_item", "count": 1, "components": {"custommachinery:machine":"custommachinery:power_crusher"} } } [PreviousToggle Configchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/misc/toggle-config) [NextDatapackchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/misc/datapack) Last updated 1 year ago sun-brightdesktopmoon script.js Copy ServerEvents.recipes(event => { event.shaped('custommachinery:custom_machine_item[custommachinery:machine="custommachinery:tester"]'), [\ 'DDD',\ 'D D',\ 'DDD'\ ], { 'D': 'minecraft:diamond' }) }) sun-brightdesktopmoon --- # Item component | Custom Machinery 1.21 This is the component that let your machine interact with items, basically it add an inventory to your machine. Each Item Component add 1 slot to the machine inventory and each slot can held 1 stack of item but you can add as many components as you want. circle-info You can add as much item component as you want. Item Component can have different types depending on the desired behaviour. The type for a default item component is: `"type": "custommachinery:item"` Here is a list of all available item component types with their dedicated wiki pages : * [`custommachinery:item_fluid`](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/fluid) * [`custommachinery:item_energy`](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/energy) * [`custommachinery:item_upgrade`](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/upgrade) * [`custommachinery:item_result`](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/result) * [`custommachinery:item_fuel`](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/fuel) * [`custommachinery:item_filter`](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/filter) ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#properties) Properties The item component has 2 mandatory properties and 6 optional properties. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#mandatory-properties) Mandatory properties Copy "type": "custommachinery:item" //Mandatory to define an item component. chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#description) Description : A string that define the id of the slot (used in gui element and recipes), the string must be all lowercase with letters and numbers only (no spaces or special characters). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#example) Example : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#optional-properties) Optional properties chevron-rightCapacity[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#capacity) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#name-capacity) Name : `capacity` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#description-1) Description : A positive integer value that define the maximum number of item that you can put in the slot. This does not override the item stack size (if you set the slot capacity to 100 items will still stack by 64 or less). This is used to decrease the available stack size, not increase it. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#default-64) Default : 64 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#example-1) Example : chevron-rightWhitelist[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#whitelist) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#name-whitelist) Name : `whitelist` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#description-2) Description : A list of items that the slot can accept. The items must be referenced by their registry name like `minecraft:diamond` or minecraft:stone. You can also use a tag here using the # prefix like `#minecraft:logs` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#default-empty) Default : empty All items are accepted by the slot. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#example-2) Example : The slot will accept only Minecraft diamond and items in the minecraft:logs tag. Note : The blacklist (see below) takes priority over the whitelist. If an item is in both the blacklist and whitelist it won't be accepted by the slot. chevron-rightBlacklist[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#blacklist) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#name-blacklist) Name : `blacklist` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#description-3) Description : A blacklist of items that the slot can't accept. The items must be referenced by their registry name like `minecraft:diamond` or minecraft:stone. You can also use a tag here using the # prefix like `#minecraft:logs` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#default-empty-1) Default : empty All items are accepted by the slot. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#example-3) Example : The slot will accept all items but Minecraft diamond and items in the minecraft:logs tag. Note : The blacklist takes priority over the whitelist (see above). If an item is in both the blacklist and whitelist it won't be accepted by the slot. chevron-rightMode[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#mode) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#name-mode) Name : `mode` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#description-4) Description : The IO mode of the slot, used only by recipes to know which slots are inputs and outputs. Available modes are (input/output/both/none). While crafting the machine will search for items to consume in input slots and put the recipe results in the output slots. For changing I/O mode of a slot for external interaction, such as hoppers and pipes see the [Config](https://frinn.gitbook.io/custom-machinery-1.21/misc/i-o-config) property below. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#default-both) Default : `both` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#example-4) Example : [I/O Configchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/misc/i-o-config) chevron-rightLocked[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#locked) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#name-locked) Name : `locked` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#description-5) Description : A boolean value, if true the player won't be able to place and remove items from this slot. Recipes and hoppers/pipes will still be able to place/remove items from this component (as long as they match the filter, mode and config properties). The locking of a slot can be changed using KubeJS or Crafttweaker integration. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#default-false) Default : `false` The player will be able to place items in the slot. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#example-5) Example : The player won't be able to place or remove items from the slot. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#example-6) Example A basic input slot A Fuel slot that will accept only coal and charcoal (for a furnace for example) [PreviousHeat component (Mekanism)chevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism) [NextFuelchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/fuel) Last updated 1 year ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#example-6) sun-brightdesktopmoon Copy "id": "slot1" Copy "capacity": 4 //Any item that will be put in the slot will have a maximum stack size of 4 items (or less if the item max stack size is less like tools and armors). Copy "whitelist": ["minecraft:diamond", "#minecraft:logs"] Copy "blacklist": ["minecraft:diamond", "#minecraft:logs"] Copy "mode": "input" //Set the slot as an input slot. Copy "locked": true Copy { "type": "custommachinery:item", "id": "input", "mode": "input" } Copy { "type": "custommachinery:item_fuel", "id": "fuel", "filter": ["minecraft:coal", "minecraft:charcoal"], "whitelist": true, "mode": "input" } sun-brightdesktopmoon --- # Text component | Custom Machinery 1.21 Text Components are used to display strings to the player, with more formatting options than a default string (color, bold, etc...) Custom Machinery use these components in various places such as the machine name or tooltips properties. circle-info The [Minecraft wikiarrow-up-right](https://minecraft.fandom.com/wiki/Raw_JSON_text_format#Java_Edition) have a full documentation of how to make text components using json. Be sure to follow the "Java edition" part. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component#available-properties) Available properties : * `text` (The text to display) * `bold` (true/false) * `italic` (true/false) * `underlined` (true/false) * `striketrough` (true/false) * `obfuscated` (true/false) * `color` ("colorID" or "#RRGGBB" hex format) * `font` (custom font id, minecraft only provide "minecraft:default") * `children` Not supported ! ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component#example) Example : Display `Hello !` in red and bold. Copy { "text": "Hello !", "bold": true, "color": "red" } [PreviousRequirement display infochevron-left](https://frinn.gitbook.io/custom-machinery-1.21/misc/requirement-display-info) * [Available properties :](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component#available-properties) * [Example :](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component#example) sun-brightdesktopmoon sun-brightdesktopmoon --- # Requirement display info | Custom Machinery 1.21 A requirement display info is a small icon that show up in jei recipe jei to provide the player various information about the recipe. The display info can use any item, texture or sprite and have a list of tooltips that will be displayed when the player hover it with its mouse cursor. Example : The [Structure requirement](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/structure) add by default a structure block icon with a tooltip indicating the list of required blocks to build the structure. ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2Fcontent.gitbook.com%2Fcontent%2FZznnGu8KvEhqjN3qmLqp%2Fblobs%2FnNOenj5skmta9ocyfwJa%2Fimage.png&width=300&dpr=3&quality=100&sign=fafe363&sv=2) You can override the default display info of any requirements, or create a new one for requirements that doesn't have a default one. A custom display info won't override the click behavior of a default display info, like the structure requirement that let you click on the icon to show the structure. circle-exclamation Each requirements can have only 1 display info. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/requirement-display-info#tooltip) Tooltip A display info can have a list of tooltips specified. If the requirement have a default tooltip it will be overriden. The tooltip is essentially a list of [Text components](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) . Each component in the list will be a new line in the tooltip. Copy "info": { "tooltips": [\ "Some tooltips",\ {"text": "Some tooltip in red", "color": "red"}\ ] } ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/requirement-display-info#icon) Icon There are 3 ways to define a display info icon : item, texture and sprite (animated texture). If you don't specify an icon this default green + icon will be used. ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2Fcontent.gitbook.com%2Fcontent%2FZznnGu8KvEhqjN3qmLqp%2Fblobs%2FGXAOvACIulUqdH9hdb5Z%2Fimage.png&width=300&dpr=3&quality=100&sign=4d25a14f&sv=2) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/requirement-display-info#item) Item Simply provide the id of the item to show as icon. Example : Show a diamond as icon #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/requirement-display-info#texture) Texture Simply provide the path to the texture file, the texture MUST be in a loaded resourcepack (Openloader or KubeJS work well for that) and the .png extension is necessary. You can also specify the width/height of the texture (default 10px) and the u/v of the texture (default 0). Example : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/requirement-display-info#sprite) Sprite A sprite is essentialy a texture that is stitched into a Minecraft texture atlas, allowing the use of animated textures. Simply specify the id of the atlas and the id of the texture. Example : Use the purple nether portal block ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/requirement-display-info#example) Example Add a diamond icon with a tooltip : ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2Fcontent.gitbook.com%2Fcontent%2FZznnGu8KvEhqjN3qmLqp%2Fblobs%2FcyhZBi1Zm0lVb7Fey6TD%2Fimage.png&width=300&dpr=3&quality=100&sign=cd6f524c&sv=2) [PreviousRangechevron-left](https://frinn.gitbook.io/custom-machinery-1.21/misc/range) [NextText componentchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) * [Tooltip](https://frinn.gitbook.io/custom-machinery-1.21/misc/requirement-display-info#tooltip) * [Icon](https://frinn.gitbook.io/custom-machinery-1.21/misc/requirement-display-info#icon) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/misc/requirement-display-info#example) sun-brightdesktopmoon Copy "info": { "item": "minecraft:diamond" } Copy "info": { "icon": "custommachinery:textures/gui/creation/create_icon.png" } Copy "info": { "atlas": "minecraft:textures/atlas/blocks.png", "sprite": "minecraft:block/nether_portal" } Copy { //other requirement properties "info": { "item": "minecraft:diamond", "tooltips": ["This recipe make diamonds"] } } sun-brightdesktopmoon --- # Range | Custom Machinery 1.21 A few recipe requirements such as [Time](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/time) or [Position](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/position) need a range to function properly. The range can be an unique number (in that case just specify it) or a range of values starting from negative infinity (**\-2147483648**) to positive infinity (**2147483647**). Several ranges can also be specified, in that case the tested value must match at least one of the specified range to pass. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/range#syntax) Syntax : The range must be specified with the following syntax : 1. Start with `[` (lower bound included) or `(` (lower bound excluded).\ \ 2. A number which will be the lower bound of the range, or nothing if you want no lower bound.\ \ 3. A `,` to separate the lower bound from the upper bound.\ \ 4. A number which will be the upper bound of the range, or nothing if you want no upper bound.\ \ 5. End with `]` (upper bound included) or `)` (upper bound excluded). 6. If you want to specify another range ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/range#special-cases) Special cases : * Use `""` or `"*"` to make a range that accept any values. * Use `"1"` to make a range that accept only the number 1. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/range#examples) Examples : Some range examples are: Spec Description `"1"` Accept only 1 `"[1,42)"`\ \ Accept 1 (included) to 42 (not included)\ \ `"[1,42]"`\ \ Accept 1 to 42 (both included)\ \ `"[1,)"`\ \ Accept 1 and higher\ \ `"(,1],[42,)"`\ \ Accept up to 1 (included) and 42 or higher\ \ [PreviousDatapackchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/misc/datapack)\ [NextRequirement display infochevron-right](https://frinn.gitbook.io/custom-machinery-1.21/misc/requirement-display-info)\ \ * [Syntax :](https://frinn.gitbook.io/custom-machinery-1.21/misc/range#syntax)\ \ * [Special cases :](https://frinn.gitbook.io/custom-machinery-1.21/misc/range#special-cases)\ \ * [Examples :](https://frinn.gitbook.io/custom-machinery-1.21/misc/range#examples)\ \ \ sun-brightdesktopmoon\ \ sun-brightdesktopmoon --- # Empty element | Custom Machinery 1.21 The empty gui element does nothing on it's own, it's useless to add it in a machine json. It's only use is for replacing another gui element when a recipe is processing, that way it is possible to 'remove' a machine gui element by replacing it by an empty element with the same id. Empty elements are defined in json with : `"type": "custommachinery:empty"`. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/empty-element#properties) Properties The empty element has 1 mandatory property and 1 optional property : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/empty-element#mandatory-property) Mandatory property Copy "type": "custommachinery:empty" //Mandatory to define an empty element. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/empty-element#optional-property) Optional property chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/empty-element#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/empty-element#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/empty-element#description) Description : The id of the element. If used in a custom machine recipe, this element will replace another element with the same id. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/empty-element#example) Example : The element will replace another element with the id "input". Copy "id": "input" ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/empty-element#example-1) Example A simple empty gui element : Copy { "type": "custommachinery:empty", "id": "input" } [PreviousDump elementchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element) [NextEnergy elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element) Last updated 1 year ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/empty-element#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/empty-element#example-1) sun-brightdesktopmoon sun-brightdesktopmoon --- # Upgrades | Custom Machinery 1.21 Machine upgrades are items that can be used to change the behaviors of a custom machine when inserted in an [upgrade item component](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/upgrade) . Upgrade items can change the following behaviours : * Recipe requirements (items, fluids, energy... consumption and production) * Machine components (capacity, max/min inputs/outputs) * Cores amount of the machine processor. circle-check You can define any item registered in the game as machine upgrade. The machine upgrade must be defined in a json file placed in a datapack, such as machines and recipes json. The path of the machine upgrade json file must be : `[datapack_name]/data/[namespace]/upgrade/my_upgrade.json` You can use whatever you want as \[datapack_name_\] but \[namespace\] and json file name must be all lowercase without spaces or special characters except `___` circle-info Upgrades can also be created using [KubeJS](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/upgrades) ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#properties) Properties The upgrade json has 2 mandatory properties and 5 optional properties. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#mandatory-properties) Mandatory properties chevron-rightItem[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#item) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#name-item) Name : `item` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#description) Description : The item you want to use as upgrade, you can define only one item per upgrade json file (but you can make as many file as you want). The item can be any vanilla or modded item. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#example) Example : Copy "item": "minecraft:diamond" The upgrade will be a vanilla diamond. chevron-rightMachines[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#machines) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#name-machines) Name : `machines` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#description-1) Description : A list of custom machines where this upgrade is allowed. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#example-1) Example : This upgrade can be applied to the magic spawner and power crusher machines. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#optional-properties) Optional properties chevron-rightRequirements[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#requirements) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#name-requirements) Name : `requirements` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#description-2) Description : A list of [recipe modifiers](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers) . These are used to define how the upgrade will influence the recipe processing. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#example-2) Example : This modifier will half the energy input required to process the recipe. chevron-rightComponents[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#components) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#name-components) Name : `components` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#description-3) Description : A list of [component modifiers](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers) . These are used to define how the upgrade will influence the recipe processing. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#example-3) Example : This modifier will add 1000FE to the machine's energy capacity. chevron-rightCore[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#core) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#name-core) Name : `core` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#description-4) Description : A single core modifier, used to modify the amount of cores the machine can use to process recipes. A core modifier has the following properties: * `operation` : addition, multiplication or exponential * `modifier` : The value applied to the operation. * `max` : The max amount of cores the machine can have after applying the upgrade. * Optional (default = 32). * `min` : The min amount of cores the machine can have after applying the upgrade. * Optional (default = 1). * `tooltip` : The tooltip displayed on the upgrade item. * Optional (A default tooltip will be displayed). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#example-4) Example : This core modifier will add 2 cores to the machine processor. chevron-rightMax[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#max) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#name-max) Name : `max` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#description-5) Description : A positive integer that define the maximum amount of upgrades of this type that can be applied in a machine at a time. Each item in a stack count as a separate upgrade. This does not limit the stack size in the upgrade slot, but upgrades in excess won't be taken in account. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#default-64) Default : 64 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#example-5) Example : Only 4 upgrades can be applied in the machine. chevron-rightTooltip[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#tooltip) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#name-tooltip) Name : `tooltip` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#description-6) Description : The tooltip that will render when a player hover any machine upgrade item in a gui. This is a [text component](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) . #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#default) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#example-6) Example : The tooltip will be "Speed upgrade MK1" in orange. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#example-7) Example The machine upgrade json below make a vanilla diamond item half the recipe duration in the Custom Machinery Power Crusher included in the test datapack. The upgrade below will double the machine's energy buffer, and add a second core to the machine. [PreviousWorking corechevron-left](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/working-core) [NextRecipe modifierschevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers) Last updated 5 months ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades#example-7) sun-brightdesktopmoon Copy "machines": ["custommachinery:magic_spawner", "custommachinery:power_crusher"] Copy "requirements": [\ {\ "requirement": "custommachinery:energy",\ "mode": "input",\ "operation": "multiplication",\ "modifier": 0.5\ }\ ] Copy "components": [\ {\ "component": "custommachinery:energy",\ "target": "capacity",\ "operation": "addition",\ "modifier": 1000\ }\ ] Copy "core": [\ {\ "operation": "addition",\ "modifier": 2\ }\ ] Copy "max": 4 Copy "tooltip": { "text": "custommachinery.upgrade.tooltip", "color": "aqua" } Copy "tooltip": { "text": "Speed upgrade MK1", "color": "orange" } upgrade.json Copy { "item": "minecraft:diamond", "machines": ["custommachinery:power_crusher"], "requirements": [\ {\ "requirement": "custommachinery:speed",\ "mode": "input",\ "operation": "multiplication",\ "modifier": 0.5\ }\ ] } upgrade.json Copy { "item": "minecraft:diamond", "machines": ["custommachinery:power_crusher"], "components": [\ {\ "component": "custommachinery:energy",\ "target": "capacity",\ "operation": "multiplication",\ "modifier": 2\ }\ ], "core": { "operation": "addition", "modifier": 1 } } sun-brightdesktopmoon --- # Datapack | Custom Machinery 1.21 A datapack is a folder (or Zip archive) containing Json files that will be parsed by Minecraft and mods to configure various gameplay elements (recipes, tags, advancements, worldgen etc...) This wiki covers only the basics, that you need to make custom machines and recipes, for more detailed information about datapacks see [the vanilla wikiarrow-up-right](https://minecraft.fandom.com/wiki/Data_pack) . ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/datapack#how-to-make-a-datapack) How to make a datapack 1. Create a new folder, name it as you want, there are no restrictions on the name of that folder. 2. Inside that folder create a new folder named `data` 3. Next to the `data` folder create a new text file named exactly `pack.mcmeta` (the .mcmeta is the file extension, be sure that your file isn't named `pack.mcmeta.txt` 4. Open the `pack.mcmeta` file with the text editor of your choice and paste the following : Copy { "pack": { "pack_format": 9, "description": "A description for my datapack" } } That's it, your folder is now a datapack. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/datapack#how-to-load-your-datapack) How to load your datapack #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/datapack#the-vanilla-way) The vanilla way circle-exclamation This method won't work if you want to publish your modpack on Curseforge, as it require the world to be generated first. In vanilla datapacks must be placed in the `datapacks` folder, which can be found in the `world` folder. * Singleplayer : `/saves//datapacks/` * Server : `//datapacks/` circle-info If you're playing on a server you don't need to install datapacks in your game (they will be ignored anyway). The datapacks installed on the server are synched automatically when you connect. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/datapack#using-open-loader) Using Open Loader 1. Install [Open Loaderarrow-up-right](https://www.curseforge.com/minecraft/mc-mods/open-loader) like any other mods. 2. Place your datapack folder here : `/config/openloader/data/` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/datapack#using-kubejs) Using KubeJS If you already have [KubeJSarrow-up-right](https://www.curseforge.com/minecraft/mc-mods/kubejs) installed (don't install it only for loading datapacks). The `/kubejs/data` folder is already a datapack, any json files here will be loaded as they would be in a datapack. You don't need any `pack.mcmeta` file. [PreviousCrafting your machinechevron-left](https://frinn.gitbook.io/custom-machinery-1.21/misc/crafting-your-machine) [NextRangechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/misc/range) Last updated 1 year ago * [How to make a datapack](https://frinn.gitbook.io/custom-machinery-1.21/misc/datapack#how-to-make-a-datapack) * [How to load your datapack](https://frinn.gitbook.io/custom-machinery-1.21/misc/datapack#how-to-load-your-datapack) sun-brightdesktopmoon sun-brightdesktopmoon --- # Toggle Config | Custom Machinery 1.21 Some components have a `config` property that you can define in the machine json. Unlike the I/O config, the toggle config only support 2 states per sides : `enabled` and `disabled` . Supported components : * [Heat component (Mekanism)](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism) * [Pressure component (PNC)](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pressure-component-pnc) circle-info This property will define the default toggle mode of the component for each side of the machine, but these toggle modes can be changed later in game by the player if you add a [config element](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element) to the machine GUI. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/toggle-config#side-modes) Side modes You can configure the toggle mode of a specific component for each sides of the machine. Available sides are : top, bottom, front, back, right, left circle-info The machine `front` side is the side that faced the player when the machine was placed. You can also use `default` to configure each sides that aren't specified. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/toggle-config#available-i-o-modes) Available I/O modes : * `enabled` * `disabled` ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/toggle-config#disabling-gui-config) Disabling gui config By default any player can change the side mode of a component by using the config button (only if a [config gui element](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element) is present in the machine GUI). You can prevent player to config a specific component by adding in the config : ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/toggle-config#color) Color By default when the config button is clicked, all configurable slots will turn blue. This can be changed using `color` property. Color property support various formats, pick one of these : Example of a config gui with a few colored slots. ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2F3380432015-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FZznnGu8KvEhqjN3qmLqp%252Fuploads%252FwvOgHCSQTCGWjcpR2Sub%252Fimage.png%3Falt%3Dmedia%26token%3Deaeb4541-3ed6-4417-9bc1-5ae32c75a8e3&width=768&dpr=3&quality=100&sign=6c76af38&sv=2) ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/toggle-config#example) Example : A component config that has the following properties : * Enable the left and right sides. * Disable all other sides. * The config can't be modified by the player with the gui config button. All sides are optional. `default` will act for all sides that are not specified. If `default` is not specified `enabled` mode will be used. [PreviousI/O Configchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/misc/i-o-config) [NextCrafting your machinechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/misc/crafting-your-machine) Last updated 1 year ago * [Side modes](https://frinn.gitbook.io/custom-machinery-1.21/misc/toggle-config#side-modes) * [Disabling gui config](https://frinn.gitbook.io/custom-machinery-1.21/misc/toggle-config#disabling-gui-config) * [Color](https://frinn.gitbook.io/custom-machinery-1.21/misc/toggle-config#color) * [Example :](https://frinn.gitbook.io/custom-machinery-1.21/misc/toggle-config#example) sun-brightdesktopmoon Copy "enabled": false Copy //Full json object, values between 0 and 1 "color": { "alpha": 0.5, "red": 1, "green": 0, "blue": 0 } //Array of color, the order is alpha, red, green, blue. Values between 0 and 1 "color": [0.5, 1, 0, 0] //ARGB 32bit integer "color": 2147418112 //Minecraft color names, only support a few colors listed here : https://minecraft.fandom.com/wiki/Formatting_codes "color": "red" Copy { "type": "custommachinery:heat", "config": { "default": "disabled", "right": "enabled", "left": "enabled", "enabled": false } } sun-brightdesktopmoon --- # Chunkload | Custom Machinery 1.21 **Use one of these methods to add a** [**Chunkload Requirement**](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/chunkload) **to the recipe.** Copy .chunkload() .chunkload(radius) * The `radius` param must be an integer between 1 and 32. Default to 1 if not specified. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/chunkload#example) Example This recipe will chunkload an area of 3x3 chunks around the machine in exchange of 10FE/t : Copy .create("custommachinery:dynamo", 1) .chunkload(2) .requireEnergyPerTick(10) .build(); [PreviousChemical (Mekanism)chevron-left](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/chemical-mekanism) [NextContraption (Create)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/contraption-create) sun-brightdesktopmoon sun-brightdesktopmoon --- # Comparator | Custom Machinery 1.21 Some requirements have a `comparator` property, those are used to compare a value checked by the requirement to a value specified by the recipe maker. Available comparators are : * `>>` Strictly greater * `>=` Greater or equals * `==` Strictly equals * `<=` Lesser or equals * `<<` Strictly lesser [PreviousCore modifierchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/upgrades/core-modifier) [NextI/O Configchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/misc/i-o-config) Last updated 1 year ago sun-brightdesktopmoon sun-brightdesktopmoon --- # Sky | Custom Machinery 1.21 U**se this method to add a** [**sky requirement**](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/sky) **to the recipe.** Copy .mustSeeSky() ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/sky#example) Example The following recipe will require the machine to have a clear access to the sky : Copy .create("custommachinery:power_crusher", 20) .mustSeeSky() .build(); [PreviousRadiation (Mekanism)chevron-left](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/radiation-mekanism) [NextStructurechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/structure) sun-brightdesktopmoon sun-brightdesktopmoon --- # Background element | Custom Machinery 1.21 The background gui element work mostly the same way as the [texture gui element](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element) . It is used to display a background texture for the machine gui. circle-exclamation By default the machine gui doesn't have a background texture, meaning that the gui will be transparent if no background element are specified. It can also be used to change the size of the gui. The default machine gui size is 256x192px and the maximum size is 3840x2160px. If a texture is specified the width/height of the gui will use the width/height of that texture (unless these properties are specified in the background element). Background elements are defined in json with `"type": "custommachinery:background"`. circle-exclamation You can only define 1 background element for a machine gui, if more than 1 background elements are added only the first will be used and the other ignored. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element#properties) Properties The background element has 1 mandatory property and 3 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element#mandatory-property) Mandatory property Copy "type": "custommachinery:background" //Mandatory to define a background element. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element#optional-properties) Optional properties chevron-rightTexture[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element#texture) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element#name-texture) Name : `texture` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element#description) Description : The location of the texture that will be rendered into the GUI. The location must be referenced by : `namespace:path/file.png` The texture loader will search for textures in the `assets/namespace` folder, the .png extension is required or the file will not be found. The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided. If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element#default) Default : Copy "texture": "custommachinery:textures/gui/base_background.png" #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element#example) Example : The file `assets/textures/my_background_texture.png` will be used for the slot element. Copy "texture": "namespace:textures/my_background_texture.png" chevron-rightWidth[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element#width) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element#name-width) Name : `width` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element#description-1) Description : A positive integer that define the width of the machine gui. Maximum allowed value : 3840 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element#default-256) Default : `256` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element#example-1) Example : chevron-rightHeight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element#height) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element#name-height) Name : `height` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element#description-2) Description : A positive integer that define the height of the machine gui. Maximum allowed value : 2160 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element#default-192) Default : `192` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element#example-2) Example : ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element#example-3) Example : The most basic background gui element that will fix 99% of your use-cases : A background gui element that resize the machine gui to 192x256px A background gui element that change the default texture (size will be handled automatically) : [PreviousMachine GUIchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui) [NextBar elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element) Last updated 1 year ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element#properties) * [Example :](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element#example-3) sun-brightdesktopmoon Copy "width": 512 //The machine gui will be 512px wide. Copy "height": 512 //The machine gui will be 512px high. Copy { "type": "custommachinery:background" } Copy { "type": "custommachinery:size", "width": 192, "height": 256 } Copy { "type": "custommachinery:background", "texture": "custommachinery:textures/custom_machine_gui_background.png" } sun-brightdesktopmoon --- # Button | Custom Machinery 1.21 **Use one of these methods to add a** [**Button Requirement**](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/button) **to the recipe.** Copy .requireButtonPressed("id") .requireButtonReleased("id") * The `id` param must be a string that define which [button element](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element) need to be pressed to start the recipe. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/button#example) Example This recipe will produce 10FE each time the player press the button : Copy .create("custommachinery:dynamo", 1) .requireButtonPressed("button") .produceEnergy(10) .build(); [PreviousRecipeschevron-left](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes) [NextChemical (Mekanism)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/chemical-mekanism) sun-brightdesktopmoon sun-brightdesktopmoon --- # Component modifier | Custom Machinery 1.21 circle-info Find all component types and targets that can be modified [here](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#list-of-properties-that-can-be-modified) . Copy //Create a modifier that add/multiply a value to any machine component. //component must be specified using its id: "namespace:component" //Value can be any numerical value. //Id can be empty "" if the component doesn't have an id (like energy). //Pick one of the 3 methods below : CMComponentModifierBuilder.add(component, id, value) CMComponentModifierBuilder.mul(component, id, value) CMComponentModifierBuilder.exp(component, id, value) //Specifying a target is mandatory .target(String target) //All methods below are optional //Specify the maximum value that can be obtained after applying this modifier. //It can be any numerical value. //Default is POSITIVE_INFINITY. .max(double max) //Specify the minimum value that can be obtained after applying this modifier. //It can be any numerical value. //Default is NEGATIVE_INFINITY. .min(double max) //Change the tooltip displayed when holding shift while hovering the upgrade item. //Default : a short string that describe the effect of this modifier. .tooltip(String tooltip) //Use Text.of("text here") for more formating options. //See https://kubejs.com/wiki/kubejs/Text/ .tooltip(Text tooltip) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/upgrades/component-modifier#example) Example A modifier that double the machine energy capacity A modifier that add 50mB max input to the fluid component with id "input1" [PreviousRecipe modifierchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/upgrades/recipe-modifier) [NextCore modifierchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/upgrades/core-modifier) Last updated 5 months ago sun-brightdesktopmoon Copy CMComponentModifierBuilder.mul("custommachinery:energy", "", 2) .target("capacity") Copy CMComponentModifierBuilder.add("custommachinery:fluid", "input1", 50) .target("max_input") sun-brightdesktopmoon --- # Item filter | Custom Machinery 1.21 U**se one of these methods to add an** [Item filter](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/item-filter) **requirement to the recipe.** Copy .requireItemFilter(IIngredient ingredient) .requireItemFilter(IIngredient ingredient, String slot) * The `ingredient` param must be a CT [IIngredientarrow-up-right](https://docs.blamejared.com/1.20.2/en/vanilla/api/ingredient/IIngredient) . * The `slot` param must be a valid slot id. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/item-filter#example) Example The following recipe will run only if the filter slot "filter1" is set to a vanilla diamond : Copy .create("custommachinery:power_crusher", 20) .requireItemFilter(, "filter1") .build(); [PreviousHeat (Mekanism)chevron-left](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/heat-mekanism) [NextRadiation (Mekanism)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/radiation-mekanism) sun-brightdesktopmoon sun-brightdesktopmoon --- # Chemical (Mekanism) | Custom Machinery 1.21 circle-exclamation This requirement requires [Custom Machinery Mekanismarrow-up-right](https://www.curseforge.com/minecraft/mc-mods/custom-machinery-mekanism) to be installed. **Use one of these methods to add a** [**Chemical Requirement**](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/chemical-mekanism) **to the recipe.** Copy .requireChemical(chemical) .requireChemical(chemical, "tankID") .requireChemicalPerTick(chemical) .requireChemicalPerTick(chemical, "tankID") .produceChemical(chemical) .produceChemical(chemical, "tankID") .produceChemicalPerTick(chemical) .produceChemicalPerTick(chemical, "tankID") * The `chemical` param must be specified using the corresponding brackets : You can specify an amount like this : ` * 1000` * The `tank` param must be a string corresponding to a tank id defined in a custom machine json [Chemical Component](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism) `tank` property. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/chemical-mekanism#example) Example This recipe will consume 1000mB of steam gas and produce 100mB of white pigment : [PreviousButtonchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/button) [NextChunkloadchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/chunkload) Last updated 1 year ago sun-brightdesktopmoon Copy .create("custommachinery:boiler", 20) .requireChemical( * 1000) .produceChemical( * 100) .build(); sun-brightdesktopmoon --- # Radiation (Mekanism) | Custom Machinery 1.21 circle-exclamation This requirement requires [Custom Machinery Mekanismarrow-up-right](https://www.curseforge.com/minecraft/mc-mods/custom-machinery-mekanism) to be installed. **Use one of these methods to add a** [**radiation requirement**](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/radiation-mekanism) **to the recipe.** Copy .requireRadiation(amount) .requireRadiation(amount, radius) .requireRadiationPerTick(amount) .requireRadiationPerTick(amount, radius) .emitRadiation(amount) .emitRadiationPerTick(amount) * The `amount` param must be a positive decimal value. (in Sv). * The `radius` param must be a positive integer value (in blocks). ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/radiation-mekanism#example) Example The following recipe will absorb 1 mSv each tick while running : Copy .create("custommachinery:boiler", 20) .requireRadiationPerTick(0.001) .build(); [PreviousItem filterchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/item-filter) [NextSkychevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/sky) sun-brightdesktopmoon sun-brightdesktopmoon --- # Function | Custom Machinery 1.21 **Use one of these methods to add a function that must be processed by the machine to continue the recipe.** Note: This has nothing to do with MC functions (or commands), this requirement allow you to make your own code in ZenScript and pass it to be executed by the machine. Copy //These imports are needed, put these 2 lines on top of the script. import mods.custommachinery.Context; import mods.custommachinery.Machine; //Executed when the machine is idle and search a recipe to process. //Returning success will allow the machine to process this recipe (if all other requirements allow it as well). //Returning error will prevent the machine to process this recipe (the machine will keep searching for another valid recipe). .requireFunctionToStart((ctx as Context) => {return ctx.success()}) //Executed the first tick of the crafting process. //Returning success will allow the machine to continue to process this recipe. //Returning error will put the machine in error status and display the provided error message. .requireFunctionOnStart((ctx as Context) => {return ctx.success()}) //Executed each tick of the crafting process. //Returning success will allow the machine to continue to process this recipe. //Returning error will put the machine in error status and display the provided error message. .requireFunctionEachTick((ctx as Context) => {return ctx.success()}) //Executed the last tick of the crafting process. //Returning success will allow the machine to continue to process this recipe. //Returning error will put the machine in error status and display the provided error message. .requireFunctionOnEnd((ctx as Context) => {return ctx.success()}) * The passed function MUST return a Result. * Valid results are : `ctx.success()` and `ctx.error("Error message")` * Context has various methods for interacting with the machine, see [it's wiki page](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context) * The function can be delayed, put `.delay(delay)` directly after any `.requireFunctionXXX()` call to make the function be executed at the specified delay. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function#example) Example [PreviousExperiencechevron-left](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/experience) [NextContextchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context) sun-brightdesktopmoon Copy import mods.custommachinery.Context; import mods.custommachinery.Machine; mods.custommachinery.CMRecipeBuilder.create("custommachinery:power_crusher", 100) .requireFunctionOnEnd((ctx as Context) => { var machine = ctx.machine as Machine; var output = machine.addItemToSlot("output1", , false); if(!output.empty) return ctx.error("Couldn't put a diamond in output slot."); else return ctx.success(); }) .build(); sun-brightdesktopmoon --- # Core modifier | Custom Machinery 1.21 A core modifier can be used to modify the amount of cores a machine can use for processing recipe. Each core can process a single recipe at a time, but not necessarily the same recipe as the other cores. circle-exclamation This only works for machines using a [machine processor](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor/machine) (all machines by default). Copy //Create a modifier that add/multiply the machine processor core amount //Value can be any numerical value. //Pick one of the 3 methods below : CMCoreModifierBuilder.add(value) CMCoreModifierBuilder.mul(value) CMCoreModifierBuilder.exp(value) //All methods below are optional //Specify the maximum value that can be obtained after applying this modifier. //It can be any numerical value. //Default is POSITIVE_INFINITY. .max(double max) //Specify the minimum value that can be obtained after applying this modifier. //It can be any numerical value. //Default is NEGATIVE_INFINITY. .min(double max) //Change the tooltip displayed when holding shift while hovering the upgrade item. //Default : a short string that describe the effect of this modifier. .tooltip(String tooltip) //Use Text.of("text here") for more formating options. //See https://kubejs.com/wiki/kubejs/Text/ .tooltip(Text tooltip) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/upgrades/core-modifier#example) Example A modifier that double the machine core amount A modifier that add 1 core to the machine [PreviousComponent modifierchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/upgrades/component-modifier) [NextComparatorchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/misc/comparator) Last updated 5 months ago sun-brightdesktopmoon Copy CMCoreModifierBuilder.mul(2) Copy CMCoreModifierBuilder.add(1) sun-brightdesktopmoon --- # Contraption (Create) | Custom Machinery 1.21 circle-exclamation This requirement requires [Custom Machinery Createarrow-up-right](https://www.curseforge.com/minecraft/mc-mods/custom-machinery-create) to be installed. **Use one of these methods to add a** [**contraption requirement**](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create) **to the recipe.** Copy .requireSU(speed) .requireSU(speed, stressImpact) .requireScalingSU(speed) .requireScalingSU(speed, stressImpact) .produceSU(speed) .produceSU(speed, stressCapacity) * The `speed`, `stressImpact` and `stressCapacity` params must be a positive decimal value. * The `scaling` methods will make the recipe processing speed scale with the speed provided to the machine. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/contraption-create#example) Example This recipe require at least 64rpm to start and add a stress impact of 2 times its speed to the network : Copy .create("custommachinery:boiler", 20) .requireSU(64, 2) .build(); [PreviousChunkloadchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/chunkload) [NextExperiencechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/experience) sun-brightdesktopmoon sun-brightdesktopmoon --- # Experience | Custom Machinery 1.21 **Use one of these methods to add an** [**experience requirement**](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/experience) **to the recipe.** Copy .requireXp(amount) .requireXpPerTick(amount) .produceXp(amount) .produceXpPerTick(amount) .requireLevel(amount) .requireLevelPerTick(amount) .produceLevel(amount) .produceLevelPerTick(amount) * The `amount` param must be a positive integer. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/experience#example) Example The following recipe will produce 3xp points: Copy .create("custommachinery:power_crusher", 20) .produceXp(3) .build(); [PreviousContraption (Create)chevron-left](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/contraption-create) [NextFunctionchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function) sun-brightdesktopmoon sun-brightdesktopmoon --- # Heat (Mekanism) | Custom Machinery 1.21 circle-exclamation This requirement requires [Custom Machinery Mekanismarrow-up-right](https://www.curseforge.com/minecraft/mc-mods/custom-machinery-mekanism) to be installed. **Use one of these methods to add a** [**heat requirement**](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/heat-mekanism) **or** [**temperature requirement**](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/temperature-mekanism) **to the recipe.** Copy .requireHeat(amount) .requireHeatPerTick(amount) .produceHeat(amount) .produceHeatPerTick(amount) .requireTemp("range", "unit") .requireTempKelvin("range") .requireTempCelsius("range") .requireTempFahrenheit("range") .requireTempRankine("range") .requireTempAmbient("range") * The `amount` param must be a positive integer. * The `range` param must be a valid [Range](https://frinn.gitbook.io/custom-machinery-1.21/misc/range) . * The `"unit"` param must be a valid temperature unit, valid values are : `kelvin`, `celsius`, `fahrenheit`, `rankine` and `ambient`. It is recommended to use the specific methods for each unit thought. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/heat-mekanism#example) Example The following recipe will run only if the machine temperature is above 100°C and will produce 1000 heat. [PreviousMachinechevron-left](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/machine) [NextItem filterchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/item-filter) sun-brightdesktopmoon Copy .create("custommachinery:boiler", 20) .requireTempCelsius("(100,)") .produceHeat(1000) .build(); sun-brightdesktopmoon --- # Structure | Custom Machinery 1.21 **Use one of these methods to add a** [**Structure Requirement**](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/structure) **to the recipe.** Copy //Only requires the structure .requireStructure(String[][] pattern, Map keys) //Destroys the structure (DON'T drop the blocks) .destroyStructure(String[][] pattern, Map keys) //Break the structure (drops the blocks) .breakStructure(String[][] pattern, Map keys) //Place the structure (drops the replaced blocks) .placeStructure(String[][] pattern, Map keys, true) //Place the structure (DON'T drop the replaced blocks) .placeStructure(String[][] pattern, Map keys, false) * The `pattern` param must be an array of array of strings. See `pattern` property of structure requirement. Example: `[["aaa", "aaa", "aaa"], ["aaa", "ama", "aaa"], ["aaa", "aaa", "aaa"]]` Define a 3x3x3 box around the machine `m` * The `keys` param must be a map of string -> string. See `keys` property of structure requirement. The keys of the map must be single characters (except `m` which is reserved for the machine) and the values must be a block ID with the format: `namespace:block_id[state1=value,state2=value]` (states are optional). Example: `{"a": "minecraft:stone", "b": "minecraft:diamond_block"}` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/structure#example) Example Copy .requireStructure([[\ "aaa",\ "a a",\ "aaa",\ " m "\ ]], {"a": "minecraft:stone"}) A 3x1x3 hollow ring of stone behind the machine. [PreviousSkychevron-left](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/sky) [NextUpgradeschevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/upgrades) sun-brightdesktopmoon sun-brightdesktopmoon --- # Upgrades | Custom Machinery 1.21 Custom Machine upgrades can be made with KubeJS script. Create a .js file in the `kubejs\server_scripts` folder (ex: custom\_machine\_upgrades.js) and look at the example below to see all the available methods to create a Custom Machine upgrade with KubeJS. If you're not familiar about custom machine upgrades see [the wiki page](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades) . ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/upgrades#creating-custom-machine-upgrade-with-kubejs) Creating custom machine upgrade with KubeJS Copy //Use the 'cm_upgrades' event to register custom machine upgrades. CustomMachineryEvents.upgrades(event => { //Create the upgrade builder and give it the item that will act as upgrade. //Use Item.of("item_id") to create the item. event.create(Item item) //If maxAmount is not specified the default is 64. event.create(Item item, int maxAmount) //Add a machine or a list of machines that will accept this upgrade, //the machine ID must be "namespace:id" like "custommachinery:my_machine", //if the json is located in (my_datapack)/data/custommachinery/machines/my_machine.json .machine(String... machineID) //You can add a custom tooltip to the machine upgrade item. .tooltip(String... tooltips) //Use Text.of("text here") for more formatting options, //See https://kubejs.com/wiki/kubejs/Text/ .tooltip(Text... tooltips) //Add a recipe modifier to this upgrade. .requirement(CMRecipeModifierBuilder modifier) //Add a component modifier to this upgrade. .component(CMRecipeModifierBuilder modifier) //Add a core modifier to this upgrade. .core(CMCoreModifierBuilder modifier) }) [Recipe modifierchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/upgrades/recipe-modifier) [Component modifierchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/upgrades/component-modifier) [Core modifierchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/upgrades/core-modifier) ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/upgrades#examples) Examples A gold ingot put inside the Power Crusher will double it's energy consumption with a maximum of 1000FE but also half it's duration time with a minimum of 100 ticks. [PreviousWorking corechevron-left](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/working-core) [NextRecipe modifierchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/upgrades/recipe-modifier) Last updated 5 months ago * [Creating custom machine upgrade with KubeJS](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/upgrades#creating-custom-machine-upgrade-with-kubejs) * [Examples](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/upgrades#examples) sun-brightdesktopmoon Copy CustomMachineryEvents.upgrades(event => { event.create(Item.of('minecraft:gold_ingot')) .machine("custommachinery:power_crusher") .modifier(CMRecipeModifierBuilder.mulInput('custommachinery:energy', 2).max(1000)) .modifier(CMRecipeModifierBuilder.mulInput('custommachinery:speed', 1.5).min(100)) }) sun-brightdesktopmoon --- # Recipe modifier | Custom Machinery 1.21 circle-info Find all requirement types and targets that can be modified [here](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#list-of-properties-that-can-be-modified) . triangle-exclamation When multiplying values between 0 and 1 you will almost always prefer to use 'exp' instead of 'mul' Copy //Create a modifier that add/multiply a value to any input/output requirement of the specified type. //requirement must be specified using its id: "namespace:requirement" //Value can be any numerical value. //Pick one of the 6 methods below : CMRecipeModifierBuilder.addInput(requirement, value) CMRecipeModifierBuilder.mulInput(requirement, value) CMRecipeModifierBuilder.expInput(requirement, value) CMRecipeModifierBuilder.addOutput(requirement, value) CMRecipeModifierBuilder.mulOutput(requirement, value) CMRecipeModifierBuilder.expOutput(requirement, value) //All methods below are optional //Specify a target, in case the requirement have several values that can be modified. //Only 1 target can be defined for a modifier, default is none. .target(String target) //Specify a chance for this modifier to be applied. //Must be a value between 0 and 1, 0 is never applied and 1 is 100% chance to be applied. //Default is 1. .chance(double chance) //Specify the maximum value that can be obtained after applying this modifier. //It can be any numerical value. //Default is POSITIVE_INFINITY. .max(double max) //Specify the minimum value that can be obtained after applying this modifier. //It can be any numerical value. //Default is NEGATIVE_INFINITY. .min(double max) //Change the tooltip displayed when holding shift while hovering the upgrade item. //Default : a short string that describe the effect of this modifier. .tooltip(String tooltip) //Use Text.of("text here") for more formating options. //See https://kubejs.com/wiki/kubejs/Text/ .tooltip(Text tooltip) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/upgrades/recipe-modifier#example) Example A modifier that double the per-tick energy input A modifier that half the processing time [PreviousUpgradeschevron-left](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/upgrades) [NextComponent modifierchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/upgrades/component-modifier) Last updated 5 months ago sun-brightdesktopmoon Copy CMRecipeModifierBuilder.mulInput("custommachinery:energy_per_tick", 2) Copy CMRecipeModifierBuilder.expInput("custommachinery:speed", 0.5) sun-brightdesktopmoon --- # I/O Config | Custom Machinery 1.21 Some components have a `config` property that you can define in the machine json. This property can be used to define the default Input/Output (I/O) sides for the component. Supported components : * [Energy component](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component) * [Fluid component](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component) * [Item component](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component) * [Chemical component (Mekanism)](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism) * [Contraption component (Create)](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/contraption-component-create) circle-info This property will define the default I/O mode of the component for each side of the machine, but these I/O modes can be changed later in game by the player if you add a [config element](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element) to the machine GUI. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/i-o-config#side-modes) Side modes You can configure the I/O mode of a specific component for each sides of the machine. Available sides are : top, bottom, front, back, right, left circle-info The machine `front` side is the side that faced the player when the machine was placed. You can also use `default` to configure each sides that aren't specified. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/i-o-config#available-i-o-modes) Available I/O modes : * `input` : only input * `output` : only output * `both` : input and output * `none` : neither input nor output ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/i-o-config#auto-input-output) Auto input/output Starting from CM 0.7.0 the machines now have the ability to auto input/output items, fluids and energy from/to blocks next to the machine. By default this behavior is disabled for items and fluids. For energy components the default behavior is to auto input from all sides. To enable or disable auto I/O simply use : ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/i-o-config#disabling-gui-config) Disabling gui config By default any player can change the side mode of a component, or activate auto I/O by using the config button (only if a [config gui element](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element) is present in the machine GUI). You can prevent player to config a specific component by adding in the config : ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/i-o-config#color) Color By default when the config button is clicked, all configurable slots will turn blue. This can be changed using `color` property. Color property support various formats, pick one of these : Example of a config gui with a few colored slots. ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2F3380432015-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FZznnGu8KvEhqjN3qmLqp%252Fuploads%252FwvOgHCSQTCGWjcpR2Sub%252Fimage.png%3Falt%3Dmedia%26token%3Deaeb4541-3ed6-4417-9bc1-5ae32c75a8e3&width=768&dpr=3&quality=100&sign=6c76af38&sv=2) ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/misc/i-o-config#example) Example : A component config that has the following properties : * Allow input from the left side. * Allow output to the right side. * All other sides (top, bottom, front and back) can't input or output. * Auto input and output are enabled. * The config can't be modified by the player with the gui config button. All sides are optional. `default` will act for all sides that are not specified. If `default` is not specified `both` mode will be used. [PreviousComparatorchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/misc/comparator) [NextToggle Configchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/misc/toggle-config) Last updated 1 year ago * [Side modes](https://frinn.gitbook.io/custom-machinery-1.21/misc/i-o-config#side-modes) * [Auto input/output](https://frinn.gitbook.io/custom-machinery-1.21/misc/i-o-config#auto-input-output) * [Disabling gui config](https://frinn.gitbook.io/custom-machinery-1.21/misc/i-o-config#disabling-gui-config) * [Color](https://frinn.gitbook.io/custom-machinery-1.21/misc/i-o-config#color) * [Example :](https://frinn.gitbook.io/custom-machinery-1.21/misc/i-o-config#example) sun-brightdesktopmoon Copy "config": { "input": true, //Enable auto-input "output": false, //Disable auto-output } Copy "enabled": false Copy //Full json object, values between 0 and 1 "color": { "alpha": 0.5, "red": 1, "green": 0, "blue": 0 } //Array of color, the order is alpha, red, green, blue. Values between 0 and 1 "color": [0.5, 1, 0, 0] //ARGB 32bit integer "color": 2147418112 //Minecraft color names, only support a few colors listed here : https://minecraft.fandom.com/wiki/Formatting_codes "color": "red" Copy { "type": "item", "mode": "input", "id": "slot1", "config": { "default": "none", "right": "output", "left": "input", "input": true, "output": true, "enabled": false } } sun-brightdesktopmoon --- # Config element | Custom Machinery 1.21 The config gui element is used to add an I/O side config button on the Machine GUI. Config elements are defined in json with : `"type": "custommachinery:config"`. circle-info If you don't add this element the players won't be able to configurate I/O of the machine, that can be useful if you want to make a machine with defined I/O sides. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#properties) Properties The config element has 3 mandatory properties and 7 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#mandatory-properties) Mandatory properties Copy "type": "custommachinery:config" //Mandatory to define a config element. chevron-rightX[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#x) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#name-x) Name : `x` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#description) Description : A positive integer value that define the x axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#example) Example : The element will be rendered 100px to the right from the top-left corner of the gui. Copy "x": 100 chevron-rightY[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#y) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#name-y) Name : `y` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#description-1) Description : A positive integer value that define the y axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#example-1) Example : The element will be rendered 100px to the bottom from the top-left corner of the gui. Copy "y": 100 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#optional-properties) Optional properties chevron-rightTexture[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#texture) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#name-texture) Name : `texture` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#description-2) Description : The location of the texture that will be rendered into the GUI. The location must be referenced by : `namespace:path/file.png` The texture loader will search for textures in the `assets/namespace` folder, the .png extension is required or the file will not be found. The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided. If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#default) Default : Copy "texture": "custommachinery:textures/gui/base_config.png" #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#example-2) Example : The file `assets/textures/my_texture.png` will be used. Copy "texture": "namespace:textures/my_texture.png" chevron-rightTexture hovered[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#texture-hovered) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#name-texture_hovered) Name : `texture_hovered` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#description-3) Description : The location of the texture that will be rendered into the GUI, only when the element is hovered by the player mouse cursor. The location must be referenced by : `namespace:path/file.png` The texture loader will search for textures in the `assets/namespace` folder, the .png extension is required or the file will not be found. The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided. If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#default-1) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#example-3) Example : The file `assets/textures/my_texture.png` will be used. chevron-rightWidth[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#width) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#name-width) Name : `width` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#description-4) Description : A positive integer value that define the width of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#default-2) Default : The same width as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#example-4) Example : The width of the element will be 100px. chevron-rightHeight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#height) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#name-height) Name : `height` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#description-5) Description : A positive integer value that define the height of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#default-3) Default : The same height as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#example-5) Example : The height of the element will be 100px. chevron-rightPriority[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#priority) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#name-priority) Name : `priority` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#description-6) Description : An integer property that define the priority of the Element to be rendered. Elements with higher priority will be rendered first. If 2 elements are at the same position the first to be rendered will be under and the last will be above. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#default-0) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#example-6) Example : The element will be rendered under each element that have a priority lower than 1000. chevron-rightTooltips[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#tooltips) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#name-tooltips) Name : `tooltips` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#description-7) Description : A list of [Text components](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) that will be shown as tooltips when the player mouse cursor hover the element. Each tooltips of the list will be a new line. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#example-7) Example : Replace the default tooltips with a single line that say "Click me !" : chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#description-8) Description : The id of this gui element. By default it does nothing and can be omitted. This is really only useful if you intend to make a recipe that replace this element. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#default-empty) Default : `empty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#example-8) Example : The id of this element will be `config` ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#example-9) Example A basic config element using the base texture provided by Custom Machinery : ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2Fcontent.gitbook.com%2Fcontent%2FZznnGu8KvEhqjN3qmLqp%2Fblobs%2FkpdrhYUhJVlMt209URX7%2Fconfig_element.png&width=768&dpr=3&quality=100&sign=30b84427&sv=2) Config element [PreviousChemical element (Mekanism)chevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism) [NextDump elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element) Last updated 1 year ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element#example-9) sun-brightdesktopmoon Copy "texture": "custommachinery:textures/gui/base_config_hovered.png" Copy "texture_hovered": "namespace:textures/my_texture.png" Copy "width": 100 Copy "height": 100 Copy "priority": 1000 Copy "tooltips": "Click me !" Copy "id": "config" Copy { "type": "custommachinery:config", "x": 20, "y": 20 } sun-brightdesktopmoon --- # Context | Custom Machinery 1.21 Context is the object provided in the function requirement using the Crafttweaker integration. It contains various methods for interacting with the machine. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#methods) Methods chevron-rightSet the result of the function[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#set-the-result-of-the-function) Every function **MUST** return a result, which is either a success or an error. Copy //Get a success result ctx.success(); //Get an error result ctx.error("Some error message"); chevron-rightGet the remaining crafting time[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#get-the-remaining-crafting-time) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#name-remainingtime) Name : `remainingTime` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#description) Description : Return a decimal value that represent the time in ticks before the end of the current recipe process. This value does not take into account any speed modifiers applied to the machine. Note : This method won't work when used inside `requireFunctionToStart`, the other 3 function requirements are fine to use. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#example) Example Copy .requireFunctionEachTick((ctx as Context) => { var time = ctx.remainingTime; //Use time here }) chevron-rightGet the crafting process base speed[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#get-the-crafting-process-base-speed) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#name-basespeed) Name : `baseSpeed` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#description-1) Description : Return a decimal value that represent the base speed (before upgrades are applied) of the crafting process. By default it returns 1 Note : This method won't work when used inside `requireFunctionToStart`, the other 3 function requirements are fine to use. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#example-1) Example Copy .requireFunctionEachTick((ctx as Context) => { var baseSpeed = ctx.baseSpeed; //Use baseSpeed here }) chevron-rightSet the crafting process base speed[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#set-the-crafting-process-base-speed) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#name-basespeed-1) Name : `baseSpeed` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#description-2) Description : Set a decimal value as the base speed (before upgrades are applied) of the crafting process. The new speed must not be negative. Note : This method won't work when used inside `requireFunctionToStart`, the other 3 function requirements are fine to use. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#example-2) Example : Copy .requireFunctionOnStart((ctx as Context) => { ctx.baseSpeed = 2; }) chevron-rightGet the crafting process modified speed[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#get-the-crafting-process-modified-speed) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#name-modifiedspeed) Name : `modifiedSpeed` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#description-3) Description : Return a decimal value that represent the modified speed (after upgrades are applied) of the crafting process. Note : This method won't work when used inside `requireFunctionToStart`, the other 3 function requirements are fine to use. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#example-3) Example chevron-rightGet the machine as a tile entity[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#get-the-machine-as-a-tile-entity) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#name-tile) Name : `tile` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#description-4) Description : Return a [BlockEntityarrow-up-right](https://docs.blamejared.com/1.18/en/vanilla/api/block/entity/BlockEntity) , you can use it to get various information about the machine, see the linked CT wiki page. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#example-4) Example chevron-rightGet the machine as a custom machine[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#get-the-machine-as-a-custom-machine) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#name-machine) Name : `machine` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#description-5) Description : Return a [Machine](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/machine) , you can use it to check, input and output energy, fluids and items from/to the machine. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context#example-5) Example [PreviousFunctionchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function) [NextMachinechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/machine) sun-brightdesktopmoon Copy .requireFunctionEachTick((ctx as Context) => { var modifiedSpeed = ctx.modifiedSpeed; //Use modifiedSpeed here }) Copy .requireFunctionEachTick((ctx as Context) => { var tile = ctx.tile; //Use tile here }) Copy .requireFunctionEachTick((ctx as Context) => { var machine = ctx.machine; //Use machine here }) sun-brightdesktopmoon --- # Dump element | Custom Machinery 1.21 The dump element is a button used to void the content of one or several fluid tanks. When clicked, the dump button will find the specified fluid component in the machine and void it's content. Dump elements are defined in json with : `"type": "custommachinery:dump"`. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#properties) Properties The dump gui element has 4 mandatory properties and 8 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#mandatory-properties) Mandatory properties Copy "type": "custommachinery:dump" //Mandatory to define a dump element. chevron-rightX[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#x) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#name-x) Name : `x` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#description) Description : A positive integer value that define the x axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#example) Example : The element will be rendered 100px to the right from the top-left corner of the gui. Copy "x": 100 chevron-rightY[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#y) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#name-y) Name : `y` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#description-1) Description : A positive integer value that define the y axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#example-1) Example : The element will be rendered 100px to the bottom from the top-left corner of the gui. Copy "y": 100 chevron-rightTanks[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#tanks) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#name-tanks) Name : `tanks` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#description-2) Description : The id of the [Fluid Component](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#mandatory-properties) you want to void. It must be the exact same id specified in the fluid component json `id` property. You can specify a list of tank id \`\["tank1", "tank2"...\] in which case all specified tanks will be voided when the dump element is clicked. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#example-2) Example : The element will void the fluid component with id `tank1`, if no fluid component has this id it will do nothing. Copy "tanks": "tank1" #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#optional-properties) Optional properties chevron-rightWidth[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#width) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#name-width) Name : `width` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#description-3) Description : A positive integer value that define the width of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#default) Default : The same width as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#example-3) Example : The width of the element will be 100px. chevron-rightHeight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#height) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#name-height) Name : `height` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#description-4) Description : A positive integer value that define the height of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#default-1) Default : The same height as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#example-4) Example : The height of the element will be 100px. chevron-rightPriority[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#priority) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#name-priority) Name : `priority` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#description-5) Description : An integer property that define the priority of the Element to be rendered. Elements with higher priority will be rendered first. If 2 elements are at the same position the first to be rendered will be under and the last will be above. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#default-0) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#example-5) Example : The element will be rendered under each element that have a priority lower than 1000. chevron-rightTexture[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#texture) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#name-texture) Name : `texture` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#description-6) Description : The location of the texture that will be rendered into the GUI. The location must be referenced by : `namespace:path/file.png` The texture loader will search for textures in the `assets/namespace` folder, the .png extension is required or the file will not be found. The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided. If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#default-2) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#example-6) Example : The file `assets/textures/my_texture.png` will be used for the dump element. chevron-rightTexture hovered[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#texture-hovered) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#name-texture_hovered) Name : `texture_hovered` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#description-7) Description : The location of the texture that will be rendered into the GUI when the players mouse cursor is hovering the element. The location must be referenced by : `namespace:path/file.png` The texture loader will search for textures in the `assets/namespace` folder, the .png extension is required or the file will not be found. The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided. If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#default-3) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#example-7) Example : The file `assets/textures/my_texture.png` will be used. chevron-rightComponent[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#component) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#name-component) Name : `component` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#description-8) Description : The type of component to dump contents. Must be specified as a machine component type id e.g: `"custommachinery:item"` This can be a list if you need to dump the content of multiple component types : `["custommachinery:item", "custommachinery:fluid"]` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#default-custommachinery-fluid) Default : `"custommachinery:fluid"` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#example-8) Example : This will make the dump gui element void content from item slots only. chevron-rightTooltips[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#tooltips) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#name-tooltips) Name : `tooltips` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#description-9) Description : A list of [Text components](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) that will be shown as tooltips when the player mouse cursor hover the element. Each tooltips of the list will be a new line. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#example-9) Example : Replace the default tooltips with a single line that say "Click me !" : chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#description-10) Description : The id of this gui element. By default it does nothing and can be omitted. This is really only useful if you intend to make a recipe that replace this element. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#default-empty) Default : `empty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#example-10) Example : The id of this element will be `dump` ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#example-11) Example A basic dump element : ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2Fgithub.com%2FFrinn38%2FCustom-Machinery%2Fraw%2F1.16.5%2Fwiki%2Fdump_element.png&width=768&dpr=3&quality=100&sign=b16a3a17&sv=2) Dump element base texture [PreviousConfig elementchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element) [NextEmpty elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/empty-element) Last updated 1 year ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element#example-11) sun-brightdesktopmoon Copy "width": 100 Copy "height": 100 Copy "priority": 1000 Copy "texture": "custommachinery:textures/gui/base_dump.png" Copy "texture": "namespace:textures/my_texture.png" Copy "texture_hovered": "custommachinery:textures/gui/base_dump_hovered.png" Copy "texture_hovered": "namespace:textures/my_texture.png" Copy "component": "custommachinery:item" Copy "tooltips": "Click me !" Copy "id": "dump" Copy { "type": "custommachinery:dump", "x": 20, "y": 20, "id": "tank1" } sun-brightdesktopmoon --- # Component modifiers | Custom Machinery 1.21 Component modifiers are used to tweak some properties of a machine component. They are defined in json inside of the `components` property of the machine upgrade item json. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#list-of-properties-that-can-be-modified) List of properties that can be modified Component Needs id Target Modified property [Chunkload](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chunkload-component) No "radius" `radius` [Energy](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component) No "capacity" `capacity` [Energy](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component) No "max\_input" `maxInput` [Energy](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component) No "min\_input" `minInput` [Energy](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component) No "max\_output" `maxOutput` [Energy](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component) No "min\_output"" `minOutput` [Experience](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component) No "capacity" `capacity` [Fluid](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component) Yes "capacity" `capacity` [Fluid](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component) Yes "max\_input" `maxInput` [Fluid](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component) Yes "min\_input" `minInput` [Fluid](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component) Yes "max\_output" `maxOutput` [Fluid](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component) Yes "min\_output" `minOutput` [Heat (PNC)](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pnc-heat-component-pnc) No "capacity" `capacity` [Heat (PNC)](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pnc-heat-component-pnc) No "resistance" `resistance` [Item](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component) Yes "capacity" `capacity` [Item](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component) Yes "max\_input" `maxInput` [Item](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component) Yes "max\_output" `maxOutput` [Pressure (PNC)](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pressure-component-pnc) No "volume" `volume` ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#properties) Properties The component modifier has 4 mandatory properties and 4 optional property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#mandatory-properties) Mandatory properties chevron-rightComponent[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#component) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#name-component) Name : `component` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#description) Description : The type of the componentyou want to apply the modifier to. This is the same type as the one you specify in the `type` property when defining the component in the machine json. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#example) Example : This modifier will be applied to the energy component. chevron-rightTarget[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#target) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#name-target) Name : `target` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#description-1) Description : The `target` property can be used to define which one of the component property you want to modify. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#example-1) Example : Modify the capacity property of the component : chevron-rightOperation[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#operation) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#name-operation) Name : `operation` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#description-2) Description : The mathematical operation that will be applied to the targeted component property by the modifier. The available operations are : * `addition` : The resulting value will be the sum of the base component value and the modifier value multiplied by the amount of upgrades. `final_value = base_value + upgrade_modifier * upgrade_amount` * `multiplication` : The resulting value will be the multiplication of the base component value and the modifier value multiplied by the amount of upgrades. `final_value = base_value * upgrade_modifier * upgrade_amount` * exponential : The resulting value will be the multiplication of the base component value and the modifier value powered to the amount of upgrades. `final_value = base_value * upgrade_modifier ^ upgrade_amount` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#example-2) Example : The base component value (defined in the machine json) will be multiplicated by the value defined in this modifier. chevron-rightModifier[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#modifier) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#name-modifier) Name : `modifier` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#description-3) Description : The value (double) to add or multiply to the base component value. It can be positive or negative and support decimal numbers. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#example-3) Example : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#optional-properties) Optional properties chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#description-4) Description : Some components (fluids and items in CM, more in addons) have an id property that must be specified in the modifier so it know which specific component to modify. If a component is single (energy, experience, chunkload in CM) the id can be omitted. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#default-empty) Default : `empty` The modifier will be applied to the single component of the specified type. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#example-4) Example : The modifier will be applied to a component with id "input1" : chevron-rightMax[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#max) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#name-max) Name : `max` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#description-5) Description : A positive integer that define the maximum value obtained after applying this upgrade. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#default-positive_infinity) Default : `POSITIVE_INFINITY` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#example-5) Example : Whatever the modifier does, the resulting value won't be greater than 42. chevron-rightMin[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#min) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#name-min) Name : `min` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#description-6) Description : A positive integer that define the minimum value obtained after applying this upgrade. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#default-negative_infinity) Default : `NEGATIVE_INFINITY` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#example-6) Example : Whatever the modifier does, the resulting value won't be lower than 42. chevron-rightTooltip[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#tooltip) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#name-tooltip) Name : `tooltip` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#description-7) Description : The tooltip that will render when a player hover any machine upgrade item in a gui while holding shift. This is a [text component](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) . #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#default) Default : A short string that describe what the modifier does like : `-50% Energy capacity` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#example-7) Example : The tooltip will be "Overclock: Double energy capacity" in orange. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#example-8) Example A modifier that double energy capacity : A modifier that add 50mB of max input in a fluid component with id "input1" : [PreviousRecipe modifierschevron-left](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers) [NextCrafttweaker (deprecated)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated) Last updated 4 months ago * [List of properties that can be modified](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#list-of-properties-that-can-be-modified) * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers#example-8) sun-brightdesktopmoon Copy "component": "custommachinery:energy" Copy "target": "capacity" Copy "operation": "multiplication" Copy "modifier": 0.5 Copy "id": "input1" Copy "max": 42 Copy "min": 42 Copy "tooltip": { "text": "Overclock: Double energy capacity", "color": "orange" } Copy { "component": "custommachinery:energy", "target": "capacity", "operation": "multiplication", "modifier": 2 } Copy { "component": "custommachinery:fluid", "id": "input1", "target": "max_input", "operation": "addition", "modifier": 50 } sun-brightdesktopmoon --- # Chemical element (Mekanism) | Custom Machinery 1.21 circle-exclamation This element requires [Custom Machinery Mekanismarrow-up-right](https://www.curseforge.com/minecraft/mc-mods/custom-machinery-mekanism) to be installed. The chemical elements are used to display the content of a chemical component in the Machine GUI. A chemical element must be associated with a [chemical component](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism) using the id property. It will display the fluid stored in the component on the machine GUI. If the element cannot find the component (usually because of an error in the id) the element will still be rendered but it will always be empty. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#all-of-mekanism-chemicals-types-are-supported) All of Mekanism chemicals types are supported : * Gas * Infusion * Pigment * Slurry Chemical elements are defined in json with : `"type": "custommachinery:chemical"`. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#properties) Properties The chemical element has 4 mandatory properties and 7 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#mandatory-properties) Mandatory properties Copy "type": "custommachinery:chemical" //Mandatory to define a chemical element. chevron-rightX[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#x) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#name-x) Name : `x` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#description) Description : A positive integer value that define the x axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#example) Example : The element will be rendered 100px to the right from the top-left corner of the gui. Copy "x": 100 chevron-rightY[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#y) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#name-y) Name : `y` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#description-1) Description : A positive integer value that define the y axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#example-1) Example : The element will be rendered 100px to the bottom from the top-left corner of the gui. chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#description-2) Description : The id of the [Chemical Component](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chemical-component-mekanism) you want to link to this element. It must be the exact same id specified in the chemical component json `id` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#example-2) Example : The element will display the chemical component with id `tank1`, if no chemical component has this id it will do nothing. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#optional-properties) Optional properties chevron-rightWidth[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#width) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#name-width) Name : `width` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#description-3) Description : A positive integer value that define the width of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#default) Default : The same width as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#example-3) Example : The width of the element will be 100px. chevron-rightHeight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#height) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#name-height) Name : `height` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#description-4) Description : A positive integer value that define the height of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#default-1) Default : The same height as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#example-4) Example : The height of the element will be 100px. chevron-rightPriority[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#priority) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#name-priority) Name : `priority` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#description-5) Description : An integer property that define the priority of the Element to be rendered. Elements with higher priority will be rendered first. If 2 elements are at the same position the first to be rendered will be under and the last will be above. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#default-0) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#example-5) Example : The element will be rendered under each element that have a priority lower than 1000. chevron-rightTexture[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#texture) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#name-texture) Name : `texture` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#description-6) Description : The location of the texture that will be rendered into the GUI. The location must be referenced by : `namespace:path/file.png` The texture loader will search for textures in the `assets/namespace` folder, the .png extension is required or the file will not be found. The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided. If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#default-2) Default : The default fluid element texture : `custommachinery:textures/gui/base_fluid_storage.png` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#example-6) Example : The file `assets/textures/my_tank_texture.png` will be used for the fluid element. chevron-rightTooltips[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#tooltips) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#name-tooltips) Name : `tooltips` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#description-7) Description : A list of [Text components](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) that will be shown as tooltips when the player mouse cursor hover the element. Each tooltips of the list will be a new line. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#example-7) Example : Replace the default tooltips with a single line that say "Click me !" : chevron-rightOrientation[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#orientation) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#name-orientation) Name : `orientation` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#description-8) Description : The direction the bar will be filled to. Valid values are : `top`, `right`, `bottom` and `left`. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#default-top) Default : `top` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#example-8) Example : The bar will fill towards the right for the machine gui. chevron-rightHighlight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#highlight) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#name-highlight) Name : `highlight` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#description-9) Description : A boolean property, if true the element will highlight (become slightly brighter) when the player mouse hover it. If false the element will not highlight on mouse hover. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#default-true) Default : true #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#example-9) Example : The element will not highlight on mouse hover : ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#example-10) Example : A basic gas chemical element linked to a gas chemical component using the id "tank1" and using the default texture : [PreviousButton elementchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element) [NextConfig elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/config-element) Last updated 8 months ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#properties) * [Example :](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism#example-10) sun-brightdesktopmoon Copy "y": 100 Copy "id": "tank1" Copy "width": 100 Copy "height": 100 Copy "priority": 1000 Copy "texture": "namespace:textures/my_tank_texture.png" Copy "tooltips": "Click me !" Copy "orientation": "right" Copy "highlight": false Copy { "type": "custommachinery:gas", "x": 20, "y": 20, "id": "tank1" } sun-brightdesktopmoon --- # Bar element | Custom Machinery 1.21 The bar gui element can be used to display a number in the form of a fillable bar (the default texture is the same one as the energy gui element). The number value must be stored in the machine data, which is accessible only by using Crafttweaker or KubeJS scripts. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#example-setting-a-number-in-the-data-from-a-script) Example: setting a number in the data from a script KubeJS Crafttweaker Copy .requireFunctionEachTicks(ctx => { //Set the variable named "amount" to 10 //"amount" can be replaced by anything else, //as long as it match the ID specified in the bar gui element properties. ctx.machine.data.amount = 10; return ctx.success() }) Copy .requireFunctionEachTicks((ctx as Context) => { //Set the variable named "amount" to 10 //"amount" can be replaced by anything else, //as long as it match the ID specified in the bar gui element properties. ctx.machine.data.amount = 10; return ctx.success(); }); Bar elements are defined in json with : `"type": "custommachinery:bar"`. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#properties) Properties The bar gui element has 4 mandatory properties and 10 optional properties. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#mandatory-properties) Mandatory properties Copy "type": "custommachinery:bar" //Mandatory to define a bar element. chevron-rightX[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#x) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#name-x) Name : `x` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#description) Description : A positive integer value that define the x axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#example) Example : The element will be rendered 100px to the right from the top-left corner of the gui. Copy "x": 100 chevron-rightY[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#y) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#name-y) Name : `y` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#description-1) Description : A positive integer value that define the y axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#example-1) Example : The element will be rendered 100px to the bottom from the top-left corner of the gui. chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#description-2) Description : A string that define the name of the number variable in the machine data that should be used for filling the bar. If the machine data doesn't contain any number value with this id the number shown by the bar will always be 0. The number variable must be at the higher level of the machine data : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#example-2) Example : The bar gui element will show the number variable named "amount" from the machine data : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#optional-properties) Optional properties chevron-rightWidth[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#width) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#name-width) Name : `width` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#description-3) Description : A positive integer value that define the width of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#default) Default : The same width as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#example-3) Example : The width of the element will be 100px. chevron-rightHeight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#height) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#name-height) Name : `height` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#description-4) Description : A positive integer value that define the height of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#default-1) Default : The same height as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#example-4) Example : The height of the element will be 100px. chevron-rightPriority[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#priority) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#name-priority) Name : `priority` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#description-5) Description : An integer property that define the priority of the Element to be rendered. Elements with higher priority will be rendered first. If 2 elements are at the same position the first to be rendered will be under and the last will be above. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#default-0) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#example-5) Example : The element will be rendered under each element that have a priority lower than 1000. chevron-rightEmpty texture[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#empty-texture) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#name-texture_empty) Name : `texture_empty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#description-6) Description : Point to a texture to use as the empty element texture. The texture must be loaded in-game with a resource pack or a loader mod. The texture can be any size, if the texture size is different from the default size the `width` and `height` properties of the element will be automatically changed to fit the texture size if not provided. If the `width` and/or `height` properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#default-2) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#example-6) Example : The element will search for a texture located in `assets/namespace/textures/energy_element_texture_empty.png` **The .png extension is mandatory**. chevron-rightFilled texture[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#filled-texture) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#name-texture_filled) Name : `texture_filled` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#description-7) Description : Point to a texture to use as the filled element texture. The texture must be loaded in-game with a resource pack or a loader mod. The filled texture will be rendered on top on the empty texture, how much the filled texture overlap the empty texture is relative to the amount of energy inside the energy component. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#default-3) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#example-7) Example : The element will search for a texture located in `assets/namespace/textures/energy_element_texture_filled.png` **The .png extension is mandatory**. chevron-rightHighlight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#highlight) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#name-highlight) Name : `highlight` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#description-8) Description : A boolean property, if true the element will highlight (become slightly brighter) when the player mouse hover it. If false the element will not highlight on mouse hover. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#default-true) Default : true #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#example-8) Example : The element will not highlight on mouse hover : chevron-rightTooltips[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#tooltips) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#name-tooltips) Name : `tooltips` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#description-9) Description : A list of [Text components](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) that will be shown as tooltips when the player mouse cursor hover the element. Each tooltips of the list will be a new line. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#example-9) Example : Replace the default tooltips with a single line that say "Click me !" : chevron-rightMin[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#min) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#name-min) Name : `min` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#description-10) Description : An integer value that define the minimal amount needed for the bar to start filling. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#default-0-1) Default : `0` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#example-10) Example : The bar will start filling if the displayed number is higher than 100. chevron-rightMax[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#max) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#name-max) Name : `max` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#description-11) Description : An integer value that define the maximal amount displayed by the bar. (From this amount the bar will show full. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#default-1000) Default : `1000` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#example-11) Example : The bar will be full if the displayed number is equals or higher than 100. chevron-rightOrientation[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#orientation) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#name-orientation) Name : `orientation` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#description-12) Description : The direction the bar will be filled to. Valid values are : `top`, `right`, `bottom` and `left`. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#default-top) Default : `top` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#example-12) Example : The bar will fill towards the right for the machine gui. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#example-13) Example A bar with default texture, which show a number stored in the machine data with id "amount", which is between 0 and 10000 : [PreviousBackground elementchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element) [NextButton elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element) * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element#example-13) sun-brightdesktopmoon Copy "y": 100 Copy // This is OK machine.data.amount = 10 // This won't work machine.data.something.amount = 10 Copy "id": "amount" Copy "width": 100 Copy "height": 100 Copy "priority": 1000 Copy "texture_empty": "custommachinery:textures/gui/base_energy_storage_empty" Copy "texture_empty": "namespace:textures/energy_element_texture_empty.png" Copy "texture_filled": "custommachinery:textures/gui/base_energy_storage_filled" Copy "texture_filled": "namespace:textures/energy_element_texture_filled.png" Copy "highlight": false Copy "tooltips": "Click me !" Copy "min": 100 Copy "max": 100 Copy "orientation": "right" Copy { "type": "custommachinery:bar", "x": 20, "y": 20, "id": "amount", "max": 10000 } sun-brightdesktopmoon --- # Reset element | Custom Machinery 1.21 The reset gui element is a button used to reset the machine to it's idle state. When clicked, the reset button will stop the current process and put the machine in it's idle state, all already used inputs will be lost. Reset elements are defined in json with : `"type": "custommachinery:reset"`. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#properties) Properties The reset gui element has 3 mandatory properties and 7 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#mandatory-properties) Mandatory properties Copy "type": "custommachinery:reset" //Mandatory to define a reset element. chevron-rightX[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#x) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#name-x) Name : `x` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#description) Description : A positive integer value that define the x axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#example) Example : The element will be rendered 100px to the right from the top-left corner of the gui. Copy "x": 100 chevron-rightY[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#y) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#name-y) Name : `y` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#description-1) Description : A positive integer value that define the y axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#example-1) Example : The element will be rendered 100px to the bottom from the top-left corner of the gui. Copy "y": 100 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#optional-properties) Optional properties chevron-rightWidth[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#width) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#name-width) Name : `width` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#description-2) Description : A positive integer value that define the width of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#default) Default : The same width as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#example-2) Example : The width of the element will be 100px. Copy "width": 100 chevron-rightHeight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#height) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#name-height) Name : `height` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#description-3) Description : A positive integer value that define the height of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#default-1) Default : The same height as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#example-3) Example : The height of the element will be 100px. chevron-rightPriority[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#priority) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#name-priority) Name : `priority` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#description-4) Description : An integer property that define the priority of the Element to be rendered. Elements with higher priority will be rendered first. If 2 elements are at the same position the first to be rendered will be under and the last will be above. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#default-0) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#example-4) Example : The element will be rendered under each element that have a priority lower than 1000. chevron-rightTexture[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#texture) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#name-texture) Name : `texture` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#description-5) Description : The location of the texture that will be rendered into the GUI. The location must be referenced by : `namespace:path/file.png` The texture loader will search for textures in the `assets/namespace` folder, the .png extension is required or the file will not be found. The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided. If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#default-2) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#example-5) Example : The file `assets/textures/my_texture.png` will be used for the reset element. chevron-rightTexture hovered[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#texture-hovered) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#name-texture_hovered) Name : `texture_hovered` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#description-6) Description : The location of the texture that will be rendered into the GUI when the players mouse cursor is hovering the element. The location must be referenced by : `namespace:path/file.png` The texture loader will search for textures in the `assets/namespace` folder, the .png extension is required or the file will not be found. The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided. If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#default-3) Default : Example : The file `assets/textures/my_texture.png` will be used. chevron-rightTooltips[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#tooltips) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#name-tooltips) Name : `tooltips` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#description-7) Description : A list of [Text components](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) that will be shown as tooltips when the player mouse cursor hover the element. Each tooltips of the list will be a new line. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#example-6) Example : Replace the default tooltips with a single line that say "Click me !" : chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#description-8) Description : The id of this gui element. By default it does nothing and can be omitted. This is really only useful if you intend to make a recipe that replace this element. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#default-empty) Default : `empty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#example-7) Example : The id of this element will be `reset` ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#example-8) Example A basic reset gui element : ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2Fgithub.com%2FFrinn38%2FCustom-Machinery%2Fraw%2F1.16.5%2Fwiki%2Freset_element.png&width=768&dpr=3&quality=100&sign=9ac99234&sv=2) Reset element base texture [PreviousProgress bar elementchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element) [NextSplit elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element) Last updated 1 year ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element#example-8) sun-brightdesktopmoon Copy "height": 100 Copy "priority": 1000 Copy "texture": "custommachinery:textures/gui/base_reset.png" Copy "texture": "namespace:textures/my_texture.png" Copy "texture_hovered": "custommachinery:textures/gui/base_reset_hovered.png" Copy "texture_hovered": "namespace:textures/my_texture.png" Copy "tooltips": "Click me !" Copy "id": "reset" Copy { "type": "custommachinery:reset", "x": 20, "y": 20 } sun-brightdesktopmoon --- # Fluid element | Custom Machinery 1.21 The fluid elements are used to display the content of a fluid component in the Machine GUI. A Fluid element must be associated with a [Fluid Component](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component) using the id property. It will display the fluid stored in the Fluid Component on the Machine GUI. Fluid elements are defined in json with `"type": "custommachinery:fluid"`. If the fluid element cannot find the fluid Component (usually because of an error in the id) the fluid element will still be rendered but it will always be empty. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#properties) Properties The fluid element has 4 mandatory properties and 7 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#mandatory-properties) Mandatory properties Copy "type": "custommachinery:fluid" //Mandatory to define a fluid element. chevron-rightX[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#x) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#name-x) Name : `x` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#description) Description : A positive integer value that define the x axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#example) Example : The element will be rendered 100px to the right from the top-left corner of the gui. Copy "x": 100 chevron-rightY[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#y) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#name-y) Name : `y` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#description-1) Description : A positive integer value that define the y axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#example-1) Example : The element will be rendered 100px to the bottom from the top-left corner of the gui. Copy "y": 100 chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#description-2) Description : The id of the [Fluid Component](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component#mandatory-properties) you want to link to this element. It must be the exact same id specified in the fluid component json `id` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#example-2) Example : The element will display the fluid component with id `tank1`, if no fluid component has this id it will do nothing. Copy "id": "tank1" #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#optional-properties) Optional properties chevron-rightWidth[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#width) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#name-width) Name : `width` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#description-3) Description : A positive integer value that define the width of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#default) Default : The same width as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#example-3) Example : The width of the element will be 100px. chevron-rightHeight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#height) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#name-height) Name : `height` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#description-4) Description : A positive integer value that define the height of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#default-1) Default : The same height as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#example-4) Example : The height of the element will be 100px. chevron-rightPriority[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#priority) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#name-priority) Name : `priority` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#description-5) Description : An integer property that define the priority of the Element to be rendered. Elements with higher priority will be rendered first. If 2 elements are at the same position the first to be rendered will be under and the last will be above. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#default-0) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#example-5) Example : The element will be rendered under each element that have a priority lower than 1000. chevron-rightTexture[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#texture) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#name-texture) Name : `texture` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#description-6) Description : The location of the texture that will be rendered into the GUI. The location must be referenced by : `namespace:path/file.png` The texture loader will search for textures in the `assets/namespace` folder, the .png extension is required or the file will not be found. The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided. If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#default-2) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#example-6) Example : The file `assets/textures/my_tank_texture.png` will be used for the fluid element. chevron-rightTexture hovered[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#texture-hovered) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#name-texture_hovered) Name : `texture_hovered` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#description-7) Description : The location of the texture that will be rendered into the GUI when the players mouse cursor is hovering the element. The location must be referenced by : `namespace:path/file.png` The texture loader will search for textures in the `assets/namespace` folder, the .png extension is required or the file will not be found. The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided. If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#default-3) Default : None, the element will use the texture defined in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#example-7) Example : The file `assets/textures/my_texture.png` will be used. chevron-rightTooltips[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#tooltips) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#name-tooltips) Name : `tooltips` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#description-8) Description : A list of [Text components](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) that will be shown as tooltips when the player mouse cursor hover the element. Each tooltips of the list will be a new line. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#example-8) Example : Replace the default tooltips with a single line that say "Click me !" : chevron-rightHighlight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#highlight) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#name-highlight) Name : `highlight` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#description-9) Description : A boolean property, if true the element will highlight (become slightly brighter) when the player mouse hover it. If false the element will not highlight on mouse hover. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#default-true) Default : true #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#example-9) Example : The element will not highlight on mouse hover : chevron-rightOrientation[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#orientation) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#name-orientation) Name : `orientation` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#description-10) Description : The direction the bar will be filled to. Valid values are : `top`, `right`, `bottom` and `left`. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#default-top) Default : `top` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#example-10) Example : The bar will fill towards the right for the machine gui. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#example-11) Example : A basic fluid element linked to a fluid component using the id "tank1" and using the default texture : Result : ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2Fgithub.com%2FFrinn38%2FCustom-Machinery%2Fraw%2F1.16.5%2Fwiki%2Ffluid_element.png&width=768&dpr=3&quality=100&sign=f46dbddb&sv=2) Fluid element base texture (Here the Fluid Component contains 4000mB of Water) [PreviousExperience elementchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element) [NextFuel elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element) Last updated 9 months ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#properties) * [Example :](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element#example-11) sun-brightdesktopmoon Copy "width": 100 Copy "height": 100 Copy "priority": 1000 Copy "texture": "custommachinery:textures/gui/base_fluid_storage.png" Copy "texture": "namespace:textures/my_tank_texture.png" Copy "texture_hovered": "namespace:textures/my_texture.png" Copy "tooltips": "Click me !" Copy "highlight": false Copy "orientation": "right" Copy { "type": "custommachinery:fluid", "x": 20, "y": 20, "id": "tank1" } sun-brightdesktopmoon --- # PNC Heat element (PNC) | Custom Machinery 1.21 circle-exclamation This gui element requires [Custom Machinery Pneumaticcraftarrow-up-right](https://www.curseforge.com/minecraft/mc-mods/custom-machinery-pneumaticcraft) to be installed. The heat gui element is used to display the content of a [heat component](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pnc-heat-component-pnc) present in the machine. Heat elements are defined in json with : `"type": "custommachinery:pnc_heat"`. Note that if you didn't set a heat component in the machine json the heat element will still work but will always show a value of 0. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#properties) Properties The heat element has 3 mandatory properties and 5 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#mandatory-properties) Mandatory properties Copy "type": "custommachinery:pnc_heat" //Mandatory to define a PNC heat element. chevron-rightX[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#x) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#name-x) Name : `x` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#description) Description : A positive integer value that define the x axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#example) Example : The element will be rendered 100px to the right from the top-left corner of the gui. Copy "x": 100 chevron-rightY[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#y) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#name-y) Name : `y` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#description-1) Description : A positive integer value that define the y axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#example-1) Example : The element will be rendered 100px to the bottom from the top-left corner of the gui. Copy "y": 100 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#optional-properties) Optional properties chevron-rightWidth[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#width) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#name-width) Name : `width` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#description-2) Description : A positive integer value that define the width of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#default) Default : The same width as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#example-2) Example : The width of the element will be 100px. chevron-rightHeight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#height) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#name-height) Name : `height` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#description-3) Description : A positive integer value that define the height of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#default-1) Default : The same height as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#example-3) Example : The height of the element will be 100px. chevron-rightPriority[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#priority) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#name-priority) Name : `priority` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#description-4) Description : An integer property that define the priority of the Element to be rendered. Elements with higher priority will be rendered first. If 2 elements are at the same position the first to be rendered will be under and the last will be above. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#default-0) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#example-4) Example : The element will be rendered under each element that have a priority lower than 1000. chevron-rightTooltips[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#tooltips) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#name-tooltips) Name : `tooltips` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#description-5) Description : A list of [Text components](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) that will be shown as tooltips when the player mouse cursor hover the element. Each tooltips of the list will be a new line. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#example-5) Example : Replace the default tooltips with a single line that say "Click me !" : chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#description-6) Description : The id of this gui element. By default it does nothing and can be omitted. This is really only useful if you intend to make a recipe that replace this element. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#default-empty) Default : `empty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#example-6) Example : The id of this element will be `heat` ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#example-7) Example A typical heat gui element : Result : ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2F3380432015-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FZznnGu8KvEhqjN3qmLqp%252Fuploads%252FIVr31tjBgs2E1IUlGz3D%252Fpnc_heat_element.png%3Falt%3Dmedia%26token%3D3e658dc4-81be-46e9-ac17-24e281aa0e7e&width=768&dpr=3&quality=100&sign=a7e0980&sv=2) [PreviousPlayer inventory elementchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element) [NextPressure element (PNC)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc) Last updated 7 months ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc#example-7) sun-brightdesktopmoon Copy "width": 100 Copy "height": 100 Copy "priority": 1000 Copy "tooltips": "Click me !" Copy "id": "heat" Copy { "type": "custommachinery:pnc_heat", "x": 20, "y": 20 } sun-brightdesktopmoon --- # Pressure element (PNC) | Custom Machinery 1.21 circle-exclamation This gui element requires [Custom Machinery Pneumaticcraftarrow-up-right](https://www.curseforge.com/minecraft/mc-mods/custom-machinery-pneumaticcraft) to be installed. The pressure gui element is used to display the content of a [pressure component](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pressure-component-pnc) present in the machine. Pressure elements are defined in json with : `"type": "custommachinery:pressure"` . Note that if you didn't set a pressure component in the machine json the pressure element will still work but will always show a value of 0. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#properties) Properties The pressure element has 3 mandatory properties and 5 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#mandatory-properties) Mandatory properties Copy "type": "custommachinery:pressure" chevron-rightX[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#x) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#name-x) Name : `x` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#description) Description : A positive integer value that define the x axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#example) Example : The element will be rendered 100px to the right from the top-left corner of the gui. Copy "x": 100 chevron-rightY[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#y) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#name-y) Name : `y` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#description-1) Description : A positive integer value that define the y axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#example-1) Example : The element will be rendered 100px to the bottom from the top-left corner of the gui. Copy "y": 100 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#optional-properties) Optional properties chevron-rightWidth[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#width) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#name-width) Name : `width` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#description-2) Description : A positive integer value that define the width of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#default) Default : The same width as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#example-2) Example : The width of the element will be 100px. chevron-rightHeight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#height) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#name-height) Name : `height` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#description-3) Description : A positive integer value that define the height of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#default-1) Default : The same height as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#example-3) Example : The height of the element will be 100px. chevron-rightPriority[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#priority) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#name-priority) Name : `priority` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#description-4) Description : An integer property that define the priority of the Element to be rendered. Elements with higher priority will be rendered first. If 2 elements are at the same position the first to be rendered will be under and the last will be above. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#default-0) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#example-4) Example : The element will be rendered under each element that have a priority lower than 1000. chevron-rightTooltips[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#tooltips) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#name-tooltips) Name : `tooltips` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#description-5) Description : A list of [Text components](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) that will be shown as tooltips when the player mouse cursor hover the element. Each tooltips of the list will be a new line. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#example-5) Example : Replace the default tooltips with a single line that say "Click me !" : chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#description-6) Description : The id of this gui element. By default it does nothing and can be omitted. This is really only useful if you intend to make a recipe that replace this element. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#default-empty) Default : `empty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#example-6) Example : The id of this element will be `pressure` ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#example-7) Example A typical pressure gui element : Result : ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2F3380432015-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FZznnGu8KvEhqjN3qmLqp%252Fuploads%252FDsrbAwLbiC9cO6uwHkh5%252Fpressure_element.png%3Falt%3Dmedia%26token%3Dba7ec3dd-318f-43cf-a6db-7de0edb1113c&width=768&dpr=3&quality=100&sign=9d6b28f&sv=2) pressure gui element [PreviousPNC Heat element (PNC)chevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc) [NextProgress bar elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element) Last updated 1 year ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc#example-7) sun-brightdesktopmoon Copy "width": 100 Copy "height": 100 Copy "priority": 1000 Copy "tooltips": "Click me !" Copy "id": "pressure" Copy { "type": "custommachinery:pressure", "x": 20, "y": 20 } sun-brightdesktopmoon --- # Fuel element | Custom Machinery 1.21 Fuel element is used to render a fuel bar on the Machine GUI. Fuel elements are defined in json with : `"type": "custommachinery:fuel"`. You can add as many fuel element as you want to the machine GUI but they will all show the same burn time and be filled the same. By default the texture is the same as the vanilla furnace little flame but you can change it if wanted. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#properties) Properties The fuel element has 3 mandatory properties and 8 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#mandatory-properties) Mandatory properties Copy "type": "custommachinery:fuel" //Mandatory to define a fuel element. chevron-rightX[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#x) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#name-x) Name : `x` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#description) Description : A positive integer value that define the x axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#example) Example : The element will be rendered 100px to the right from the top-left corner of the gui. Copy "x": 100 chevron-rightY[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#y) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#name-y) Name : `y` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#description-1) Description : A positive integer value that define the y axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#example-1) Example : The element will be rendered 100px to the bottom from the top-left corner of the gui. Copy "y": 100 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#optional-properties) Optional properties chevron-rightWidth[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#width) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#name-width) Name : `width` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#description-2) Description : A positive integer value that define the width of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#default) Default : The same width as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#example-2) Example : The width of the element will be 100px. chevron-rightHeight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#height) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#name-height) Name : `height` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#description-3) Description : A positive integer value that define the height of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#default-1) Default : The same height as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#example-3) Example : The height of the element will be 100px. chevron-rightPriority[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#priority) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#name-priority) Name : `priority` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#description-4) Description : An integer property that define the priority of the Element to be rendered. Elements with higher priority will be rendered first. If 2 elements are at the same position the first to be rendered will be under and the last will be above. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#default-0) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#example-4) Example : The element will be rendered under each element that have a priority lower than 1000. chevron-rightEmpty texture[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#empty-texture) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#name-texture_empty) Name : `texture_empty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#description-5) Description : Point to a texture to use as the empty element texture. The texture must be loaded in-game with a resource pack or a loader mod. The texture can be any size, if the texture size is different from the default size the `width` and `height` properties of the element will be automatically changed to fit the texture size if not provided. If the `width` and/or `height` properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#default-2) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#example-5) Example : The element will search for a texture located in `assets/namespace/textures/fuel_element_texture_empty.png` **The .png extension is mandatory**. chevron-rightFilled texture[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#filled-texture) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#name-texture_filled) Name : `texture_filled` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#description-6) Description : Point to a texture to use as the filled element texture. The texture must be loaded in-game with a resource pack or a loader mod. The texture can be any size, if the texture size is different from the default size the `width` and `height` properties of the element will be automatically changed to fit the texture size if not provided. If the `width` and/or `height` properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#default-3) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#example-6) Example : The element will search for a texture located in `assets/namespace/textures/fuel_element_texture_filled.png` **The .png extension is mandatory**. chevron-rightTooltips[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#tooltips) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#name-tooltips) Name : `tooltips` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#description-7) Description : A list of [Text components](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) that will be shown as tooltips when the player mouse cursor hover the element. Each tooltips of the list will be a new line. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#example-7) Example : Replace the default tooltips with a single line that say "Click me !" : chevron-rightOrientation[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#orientation) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#name-orientation) Name : `orientation` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#description-8) Description : The direction the bar will be filled to. Valid values are : `top`, `right`, `bottom` and `left`. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#default-top) Default : `top` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#example-8) Example : The bar will fill towards the right for the machine gui. chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#description-9) Description : The id of this gui element. By default it does nothing and can be omitted. This is really only useful if you intend to make a recipe that replace this element. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#default-empty) Default : `empty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#example-9) Example : The id of this element will be `fuel` ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#example-10) Example A basic fuel element : Result : On the image below the Machine was given 1 coal which have a burn time of 1600 ticks and the screenshot was taken at 913 ticks of burn time remaining so the fuel bar was filled at about 55% ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2Fgithub.com%2FFrinn38%2FCustom-Machinery%2Fraw%2F1.16.5%2Fwiki%2Ffuel_element.png&width=768&dpr=3&quality=100&sign=1a2d3a25&sv=2) Fuel element base texture [PreviousFluid elementchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element) [NextHeat element (Mekanism)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism) Last updated 1 year ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element#example-10) sun-brightdesktopmoon Copy "width": 100 Copy "height": 100 Copy "priority": 1000 Copy "texture_empty": "custommachinery:textures/gui/base_fuel_empty" Copy "texture_empty": "namespace:textures/fuel_element_texture_empty.png" Copy "texture_filled": "custommachinery:textures/gui/base_fuel_filled" Copy "texture_filled": "namespace:textures/fuel_element_texture_filled.png" Copy "tooltips": "Click me !" Copy "orientation": "right" Copy "id": "fuel" Copy { "type": "custommachinery:fuel", "x": 20, "y": 20 } sun-brightdesktopmoon --- # Machine | Custom Machinery 1.21 Machine is one of the object provided in the [function requirement context](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context) . It contains various methods for interacting with the machine. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/machine#methods) Methods chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/machine#id) Get the id of the machine, the id is a String of the format : `namespace:path`. You can also change the machine id, the machine will switch to the specified machine, inventory will be preserved as long as machines have similar inventories. Copy var machine = ctx.machine; //Return the machine id as a string. var id = machine.id; //Change the machine ID machine.id = "namespace:machine_id" chevron-rightData[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/machine#data) Add a way to store custom data in the machine. The stored data will be stored in the machine as NBT and saved when the machine is unloaded, preventing loosing the data, for example, when the game is quitted. In a CT script the data is retrieved as a [MapDataarrow-up-right](https://docs.blamejared.com/1.18/en/vanilla/api/data/MapData) . Copy var machine = ctx.machine; //Get the MapData from the machine. var data = machine.data; //Put something in the data : data.put("power", 2) chevron-rightOwner[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/machine#owner) Copy var machine = ctx.machine; //Get the machine owner name as a Component, or null if the machine doesn't have an owner. var ownerName = machine.ownerName; //Get the machine owner UUID, or null if the machine doesn't have an owner. var ownerId = machine.ownerId; //Check if an entity is the owner of the machine. var isOwner = machine.isOwner(entity); //Get the owner as a LivingEntity, or null if the machine doesn't have an owner. //This only works if the entity that own the machine is loaded. //If the owner is a player they must be connected. //IF the owner is a mob it must be in a loaded chunk. var owner = machine.owner; //Set a LivingEntity as the new machine owner. machine.owner = entity; chevron-rightPause[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/machine#pause) Allow to check if the machine is paused, and pause or resume it. Copy var machine = ctx.machine; //Return true if the machine is paused, false otherwise var paused = machine.paused; //Pause the machine machine.paused = true; //Resume the machine machine.pause = false; chevron-rightEnergy[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/machine#energy) chevron-rightFluids[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/machine#fluids) chevron-rightItems[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/machine#items) chevron-rightChunkload[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/machine#chunkload) ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/machine#mekanism-support) Mekanism support circle-info The following methods are only available if [Custom Machinery Mekanismarrow-up-right](https://www.curseforge.com/minecraft/mc-mods/custom-machinery-mekanism) addon is installed. chevron-rightChemicals[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/machine#chemicals) All chemicals used here must be a Crafttweaker [ChemicalStackarrow-up-right](https://docs.blamejared.com/1.16/en/mods/Mekanism/api/chemical/stack/ChemicalStack) . Examples : Put 500mB of steam gas in the first available tank. Remove all the slurry stored in the "slurry" tank. chevron-rightHeat/Temperature[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/machine#heat-temperature) chevron-rightRadiations[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/machine#radiations) [PreviousContextchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context) [NextHeat (Mekanism)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/heat-mekanism) Last updated 1 year ago * [Methods](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/machine#methods) * [Mekanism support](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/machine#mekanism-support) sun-brightdesktopmoon Copy var machine = ctx.machine; //Return the energy stored in the machine internal buffer. var energy = machine.energyStored; //Return the maximum capacity of the machine energy storage. var energyCapacity = machine.energyCapacity; //Return the amount of energy that was successfully added to the machine (or amountToAdd if all the energy was inserted). //If simulate is `false` the energy will really be inserted, otherwise it wont. //amountToAdd MUST be a positive value. var addedEnergy = machine.addEnergy(amountToAdd, simulate); //Return the amount of energy that was successfully removed from the machine (or amountToRemove if all the energy was extracted). //If simulate is `false` the energy will really be extracted, otherwise it wont. //amountToRemove MUST be a positive value. var removedEnergy = machine.removeEnergy(amountToRemove, simulate); Copy var machine = ctx.machine; //Return the fluid stored in the specified tank. //The returned fluid is a CT IFluidStack, see docs : https://docs.blamejared.com/1.16/en/vanilla/api/fluid/IFluidStack var fluid = machine.getFluidStored("tankID"); //Return the capacity of the specified tank. var capacity = machine.getFluidCapacity("tankID"); //Add the specified fluid to the first available tank. //Return the amount of fluid that was added. //The passed fluid must be a CT IFluidStack, see docs : https://docs.blamejared.com/1.16/en/vanilla/api/fluid/IFluidStack //If simulate is `false` the fluid will really be inserted, otherwise it wont. var remaining = machine.addFluid(fluid, simulate); //Add the specified fluid to the specified tank. //Return the amount of fluid that was added. //The passed fluid must be a CT IFluidStack, see docs : https://docs.blamejared.com/1.16/en/vanilla/api/fluid/IFluidStack //If simulate is `false` the fluid will really be inserted, otherwise it wont. var remaining = machine.addFluidToTank("tankID", fluid, simulate); //Remove the specified fluid from the first available tank. //Return the fluid that was successfully removed. //Both passed and returned fluids must be a CT IFluidStack, see docs : https://docs.blamejared.com/1.16/en/vanilla/api/fluid/IFluidStack //If simulate is `false` the fluid will really be removed, otherwise it wont. var removedFluid = machine.removeFluid(fluid, simulate); //Remove the specified amount of fluid from the specified tank. //Return the fluid that was successfully removed. //The returned fluid is a CT IFluidStack, see docs : https://docs.blamejared.com/1.16/en/vanilla/api/fluid/IFluidStack //The specified amount MUST be a positive integer value. //If simulate is `false` the fluid will really be removed, otherwise it wont. var remaining = machine.removeFluidFromTank("tankID", amount, simulate); Copy var machine = ctx.machine; //Return the item stored in the specified slot. //The returned item is a CT IItemStack, see docs : https://docs.blamejared.com/1.16/en/vanilla/api/items/IItemStack var item = machine.getItemStored("slotID"); //Return the capacity of the specified slot. var capacity = machine.getItemCapacity("slotID"); //Add the specified item to the specified slot. //Return the item that couldn't be added, or an empty ItemStack if all items were successfully added. //The passed item must be a CT IItemStack, see docs : https://docs.blamejared.com/1.16/en/vanilla/api/items/IItemStack //If simulate is `false` the item will really be inserted, otherwise it wont. var remaining = machine.addItemToSlot("slotID", itemToAdd, simulate); //Remove the specified amount of item from the specified slot. //Return the item that were successfully removed, or an empty ItemStack if the slot was empty. //The returned item is a CT IItemStack, see docs : https://docs.blamejared.com/1.16/en/vanilla/api/items/IItemStack //The specified amount MUST be a positive integer value. //If simulate is `false` the item will really be extracted, otherwise it wont. var extracted = machine.removeItemFromSlot("slotID", amountToRemove, simulate); //Lock a slot (players won't be able to place or take items from the GUI but automation will still work. machine.lockSlot("slotID"); //Unlock a slot machine.unlockSlot("slotID"); //Return true if the slot is locked, false otherwise var locked = slot.isSlotLocked(); Copy let machine = ctx.machine //Enable chunkloading with a radius of 1 machine.enableChunkloading(1) //Disable chunkloading machine.disableChunkload() //Check if chunkloading is active let active = machine.isChunkloadEnabled() //Get the current chunkload radius let radius = machine.getChunkloadRadius() Copy //Get the machine from the context. var machine = ctx.machine; //Return the chemical stored in the specified tank. var fluid = machine.getChemicalStored("tankID"); //Set a the content of a tank. //Doesn't return anything. machine.setChemicalStored(chemical); //Return the capacity of the specified tank. var capacity = machine.getChemicalCapacity("tankID"); //Add the specified chemical to the first available tank. //Return the chemical that couldn't be added. //If simulate is `false` the chemical will really be inserted, otherwise it wont. var remaining = machine.addChemical(chemical, simulate); //Add the specified chemical to the specified tank. //Return the chemical that couldn't be added. //If simulate is `false` the chemical will really be inserted, otherwise it wont. var remaining = machine.addChemicalToTank("tankID", chemical, simulate); //Remove the specified chemical from the first available tank. //Return the chemical that was successfully removed. //If simulate is `false` the chemical will really be removed, otherwise it wont. var removedFluid = machine.removeChemical(chemical, simulate); //Remove the specified amount of chemical from the specified tank. //Return the chemical that was successfully removed. //The specified amount MUST be a positive integer value. //If simulate is `false` the chemical will really be removed, otherwise it wont. var remaining = machine.removeChemicalFromTank("tankID", amount, simulate); Copy machine.addChemical( * 500, false); Copy var removedSlurry = machine.removeChemicalFromTank("slurry", machine.getChemicalCapacity("slurry"), false); Copy //Get the machine from the context. var machine = ctx.machine; //Get the heat stored in the machine (as raw decimal value). var heat = machine.heat; //Get the temperature of the machine (in Kelvin I guess). var temperature = machine.temperature; //Add some heat to the machine (you can use negative values to actually remove heat). machine.addHeat(amount); //Set the heat of the machine to a specified value. machine.heat = amount; Copy //Get the machine from the context. var machine = ctx.machine; //Get the radiations amount at the machine position. var radiations = machine.radiations; //Add some radiations to the machine position. machine.addRadiations(amount); //Remove radiations in a radius (in blocks) around the machine. machine.removeRadiations(amount, radius); sun-brightdesktopmoon --- # Energy element | Custom Machinery 1.21 The energy gui element is used to display the content of an [Energy Component](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component) present in the machine. Energy elements are defined in json with : `"type": "custommachinery:energy"`. Note that if you didn't set an energy component in the machine json the Energy Element will still work but will always show a value of 0FE. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#properties) Properties The energy element has 3 mandatory properties and 9 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#mandatory-properties) Mandatory properties Copy "type": "custommachinery:energy" //Mandatory to define an energy element. chevron-rightX[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#x) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#name-x) Name : `x` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#description) Description : A positive integer value that define the x axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#example) Example : The element will be rendered 100px to the right from the top-left corner of the gui. Copy "x": 100 chevron-rightY[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#y) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#name-y) Name : `y` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#description-1) Description : A positive integer value that define the y axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#example-1) Example : The element will be rendered 100px to the bottom from the top-left corner of the gui. Copy "y": 100 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#optional-properties) Optional properties chevron-rightWidth[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#width) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#name-width) Name : `width` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#description-2) Description : A positive integer value that define the width of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#default) Default : The same width as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#example-2) Example : The width of the element will be 100px. Copy "width": 100 chevron-rightHeight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#height) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#name-height) Name : `height` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#description-3) Description : A positive integer value that define the height of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#default-1) Default : The same height as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#example-3) Example : The height of the element will be 100px. chevron-rightPriority[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#priority) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#name-priority) Name : `priority` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#description-4) Description : An integer property that define the priority of the Element to be rendered. Elements with higher priority will be rendered first. If 2 elements are at the same position the first to be rendered will be under and the last will be above. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#default-0) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#example-4) Example : The element will be rendered under each element that have a priority lower than 1000. chevron-rightEmpty texture[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#empty-texture) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#name-texture_empty) Name : `texture_empty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#description-5) Description : Point to a texture to use as the empty element texture. The texture must be loaded in-game with a resource pack or a loader mod. The texture can be any size, if the texture size is different from the default size the `width` and `height` properties of the element will be automatically changed to fit the texture size if not provided. If the `width` and/or `height` properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#default-2) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#example-5) Example : The element will search for a texture located in `assets/namespace/textures/energy_element_texture_empty.png` **The .png extension is mandatory**. chevron-rightFilled texture[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#filled-texture) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#name-texture_filled) Name : `texture_filled` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#description-6) Description : Point to a texture to use as the filled element texture. The texture must be loaded in-game with a resource pack or a loader mod. The filled texture will be rendered on top on the empty texture, how much the filled texture overlap the empty texture is relative to the amount of energy inside the energy component. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#default-3) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#example-6) Example : The element will search for a texture located in `assets/namespace/textures/energy_element_texture_filled.png` **The .png extension is mandatory**. chevron-rightTooltips[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#tooltips) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#name-tooltips) Name : `tooltips` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#description-7) Description : A list of [Text components](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) that will be shown as tooltips when the player mouse cursor hover the element. Each tooltips of the list will be a new line. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#example-7) Example : Replace the default tooltips with a single line that say "Click me !" : chevron-rightHighlight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#highlight) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#name-highlight) Name : `highlight` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#description-8) Description : A boolean property, if true the element will highlight (become slightly brighter) when the player mouse hover it. If false the element will not highlight on mouse hover. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#default-true) Default : true #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#example-8) Example : The element will not highlight on mouse hover : chevron-rightOrientation[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#orientation) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#name-orientation) Name : `orientation` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#description-9) Description : The direction the bar will be filled to. Valid values are : `top`, `right`, `bottom` and `left`. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#default-top) Default : `top` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#example-9) Example : The bar will fill towards the right for the machine gui. chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#description-10) Description : The id of this gui element. By default it does nothing and can be omitted. This is really only useful if you intend to make a recipe that replace this element. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#default-empty) Default : `empty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#example-10) Example : The id of this element will be `energy` ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#example-11) Example A typical Energy GUI Element : Result : ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2Fgithub.com%2FFrinn38%2FCustom-Machinery%2Fraw%2F1.16.5%2Fwiki%2Fenergy_element.png&width=768&dpr=3&quality=100&sign=6baba07d&sv=2) Energy element base texture [PreviousEmpty elementchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/empty-element) [NextExperience elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element) Last updated 1 year ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element#example-11) sun-brightdesktopmoon Copy "height": 100 Copy "priority": 1000 Copy "texture_empty": "custommachinery:textures/gui/base_energy_storage_empty" Copy "texture_empty": "namespace:textures/energy_element_texture_empty.png" Copy "texture_filled": "custommachinery:textures/gui/base_energy_storage_filled" Copy "texture_filled": "namespace:textures/energy_element_texture_filled.png" Copy "tooltips": "Click me !" Copy "highlight": false Copy "orientation": "right" Copy "id": "energy" Copy { "type": "custommachinery:energy", "x": 20, "y": 20 } sun-brightdesktopmoon --- # Experience element | Custom Machinery 1.21 The experience gui element is used to display the amount of xp stored in the machine's [experience component](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component) . It can also be used as a button that will take/give xp from/to the player when pressed. The behavior of the experience element depends of its `mode` property (see below). Experience elements are defined in json with `"type": "custommachinery:experience"`. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#properties) Properties The experience gui element has 4 mandatory properties and 8 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#mandatory-properties) Mandatory properties Copy "type": "custommachinery:experience" //Mandatory to define an experience gui element. chevron-rightX[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#x) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#name-x) Name : `x` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#description) Description : A positive integer value that define the x axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#example) Example : The element will be rendered 100px to the right from the top-left corner of the gui. Copy "x": 100 chevron-rightY[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#y) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#name-y) Name : `y` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#description-1) Description : A positive integer value that define the y axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#example-1) Example : The element will be rendered 100px to the bottom from the top-left corner of the gui. Copy "y": 100 chevron-rightMode[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#mode) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#name-mode) Name : `mode` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#description-2) Description : The mode define the behavior of the element, valid values are : * "input\_one" : The player who press the button will give 1 level of their xp to the machine. * "input\_ten" : The player who press the button will give 10 levels of their xp to the machine. * "input\_all" : The player who press the button will give all their xp to the machine. * "output\_one" : The player who press the button will be given 1 level from the machine. * "output\_ten" : The player who press the button will be given 10 levels from the machine. * "output\_all" : The player who press the button will be given all the xp in the machine. * "display" : The element will only display a texture and, when hovered, will show the amount of xp stored in the machine. * "display\_bar" : The element will show a bar representing the amount of xp stored in the machine. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#example-2) Example : When pressing this gui element the player will give one level of xp to the machine. Copy "mode": "input_one" #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#optional-properties) Optional properties chevron-rightWidth[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#width) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#name-width) Name : `width` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#description-3) Description : A positive integer value that define the width of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#default) Default : The same width as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#example-3) Example : The width of the element will be 100px. chevron-rightHeight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#height) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#name-height) Name : `height` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#description-4) Description : A positive integer value that define the height of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#default-1) Default : The same height as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#example-4) Example : The height of the element will be 100px. chevron-rightPriority[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#priority) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#name-priority) Name : `priority` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#description-5) Description : An integer property that define the priority of the Element to be rendered. Elements with higher priority will be rendered first. If 2 elements are at the same position the first to be rendered will be under and the last will be above. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#default-0) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#example-5) Example : The element will be rendered under each element that have a priority lower than 1000. chevron-rightTexture[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#texture) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#name-texture) Name : `texture` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#description-6) Description : The location of the texture that will be rendered into the GUI. The location must be referenced by : `namespace:path/file.png` The texture loader will search for textures in the `assets/namespace` folder, the .png extension is required or the file will not be found. The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided. If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#default-2) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#example-6) Example : The file `assets/textures/my_texture.png` will be used for the dump element. chevron-rightTexture hovered[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#texture-hovered) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#name-texture_hovered) Name : `texture_hovered` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#description-7) Description : The location of the texture that will be rendered into the GUI when the players mouse cursor is hovering the element. The location must be referenced by : `namespace:path/file.png` The texture loader will search for textures in the `assets/namespace` folder, the .png extension is required or the file will not be found. The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided. If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#default-3) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#example-7) Example : The file `assets/textures/my_texture.png` will be used. chevron-rightTooltips[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#tooltips) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#name-tooltips) Name : `tooltips` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#description-8) Description : A list of [Text components](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) that will be shown as tooltips when the player mouse cursor hover the element. Each tooltips of the list will be a new line. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#example-8) Example : Replace the default tooltips with a single line that say "Click me !" : chevron-rightDisplay[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#display) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#name-display) Name : `display` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#description-9) Description : Only used when the `mode` property is set to `display` or `` display_bar` ``. This define if the tooltips of this component should show the stored amount of xp as literal or level xp values. Valid values are : * "literal" : Display the amount of xp points stored in the machine. * "level" : Display the equivalent amount of xp levels stored in the machine, rounded down. * "both" : Display both. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#default-level) Default : `level` The experience gui element's tooltip will display the stored xp as levels. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#example-9) Example : The experience gui element's tooltip will display the stored xp as xp points. chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#description-10) Description : The id of this gui element. By default it does nothing and can be omitted. This is really only useful if you intend to make a recipe that replace this element. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#default-experience) Default : `experience` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#example-10) Example : The id of this element will be `experience` ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#example-11) Example A series of experience gui elements to make a machine similar to EnderIO's experience obelisk : ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2Fcontent.gitbook.com%2Fcontent%2FZznnGu8KvEhqjN3qmLqp%2Fblobs%2F2QnHbTTPyruRPjHmWKE0%2Fexperience_element.png&width=768&dpr=3&quality=100&sign=50531251&sv=2) [PreviousEnergy elementchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/energy-element) [NextFluid elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element) Last updated 1 year ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element#example-11) sun-brightdesktopmoon Copy "width": 100 Copy "height": 100 Copy "priority": 1000 Copy "texture": "custommachinery:textures/gui/base_dump.png" Copy "texture": "namespace:textures/my_texture.png" Copy "texture_hovered": "custommachinery:textures/gui/base_dump_hovered.png" Copy "texture_hovered": "namespace:textures/my_texture.png" Copy "tooltips": "Click me !" Copy "id": "experience" Copy "gui": [\ {\ "x": 85,\ "y": 35,\ "width": 86,\ "type": "custommachinery:experience",\ "mode": "display_bar",\ "display": "both"\ },\ {\ "x": 80,\ "y": 55,\ "type": "custommachinery:experience",\ "mode": "input_one"\ },\ {\ "x": 95,\ "y": 55,\ "type": "custommachinery:experience",\ "mode": "input_ten"\ },\ {\ "x": 110,\ "y": 55,\ "type": "custommachinery:experience",\ "mode": "input_all"\ },\ {\ "x": 130,\ "y": 55,\ "type": "custommachinery:experience",\ "mode": "output_one"\ },\ {\ "x": 145,\ "y": 55,\ "type": "custommachinery:experience",\ "mode": "output_ten"\ },\ {\ "x": 160,\ "y": 55,\ "type": "custommachinery:experience",\ "mode": "output_all"\ }\ ] sun-brightdesktopmoon --- # Player inventory element | Custom Machinery 1.21 The player inventory element is used to render the player inventory into the Machine GUI (only the 4 row of items). Player inventory elements are defined in json with : `"type": "custommachinery:player_inventory"`. circle-info There can be only one player inventory element per Machine GUI, if you define several Player Inventory Elements only the first will be used. While you can change the default texture of the player inventory element you can't change the position of it's slots. See the default texture of the player inventory to see how the slots are placed. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#properties) Properties The player inventory element has 3 mandatory properties and 7 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#mandatory-properties) Mandatory properties Copy "type": "custommachinery:player_inventory" //Mandatory to define a player inventory element. chevron-rightX[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#x) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#name-x) Name : `x` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#description) Description : A positive integer value that define the x axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#example) Example : The element will be rendered 100px to the right from the top-left corner of the gui. Copy "x": 100 chevron-rightY[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#y) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#name-y) Name : `y` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#description-1) Description : A positive integer value that define the y axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#example-1) Example : The element will be rendered 100px to the bottom from the top-left corner of the gui. Copy "y": 100 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#optional-properties) Optional properties chevron-rightWidth[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#width) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#name-width) Name : `width` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#description-2) Description : A positive integer value that define the width of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#default) Default : The same width as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#example-2) Example : The width of the element will be 100px. chevron-rightHeight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#height) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#name-height) Name : `height` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#description-3) Description : A positive integer value that define the height of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#default-1) Default : The same height as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#example-3) Example : The height of the element will be 100px. chevron-rightPriority[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#priority) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#name-priority) Name : `priority` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#description-4) Description : An integer property that define the priority of the Element to be rendered. Elements with higher priority will be rendered first. If 2 elements are at the same position the first to be rendered will be under and the last will be above. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#default-0) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#example-4) Example : The element will be rendered under each element that have a priority lower than 1000. chevron-rightTexture[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#texture) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#name-texture) Name : `texture` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#description-5) Description : The location of the texture that will be rendered into the GUI. The location must be referenced by : `namespace:path/file.png` The texture loader will search for textures in the `assets/namespace` folder, the .png extension is required or the file will not be found. The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided. If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#default-2) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#example-5) Example : The file `assets/textures/player_inventory.png` will be used for the dump element. chevron-rightTexture hovered[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#texture-hovered) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#name-texture_hovered) Name : `texture_hovered` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#description-6) Description : The location of the texture that will be rendered into the GUI when the players mouse cursor is hovering the element. The location must be referenced by : `namespace:path/file.png` The texture loader will search for textures in the `assets/namespace` folder, the .png extension is required or the file will not be found. The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided. If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#default-3) Default : None, the element will use the texture defined in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#example-6) Example : The file `assets/textures/my_texture.png` will be used. chevron-rightTooltips[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#tooltips) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#name-tooltips) Name : `tooltips` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#description-7) Description : A list of [Text components](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) that will be shown as tooltips when the player mouse cursor hover the element. Each tooltips of the list will be a new line. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#example-7) Example : Replace the default tooltips with a single line that say "Click me !" : chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#description-8) Description : The id of this gui element. By default it does nothing and can be omitted. This is really only useful if you intend to make a recipe that replace this element. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#default-empty) Default : `empty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#example-8) Example : The id of this element will be `player_inventory` ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#example-9) Example A basic Player Inventory Element using the default texture : Result : ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2Fgithub.com%2FFrinn38%2FCustom-Machinery%2Fraw%2F1.16.5%2Fwiki%2Fplayer_inventory_element.png&width=768&dpr=3&quality=100&sign=47deade7&sv=2) Player inventory element base texture (The diamonds are present in the Player Inventory, you can move them from the Element like in any other GUI) [PreviousHeat element (Mekanism)chevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism) [NextPNC Heat element (PNC)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc) Last updated 1 year ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element#example-9) sun-brightdesktopmoon Copy "width": 100 Copy "height": 100 Copy "priority": 1000 Copy "texture": "custommachinery:textures/gui/base_inventory.png" Copy "texture": "namespace:textures/player_inventory.png" Copy "texture_hovered": "namespace:textures/my_texture.png" Copy "tooltips": "Click me !" Copy "id": "player_inventory" Copy { "type": "custommachinery:player_inventory", "x": 50, "y": 80 } sun-brightdesktopmoon --- # Text element | Custom Machinery 1.21 Text element is used to render a text on the Machine GUI. Text elements are defined in json with : `"type": "custommachinery:text"`. The text must be a single [text component](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) and can't have multiple lines (use multiple text elements for that). You can change the size of text using `width` and `height` property. circle-info By default all text gui elements are hidden in jei, to make them show up see the "jei" property below. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#properties) Properties The text element has 4 mandatory properties and 7 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#mandatory-properties) Mandatory properties Copy "type": "custommachinery:text" //Mandatory to define a text element. chevron-rightX[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#x) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#name-x) Name : `x` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#description) Description : A positive integer value that define the x axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#example) Example : The element will be rendered 100px to the right from the top-left corner of the gui. Copy "x": 100 chevron-rightY[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#y) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#name-y) Name : `y` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#description-1) Description : A positive integer value that define the y axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#example-1) Example : The element will be rendered 100px to the bottom from the top-left corner of the gui. Copy "y": 100 chevron-rightText[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#text) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#name-text) Name : `text` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#description-2) Description : A [text component](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) to be rendered on the GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#example-2) Example : A simple line of text : Copy "text": "An Awesome Title For My Machine GUI !" Adding some style options : Copy "text": {"text": "Red and bold text", "color": "red", "bold": true} #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#optional-properties) Optional properties chevron-rightPriority[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#priority) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#name-priority) Name : `priority` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#description-3) Description : An integer property that define the priority of the Element to be rendered. Elements with higher priority will be rendered first. If 2 elements are at the same position the first to be rendered will be under and the last will be above. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#default-0) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#example-3) Example : The element will be rendered under each element that have a priority lower than 1000. chevron-rightAlignment[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#alignment) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#name-alignment) Name : `alignment` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#description-4) Description : How the text is aligned compared to the Element position. Available values are `left/center/right` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#default-left) Default : `left` The left of the text string will be at the Element position. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#example-4) Example : chevron-rightJei[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#jei) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#name-jei) Name : `jei` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#description-5) Description : A boolean that define if the element should render in jei. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#default-false) Default : `false` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#example-5) Example : The element will render in jei : chevron-rightWidth[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#width) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#name-width) Name : `width` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#description-6) Description : A positive integer value that define the width of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#default) Default : The width of the specified text. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#example-6) Example : The width of the element will be 100px. chevron-rightHeight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#height) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#name-height) Name : `height` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#description-7) Description : A positive integer value that define the height of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#default-1) Default : The default height of text in Minecraft (about 9px). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#example-7) Example : The height of the element will be 100px. chevron-rightTooltips[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#tooltips) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#name-tooltips) Name : `tooltips` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#description-8) Description : A list of [Text components](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) that will be shown as tooltips when the player mouse cursor hover the element. Each tooltips of the list will be a new line. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#example-8) Example : Replace the default tooltips with a single line that say "Click me !" : chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#description-9) Description : The id of this gui element. By default it does nothing and can be omitted. This is really only useful if you intend to make a recipe that replace this element. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#default-empty) Default : `empty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#example-9) Example : The id of this element will be `text` ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#example-10) Example A basic text element : Result : ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2Fgithub.com%2FFrinn38%2FCustom-Machinery%2Fraw%2F1.16.5%2Fwiki%2Ftext_element.png&width=768&dpr=3&quality=100&sign=fb26cce2&sv=2) A text element [PreviousStatus elementchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element) [NextTexture elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element) Last updated 1 year ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element#example-10) sun-brightdesktopmoon Copy "priority": 1000 Copy "alignment": "center" //The center of the text string will be at the element position. Copy "jei": true Copy "width": 100 Copy "height": 100 Copy "tooltips": "Click me !" Copy "id": "text" Copy { "type": "custommachinery:text", "x": 20, "y": 20, "text": "My Awesome Machine" } sun-brightdesktopmoon --- # Button element | Custom Machinery 1.21 The button gui element is used to add a clickable button to the machine gui. All button elements have a unique string id (that you must specify in the elements properties), when the button is pressed a boolean flag will be written in the machine data. This data can be accessed using [Crafttweaker](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function) or [KubeJS](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/function) Function requirement. Simply using `data.buttonID` will give you a boolean that represent the current state of the button (true for pressed, false for released). A [Button requirement](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/button) can also be used to make the recipe start only if the button is pressed. Button elements are defined in json with : `"type": "custommachinery:button"`. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#properties) Properties The button gui element has 4 mandatory properties and 12 optional properties. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#mandatory-properties) Mandatory properties Copy "type": "custommachinery:button" //Mandatory to define a button element. chevron-rightX[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#x) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#name-x) Name : `x` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#description) Description : A positive integer value that define the x axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#example) Example : The element will be rendered 100px to the right from the top-left corner of the gui. Copy "x": 100 chevron-rightY[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#y) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#name-y) Name : `y` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#description-1) Description : A positive integer value that define the y axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#example-1) Example : The element will be rendered 100px to the bottom from the top-left corner of the gui. Copy "y": 100 chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#description-2) Description : A string representing the id of the button, can be used in a Function requirement to check the state of the button, or in a [Button requirement](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/button) to make the recipe start only when the button is pressed. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#example-2) Example : The id of the button will be `button1` : Copy "id": "button1" #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#optional-properties) Optional properties chevron-rightTexture[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#texture) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#name-texture) Name : `texture` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#description-3) Description : The location of the texture that will be rendered into the GUI. The location must be referenced by : `namespace:path/file.png` The texture loader will search for textures in the `assets/namespace` folder, the .png extension is required or the file will not be found. The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided. If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#default) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#example-3) Example : The file `assets/textures/my_texture.png` will be used. chevron-rightTexture toggle[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#texture-toggle) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#name-texture_toggle) Name : `texture_toggle` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#description-4) Description : The location of the texture that will be rendered into the GUI when the button is toggled and pressed. The location must be referenced by : `namespace:path/file.png` The texture loader will search for textures in the `assets/namespace` folder, the .png extension is required or the file will not be found. The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided. If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#default-1) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#example-4) Example : The file `assets/textures/my_texture.png` will be used. chevron-rightTexture hovered[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#texture-hovered) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#name-texture_hovered) Name : `texture_hovered` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#description-5) Description : The location of the texture that will be rendered into the GUI when the players mouse cursor is hovering the element. The location must be referenced by : `namespace:path/file.png` The texture loader will search for textures in the `assets/namespace` folder, the .png extension is required or the file will not be found. The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided. If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#default-2) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#example-5) Example : The file `assets/textures/my_texture.png` will be used. chevron-rightTexture toggle hovered[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#texture-toggle-hovered) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#name-texture_toggle_hovered) Name : `texture_toggle_hovered` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#description-6) Description : The location of the texture that will be rendered into the GUI when the button is toggled and the player mouse cursor is hovering it. The location must be referenced by : `namespace:path/file.png` The texture loader will search for textures in the `assets/namespace` folder, the .png extension is required or the file will not be found. The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided. If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#default-3) Default : Example : The file `assets/textures/my_texture.png` will be used. chevron-rightWidth[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#width) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#name-width) Name : `width` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#description-7) Description : A positive integer value that define the width of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#default-4) Default : The same width as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#example-6) Example : The width of the element will be 100px. chevron-rightHeight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#height) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#name-height) Name : `height` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#description-8) Description : A positive integer value that define the height of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#default-5) Default : The same height as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#example-7) Example : The height of the element will be 100px. chevron-rightPriority[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#priority) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#name-priority) Name : `priority` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#description-9) Description : An integer property that define the priority of the Element to be rendered. Elements with higher priority will be rendered first. If 2 elements are at the same position the first to be rendered will be under and the last will be above. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#default-0) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#example-8) Example : The element will be rendered under each element that have a priority lower than 1000. chevron-rightTooltips[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#tooltips) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#name-tooltips) Name : `tooltips` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#description-10) Description : A list of [Text components](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) that will be shown as tooltips when the player mouse cursor hover the element. Each tooltips of the list will be a new line. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#example-9) Example : Replace the default tooltips with a single line that say "Click me !" : chevron-rightToggle[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#toggle) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#name-toggle) Name : `toggle` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#description-11) Description : A boolean that define whether the button will act as a lever (stay pressed until clicked again). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#default-false) Default : `false` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#example-10) Example : The button will stay pressed until clicked again : chevron-rightText[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#text) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#name-text) Name : `text` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#description-12) Description : A text component that will be rendered on top of the button texture. Note that by default the button texture is 20x20px square so a text too big will overflow from the button texture. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#default-empty) Default : `empty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#example-11) Example : The following will add "Click Me !" text on the button : The same in red : chevron-rightItem[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#item) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#name-item) Name : `item` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#description-13) Description : Add an item to be rendered on top of the button texture. The item can be specified either with just its id : `"minecraft:diamond"` Or with a stack : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#default-empty-1) Default : `empty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#example-12) Example : The rendered item will be a gold ingot : chevron-rightHold time[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#hold-time) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#name-hold_time) Name : `hold_time` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#description-14) Description : A positive integer value that represent the time (in ticks) that the button will stay pressed when a player press it in the machine GUI. Visually the button will not look pressed but internally the machine will keep it pressed until this hold time is expired. This can be used when a machine need a button to be pressed to start a recipe, but since the machine check recipes only every 20 ticks the player would have to press the button exactly that tick or the recipe won't start. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#default-1-1) Default : `1` The button only stay pressed for 1 tick. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#example-13) Example : The button will stay pressed for 20 ticks (1 second). ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#example-14) Example A basic button element using the base texture provided by Custom Machinery with a diamond : ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2Fcontent.gitbook.com%2Fcontent%2FZznnGu8KvEhqjN3qmLqp%2Fblobs%2FXsycTMGDSUy5nOf7eRHB%2Fbutton_element.png&width=768&dpr=3&quality=100&sign=b394de56&sv=2) Button element [PreviousBar elementchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element) [NextChemical element (Mekanism)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/chemical-element-mekanism) Last updated 1 year ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element#example-14) sun-brightdesktopmoon Copy "texture": "custommachinery:textures/gui/base_button.png" Copy "texture": "namespace:textures/my_texture.png" Copy "texture_toggle": "custommachinery:textures/gui/base_button_toogle.png" Copy "texture_toggle": "namespace:textures/my_texture.png" Copy "texture_hovered": "custommachinery:textures/gui/base_button_hovered.png" Copy "texture_hovered": "namespace:textures/my_texture.png" Copy "texture_toggle_hovered": "custommachinery:textures/gui/base_button_toogle_hovered.png" Copy "texture_toggle_hovered": "namespace:textures/my_texture.png" Copy "width": 100 Copy "height": 100 Copy "priority": 1000 Copy "tooltips": "Click me !" Copy "toggle": true Copy "text": "Click Me !" Copy "text": {"text": "Click Me !", "color": "red"} Copy {"id": "minecraft:diamond", "Count": 4, "tag": "Some NBT"} Copy "item": "minecraft:gold_ingot" Copy "hold_time": 20 Copy { "type": "custommachinery:button", "x": 20, "y": 20, "id": "diamond", "item": "minecraft:diamond" } sun-brightdesktopmoon --- # Status element | Custom Machinery 1.21 The status element is used to shown the crafting status of the custom machine in the Machine GUI. Status element must be defined in json like : `"type": "custommachinery:status"`. The crafting status of a custom machine can be `IDLE`, `RUNNING` or `ERRORED`. ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2Fcontent.gitbook.com%2Fcontent%2FZznnGu8KvEhqjN3qmLqp%2Fblobs%2Fu9jeLtoElCw8Atwtqngz%2Fbase_status_idle.png&width=300&dpr=3&quality=100&sign=c7bb157f&sv=2)`IDLE` mean the machine can't craft any recipes (because of missing inputs) ![running_texture](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2Fcontent.gitbook.com%2Fcontent%2FZznnGu8KvEhqjN3qmLqp%2Fblobs%2FgHk6ECTrN3mPtQLs49Nt%2Fbase_status_running.png&width=300&dpr=3&quality=100&sign=65b3352a&sv=2)`RUNNING` mean the machine is currently processing a recipe ![errored_texture](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2Fcontent.gitbook.com%2Fcontent%2FZznnGu8KvEhqjN3qmLqp%2Fblobs%2FPQdRDnsAQ9oyWBlltc1E%2Fbase_status_errored.png&width=300&dpr=3&quality=100&sign=a3a4a684&sv=2)`ERRORED` mean the machine encountered an error while processing a recipe, the error message will be displayed as a tooltip when you hover the Status Element with your mouse. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#properties) Properties The status element has 3 mandatory properties and 9 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#mandatory-properties) Mandatory properties Copy "type": "custommachinery:status" //Mandatory to define a status element. chevron-rightX[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#x) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#name-x) Name : `x` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#description) Description : A positive integer value that define the x axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#example) Example : The element will be rendered 100px to the right from the top-left corner of the gui. Copy "x": 100 chevron-rightY[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#y) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#name-y) Name : `y` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#description-1) Description : A positive integer value that define the y axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#example-1) Example : The element will be rendered 100px to the bottom from the top-left corner of the gui. Copy "y": 100 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#optional-property) Optional property chevron-rightWidth[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#width) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#name-width) Name : `width` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#description-2) Description : A positive integer value that define the width of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#default) Default : The same width as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#example-2) Example : The width of the element will be 100px. chevron-rightHeight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#height) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#name-height) Name : `height` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#description-3) Description : A positive integer value that define the height of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#default-1) Default : The same height as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#example-3) Example : The height of the element will be 100px. chevron-rightPriority[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#priority) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#name-priority) Name : `priority` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#description-4) Description : An integer property that define the priority of the Element to be rendered. Elements with higher priority will be rendered first. If 2 elements are at the same position the first to be rendered will be under and the last will be above. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#default-0) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#example-4) Example : The element will be rendered under each element that have a priority lower than 1000. chevron-rightIdle texture[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#idle-texture) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#name-texture_idle) Name : `texture_idle` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#description-5) Description : The location of the texture file the status element will display when the machine status is IDLE. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#default-2) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#example-5) Example : The texture loader will use the file `assets/namespace/textures/status_idle_texture.png` as the status IDLE texture in the machine GUI. chevron-rightRunning texture[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#running-texture) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#name-texture_running) Name : `texture_running` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#description-6) Description : The location of the texture file the status element will display when the machine status is RUNNING. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#default-3) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#example-6) Example : The texture loader will use the file `assets/namespace/textures/status_running_texture.png` as the status RUNNING texture in the machine GUI. chevron-rightErrored texture[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#errored-texture) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#name-texture_errored) Name : `texture_errored` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#description-7) Description : The location of the texture file the status element will display when the machine status is ERRORED. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#default-4) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#example-7) Example : The texture loader will use the file `assets/namespace/textures/status_errored_texture.png` as the status ERRORED texture in the machine GUI. chevron-rightCore[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#core) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#name-core) Name : `core` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#description-8) Description : An integer property which define which status the element will display. If set to 0 the element will show the general status of the machine. If set to another value it will show the status of only that specific core. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#default-5) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#example-8) Example : The status gui element will show the status of core 3 only: chevron-rightTooltips[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#tooltips) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#name-tooltips) Name : `tooltips` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#description-9) Description : A list of [Text components](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) that will be shown as tooltips when the player mouse cursor hover the element. Each tooltips of the list will be a new line. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#example-9) Example : Replace the default tooltips with a single line that say "Click me !" : chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#description-10) Description : The id of this gui element. By default it does nothing and can be omitted. This is really only useful if you intend to make a recipe that replace this element. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#default-empty) Default : `empty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#example-10) Example : The id of this element will be `status` ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#example-11) Example : A basic status element with the default textures : Result : ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2Fgithub.com%2FFrinn38%2FCustom-Machinery%2Fraw%2F1.16.5%2Fwiki%2Fstatus_element.png&width=768&dpr=3&quality=100&sign=b32d8e6f&sv=2) Status element idle texture (Here the Custom Machine is IDLE if not obvious) [PreviousSlot elementchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element) [NextText elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element) Last updated 8 months ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#properties) * [Example :](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element#example-11) sun-brightdesktopmoon Copy "width": 100 Copy "height": 100 Copy "priority": 1000 Copy "texture_idle": "custommachinery:textures/gui/base_status_idle.png" Copy "texture_idle": "namespace:textures/status_idle_texture.png" Copy "texture_running": "custommachinery:textures/gui/base_status_running.png" Copy "texture_running": "namespace:textures/status_running_texture.png" Copy "texture_errored": "custommachinery:textures/gui/base_status_errored.png" Copy "texture_errored": "namespace:textures/status_errored_texture.png" Copy "core": 0 Copy "core": 3 Copy "tooltips": "Click me !" Copy "id": "status" Copy { "type": "custommachinery:status", "x": 20, "y": 20 } sun-brightdesktopmoon --- # Slot element | Custom Machinery 1.21 The slot elements is used to render an item slot into the Machine GUI. Slot elements are defined in json with : `"type": "custommachinery:slot"`. A slot must be associated with an [Item Component](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component) using the `id` property. It will display the item stored in the Item Component and allow you to put or remove the item trough the Machine GUI. If the slot element cannot find the item component (usually because of an error in the id) the slot will still be rendered but it will be empty and you will not be able to put or remove items. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#properties) Properties The slot element has 4 mandatory properties and 6 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#mandatory-properties) Mandatory properties Copy "type": "custommachinery:slot" //Mandatory to define a slot element. chevron-rightX[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#x) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#name-x) Name : `x` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#description) Description : A positive integer value that define the x axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#example) Example : The element will be rendered 100px to the right from the top-left corner of the gui. Copy "x": 100 chevron-rightY[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#y) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#name-y) Name : `y` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#description-1) Description : A positive integer value that define the y axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#example-1) Example : The element will be rendered 100px to the bottom from the top-left corner of the gui. Copy "y": 100 chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#description-2) Description : The id of the [Item Component](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component#mandatory-properties) you want to link to this element. It must be the exact same id specified in the item component json `id` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#example-2) Example : The element will void the item component with id `slot1`, if no item component has this id it will do nothing. Copy "id": "slot1" #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#optional-properties) Optional properties chevron-rightWidth[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#width) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#name-width) Name : `width` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#description-3) Description : A positive integer value that define the width of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#default) Default : The same width as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#example-3) Example : The width of the element will be 100px. chevron-rightHeight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#height) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#name-height) Name : `height` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#description-4) Description : A positive integer value that define the height of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#default-1) Default : The same height as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#example-4) Example : The height of the element will be 100px. chevron-rightPriority[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#priority) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#name-priority) Name : `priority` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#description-5) Description : An integer property that define the priority of the Element to be rendered. Elements with higher priority will be rendered first. If 2 elements are at the same position the first to be rendered will be under and the last will be above. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#default-0) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#example-5) Example : The element will be rendered under each element that have a priority lower than 1000. chevron-rightTexture[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#texture) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#name-texture) Name : `texture` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#description-6) Description : The location of the texture that will be rendered into the GUI. The location must be referenced by : `namespace:path/file.png` The texture loader will search for textures in the `assets/namespace` folder, the .png extension is required or the file will not be found. The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided. If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#default-2) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#example-6) Example : The file `assets/textures/my_slot_texture.png` will be used for the slot element. chevron-rightTooltips[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#tooltips) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#name-tooltips) Name : `tooltips` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#description-7) Description : A list of [Text components](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) that will be shown as tooltips when the player mouse cursor hover the element. Each tooltips of the list will be a new line. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#example-7) Example : Replace the default tooltips with a single line that say "Click me !" : chevron-rightGhost[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#ghost) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#name-ghost) Name : ghost #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#description-8) Description : If specified the slot will render a "ghost item" (slightly transparent item). The item will not be physically present on the slot (aka the player can't take it out). This can be used, for example, to show a filter. The item must be referenced by it's registry name like `"minecraft:stone"` or `modid:item_name` in general. This can be a single item, a tag (using "#namespace:id", for example "#forge:stone") or a list of both combined : \["minecraft:diamond", "#forge:stone"\]. All possible items will be cycled in the slot as ghost items, the time between each items can be changed in the config file (default : 1 second). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#default-no-item) Default : no item #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#extra-properties) Extra properties : If needed, a custom color/transparency can be applied to the ghost item (default is white with half transparency). The color must be specified as an ARGB array which value are between 0 and 1. By default the ghost item will only render if no item are present in the slot, this behavior can be changed by setting `"always_render": true` in the ghost property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#example-8) Example : A transparent coal will be displayed in the slot. An opaque (no transparency) stone, colored in full red will be always displayed in the slot : ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#example-9) Example : A basic slot element linked to an item component using the id "slot1" and using the default texture : Result : ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2Fgithub.com%2FFrinn38%2FCustom-Machinery%2Fraw%2F1.16.5%2Fwiki%2Fslot_element.png&width=768&dpr=3&quality=100&sign=274980d9&sv=2) Slot element base texture (Here the item component contains 32 diamonds, you can add and remove them through the Slot Element like in any other GUI) If you add `"item": "minecraft:coal"` to the slot element json the slot will be rendered like this ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2Fgithub.com%2FFrinn38%2FCustom-Machinery%2Fraw%2F1.16.5%2Fwiki%2Fslot_element_item.png&width=768&dpr=3&quality=100&sign=b4de1f4f&sv=2) Ghost item in slot element [PreviousSplit elementchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element) [NextStatus elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/status-element) Last updated 1 year ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#properties) * [Example :](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element#example-9) sun-brightdesktopmoon Copy "width": 100 Copy "height": 100 Copy "priority": 1000 Copy "texture": "custommachinery:textures/gui/base_slot.png" Copy "texture": "namespace:textures/my_slot_texture.png" Copy "tooltips": "Click me !" Copy "ghost": "minecraft:coal" Copy "ghost": { "items": "minecraft:stone", "color": [1.0, 1.0, 0.0, 0.0], "always_render": true } Copy { "type": "custommachinery:slot", "x": 20, "y": 20, "id": "slot1" } sun-brightdesktopmoon --- # Heat element (Mekanism) | Custom Machinery 1.21 circle-exclamation This element requires [Custom Machinery Mekanismarrow-up-right](https://www.curseforge.com/minecraft/mc-mods/custom-machinery-mekanism) to be installed. The heat gui element is used to display the content of a [heat component](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism) present in the machine. Heat elements are defined in json with : `"type": "custommachinery:heat"`. Note that if you didn't set a heat component in the machine json the heat element will still work but will always show a value of 0. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#properties) Properties The heat element has 3 mandatory properties and 11 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#mandatory-properties) Mandatory properties Copy "type": "custommachinery:heat" //Mandatory to define a heat element. chevron-rightX[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#x) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#name-x) Name : `x` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#description) Description : A positive integer value that define the x axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#example) Example : The element will be rendered 100px to the right from the top-left corner of the gui. Copy "x": 100 chevron-rightY[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#y) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#name-y) Name : `y` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#description-1) Description : A positive integer value that define the y axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#example-1) Example : The element will be rendered 100px to the bottom from the top-left corner of the gui. Copy "y": 100 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#optional-properties) Optional properties chevron-rightWidth[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#width) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#name-width) Name : `width` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#description-2) Description : A positive integer value that define the width of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#default) Default : The same width as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#example-2) Example : The width of the element will be 100px. chevron-rightHeight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#height) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#name-height) Name : `height` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#description-3) Description : A positive integer value that define the height of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#default-1) Default : The same height as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#example-3) Example : The height of the element will be 100px. chevron-rightPriority[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#priority) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#name-priority) Name : `priority` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#description-4) Description : An integer property that define the priority of the Element to be rendered. Elements with higher priority will be rendered first. If 2 elements are at the same position the first to be rendered will be under and the last will be above. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#default-0) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#example-4) Example : The element will be rendered under each element that have a priority lower than 1000. chevron-rightEmpty texture[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#empty-texture) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#name-texture_empty) Name : `texture_empty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#description-5) Description : Point to a texture to use as the empty element texture. The texture must be loaded in-game with a resource pack or a loader mod. The texture can be any size, if the texture size is different from the default size the `width` and `height` properties of the element will be automatically changed to fit the texture size if not provided. If the `width` and/or `height` properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#default-2) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#example-5) Example : The element will search for a texture located in `assets/namespace/textures/heat_element_texture_empty.png` **The .png extension is mandatory**. chevron-rightFilled texture[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#filled-texture) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#name-texture_filled) Name : `texture_filled` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#description-6) Description : Point to a texture to use as the filled element texture. The texture must be loaded in-game with a resource pack or a loader mod. The filled texture will be rendered on top on the empty texture, how much the filled texture overlap the empty texture is relative to the amount of heat inside the heat component. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#default-3) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#example-6) Example : The element will search for a texture located in `assets/namespace/textures/heat_element_texture_filled.png` **The .png extension is mandatory**. chevron-rightTooltips[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#tooltips) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#name-tooltips) Name : `tooltips` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#description-7) Description : A list of [Text components](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) that will be shown as tooltips when the player mouse cursor hover the element. Each tooltips of the list will be a new line. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#example-7) Example : Replace the default tooltips with a single line that say "Click me !" : chevron-rightOrientation[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#orientation) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#name-orientation) Name : `orientation` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#description-8) Description : The direction the bar will be filled to. Valid values are : `top`, `right`, `bottom` and `left`. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#default-top) Default : `top` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#example-8) Example : The bar will fill towards the right for the machine gui. chevron-rightMin[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#min) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#name-min) Name : `min` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#description-9) Description : A positive decimal value that represent the minimal temperature displayed in the gui element. If the machine temperature is below this specified value the heat bar will appear empty. The value is in Kelvin so the minimal accepted value is 0. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#default-300.0) Default : `300.0` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#example-9) Example : The bar will start to fill when the machine temperature is above 400K chevron-rightMax[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#max) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#name-max) Name : `max` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#description-10) Description : A positive decimal value that represent the maximal temperature displayed in the gui element. If the machine temperature is above this specified value the heat bar will appear full. The value is in Kelvin and the minimal accepted value is 1. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#default-400.0) Default : 4`00.0` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#example-10) Example : The bar will appear full when the machine temperature is at 1000K chevron-rightHighlight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#highlight) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#name-highlight) Name : `highlight` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#description-11) Description : A boolean property, if true the element will highlight (become slightly brighter) when the player mouse hover it. If false the element will not highlight on mouse hover. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#default-true) Default : true #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#example-11) Example : The element will not highlight on mouse hover : chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#description-12) Description : The id of this gui element. By default it does nothing and can be omitted. This is really only useful if you intend to make a recipe that replace this element. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#default-empty) Default : `empty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#example-12) Example : The id of this element will be `heat` ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#example-13) Example A typical heat gui element : Result : ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2Fcontent.gitbook.com%2Fcontent%2FZznnGu8KvEhqjN3qmLqp%2Fblobs%2FEiG67w7Xnbdlvh6c1BgG%2Fheat_element.png&width=768&dpr=3&quality=100&sign=5b34f8a0&sv=2) [PreviousFuel elementchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fuel-element) [NextPlayer inventory elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/player-inventory-element) Last updated 5 months ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/heat-element-mekanism#example-13) sun-brightdesktopmoon Copy "width": 100 Copy "height": 100 Copy "priority": 1000 Copy "texture_empty": "custommachinery:textures/gui/base_fluid_storage.png" Copy "texture_empty": "namespace:textures/heat_element_texture_empty.png" Copy "texture_filled": "custommachinery:textures/gui/base_heat_storage_filled" Copy "texture_filled": "namespace:textures/heat_element_texture_filled.png" Copy "tooltips": "Click me !" Copy "orientation": "right" Copy "min": 400.0 Copy "max": 1000.0 Copy "highlight": false Copy "id": "heat" Copy { "type": "custommachinery:heat", "x": 20, "y": 20 } sun-brightdesktopmoon --- # Texture element | Custom Machinery 1.21 The texture gui element is the most basic element, it is used to render a texture on the Machine GUI. Texture elements are defined in json with : `"type": "custommachinery:texture"`. The texture must be loaded into the game by either a resourcepack or a resource loader mod. Note : By default the Machine GUI don't have any textures, not even a background. If you want a background four your Custom Machine GUI you need to use a Texture Element and set the x/y properties to 0/0. circle-info By default all texture gui elements are hidden in jei, to make them show up see the "jei" property below. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#properties) Properties The texture element has 4 mandatory properties and 7 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#mandatory-properties) Mandatory properties Copy "type": "custommachinery:texture" //Mandatory to define a texture element. chevron-rightX[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#x) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#name-x) Name : `x` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#description) Description : A positive integer value that define the x axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#example) Example : The element will be rendered 100px to the right from the top-left corner of the gui. Copy "x": 100 chevron-rightY[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#y) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#name-y) Name : `y` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#description-1) Description : A positive integer value that define the y axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#example-1) Example : The element will be rendered 100px to the bottom from the top-left corner of the gui. Copy "y": 100 chevron-rightTexture[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#texture) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#name-texture) Name : `texture` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#description-2) Description : The location of the texture that will be rendered into the GUI. The location must be referenced by : `namespace:path/file.png` The texture loader will search for textures in the `assets/namespace` folder, the .png extension is required or the file will not be found. The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided. If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#example-2) Example : The file `assets/textures/my_texture.png` will be used. Copy "texture": "namespace:textures/my_texture.png" #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#optional-properties) Optional properties chevron-rightWidth[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#width) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#name-width) Name : `width` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#description-3) Description : A positive integer value that define the width of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#default) Default : The same width as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#example-3) Example : The width of the element will be 100px. chevron-rightHeight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#height) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#name-height) Name : `height` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#description-4) Description : A positive integer value that define the height of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#default-1) Default : The same height as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#example-4) Example : The height of the element will be 100px. chevron-rightPriority[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#priority) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#name-priority) Name : `priority` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#description-5) Description : An integer property that define the priority of the Element to be rendered. Elements with higher priority will be rendered first. If 2 elements are at the same position the first to be rendered will be under and the last will be above. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#default-0) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#example-5) Example : The element will be rendered under each element that have a priority lower than 1000. chevron-rightJei[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#jei) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#name-jei) Name : `jei` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#description-6) Description : A boolean that define if the element should render in jei. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#default-false) Default : `false` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#example-6) Example : The element will render in jei : chevron-rightZLevel[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#zlevel) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#name-zlevel) Name : `zlevel` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#description-7) Description : An integer that define the depth (z coordinate) in which the texture will be rendered in the machine gui. Higher values will make the texture render above anything else, including items, fluids, tooltips etc... #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#default-0-1) Default : `0` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#example-7) Example : By default fluids render at z=100 so this will make the texture render above them : chevron-rightTexture hovered[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#texture-hovered) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#name-texture_hovered) Name : `texture_hovered` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#description-8) Description : The location of the texture that will be rendered into the GUI when the players mouse cursor is hovering the element. The location must be referenced by : `namespace:path/file.png` The texture loader will search for textures in the `assets/namespace` folder, the .png extension is required or the file will not be found. The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided. If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#default-2) Default : None, the element will use the texture provided in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#example-8) Example : The file `assets/textures/my_texture.png` will be used. chevron-rightTooltips[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#tooltips) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#name-tooltips) Name : `tooltips` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#description-9) Description : A list of [Text components](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) that will be shown as tooltips when the player mouse cursor hover the element. Each tooltips of the list will be a new line. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#example-9) Example : Replace the default tooltips with a single line that say "Click me !" : chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#description-10) Description : The id of this gui element. By default it does nothing and can be omitted. This is really only useful if you intend to make a recipe that replace this element. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#default-empty) Default : `empty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#example-10) Example : The id of this element will be `texture` ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#example-11) Example A background Texture Element using the base background texture provided by Custom Machinery : ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2Fcontent.gitbook.com%2Fcontent%2FZznnGu8KvEhqjN3qmLqp%2Fblobs%2FTXwT4G8XTxVUfG7RzEpQ%2Fbase_background.png&width=768&dpr=3&quality=100&sign=ffd8d1a2&sv=2) Base background texture [PreviousText elementchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element) [NextJEI Recipe GUIchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/jei-recipe-gui) Last updated 1 day ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/texture-element#example-11) sun-brightdesktopmoon Copy "width": 100 Copy "height": 100 Copy "priority": 1000 Copy "jei": true Copy "zlevel": 110 Copy "texture_hovered": "namespace:textures/my_texture.png" Copy "tooltips": "Click me !" Copy "id": "texture" Copy { "type": "custommachinery:texture", "x": 0, "y": 0, "texture": "custommachinery:textures/gui/base_background.png" } sun-brightdesktopmoon --- # Progress bar element | Custom Machinery 1.21 The progress bar element is used to render a progress bar in the Machine GUI (see the arrow that is slowly filled in the furnace GUI while smelting ? That's a progress bar). Progress bar elements are defined in json with : `"type": "custommachinery:progress"`. circle-exclamation You can add as much Progress Bar Elements as you want but they will all be filled at the same time since the machine can only process 1 recipe at a time. When hovering the progress bar in jei with advanced item tooltips enabled (F3 + H), the progress bar tooltip will display the recipe ID. You can disable the need of enabling item tooltips in the config by setting `needAdvancedInfoForRecipeID` to false. circle-info If JEI is installed you can click on the progress bar element in the machine gui to display in JEI all the recipes for this machine. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#properties) Properties The progress bar element has 3 mandatory properties and 10 optional properties : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#mandatory-properties) Mandatory properties Copy "type": "custommachinery:progress" //Mandatory to define a progress bar element. chevron-rightX[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#x) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#name-x) Name : `x` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#description) Description : A positive integer value that define the x axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#example) Example : The element will be rendered 100px to the right from the top-left corner of the gui. Copy "x": 100 chevron-rightY[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#y) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#name-y) Name : `y` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#description-1) Description : A positive integer value that define the y axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#example-1) Example : The element will be rendered 100px to the bottom from the top-left corner of the gui. Copy "y": 100 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#optional-properties) Optional properties chevron-rightWidth[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#width) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#name-width) Name : `width` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#description-2) Description : A positive integer value that define the width of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#default) Default : The same width as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#example-2) Example : The width of the element will be 100px. chevron-rightHeight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#height) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#name-height) Name : `height` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#description-3) Description : A positive integer value that define the height of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#default-1) Default : The same height as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#example-3) Example : The height of the element will be 100px. chevron-rightPriority[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#priority) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#name-priority) Name : `priority` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#description-4) Description : An integer property that define the priority of the Element to be rendered. Elements with higher priority will be rendered first. If 2 elements are at the same position the first to be rendered will be under and the last will be above. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#default-0) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#example-4) Example : The element will be rendered under each element that have a priority lower than 1000. chevron-rightEmpty texture[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#empty-texture) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#name-texture_empty) Name : `texture_empty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#description-5) Description : Point to a texture to use as the empty element texture. The texture must be loaded in-game with a resource pack or a loader mod. The texture can be any size, if the texture size is different from the default size the `width` and `height` properties of the element will be automatically changed to fit the texture size if not provided. If the `width` and/or `height` properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#default-2) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#example-5) Example : The element will search for a texture located in `assets/namespace/textures/progress_element_texture_empty.png` **The .png extension is mandatory**. chevron-rightFilled texture[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#filled-texture) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#name-texture_filled) Name : `texture_filled` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#description-6) Description : Point to a texture to use as the filled element texture. The texture must be loaded in-game with a resource pack or a loader mod. The filled texture will be rendered on top on the empty texture, how much the filled texture overlap the empty texture is relative to the amount of energy inside the energy component. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#default-3) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#example-6) Example : The element will search for a texture located in `assets/namespace/textures/progress_element_texture_filled.png` **The .png extension is mandatory**. chevron-rightTooltips[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#tooltips) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#name-tooltips) Name : `tooltips` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#description-7) Description : A list of [Text components](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) that will be shown as tooltips when the player mouse cursor hover the element. Each tooltips of the list will be a new line. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#example-7) Example : Replace the default tooltips with a single line that say "Click me !" : chevron-rightOrientation[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#orientation) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#name-orientation) Name : `orientation` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#description-8) Description : The orientation (right/left/top/bottom) of the arrow. When the recipe is processing the arrow will fill to this direction (from the opposite). If using custom textures they will not be rotated, but they will be filled according to the specified direction. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#default-right) Default : `right` The arrow point to the right and is filled from the left to the right. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#example-8) Example : The arrow point to the bottom and is filled from the top to the bottom. chevron-rightStart[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#start) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#name-start) Name : `start` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#description-9) Description : A positive decimal value that represent at which percentage of the recipe progress the bar should start rendering. The specified value must be between 0.0 (start of the recipe) and 1.0 (end of the recipe). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#default-0.0) Default : `0.0` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#example-9) Example : The progress bar will start rendering at 30% of the recipe progress : chevron-rightEnd[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#end) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#name-end) Name : `end` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#description-10) Description : A positive decimal value that represent at which percentage of the recipe progress the bar should stop rendering. The specified value must be between 0.0 (start of the recipe) and 1.0 (end of the recipe). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#default-1.0) Default : `1.0` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#example-10) Example : The progress bar will stop rendering at 80% of the recipe progress : chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#description-11) Description : The id of this gui element. By default it does nothing and can be omitted. This is really only useful if you intend to make a recipe that replace this element. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#default-empty) Default : `empty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#example-11) Example : The id of this element will be `progress` ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#example-12) Example A basic Progress Bar Element using the default textures : Result : ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2Fgithub.com%2FFrinn38%2FCustom-Machinery%2Fraw%2F1.16.5%2Fwiki%2Fprogress_bar_element.png&width=768&dpr=3&quality=100&sign=91e49a90&sv=2) Progress bar base texture In this example JEI is installed and display a "Show Recipes" tooltip when the mouse hover the element. [PreviousPressure element (PNC)chevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc) [NextReset elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element) Last updated 1 year ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element#example-12) sun-brightdesktopmoon Copy "width": 100 Copy "height": 100 Copy "priority": 1000 Copy "texture_empty": "custommachinery:textures/gui/base_progress_empty" Copy "texture_empty": "namespace:textures/progress_element_texture_empty.png" Copy "texture_filled": "custommachinery:textures/gui/base_progress_filled" Copy "texture_filled": "namespace:textures/progress_element_texture_filled.png" Copy "tooltips": "Click me !" Copy "orientation": "bottom" Copy "start": 0.3 Copy "end": 0.8 Copy "id": "progress" Copy { "type": "custommachinery:progress", "x": 116, "y": 50 } sun-brightdesktopmoon --- # Split element | Custom Machinery 1.21 The split gui element is used to add a clickable button to the machine gui. When clicked, all items present in one of the machine's input slots will be sorted to fill all slots. circle-info The behavior is very similar to Mekanism's machines auto-sort button All split elements must have a unique string id (that you must specify in the elements properties). Split elements are defined in json with : `"type": "custommachinery:split"`. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#properties) Properties The split gui element has 4 mandatory properties and 9 optional properties. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#mandatory-properties) Mandatory properties Copy "type": "custommachinery:button" //Mandatory to define a button element. chevron-rightX[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#x) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#name-x) Name : `x` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#description) Description : A positive integer value that define the x axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#example) Example : The element will be rendered 100px to the right from the top-left corner of the gui. Copy "x": 100 chevron-rightY[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#y) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#name-y) Name : `y` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#description-1) Description : A positive integer value that define the y axis position of the element to be displayed on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#example-1) Example : The element will be rendered 100px to the bottom from the top-left corner of the gui. Copy "y": 100 chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#description-2) Description : A string representing the id of the button, can be used in a Function requirement to check the state of the button, or in a [Button requirement](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/button) to make the recipe start only when the button is pressed. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#example-2) Example : The id of the button will be `button1` : Copy "id": "button1" #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#optional-properties) Optional properties chevron-rightTexture[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#texture) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#name-texture) Name : `texture` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#description-3) Description : The location of the texture that will be rendered into the GUI. The location must be referenced by : `namespace:path/file.png` The texture loader will search for textures in the `assets/namespace` folder, the .png extension is required or the file will not be found. The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided. If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#default) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#example-3) Example : The file `assets/textures/my_texture.png` will be used. chevron-rightTexture toggle[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#texture-toggle) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#name-texture_toggle) Name : `texture_toggle` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#description-4) Description : The location of the texture that will be rendered into the GUI when the button is toggled and pressed. The location must be referenced by : `namespace:path/file.png` The texture loader will search for textures in the `assets/namespace` folder, the .png extension is required or the file will not be found. The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided. If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#default-1) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#example-4) Example : The file `assets/textures/my_texture.png` will be used. chevron-rightTexture hovered[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#texture-hovered) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#name-texture_hovered) Name : `texture_hovered` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#description-5) Description : The location of the texture that will be rendered into the GUI when the players mouse cursor is hovering the element. The location must be referenced by : `namespace:path/file.png` The texture loader will search for textures in the `assets/namespace` folder, the .png extension is required or the file will not be found. The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided. If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#default-2) Default : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#example-5) Example : The file `assets/textures/my_texture.png` will be used. chevron-rightTexture toggle hovered[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#texture-toggle-hovered) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#name-texture_toggle_hovered) Name : `texture_toggle_hovered` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#description-6) Description : The location of the texture that will be rendered into the GUI when the button is toggled and the player mouse cursor is hovering it. The location must be referenced by : `namespace:path/file.png` The texture loader will search for textures in the `assets/namespace` folder, the .png extension is required or the file will not be found. The texture can be any size, if the texture size is different from the default size the width and height properties of the element will be automatically changed to fit the texture size if not provided. If the width and/or height properties of the element are provided, the texture will be stretched to fit the dimensions of the element (it can render weirdly in that case). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#default-3) Default : Example : The file `assets/textures/my_texture.png` will be used. chevron-rightWidth[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#width) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#name-width) Name : `width` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#description-7) Description : A positive integer value that define the width of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#default-4) Default : The same width as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#example-6) Example : The width of the element will be 100px. chevron-rightHeight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#height) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#name-height) Name : `height` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#description-8) Description : A positive integer value that define the height of the element on the Machine GUI. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#default-5) Default : The same height as the texture specified in the `texture` property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#example-7) Example : The height of the element will be 100px. chevron-rightPriority[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#priority) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#name-priority) Name : `priority` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#description-9) Description : An integer property that define the priority of the Element to be rendered. Elements with higher priority will be rendered first. If 2 elements are at the same position the first to be rendered will be under and the last will be above. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#default-0) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#example-8) Example : The element will be rendered under each element that have a priority lower than 1000. chevron-rightTooltips[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#tooltips) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#name-tooltips) Name : `tooltips` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#description-10) Description : A list of [Text components](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) that will be shown as tooltips when the player mouse cursor hover the element. Each tooltips of the list will be a new line. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#example-9) Example : Replace the default tooltips with a single line that say "Click me !" : chevron-rightSlots[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#slots) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#name-slots) Name : `slots` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#description-11) Description : A list of slot ids which are the slots that will be sorted while this split button is active. The slots ids must be the same as specified in the [Item component](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component) and [Slot element](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element) `id`property. If the list is empty then any normal slot (not fuel, upgrade, etc) in `input`mode will be sorted. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#default-empty) Default : `empty` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#example-10) Example : While this split element is active, only slots with ids `input1`, `input2`, `input3` will be sorted. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#example-11) Example A basic split element using the base texture provided by Custom Machinery : ![](https://frinn.gitbook.io/custom-machinery-1.21/~gitbook/image?url=https%3A%2F%2F3380432015-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FZznnGu8KvEhqjN3qmLqp%252Fuploads%252F9tGDAmrhHToHsZ6yQ35H%252Fsplit_element.png%3Falt%3Dmedia%26token%3D8eb361fe-9dbf-4e41-b680-5a0dcfe07ca2&width=768&dpr=3&quality=100&sign=f015ef84&sv=2) Button element [PreviousReset elementchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/reset-element) [NextSlot elementchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/slot-element) Last updated 1 year ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/split-element#example-11) sun-brightdesktopmoon Copy "texture": "custommachinery:textures/gui/base_split.png" Copy "texture": "namespace:textures/my_texture.png" Copy "texture_toggle": "custommachinery:textures/gui/base_split_toogle.png" Copy "texture_toggle": "namespace:textures/my_texture.png" Copy "texture_hovered": "custommachinery:textures/gui/base_split_hovered.png" Copy "texture_hovered": "namespace:textures/my_texture.png" Copy "texture_toggle_hovered": "custommachinery:textures/gui/base_split_toogle_hovered.png" Copy "texture_toggle_hovered": "namespace:textures/my_texture.png" Copy "width": 100 Copy "height": 100 Copy "priority": 1000 Copy "tooltips": "Click me !" Copy "slots": ["input1", "input2", "input3"] Copy { "type": "custommachinery:split", "x": 20, "y": 20 } sun-brightdesktopmoon --- # Recipe modifiers | Custom Machinery 1.21 Requirement modifiers are used to tweak some properties of a recipe requirement. They are defined in json inside of the `requirements` property of the machine upgrade item json. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#list-of-properties-that-can-be-modified) List of properties that can be modified Requirement Target Modified property [Block](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/block) \- `amount` [Block](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/block) "chance" `chance` [Command](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command) "chance" `chance` [Drop](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/drop) \- `amount` [Drop](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/drop) "radius" `radius` [Drop](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/drop) "chance" `chance` [Durability](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/durability) \- `amount` [Durability](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/durability) "chance" `chance` [Effect](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/effect) "time" `time` [Effect](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/effect) "level" `level` [Effect](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/effect) "radius" `radius` [Effect](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/effect) "chance" `chance` [Energy](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/energy) \- `amount` [Energy](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/energy) "chance" `chance` [Energy per tick](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/energy-per-tick) \- `amount` [Energy per tick](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/energy-per-tick) "chance" `chance` [Entity](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/entity) \- `amount` [Entity](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/entity) "radius" `radius` [Entity](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/entity) "chance" `chance` [Fluid](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/fluid) \- `amount` [Fluid](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/fluid) "chance" `chance` [Fluid per tick](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/fluid-per-tick) \- `amount` [Fluid per tick](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/fluid-per-tick) "chance" `chance` [Item](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/item) \- `amount` [Item](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/item) "chance" `chance` [Light](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/light) \- `light` [Loot table](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/loot-table) "luck" `luck` [Redstone](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/redstone) "power" `power` Speed \- The recipe's `time` property Function "chance" `chance` ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#properties) Properties The requirement modifier has 4 mandatory properties and 2 optional property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#mandatory-properties) Mandatory properties chevron-rightRequirement[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#requirement) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#name-requirement) Name : `requirement` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#description) Description : The type of the requirement you want to apply the modifier to. This is the same type as the one you specify in the `type` property when defining the requirement in the recipe json. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#example) Example : This modifier will be applied to the energy requirement. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#note) Note : The recipe duration can also be modified with this system. Use `custommachinery:speed` to target it. Warning : Using this as a requirement will alter the recipe process duration, which is the opposite of the speed (the lower the duration the faster the speed). chevron-rightMode[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#mode) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#name-mode) Name : `mode` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#description-1) Description : The mode of the requirement you want to apply the modifier to. It can be either `input` or `output` but not both. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#example-1) Example : This modifier will be applied only on input requirements. chevron-rightOperation[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#operation) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#name-operation) Name : `operation` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#description-2) Description : The mathematical operation that will be applied to the targeted requirement property by the modifier. The available operations are : * `addition` : The resulting value will be the sum of the base requirement value and the modifier value multiplied by the amount of upgrades. `final_value = base_value + upgrade_modifier * upgrade_amount` * `multiplication` : The resulting value will be the multiplication of the base requirement value and the modifier value multiplied by the amount of upgrades. `final_value = base_value * upgrade_modifier * upgrade_amount` * exponential : The resulting value will be the multiplication of the base requirement value and the modifier value powered to the amount of upgrades. `final_value = base_value * upgrade_modifier ^ upgrade_amount` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#example-2) Example : The base requirement value (defined in the recipe) will be multiplicated by the value defined in this modifier. chevron-rightModifier[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#modifier) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#name-modifier) Name : `modifier` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#description-3) Description : The value (double) to add or multiply to the base requirement value. It can be positive or negative and support decimal numbers. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#example-3) Example : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#optional-properties) Optional properties chevron-rightTarget[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#target) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#name-target) Name : `target` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#description-4) Description : Some requirement have more than one value that can be modified. In that case the `target` property can be used to define which one of the requirement property you want to modify. For example some requirement have a `chance` property that can be modified by the upgrade, simply use `"target": "chance"` to target the chance property instead of the default one. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#default-empty) Default : `empty` The modifier will be applied to the default property of the defined requirement. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#example-4) Example : In case of the [Entity Requirementarrow-up-right](https://github.com/Frinn38/Custom-Machinery/wiki/Entity-Requirement) the default property is `amount` so if you want to modify the `radius` property you can do : chevron-rightChance[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#chance) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#name-chance) Name : `chance` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#description-5) Description : The chance the modifier will be applied to the requirement, this have nothing to do with the `chance` property some requirement have and will be applied independently. This value must be between 0 and 1 where 0 is 0% chance to be applied and 1 is 100% chance. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#default-1) Default : 1 The modifier have 100% chance to be applied on the requirement. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#example-5) Example : The modifier have 40% chance to be applied on the requirement. chevron-rightMax[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#max) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#name-max) Name : `max` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#description-6) Description : A positive integer that define the maximum value obtained after applying this upgrade. Fox example if the modifier multiply all energy output by 2 and the max is set to 1000, the maximum energy output by the recipe will be 1000FE, even if it should be greater after the multiplication. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#default-positive_infinity) Default : `POSITIVE_INFINITY` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#example-6) Example : Whatever the modifier does, the resulting value won't be greater than 42. chevron-rightMin[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#min) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#name-min) Name : `min` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#description-7) Description : A positive integer that define the minimum value obtained after applying this upgrade. Fox example if the modifier divide all items consumed by 2 and the min is set to 1, the recipe will always consume 1 item. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#default-negative_infinity) Default : `NEGATIVE_INFINITY` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#example-7) Example : Whatever the modifier does, the resulting value won't be lower than 42. chevron-rightTooltip[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#tooltip) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#name-tooltip) Name : `tooltip` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#description-8) Description : The tooltip that will render when a player hover any machine upgrade item in a gui while holding shift. This is a [text component](https://frinn.gitbook.io/custom-machinery-1.21/misc/text-component) . #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#default) Default : A short string that describe what the modifier does : `-50% Energy input` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#example-8) Example : The tooltip will be "Overclock: Recipe time divided by 2" in orange. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#example-9) Example A modifier that half the time needed to process a recipe : A modifier that double the energy per tick consumed by a recipe : A modifier that has 50% chance to add 1 item produced by a recipe : [PreviousUpgradeschevron-left](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades) [NextComponent modifierschevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers) Last updated 5 months ago * [List of properties that can be modified](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#list-of-properties-that-can-be-modified) * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/recipe-modifiers#example-9) sun-brightdesktopmoon Copy "requirement": "custommachinery:energy" Copy "mode": "input" Copy "operation": "multiplication" Copy "modifier": 0.5 Copy "target": "radius" Copy "chance": 0.4 Copy "max": 42 Copy "min": 42 Copy "tooltip": { "text": "Overclock: Recipe time divided by 2", "color": "orange" } Copy { "requirement": "custommachinery:speed", "mode": "input", "operation": "multiplication", "modifier": 0.5 } Copy { "requirement": "custommachinery:energy_per_tick", "mode": "input", "operation": "multiplication", "modifier": 2.0 } Copy { "requirement": "custommachinery:item", "mode": "output", "operation": "addition", "modifier": 1, "chance": 0.5 } sun-brightdesktopmoon --- # Requirements | Custom Machinery 1.21 Recipe requirements are what make a recipe do things, should it be inputs, outputs, world interaction etc... A recipe can take an unlimited amount of requirements. When processing a recipe, the machine will check all requirements and execute their actions, if one or several requirement couldn't be processed, the machine will switch to error status, display an error and try again later. Requirements are defined in a recipe json using the `"requirement"` property to specify an array of requirements : recipe.json Copy { "requirements": [\ {\ //Requirement 1\ },\ {\ //Requirement 2\ }\ ] } The `"requirement"` property is optional but the recipe will do nothing if no requirements are specified. circle-info You can add or change the [display info](https://frinn.gitbook.io/custom-machinery-1.21/misc/requirement-display-info) of any requirement. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements#available-requirements) Available requirements There are currently 23 requirement types implemented, each one of them have a specific goal and can be configured as you need. [Biomechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/biome) [Blockchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/block) [Commandchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command) [Dimensionchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/dimension) [Dropchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/drop) [Durabilitychevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/durability) [Effectchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/effect) [Energychevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/energy) [Energy per tickchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/energy-per-tick) [Entitychevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/entity) [Fluidchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/fluid) [Fluid per tickchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/fluid-per-tick) [Fuelchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/fuel) [Itemchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/item) [Item transformchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/item-transform) [Lightchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/light) [Loot tablechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/loot-table) [Positionchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/position) [Redstonechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/redstone) [Skychevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/sky) [Structurechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/structure) [Timechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/time) [Weatherchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/weather) [Working corechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/working-core) ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements#addons-requirements) Addons requirements These requirements are implemented in their own Custom Machinery addons. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements#mekanism) Mekanism [Chemical (Mekanism)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/chemical-mekanism) [Heat (Mekanism)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/heat-mekanism) [Radiation (Mekanism)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/radiation-mekanism) [Temperature (Mekanism)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/temperature-mekanism) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements#create) Create [Contraption requirement (Create)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create) [PreviousCraft recipechevron-left](https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe) [NextBiomechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/biome) Last updated 1 year ago * [Available requirements](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements#available-requirements) * [Addons requirements](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements#addons-requirements) sun-brightdesktopmoon sun-brightdesktopmoon --- # Biome | Custom Machinery 1.21 Biome requirement is used to make the custom machine recipe work only in some biomes of the world. The biome requirement is an input only requirement, meaning that you don't have to define the `mode` property. It is used only to restrict or allow the usage of a recipe in certain biomes of the world. The type of biome requirement is : `"custommachinery:biome"`. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/biome#properties) Properties The biome requirement has 2 mandatory properties and 1 optional property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/biome#mandatory-properties) Mandatory properties Copy "type": "custommachinery:biome" //Mandatory to define a biome requirement. chevron-rightFilter[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/biome#filter) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/biome#name-filter) Name : `filter` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/biome#description) Description : A single or array of Biome ID to check if the machine is in or not. The biomes ID must must be like "minecraft:plains" or any custom biomes. This list may be a whitelist or a blacklist depending of the "blacklist" property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/biome#default) Default : Empty, so any biomes will be allowed if the filter is a whitelist. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/biome#example) Example : Copy "filter": ["minecraft:savanna"] The recipe will only run if the machine is in a Savanna biome. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/biome#optional-properties) Optional properties chevron-rightBlacklist[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/biome#blacklist) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/biome#name-blacklist) Name: `blacklist` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/biome#description-1) Description : A Boolean value used to define if the "filter" property should be a blacklist instead of a whitelist. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/biome#default-false) Default : `false` The "filter" property will act as a whitelist. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/biome#example-1) Example : Copy "blacklist": true The "filter" property will act as a blacklist. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/biome#example-2) Example A biome requirement that will make the recipe works in all biomes but the vanilla plains : [PreviousRequirementschevron-left](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements) [NextBlockchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/block) * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/biome#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/biome#example-2) sun-brightdesktopmoon Copy { "type": "custommachinery:biome", "filter": "minecraft:plains", "blacklist": true } sun-brightdesktopmoon --- # Chunkload | Custom Machinery 1.21 The chunkload requirement can be used to make the machine chunkload an area around it. Unlike the [Chunkload machine component](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chunkload-component) , this requirement will chunkload the area only while the recipe is processing. If the recipe containing this requirement stop processing (because some other requirement aren't valid for example) the chunkload will stop too. The type of chunkload requirement is : `"custommachinery:chunkload"`. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/chunkload#properties) Properties The button requirement only has 1 mandatory property and 1 optional property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/chunkload#mandatory-properties) Mandatory properties Copy "type": "custommachinery:chunkload" //Mandatory to define a chunkload requirement. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/chunkload#optional-property) Optional property chevron-rightRadius[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/chunkload#radius) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/chunkload#name-radius) Name : `radius` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/chunkload#description) Description : The radius (in chunks) of the chunkloading area. The radius include the center chunk (where the machine is placed) so a radius of 2 means an area of 3x3 chunks. Must be between 1 and 32. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/chunkload#default-1) Default : `1` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/chunkload#example) Example : The machine will chunkload an area of 3x3 chunks. Copy "radius": 2 ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/chunkload#example-1) Example A chunkload requirement that will make the machine chunkload an area of 3x3 chunks around it as long as the recipe is processing : Copy { "type": "custommachinery:chunkload", "radius": 2 } [PreviousChemical (Mekanism)chevron-left](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/chemical-mekanism) [NextContraption requirement (Create)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create) * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/chunkload#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/chunkload#example-1) sun-brightdesktopmoon sun-brightdesktopmoon --- # Dimension | Custom Machinery 1.21 Dimension requirement is used to make the custom machine recipe work only in some dimensions of the world. The dimension requirement is an input only requirement, meaning that you don't have to define the "mode" property. It is used only to restrict or allow the usage of a recipe in certain dimensions of the world. The type of dimension requirement is : `"custommachinery:dimension"`. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/dimension#properties) Properties The dimension requirement has 2 mandatory properties and 1 optional property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/dimension#mandatory-properties) Mandatory properties Copy "type": "custommachinery:dimension" //Mandatory to define a dimension requirement. chevron-rightFilter[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/dimension#filter) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/dimension#name-filter) Name : `filter` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/dimension#description) Description : A single or array of dimensions ID to check if the machine is in or not. The dimensions ID must mus be like "minecraft:overworld" or any custom dimensions. This list may be a whitelist or a blacklist depending of the "blacklist" property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/dimension#default-empty) Default : `empty` Any biomes will be allowed if the filter is a whitelist. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/dimension#example) Example : Copy "filter": ["minecraft:overworld"] The recipe will only run if the machine is in the overworld. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/dimension#optional-properties) Optional properties chevron-rightBlacklist[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/dimension#blacklist) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/dimension#name-blacklist) Name : `blacklist` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/dimension#description-1) Description : A Boolean value used to define if the "filter" property should be a blacklist instead of a whitelist. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/dimension#default-false) Default : `false` The "filter" property will act as a whitelist. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/dimension#example-1) Example : Copy "blacklist": true The "filter" property will act as a blacklist. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/dimension#example-2) Example A dimension requirement that will make the recipe works in all dimensions but the overworld : [PreviousCommandchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command) [NextDropchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/drop) * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/dimension#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/dimension#example-2) sun-brightdesktopmoon Copy { "type": "custommachinery:dimension", "filter": "minecraft:overworld", "blacklist": true } sun-brightdesktopmoon --- # Sky | Custom Machinery 1.21 This requirement will only check if the machine has clear access to the sky. The check occurs every tick so if the machine stop having access to the sky during a process (for example if a player place a block above it), it will stop and wait for sky to be visible again. The requirement type of sky requirement is : `"custommachinery:sky"`. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/sky#properties) Properties The sky requirement has 1 mandatory property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/sky#mandatory-property) Mandatory property Copy "type": "custommachinery:sky" //Mandatory to define a sky requirement. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/sky#example) Example How to define a sky requirement: Copy { "type": "custommachinery:sky" } [PreviousPressure (PNC)chevron-left](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/pressure-pnc) [NextStructurechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/structure) * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/sky#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/sky#example) sun-brightdesktopmoon sun-brightdesktopmoon --- # Fuel | Custom Machinery 1.21 Fuel requirement is used to make the recipe need a fuel to be processed (like a furnace). The fuel item must be provided with an [Item Component](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component) with the `"variant": "custommachinery:fuel"` property. This requirement will only check if the machine is burning fuel. The check occurs every tick so if the machine run out of fuel during a process it will stop and wait for the player to add some fuel. The requirement type of fuel requirement is : `"custommachinery:fuel"`. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/fuel#properties) Properties The fuel requirement has 1 mandatory property and 1 optional property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/fuel#mandatory-property) Mandatory property Copy "type": "custommachinery:fuel" //Mandatory to define a fuel requirement. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/fuel#optional-property) Optional property chevron-rightAmount[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/fuel#amount) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/fuel#name-amount) Name : `amount` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/fuel#description) Description : A positive integer that define the amount of fuel burn each tick of the recipe process. If the machine don't have enough burn time remaining a fuel item will be consumed and it's corresponding burn time will be added. If no fuel item is found the machine will stop and error. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/fuel#default-1) Default : 1 The requirement will consume 1 burn time each recipe process tick (same as the vanilla furnace). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/fuel#example) Example : Copy "amount": 2 The requirement will consume 2 burn time each tick, meaning the fuel will be consumed 2 times faster than in a vanilla furnace. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/fuel#example-1) Example How to define a fuel requirement: Copy { "type": "custommachinery:fuel" } [PreviousFluid per tickchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/fluid-per-tick) [NextHeat (Mekanism)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/heat-mekanism) Last updated 1 year ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/fuel#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/fuel#example-1) sun-brightdesktopmoon sun-brightdesktopmoon --- # Light | Custom Machinery 1.21 Light requirement is used to check the sky or block light level at the machine position. This requirement is INPUT only, you don't have to specify a `mode` property. This requirement will block the start of the recipe if the required light level is not met, but it will never consume or produce anything. The requirement type of light requirement is : `"custommachinery:light"`. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/light#properties) Properties The light requirement has 2 mandatory properties and 1 optional property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/light#mandatory-properties) Mandatory properties Copy "type": "custommachinery:light" //Mandatory to define a light requirement. chevron-rightLight[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/light#light) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/light#name-light) Name : `light` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/light#description) Description : A [Range](https://frinn.gitbook.io/custom-machinery-1.21/misc/range) that define the valid light level the machine need to process the recipe. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/light#example) Example : Copy "light": "8" Require a light level of 8. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/light#optional-properties) Optional properties chevron-rightSky[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/light#sky) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/light#name-sky) Name : `sky` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/light#description-1) Description : A boolean, if true the requirement will check the sky light level, if false it will check the block light level. The maximum sky light level the machine can see is 14. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/light#default-false) Default : `false` Check the block light level. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/light#example-1) Example : Copy "sky": true The machine will check the sky light level. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/light#example-2) Example A light requirement that will make the recipe start only if the sky light level is below 7 : [PreviousItem filterchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/item-filter) [NextLoot tablechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/loot-table) * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/light#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/light#example-2) sun-brightdesktopmoon Copy { "type": "custommachinery:light", "light": "(,7)", "sky": true } sun-brightdesktopmoon --- # Contraption requirement (Create) | Custom Machinery 1.21 circle-exclamation This requirement requires [Custom Machinery Createarrow-up-right](https://www.curseforge.com/minecraft/mc-mods/custom-machinery-create) to be installed. The contraption requirement is used to make a recipe able to require or produce some Create kinetic speed and stress. This requirement is available in both `input` and `output` modes. The requirement type of contraption requirement is : `"custommachinery:contraption"`. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create#properties) Properties The block requirement has 3 mandatory properties and 1 optional property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create#mandatory-properties) Mandatory properties Copy "type": "custommachinery:contraption" //Mandatory to define a contraption requirement. chevron-rightMode[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create#mode) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create#name-mode) Name : `mode` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create#description) Description : Define the mode (input or output) of this requirement. * Input : The recipe will requires the specified amount of kinetic speed to start. If a stress value is specified the recipe will add a stress impact of `speed * stress` to the kinetic network. * Output : The recipe will produce the specified amount of kinetic speed while the machine is running. If a stress value is specified the recipe will add a stress capacity of `speed * stress` to the kinetic network. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create#example) Example : The recipe will produce SU : Copy "mode": "output" chevron-rightSpeed[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create#speed) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create#name-speed) Name : `speed` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create#description-1) Description : A positive decimal value that define the amount of kinetic speed (in RPM)that the recipe will require or produce. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create#example-1) Example : The recipe will require or produce 64rpm : Copy "speed": 64 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create#optional-property) Optional property chevron-rightStress[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create#stress) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create#name-stress) Name : `stress` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create#description-2) Description : A positive decimal value that define the kinetic stress capacity or impact (depending on the mode property) that the recipe will add to the kinetic network. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create#default-0) Default : 0 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create#example-2) Example : Add a kinetic stress impact/capacity of 2 times the machine speed : chevron-rightScaling[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create#scaling) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create#name-scaling) Name : `scaling` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create#description-3) Description : A boolean that define if the recipe processing speed should be scaled to the rotation speed provided to the machine. For example if the recipe requires a speed of 128 and a speed of 256 is provided the recipe will be processed 2x faster. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create#default-false) Default : `false` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create#example-3) Example : The processing speed will be scaled to the rotation speed : ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create#example-4) Example A contraption requirement that will make the recipe require at least 64rpm to start and add a stress impact of 2 times its speed to the network : [PreviousChunkloadchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/chunkload) [NextCommandchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command) * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create#example-4) sun-brightdesktopmoon Copy "stress": 2 Copy "scaling": true Copy { "type": "custommachinery:contraption", "mode": "input", "speed": 64, "stress": 2 sun-brightdesktopmoon --- # Redstone | Custom Machinery 1.21 Redstone requirement is used to make the recipe work only when the machine receive a specific redstone signal. This requirement is an **input only** requirement, meaning that you don't have to define the `mode` property. It is used only to block or allow the usage of a recipe under certain conditions but don't have any real inputs or outputs. The requirement type of redstone requirement is : `"custommachinery:redstone"`. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/redstone#properties) Properties The redstone requirement has 2 mandatory properties. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/redstone#mandatory-properties) Mandatory properties Copy "type": "custommachinery:redstone" //Mandatory to define a redstone requirement. chevron-rightPower[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/redstone#power) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/redstone#name-power) Name : `power` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/redstone#description) Description : A [range](https://frinn.gitbook.io/custom-machinery-1.21/misc/range) that define the valid redstone signal (between 0 and 15) the machine need to process the recipe. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/redstone#example) Example : The recipe will only start if the machine receive a redstone signal of exactly 1. Copy "power": "1" ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/redstone#example-1) Example A redstone requirement that will make the recipe start only if the machine received redstone signal is lower or equals than 8. Copy { "type": "custommachinery:redstone", "power": "(,8)" } [PreviousRadiation (Mekanism)chevron-left](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/radiation-mekanism) [NextTemperature (Mekanism)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/temperature-mekanism) * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/redstone#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/redstone#example-1) sun-brightdesktopmoon sun-brightdesktopmoon --- # Button | Custom Machinery 1.21 Button requirement is used to make the custom machine recipe start only when the player press a button in the machine gui. The button requirement is an input only requirement, meaning that you don't have to define the `mode` property. The type of button requirement is : `"custommachinery:button"`. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/button#properties) Properties The button requirement has 2 mandatory properties and 1 optional property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/button#mandatory-properties) Mandatory properties Copy "type": "custommachinery:button" //Mandatory to define a button requirement. chevron-rightId[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/button#id) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/button#name-id) Name : `id` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/button#description) Description : The string id of the [button element](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/button-element) that must be pressed. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/button#example) Example : The recipe will start only if the button with id `button1` is pressed by the player. Copy "id": "button1" #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/button#optional-property) Optional property chevron-rightInverse[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/button#inverse) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/button#name-inverse) Name : `inverse` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/button#description-1) Description : A boolean that will make the recipe require the button to **not** be pressed. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/button#default-false) Default : `false` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/button#example-1) Example : The recipe will start if the button is not pressed : Copy "inverse": true ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/button#example-2) Example A button requirement that will make the recipe start only if the button element with id `diamond` is pressed by the player : [PreviousBlockchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/block) [NextChemical (Mekanism)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/chemical-mekanism) Last updated 1 year ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/button#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/button#example-2) sun-brightdesktopmoon Copy { "type": "button", "id": "diamond" } sun-brightdesktopmoon --- # PNC Temperature (PNC) | Custom Machinery 1.21 circle-exclamation This requirement requires [Custom Machinery Pneumaticcraftarrow-up-right](https://www.curseforge.com/minecraft/mc-mods/custom-machinery-pneumaticcraft) to be installed. The temperature requirement can be used to make a recipe start only if the machine's [heat component](https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pnc-heat-component-pnc) temperature is at a specific value. This requirement doesn't consume or produce anything, it's only a condition for the recipe to start. The requirement type of temperature requirement is : "`custommachinery:pnc_temperature"`. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/pnc-temperature-pnc#properties) Properties The temperature requirement has 2 mandatory properties. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/pnc-temperature-pnc#mandatory-property) Mandatory property Copy "type": "custommachinery:pnc_temperature" //Mandatory to define a temperature requirement. chevron-rightTemperature[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/pnc-temperature-pnc#temperature) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/pnc-temperature-pnc#name-temperature) Name : `temperature` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/pnc-temperature-pnc#description) Description : A [Range](https://frinn.gitbook.io/custom-machinery-1.21/misc/range) of values that will allow the recipe to start. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/pnc-temperature-pnc#example) Example : The recipe will start only if the machine temperature is above 100°C Copy "temperature": "(100,)" ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/pnc-temperature-pnc#example-1) Example A temperature requirement that will allow the recipe to run only if the machine temperature is higher than 100°C : Copy { "type": "custommachinery:pnc_temperature", "temperature": "(100,)" } [PreviousPNC Heat (PNC)chevron-left](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/pnc-heat-pnc) [NextPositionchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/position) Last updated 7 months ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/pnc-temperature-pnc#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/pnc-temperature-pnc#example-1) sun-brightdesktopmoon sun-brightdesktopmoon --- # Command | Custom Machinery 1.21 Command requirement is used to make the custom machine execute commands while crafting. This requirement doesn't have a mode and will not stop the processing of a recipe even if the command fail. The command can be executed at the start, at the end or every tick of the crafting process (see the `phase` property below). The requirement type of command requirement is : `"custommachinery:command"`. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#properties) Properties The command requirement has 2 mandatory properties and 5 optional properties. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#mandatory-properties) Mandatory properties Copy "type": "custommachinery:command" //Mandatory to define a command requirement. chevron-rightCommand[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#command) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#name-command) Name : `command` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#description) Description : A string which represent the command to run, it must have the same syntax as when you run command in the chat (so begin with "/"). #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#example) Example : Copy "command": "/time set 0" The machine's world time will be set to 0. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#optional-properties) Optional properties chevron-rightPermission level[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#permission-level) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#name-permissionlevel) Name : `permissionlevel` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#description-1) Description : An integer that define the permission level the machine can run the command. In vanilla a player have a permission level of 1 and an op player have 4, see [herearrow-up-right](https://nodecraft.com/support/games/minecraft/how-to-set-a-player-as-op-admin) for more infos. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#default-2) Default : 2 Should be good enough to execute most commands. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#example-1) Example : Copy "permissionlevel": 4 The machine will run the command as an op. chevron-rightLog[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#log) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#description-2) Description : A boolean (true/false) that define if the machine should log the command when executed, if true a system message in the chat, console and logs will be shown. It can be used for debug. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#default-false) Default : `false` No logs, the machine will print a message in the logs only when it fail to execute a command but never in the chat. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#example-2) Example : Will print the command result in the chat/console/logs when executed. chevron-rightTick[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#tick) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#description-3) Description : A boolean (true/false) that define if the command should be executed each tick or just once. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#default-false-1) Default : `false` The command will be executed once. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#example-3) Example : The command will be executed each tick. chevron-rightChance[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#chance) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#name-chance) Name : `chance` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#description-4) Description : A double between 0.0 and 1.0 that define the chance of the command to be run. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#default-1) Default : 1 The command will always be run. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#example-4) Example : The command will have 70% chance to be run. chevron-rightDelay[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#delay) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#name-delay) Name : `delay` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#description-5) Description : A double value, between 0.0 and 1.0 that represents at which time of the recipe the command must be executed. A delay of 0.5 represent half of the recipe, 0.25 a quarter etc... #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#default-1-1) Default : `1` The command will be executed at the end of the recipe process. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#example-5) Example : The command will be executed when the recipe progress time is at (approximatively) a third of the recipe total duration. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#example-6) Example A command requirement that will spawn a Zombie when the recipe finish with 50% chance: [PreviousContraption requirement (Create)chevron-left](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create) [NextDimensionchevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/dimension) Last updated 2 months ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command#example-6) sun-brightdesktopmoon Copy "log": "true" Copy "tick": true Copy "chance": 0.7 Copy "delay": 0.33 Copy { "type": "custommachinery:command", "command": "/summon minecraft:zombie", "permission": 4, "chance": 0.5 } sun-brightdesktopmoon --- # Loot table | Custom Machinery 1.21 Loot table requirement is used to generate item outputs based on a vanilla, modded or custom loot table. This requirement is OUTPUT only, you don't have to specify a `mode` property. This requirement will block the end of the recipe if the generated items can't be put in a slot (because all slots are full for example). The requirement type of loot table requirement is : "`custommachinery:loot_table"`. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/loot-table#properties) Properties The loot table requirement has 2 mandatory properties and 1 optional property. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/loot-table#mandatory-properties) Mandatory properties Copy "type": "custommachinery:loot_table" //Mandatory to define a loot table requirement. chevron-rightTable[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/loot-table#table) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/loot-table#name-table) Name : `table` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/loot-table#description) Description : Define the path of the loot table file to use. The path must be of the format: `namespace:path/from/the/loot_tables/folder`. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/loot-table#example) Example : Copy "table": "custommachinery:my_loot_table" The requirement will use a loot table located in `data/custommachinery/loot_tables/my_loot_table.json`. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/loot-table#optional-property) Optional property chevron-rightLuck[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/loot-table#luck) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/loot-table#name-luck) Name : `luck` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/loot-table#description-1) Description : A float that can be used in the loot table to affect the number of generated items. See [vanilla wikiarrow-up-right](https://minecraft.fandom.com/wiki/Loot_table) for more info about loot tables. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/loot-table#default-0) Default : `0` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/loot-table#example-1) Example : Copy "luck": 1.0 ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/loot-table#example-2) Example A loot table requirement that will make the recipe output either 28 diamonds or a stone in the #forge:stones tag. In `data/custommachinery/loot_tables/test_loot_table.json` ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/loot-table#notes) Notes Minecraft loot tables are a very complex system, which is made to be used in many ways (block and mobs drops, dungeon chests, plant harvest etc...) and that would be a hell to support and test all possibilities of loot tables. So some things may break, other may not work. Loot tables have a `type` property, when possible use `"type": "custommachinery:custom_machine"`. It may not be needed thought. If you have any issues with the loot table requirement and you seek support in the github issues or in the discord, please include the loot table file and describe the most precisely possible what it should do. I am not a loot tables expert and I can't spend hours on the wiki just to understand what your loot table does. [PreviousLightchevron-left](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/light) [NextPNC Heat (PNC)chevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/pnc-heat-pnc) * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/loot-table#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/loot-table#example-2) * [Notes](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/loot-table#notes) sun-brightdesktopmoon Copy { "type": "custommachinery:loot_table", "table": "custommachinery:text_loot_table" } test\_loot\_table.json Copy { "type": "custommahinery:custom_machine", "pools": [\ {\ "rolls": 1,\ "entries": [\ {\ "functions": [\ {\ "function": "set_count",\ "count": 25\ }\ ],\ "type": "minecraft:item",\ "name": "minecraft:diamond"\ },\ {\ "type": "tag",\ "name": "forge:stone",\ "expand": true\ }\ ]\ }\ ] } sun-brightdesktopmoon --- # Radiation (Mekanism) | Custom Machinery 1.21 circle-exclamation This requirement requires [Custom Machinery Mekanismarrow-up-right](https://www.curseforge.com/minecraft/mc-mods/custom-machinery-mekanism) to be installed. The radiation requirement and its per-tick variant can be used to make a recipe absorb or emit radiations near the machine. All radiation amounts are expressed in Sievert (Sv). [Herearrow-up-right](https://github.com/mekanism/Mekanism/blob/1.19.x/src/api/java/mekanism/api/radiation/IRadiationManager.java#L21-L37) is a link to the Mekanism javadoc description about radiation amounts. The requirement type of radiation requirement is `"custommachinery:radiation"` and for the radiation per tick requirement : `"custommachinery:radiation_per_tick"`. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/radiation-mekanism#properties) Properties The radiation requirement has 3 mandatory properties and 1 optional property : #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/radiation-mekanism#mandatory-properties) Mandatory properties Copy "type": "custommachinery:radiation" //Mandatory to define a radiation requirement. OR "type": "custommachinery:radiation_per_tick" //Mandatory to define a radiation per tick requirement. chevron-rightMode[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/radiation-mekanism#mode) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/radiation-mekanism#name-mode) Name : `mode` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/radiation-mekanism#description) Description : A property that define if the recipe will absorb or emit radiations. * `input` : The recipe will absorb radiations. * `output` : The recipe will emit radiations. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/radiation-mekanism#example) Example : The recipe will absorb radiations : Copy "mode": "input" chevron-rightAmount[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/radiation-mekanism#amount) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/radiation-mekanism#name-amount) Name : `amount` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/radiation-mekanism#description-1) Description : A positive, decimal value that represent the amount (in Sv) of radiations to emit or absorb. Keep in mind that 1Sv is a **very** high value, in most case you will need to use mSv (0.001Sv) or even µSv (0.000001Sv) except of course if you need the equivalent of a nuclear reactor meltdown. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/radiation-mekanism#example-1) Example : The recipe will absorb/emit 0.001Sv. Copy "amount": 0.001 #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/radiation-mekanism#optional-property) Optional property chevron-rightRadius[hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/radiation-mekanism#radius) #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/radiation-mekanism#name-radius) Name : `radius` #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/radiation-mekanism#description-2) Description : **Use only in input mode.** A positive integer that represent the radius (in blocks) that the machine will search for radiation sources to absorb. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/radiation-mekanism#default) Default : The value of Mekanism config `radiationChunkCheckRadius` (5 by default) x16. #### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/radiation-mekanism#example-2) Example : The machine will search for radiation sources to absorb in a 10 blocks radius. ### [hashtag](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/radiation-mekanism#example-3) Example A radiation per tick requirement that will make the recipe absorb 0.001Sv each tick : [PreviousStructurechevron-left](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/structure) [NextRedstonechevron-right](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/redstone) Last updated 7 months ago * [Properties](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/radiation-mekanism#properties) * [Example](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/radiation-mekanism#example-3) sun-brightdesktopmoon Copy "radius": 10 Copy { "type": "radiation_per_tick", "amount": 0.001 } sun-brightdesktopmoon ---