Skip to content

CraftTweaker

Foreck1 edited this page Oct 23, 2026 · 3 revisions

Full API available here

Start by importing the mod into your script:

import mods.serrated.CuttingSawRecipeBuilder;
import mods.serrated.CuttingSawOutputBuilder;

Serrated has a recipe builder and an output builder: Open the recipe builder with newRecipe()

  • inputItem: item slot input used for crafting and GUI display.
  • inputBlock: physical world block state target required for the saw. Defaults to nothing if omitted.
  • blockOnly: If true, the recipe ignores the item form and only triggers via the physical block
CuttingSawRecipeBuilder.newRecipe(IIngredient inputItem, @Optional @Nullable IBlockStateMatcher inputBlock, @Optional(valueBoolean = false) boolean blockOnly);

Follow with with the output builder with addOutput. You can add as many output entries per newRecipe as you want. These are the entries in the GUI when placing an input item.

  • outputItem: Primary item stack output.
  • duration: Optional. Crafting processing time in immersive mode. Defaults to 0 ticks if omitted.
  • outputBlock: Optional. The block placed in the world when crafted in immersive mode. Defaults to null if omitted, causing the item to drop as a regular entity instead.
.addOutput(IItemStack outputItem, @Optional(valueLong = 0) int duration, @Optional @Nullable IBlockState outputBlock);

You can addExtra outputs to any output. These will be rendered in JEI and when hovering the primary output item in the addOutput method.

.addExtra(IItemStack stack);

Finalize your recipe with either addToSaw or addToStonecutter:

.addToSaw(String id);
.addToStonecutter(String id);

Examples

Simple recipe for the default configuration, turns stone bricks into stairs, slabs, and chiseled stone bricks.

import mods.serrated.CuttingSawOutputBuilder;
import mods.serrated.CuttingSawRecipeBuilder;

CuttingSawRecipeBuilder.newRecipe(<minecraft:stonebrick:0>)
  .addOutput(<minecraft:stone_brick_stairs> * 1)
  .addOutput(<minecraft:stone_slab:5> * 2)
  .addOutput(<minecraft:stonebrick:3> * 1)
  .addToStonecutter("stone_brick_variants");

Full recipe for immersirve mode, with two possible outputs and extra items. All the rotations of the log blockstate are accounted for in the first variable. It requires (note the boolean in .newRecipe) that an oak log is placed. First output (and default, unless changed) takes 20 ticks and outputs 4 oak planks, 1 oak bark and 2 sawdust; second output takes 30 ticks and drops 8 sticks.

import crafttweaker.block.IBlockStateMatcher;
import mods.serrated.CuttingSawOutputBuilder;
import mods.serrated.CuttingSawRecipeBuilder;

var oakLog as IBlockStateMatcher = <blockstate:minecraft:log:variant=oak,axis=x>
  | <blockstate:minecraft:log:variant=oak,axis=y>
  | <blockstate:minecraft:log:variant=oak,axis=z>;

CuttingSawRecipeBuilder.newRecipe(<minecraft:log:0>, oakLog, true)
  .addOutput(CuttingSawOutputBuilder.newOutput(<minecraft:planks:0> * 4, 20)
    .addExtra(<betterwithmods:bark:0>)
    .addExtra(<betterwithmods:material:22> * 2))
  .addOutput(<minecraft:stick> * 8, 30)
  .addToSaw("log_oak");

Clone this wiki locally