### Full Upgrade Configuration Examples Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades.md Complete JSON examples for configuring machine upgrades. ```json { "item": "minecraft:diamond", "machines": ["custommachinery:power_crusher"], "requirements": [ { "requirement": "custommachinery:speed", "mode": "input", "operation": "multiplication", "modifier": 0.5 } ] } ``` ```json { "item": "minecraft:diamond", "machines": ["custommachinery:power_crusher"], "components": [ { "component": "custommachinery:energy", "target": "capacity", "operation": "multiplication", "modifier": 2 } ], "core": { "operation": "addition", "modifier": 1 } } ``` -------------------------------- ### Full Item Requirement Examples Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/item.md Complete examples for input consumption and output production. ```json { "type": "custommachinery:item", "mode": "input", "ingredient": { "item": "minecraft:cobblestone", "count": 50 } } ``` ```json { "type": "custommachinery:item", "mode": "output", "ingredient": { "item": "minecraft:diamond_chestplate", "count": 1 }, "chance": 0.01 } ``` -------------------------------- ### Full Recipe Examples Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/item-transform.md Complete examples of item transform requirements. ```json5 { "type": "custommachinery:item_transform", "input": { "item": "minecraft:diorite" }, "output": "minecraft:andesite", "output_amount": 2 } ``` ```json { "type": "custommachinery:item_transform", "input": { "tag": "minecraft:diamond_pickaxe" }, "input_slot": "input1", "output": "minecraft:diamond_shovel", "output_slot": "output1" } ``` -------------------------------- ### Full Pressure Requirement Examples Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/pressure-pnc.md Complete examples for input and output pressure configurations. ```json { "type": "custommachinery:pressure", "mode": "input", "min": 2, "max": 3, "volume": 100 } ``` ```json { "type": "custommachinery:pressure", "mode": "output", "volume": 200 } ``` -------------------------------- ### Complete Structure Requirement Example Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/structure.md A full configuration example for a structure requirement. ```json { "type": "custommachinery:structure", "pattern": [ [ "sssss", "s s", "s s", "s s", "sssss", " m " ] ], "keys": { "s": "minecraft:stone" } } ``` -------------------------------- ### Experience Requirement Examples Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/experience.md Complete examples of experience requirement configurations for output and input scenarios. ```json { "type": "custommachinery:experience", "mode": "output", "amount": 2672 } ``` ```json { "type": "custommachinery:experience", "mode": "input", "amount": 10, "form": "level", "chance": 0.8 } ``` -------------------------------- ### Recipe Examples Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes.md Complete examples of defining machine recipes using the CMRecipeBuilder. ```java mods.custommachinery.CMRecipeBuilder.create("custommachinery:stone_generator", 100) .requireFluid( * 5) .requireFluidTag(, 5) .requireEnergyPerTick(20) .produceItem() .build(); ``` ```java mods.custommachinery.CMRecipeBuilder.create("custommachinery:power_crusher", 200) .requireItemTag(, 1) .requireEnergyPerTick(20) .produceItem() .produceItem().chance(0.5) .produceItem().chance(0.1) .build(); ``` -------------------------------- ### Machine appearance examples Source: https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance.md Practical examples demonstrating simple property overrides and status-based appearance changes. ```json5 "appearance": { "block": "minecraft:tnt", "sound": "minecraft:block.anvil.place", "light": 10 } ``` ```json5 "appearance": { "block": "minecraft:furnace", "running": { "block": "minecraft:furnace[lit=true]", "light": 15 } } ``` -------------------------------- ### Example Recipe with Function Logic Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function.md A complete example showing how to use requireFunctionOnEnd to interact with machine slots. ```zenscript 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(); ``` -------------------------------- ### Recipe Command Example Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/command.md A practical example of using runCommandOnEnd within a custom machine recipe. ```javascript ServerEvents.recipes(event => { event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100) .runCommandOnEnd("/time set 0") }) ``` -------------------------------- ### Example Recipe with Chunkload Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/chunkload.md A recipe example that chunkloads a 3x3 area around the machine while consuming 10FE/t. ```javascript .create("custommachinery:dynamo", 1) .chunkload(2) .requireEnergyPerTick(10) .build(); ``` -------------------------------- ### Example Recipe Implementation Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/craft-recipe.md A practical example of a recipe requiring coal and energy to produce a diamond. ```json5 { "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 }] } ``` -------------------------------- ### Consume Drop Recipe Example Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/drop.md Example of a recipe that consumes 10 stones within a 10-block radius upon starting. ```javascript ServerEvents.recipes(event => { event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100) .consumeDropsOnStart("10x #c:stones", 10) }) ``` -------------------------------- ### Example Recipe Implementation Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/data.md A complete example showing how to integrate data requirements and modifications within a KubeJS recipe event. ```javascript ServerEvents.recipes(event => { event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100) .requireIntData("power", "(100,)") //Start only if "power" is above 100 .putIntData("power", 0) //Reset the "power" data .putNBTData("test", {test: "something"}) //Add some nbt data }) ``` -------------------------------- ### Example Upgrade Implementation Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/upgrades.md A complete example showing a gold ingot upgrade that modifies energy consumption and speed for a power crusher. ```java 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(); ``` -------------------------------- ### Full Recipe Function Implementation Example Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/function.md A complete example showing a machine adding items to an output slot during each tick. ```javascript ServerEvents.recipes(event => { event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 200) .requireFunctionEachTick("add_2_diamonds") }) CustomMachineryEvents.recipeFunction("add_2_diamonds", event => { let remaining = event.machine.addItemToSlot("output1", "2x minecraft:diamond", true) if(remaining.count == 0) { event.machine.addItemToSlot("output1", "2x minecraft:diamond", false) event.success() } event.error("Can't add 2 diamonds in output slot") }) ``` -------------------------------- ### Full Ambient Sound Configuration Examples Source: https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-appearance/sound-ambient.md Examples showing both a simple sound definition and a fully configured ambient sound object. ```json5 { "ambient_sound": "namespace:sound_location" } ``` ```json { "ambient_sound": { "sound": "namespace:sound_location", "volume": 2.0, "pitch": 2.0, "source": "music" } } ``` -------------------------------- ### Example Recipe with Sky Requirement Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/sky.md This example demonstrates creating a machine recipe that requires clear access to the sky. ```javascript .create("custommachinery:power_crusher", 20) .mustSeeSky() .build(); ``` -------------------------------- ### Diamond to Energy Recipe Example Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/machine-recipe.md A practical example of a recipe consuming an item and outputting energy. ```json5 { "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 }] } ``` -------------------------------- ### Energy Consumption Recipe Example Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/energy.md A recipe example demonstrating how to consume 1000FE using the requireEnergy method. ```javascript ServerEvents.recipes(event => { event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100) .requireEnergy(1000) }) ``` -------------------------------- ### Fluid Recipe Example Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/fluid.md A basic example of adding a fluid requirement to a custom machine recipe. ```javascript ServerEvents.recipes(event => { event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100) .requireFluid("1000x water") }) ``` -------------------------------- ### Heat Component Examples Source: https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/heat-component-mekanism.md Examples of basic heat component definitions and side-specific configuration. ```json5 { "type": "custommachinery:heat" } ``` ```json { "type": "custommachinery:heat", "config": { "default": "enabled", "front": "disabled" } } ``` -------------------------------- ### Example Redstone Requirement Recipe Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/redstone.md A complete example showing how to apply a redstone requirement to a custom machine recipe. ```javascript ServerEvents.recipes(event => { event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100) .requireRedstone("(,8)") }) ``` -------------------------------- ### Produce Experience Recipe Example Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/experience.md A practical example of a custom machine recipe that produces 3 experience points. ```javascript .create("custommachinery:power_crusher", 20) .produceXp(3) .build(); ``` -------------------------------- ### Full Contraption Requirement Example Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/contraption-requirement-create.md A complete example of a contraption requirement configured for input mode. ```json { "type": "custommachinery:contraption", "mode": "input", "speed": 64, "stress": 2 } ``` -------------------------------- ### PNC Heat Component Examples Source: https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pnc-heat-component-pnc.md Basic and configured examples of the PNC heat component. ```json5 { "type": "custommachinery:pnc_heat" } ``` ```json { "type": "custommachinery:pnc_heat", "config": { "default": "enabled", "front": "disabled" } } ``` -------------------------------- ### Example Recipe with Chemical Requirements Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/chemical-mekanism.md A complete recipe example demonstrating the consumption of steam and production of white pigment. ```javascript .create("custommachinery:boiler", 20) .requireChemical( * 1000) .produceChemical( * 100) .build(); ``` -------------------------------- ### Drop Requirement Examples Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/drop.md Examples demonstrating item production and tag-based input checking within a recipe. ```json { "type": "custommachinery:drop", "mode": "output", "action": "produce", "output": "minecraft:diamond", "chance": 0.33 } ``` ```json { "type": "custommachinery:drop", "mode": "input", "action": "check", "input": { "tag": "forge:stone" }, "amount": 5, "radius": 5 } ``` -------------------------------- ### Loot Table Requirement Example Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/loot-table.md A complete example of a loot table requirement configuration. ```json { "type": "custommachinery:loot_table", "table": "custommachinery:text_loot_table" } ``` -------------------------------- ### Full Position Requirement Example Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/position.md A complete example restricting the recipe to run only above the 128 Y layer. ```json { "type": "custommachinery:position", "y": "(128,)" } ``` -------------------------------- ### Full Redstone Requirement Example Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/redstone.md A complete configuration example where the recipe triggers only if the redstone signal is 8 or lower. ```json { "type": "custommachinery:redstone", "power": "(,8)" } ``` -------------------------------- ### Example Recipe with Heat Requirements Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/heat-mekanism.md A recipe example that requires a temperature above 100°C and produces 1000 heat. ```javascript .create("custommachinery:boiler", 20) .requireTempCelsius("(100,)") .produceHeat(1000) .build(); ``` -------------------------------- ### Radiation Recipe Example Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/radiation-mekanism.md A recipe example that absorbs 1 mSv of radiation per tick. ```javascript .create("custommachinery:boiler", 20) .requireRadiationPerTick(0.001) .build(); ``` -------------------------------- ### Example Upgrade Implementation Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/upgrades.md An example of a gold ingot upgrade that modifies energy consumption and duration for a power crusher machine. ```javascript CustomMachineryEvents.upgrades(event => { event.create('minecraft:gold_ingot') .machine("custommachinery:power_crusher") .modifier(CMRecipeModifierBuilder.mulInput('custommachinery:energy', 2).max(1000)) .modifier(CMRecipeModifierBuilder.mulInput('custommachinery:speed', 1.5).min(100)) }) ``` -------------------------------- ### Example Recipe with SU Requirement Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/contraption-create.md A recipe example requiring 64 RPM and adding a stress impact of 2 times the speed. ```javascript .create("custommachinery:boiler", 20) .requireSU(64, 2) .build(); ``` -------------------------------- ### Full Biome Requirement Example Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/biome.md A complete configuration example that excludes the vanilla plains biome. ```json { "type": "custommachinery:biome", "filter": "minecraft:plains", "blacklist": true } ``` -------------------------------- ### Complete Weather Requirement Example Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/weather.md A full configuration example where the recipe runs if it is raining anywhere in the world, regardless of machine exposure. ```json { "type": "custommachinery:weather", "weather": "rain", "onmachine": false } ``` -------------------------------- ### runCommandOnStart Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/command.md Executes a command when the recipe starts. ```APIDOC ## .runCommandOnStart(command, [permissionLevel], [log]) ### Description Executes the specified command when the recipe starts. ### Parameters - **command** (string) - Required - The command to run, must start with '/'. - **permissionLevel** (integer) - Optional - The permission level for the command execution. Default: 2. - **log** (boolean) - Optional - Whether to log the command in admin chat. Default: false. ``` -------------------------------- ### Custom Machine Recipe Example Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/item.md A complete example of a custom machine recipe using item requirements and production. ```javascript ServerEvents.recipes(event => { event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100) .requireItem("cobblestone") .produceItem("3x minecraft:gravel") }) ``` -------------------------------- ### Pressure Recipe Example Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/pressure-pnc.md A recipe example requiring a pressure range of 2-3 bar and consuming 100mL of compressed air. ```javascript ServerEvents.recipes(event => { event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100) .requirePressure(2, 3, 100) }) ``` -------------------------------- ### PNC Heat Recipe Example Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/pnc-heat-pnc.md A recipe example that requires a temperature above 100°C and produces 1000 heat. ```javascript ServerEvents.recipes(event => { event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100) .requirePNCTemperature("(100,)") .producePNCHeat(1000) }) ``` -------------------------------- ### Background Element Examples Source: https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/background-element.md Complete JSON configurations for background elements, including basic, resized, and custom texture examples. ```json { "type": "custommachinery:background" } ``` ```json5 { "type": "custommachinery:background", "width": 192, "height": 256 } ``` ```json { "type": "custommachinery:background", "texture": "custommachinery:textures/custom_machine_gui_background.png" } ``` -------------------------------- ### Full Recipe Example with Loot Table Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/loot-table.md A complete example showing how to integrate a loot table output within a Custom Machinery recipe event. ```javascript ServerEvents.recipes(event => { event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100) .lootTableOutput("custommachinery:my_test_loottable") }) ``` -------------------------------- ### Full Requirement Info Example Source: https://frinn.gitbook.io/custom-machinery-1.21/misc/requirement-display-info.md Combine an item icon and a tooltip within the requirement configuration. ```json { //other requirement properties "info": { "item": "minecraft:diamond", "tooltips": ["This recipe make diamonds"] } } ``` -------------------------------- ### Full Energy Component Example Source: https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/energy-component.md A complete configuration example for an energy component within a machine's components array. ```json5 { "type": "custommachinery:energy", "capacity": 100000, "maxInput": 1000, "maxOutput": 666 } ``` -------------------------------- ### Entity Requirement Recipe Example Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/entity.md A practical example of applying an entity requirement to a custom machine recipe. ```javascript ServerEvents.recipes(event => { event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100) .requireEntities(1, 10, "minecraft:cow", true) }) ``` -------------------------------- ### Full Time Requirement Example Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/time.md A complete configuration example for a time requirement that restricts a recipe to daytime hours. ```json { "type": "custommachinery:time", "range": "(,12000)" } ``` -------------------------------- ### Button Requirement Recipe Example Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/button.md A complete recipe example requiring a button press to produce energy. ```javascript .create("custommachinery:dynamo", 1) .requireButtonPressed("button") .produceEnergy(10) .build(); ``` -------------------------------- ### Radiation Per Tick Requirement Example Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/radiation-mekanism.md A complete example of a radiation per tick requirement configuration. ```json { "type": "radiation_per_tick", "amount": 0.001 } ``` -------------------------------- ### Complete Fluid per tick Recipe Example Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/fluid-per-tick.md A full example of a fluid requirement consuming 20mB of water with a 50% chance. ```json { "type": "custommachinery:fluid_per_tick", "mode": "input", "ingredient": { "fluid": "minecraft:water", "amount": 20 }, "chance": 0.5 } ``` -------------------------------- ### Complete pressure element example Source: https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pressure-element-pnc.md A standard configuration for a pressure GUI element. ```json { "type": "custommachinery:pressure", "x": 20, "y": 20 } ``` -------------------------------- ### Complete Fluid Requirement Example Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/fluid.md A full example of a fluid requirement producing 500mB of water with a 50% chance. ```json { "type": "custommachinery:fluid", "mode": "output", "ingredient": { "fluid": "minecraft:water", "amount": 500 }, "chance": 0.5 } ``` -------------------------------- ### Structure Requirement Example Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/structure.md A practical example of defining a 3x1x3 hollow ring of stone behind the machine. ```javascript .requireStructure([[ "aaa", "a a", "aaa", " m " ]], {"a": "minecraft:stone"}) ``` -------------------------------- ### Full Button Requirement Example Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/button.md A complete configuration example for a button requirement linked to a diamond button ID. ```json { "type": "button", "id": "diamond" } ``` -------------------------------- ### Full blaze burner requirement example Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/blaze-burner-requirement-create.md A complete configuration example requiring a heated blaze burner for the recipe to run. ```json { "type": "custommachinery:blaze_burner", "heat": "heated" } ``` -------------------------------- ### Full Command Requirement Example Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command.md A complete example of a command requirement that spawns a zombie with a 50% chance upon recipe completion. ```json { "type": "custommachinery:command", "command": "/summon minecraft:zombie", "permission": 4, "chance": 0.5 } ``` -------------------------------- ### Durability Requirement Recipe Example Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/durability.md A practical example of applying a durability requirement to a custom machine recipe. ```javascript ServerEvents.recipes(event => { event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100) .damageItem("diamond_pickaxe", 3) }) ``` -------------------------------- ### Upgrade Slot Configuration Example Source: https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/upgrade.md A basic configuration for an upgrade slot set to input mode. ```json { "type": "custommachinery:item_upgrade", "id": "upgrade", "mode": "input" } ``` -------------------------------- ### Full Energy Requirement Examples Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/energy.md Complete configurations for energy production and consumption with optional chance parameters. ```json { "type": "custommachinery:energy", "mode": "output", "amount": 2672 } ``` ```json { "type": "custommachinery:energy", "mode": "input", "amount": 100, "chance": 0.8 } ``` -------------------------------- ### Basic Experience Component Configuration Source: https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component.md A minimal setup for an experience component with a defined capacity. ```json { "type": "custommachinery:experience", "capacity": 30970 } ``` -------------------------------- ### Basic Input Slot Example Source: https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component.md A standard configuration for an input slot. ```json5 { "type": "custommachinery:item", "id": "input", "mode": "input" } ``` -------------------------------- ### Light Requirement Recipe Examples Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/light.md Examples of applying sky and block light requirements within a Custom Machinery recipe event. ```javascript ServerEvents.recipes(event => { event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100) .requireSkyLight(15) event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100) .requireBlockLight("[7,)") }) ``` -------------------------------- ### Heated Blaze Burner Recipe Example Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/blaze-burner-create.md A complete recipe example requiring a heated blaze burner for a custom machine. ```javascript ServerEvents.recipes(event => { event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100) .requireHeatedBlazeBurner() }) ``` -------------------------------- ### Full Temperature Requirement Example Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/pnc-temperature-pnc.md Complete configuration for a recipe requiring a machine temperature above 100°C. ```json { "type": "custommachinery:pnc_temperature", "temperature": "(100,)" } ``` -------------------------------- ### Full experience per tick examples Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/experience-per-tick.md Complete JSON configurations for experience per tick requirements. ```json { "type": "custommachinery:experience_per_tick", "mode": "output", "amount": 2672 } ``` ```json { "type": "custommachinery:experience_per_tick", "mode": "input", "amount": 10, "form": "level", "chance": 0.8 } ``` -------------------------------- ### Recipe Effect Implementation Example Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/effect.md A practical example of applying a speed effect to a custom machine recipe upon completion. ```javascript ServerEvents.recipes(event => { event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100) .giveEffectOnEnd("minecraft:speed", 600, 10) }) ``` -------------------------------- ### Apply Core Addition Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/upgrades/core-modifier.md Example implementation to add one core to the machine capacity. ```javascript CMCoreModifierBuilder.add(1) ``` -------------------------------- ### Dimension Whitelist Recipe Example Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/dimension.md Example of applying a dimension whitelist to a custom machine recipe within a ServerEvents.recipes block. ```javascript ServerEvents.recipes(event => { event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100) .dimensionWhitelist("minecraft:overworld") }) ``` -------------------------------- ### Full Working Core Requirement Examples Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/working-core.md Complete configurations for specific core/recipe dependencies and generic active-core checks. ```json { "type": "custommachinery:working_core", "core": 1, "recipe": "custommachinery:test_recipe" } ``` ```json { "type": "custommachinery:working_core" } ``` -------------------------------- ### Full energy per tick examples Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/energy-per-tick.md Complete JSON configurations for energy production and consumption recipes. ```json { "type": "custommachinery:energy_per_tick", "mode": "output", "amount": 2672 } ``` ```json { "type": "custommachinery:energy_per_tick", "mode": "input", "amount": 20, "chance": 0.5 } ``` -------------------------------- ### Apply Core Multiplier Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/upgrades/core-modifier.md Example implementation to double the machine core capacity. ```javascript CMCoreModifierBuilder.mul(2) ``` -------------------------------- ### Full Chunkload Component Example Source: https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/chunkload-component.md A complete configuration for a chunkload component with a 3x3 loading area. ```json { "type": "custommachinery:chunkload", "radius": 2 } ``` -------------------------------- ### Custom Machine Structure Example Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/structure.md A practical example of defining a 3x1x3 hollow ring of stone structure for a custom machine recipe. ```javascript ServerEvents.recipes(event => { event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100) .requireStructure([[ "aaa", "a a", "aaa", " m " ]], {"a": "minecraft:stone"}) }) ``` -------------------------------- ### Full Entity Requirement Example Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/entity.md A complete configuration example for an entity requirement that kills 10 villagers within a 20-block radius at the end of a process. ```json { "type": "custommachinery:entity", "mode": "output", "amount": 10, "radius": 20, "action": "kill", "filter": ["minecraft:villager"], "whitelist": true } ``` -------------------------------- ### Query documentation via HTTP GET Source: https://frinn.gitbook.io/custom-machinery-1.21/llms.txt Perform a GET request to the documentation index to receive an AI-generated answer based on the provided question and optional goal. ```http GET https://frinn.gitbook.io/custom-machinery-1.21/misc/comparator.md?ask=&goal= ``` -------------------------------- ### Energy Capacity Multiplier Example Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/upgrades/component-modifier.md Example of a modifier that doubles the energy capacity of a machine. ```javascript CMComponentModifierBuilder.mul("custommachinery:energy", "", 2) .target("capacity") ``` -------------------------------- ### Full Chemical Requirement Example Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/chemical-mekanism.md A complete example of a chemical requirement producing 500mB of sulfuric acid with a 50% success chance. ```json { "type": "custommachinery:chemical", "mode": "output", "chemical": "mekanism:sulfuric_acid", "amount": 500, "chance": 0.5 } ``` -------------------------------- ### Full light requirement example Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/light.md A complete configuration requiring the sky light level to be below 7. ```json { "type": "custommachinery:light", "light": "(,7)", "sky": true } ``` -------------------------------- ### Basic Pressure Component Configuration Source: https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/pressure-component-pnc.md A complete example of a pressure component definition. ```json { "type": "custommachinery:pressure", "volume": 10000, "danger": 3, "critical": 5 } ``` -------------------------------- ### Full modifier examples Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/upgrades/component-modifiers.md Complete JSON objects demonstrating modifier configurations for different component types. ```json { "component": "custommachinery:energy", "target": "capacity", "operation": "multiplication", "modifier": 2 } ``` ```json { "component": "custommachinery:fluid", "id": "input1", "target": "max_input", "operation": "addition", "modifier": 50 } ``` -------------------------------- ### Example Sky Requirement Configuration Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/sky.md Basic configuration object for implementing a sky requirement in a machine. ```json { "type": "custommachinery:sky" } ``` -------------------------------- ### Basic progress bar configuration Source: https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/progress-bar-element.md A minimal example of a progress bar element using default textures. ```json5 { "type": "custommachinery:progress", "x": 116, "y": 50 } ``` -------------------------------- ### Full Dimension Requirement Example Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/dimension.md A complete configuration that excludes the overworld from recipe execution. ```json { "type": "custommachinery:dimension", "filter": "minecraft:overworld", "blacklist": true } ``` -------------------------------- ### Full Bar Element Example Source: https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/bar-element.md A complete configuration for a bar element displaying machine data. ```json { "type": "custommachinery:bar", "x": 20, "y": 20, "id": "amount", "max": 10000 } ``` -------------------------------- ### Define a basic dump element Source: https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/dump-element.md A complete example of a basic dump element configuration. ```json5 { "type": "custommachinery:dump", "x": 20, "y": 20, "id": "tank1" } ``` -------------------------------- ### Basic Text Element Configuration Source: https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/text-element.md A complete example of a basic text element definition. ```json5 { "type": "custommachinery:text", "x": 20, "y": 20, "text": "My Awesome Machine" } ``` -------------------------------- ### Filter Component Example Source: https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/item-component/filter.md A basic configuration example for an item filter component with a specified ID. ```json { "type": "custommachinery:item_filter", "id": "filter1" } ``` -------------------------------- ### Full Durability Requirement Example Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/durability.md A complete example of a durability requirement that damages a diamond pickaxe by 50 points. ```json { "type": "custommachinery:durability", "mode": "input", "ingredient": { "item": "minecraft:diamond_pickaxe" }, "amount": 50 } ``` -------------------------------- ### Fluid Input Addition Example Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/upgrades/component-modifier.md Example of a modifier that adds 50mB to the maximum input of a specific fluid component. ```javascript CMComponentModifierBuilder.add("custommachinery:fluid", "input1", 50) .target("max_input") ``` -------------------------------- ### Example Recipe with Time Requirement Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/time.md Demonstrates implementing a time requirement within a custom machinery recipe event. ```javascript ServerEvents.recipes(event => { event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100) .requireTime("(,12000)") }) ``` -------------------------------- ### Item Transform Recipe Example Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/item-transform.md Demonstrates a basic recipe implementation that transforms stone items into gravel within a custom machine. ```javascript ServerEvents.recipes(event => { event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100) .transformItem("#c:stones", "2x gravel")) }) ``` -------------------------------- ### Complete Heat Requirement Example Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/heat-mekanism.md A full configuration for a recipe producing 1000 heat with a 50% success chance. ```json { "type": "custommachinery:heat", "mode": "output", "amount": 1000, "chance": 0.5 } ``` -------------------------------- ### Working Core Recipe Example Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/working-core.md A practical implementation where a custom machine requires a specific core to be processing a designated recipe. ```javascript ServerEvents.recipes(event => { event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100) .requireWorkingCore(1, "kubejs:test_recipe") }) ``` -------------------------------- ### Complete Item Filter Requirement Example Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/item-filter.md A full example of an item filter requirement targeting a specific slot with a diamond ingredient. ```json { "type": "custommachinery:item_filter", "ingredient": {"item": "diamond"}, "slot": "filter1" } ``` -------------------------------- ### Define Experience GUI Elements Source: https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/experience-element.md A full configuration example for a machine GUI using multiple experience elements. ```json "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" } ] ``` -------------------------------- ### Example Recipe with Position Requirement Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/position.md Demonstrates applying a position requirement to a custom machine recipe within a ServerEvents block. ```javascript ServerEvents.recipes(event => { event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100) .requirePosition("", "(,128)", "") }) ``` -------------------------------- ### Complete empty GUI element example Source: https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/empty-element.md A full JSON configuration for an empty GUI element that replaces an element with the ID 'input'. ```json { "type": "custommachinery:empty", "id": "input" } ``` -------------------------------- ### ctx.baseSpeed Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context.md Gets or sets the base speed of the crafting process. ```APIDOC ### ctx.baseSpeed - **Get**: Returns a decimal value representing the base speed (default 1). - **Set**: Sets a decimal value for the base speed (must not be negative). ``` -------------------------------- ### Define Slot Property Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/item-filter.md Example of specifying a target filter slot by its ID. ```json "slot": "filter1" ``` -------------------------------- ### Typical heat element configuration Source: https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/pnc-heat-element-pnc.md A standard example of a heat element definition. ```json5 { "type": "custommachinery:pnc_heat", "x": 20, "y": 20 } ``` -------------------------------- ### Define Temperature Range Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/pnc-temperature-pnc.md Specifies the temperature range required for the recipe to start. ```json "temperature": "(100,)" ``` -------------------------------- ### requireButtonReleased Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/button.md Adds a requirement that a specific button must be released to start the recipe. ```APIDOC ## .requireButtonReleased(id) ### Description Requires a specific button element to be in a released state to initiate the recipe. ### Parameters - **id** (string) - Required - The identifier of the button element. ``` -------------------------------- ### Define Processor Configuration Source: https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/processor.md Examples showing the JSON structure for defining machine processors, including the default and the craft processor variant. ```json "processor": { "type": "custommachinery:machine" } ``` ```json "processor": { "type": "custommachinery:craft" } ``` -------------------------------- ### requireButtonPressed Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/button.md Adds a requirement that a specific button must be pressed to start the recipe. ```APIDOC ## .requireButtonPressed(id) ### Description Requires a specific button element to be in a pressed state to initiate the recipe. ### Parameters - **id** (string) - Required - The identifier of the button element. ``` -------------------------------- ### Loot Table JSON Definition Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/loot-table.md Example content for a custom loot table file. ```json { "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 } ] } ] } ``` -------------------------------- ### Full Item Empty Requirement Example Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/item-empty.md Complete JSON configuration for a recipe that requires the 'input1' slot to be empty. ```json { "type": "custommachinery:item_empty", "slot": "input1" } ``` -------------------------------- ### Define Ingredient Property Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/item-filter.md Example of defining multiple allowed items for the ingredient property. ```json "ingredient": [{"item": "minecraft:stick"}, {"item": "minecraft:paper"}] ``` -------------------------------- ### Full Effect Requirement Example Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/effect.md A complete configuration for an absorption effect applied to players. ```json { "type": "custommachinery:effect", "effect": "minecraft:absorption", "time": 200, "radius": 50, "level": 2, "filter": "minecraft:player", "finish": true } ``` -------------------------------- ### Basic Fluid Element Setup Source: https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-gui/fluid-element.md Defines a standard fluid element linked to a specific fluid component ID. ```json5 { "type": "custommachinery:fluid", "x": 20, "y": 20, "id": "tank1" } ``` -------------------------------- ### Get machine as a BlockContainerJS Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/function/function-event.md Retrieves the machine as a BlockContainerJS object representing the block in the world. ```javascript .requireFunctionEachTick(ctx => { let block = ctx.block; //Use block here }) ``` -------------------------------- ### Define Component I/O Configuration Source: https://frinn.gitbook.io/custom-machinery-1.21/misc/i-o-config.md Example of a component configuration specifying side-specific I/O modes and disabling GUI modification. ```json5 { "type": "item", "mode": "input", "id": "slot1", "config": { "default": "none", "right": "output", "left": "input", "input": true, "output": true, "enabled": false } } ``` -------------------------------- ### Configure Command String Source: https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/command.md Specifies the command to execute, using standard chat syntax starting with a forward slash. ```json "command": "/time set 0" ``` -------------------------------- ### Get machine as a tile entity Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/function/function-event.md Retrieves the machine as a TileEntity for accessing machine information. ```javascript .requireFunctionEachTick(ctx => { let tile = ctx.tile; //Use tile here }) ``` -------------------------------- ### Get Machine as Tile Entity Source: https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/crafttweaker-deprecated/recipes/function/context.md Retrieves the machine as a BlockEntity for accessing tile-specific information. ```java .requireFunctionEachTick((ctx as Context) => { var tile = ctx.tile; //Use tile here }) ``` -------------------------------- ### Full Contraption Component Configuration Source: https://frinn.gitbook.io/custom-machinery-1.21/creating-custom-machines/machine-components/contraption-component-create.md A complete example defining side-specific kinetic connections and a default stress impact. ```json5 { "type": "custommachinery:contraption", "config": { "default": "disabled", "left": "enabled", "right": "enabled" }, "stress_impact": 4 } ```