Customization
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:
{
"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
}
}
| Field | Description | Default |
|---|---|---|
modid | The mod ID of the mod that adds the crafting grid. | (required) |
enabled | Whether this JSON definition is enabled. | true |
silent | Whether to suppress log messages when this JSON is loaded. | false |
containerClass | The fully qualified class name of the container menu class. | (required) |
containerCallbackClass | Legacy callback field kept for older integrations. | empty |
validContainerPredicateClass | Optional predicate class used to decide whether a matching container is a valid crafting container. | empty |
getGridStartFunctionClass | Optional function class used to determine the first slot of the crafting grid dynamically. | empty |
gridSlotNumber | The slot number where the grid starts. | 1 |
gridSize | Total size of the crafting grid. If set, Crafting Tweaks infers width and height as a square grid. | 0 |
gridWidth | Width of the crafting grid. Use this with gridHeight for non-square grids. | 3 |
gridHeight | Height of the crafting grid. Use this with gridWidth for non-square grids. | 3 |
alignToGrid | The alignment of the tweak buttons. Can be left, right, top, bottom, west, east, north, south, up or down. | left |
buttonOffsetX | The X offset of the tweak buttons. | 0 |
buttonOffsetY | The Y offset of the tweak buttons. | 0 |
buttonStyle | The style of the tweak buttons. Can be default, small_width, small_height or small. | default |
hideButtons | Whether to hide all tweak buttons. Without tweak buttons, only the key binds will work. | false |
phantomItems | Whether items in this crafting grid are phantom items. Will cause clearing the grid to void them instead of transferring them to the inventory. | false |
tweakRotate | Configuration for the rotate tweak. | (see below) |
tweakBalance | Configuration for the balance tweak. | (see below) |
tweakClear | Configuration for the clear tweak. | (see below) |
Tweak Configuration
Each tweak configuration object has the following fields:
| Field | Description | Default |
|---|---|---|
enabled | Whether the tweak is enabled. | true |
showButton | Whether to show button for the tweak. | true |
buttonX | The X position of the button. | 0 |
buttonY | The Y position of the button. | 0 |