Customization

Crafting Tweaks supports many modded crafting grids and can be extended to support others as well using a simple JSON file.

Crafting Tweaks supports many modded crafting grids and can be extended to support others as well using a simple JSON file.

The easiest way to generate this JSON file is to use the Debugging Tools (see below).

If you have created a custom configuration, feel free to submit it on GitHub or Discord for it to be included natively with the next version.

Debugging Tools

You can use the /craftingtweaks debug command to toggle Crafting Tweaks' debug mode. This mode will allow you to easily analyze a mod's crafting grid and output the necessary JSON to add support for it.

After enabling the debug mode, open the mod's crafting menu screen and click-drag over the crafting grid slots (they should highlight in green). Once you let go, check your latest.log for the JSON output to paste into the craftingtweaks/grids folder.

Note that this may not always work correctly on all crafting grids, especially if they are more complex or dynamic. In those cases, the JSON-based API will most likely not be sufficient to support the mod.

Custom Crafting Grids

Crafting Tweaks supports loading JSON data to extend its functionality onto crafting grids added by third party mods.

Crafting Tweaks JSONs can be placed in a folder called craftingtweaks/grids inside the config folder.

Mods themselves can also embed JSONs under craftingtweaks/grids in their own resources (at the resources root, not the assets or data folder).

Example:

config/craftingtweaks/grids/storagenetwork.json
{
    "modid": "storagenetwork",
    "silent": false,
    "containerClass": "com.lothrazar.storagenetwork.block.request.ContainerNetworkCraftingTable",
    "gridSlotNumber": 1,
    "gridWidth": 3,
    "gridHeight": 3,
    "alignToGrid": "left",
    "buttonStyle": "small_width",
    "hideButtons": false,
    "phantomItems": false,
    "tweakRotate": {
        "enabled": true,
        "showButton": true
    },
    "tweakBalance": {
        "enabled": true,
        "showButton": true
    },
    "tweakClear": {
        "enabled": true,
        "showButton": true
    }
}
FieldDescriptionDefault
modidThe mod ID of the mod that adds the crafting grid.(required)
enabledWhether this JSON definition is enabled.true
silentWhether to suppress log messages when this JSON is loaded.false
containerClassThe fully qualified class name of the container menu class.(required)
containerCallbackClassLegacy callback field kept for older integrations.empty
validContainerPredicateClassOptional predicate class used to decide whether a matching container is a valid crafting container.empty
getGridStartFunctionClassOptional function class used to determine the first slot of the crafting grid dynamically.empty
gridSlotNumberThe slot number where the grid starts.1
gridSizeTotal size of the crafting grid. If set, Crafting Tweaks infers width and height as a square grid.0
gridWidthWidth of the crafting grid. Use this with gridHeight for non-square grids.3
gridHeightHeight of the crafting grid. Use this with gridWidth for non-square grids.3
alignToGridThe alignment of the tweak buttons. Can be left, right, top, bottom, west, east, north, south, up or down.left
buttonOffsetXThe X offset of the tweak buttons.0
buttonOffsetYThe Y offset of the tweak buttons.0
buttonStyleThe style of the tweak buttons. Can be default, small_width, small_height or small.default
hideButtonsWhether to hide all tweak buttons. Without tweak buttons, only the key binds will work.false
phantomItemsWhether items in this crafting grid are phantom items. Will cause clearing the grid to void them instead of transferring them to the inventory.false
tweakRotateConfiguration for the rotate tweak.(see below)
tweakBalanceConfiguration for the balance tweak.(see below)
tweakClearConfiguration for the clear tweak.(see below)

Tweak Configuration

Each tweak configuration object has the following fields:

FieldDescriptionDefault
enabledWhether the tweak is enabled.true
showButtonWhether to show button for the tweak.true
buttonXThe X position of the button.0
buttonYThe Y position of the button.0