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.

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.

You can see an example of this feature on this Twitter post.

Custom Crafting Grids

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

Crafting Tweaks JSONs are located in a folder called craftingtweaks/grids inside the config folder, or embedded in a mod at the root of a jar (not inside data or assets!).

This does not use data packs because data packs are not loaded on the client side, but Crafting Tweaks can run in a client-only environment.

Example:

{
    "modid": "storagenetwork",
    "silent": false,
    "containerClass": "com.lothrazar.storagenetwork.block.request.ContainerNetworkCraftingTable",
    "gridSlotNumber": 1,
    "gridSize": 9,
    "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 the data pack is enabled.true
silentWhether to suppress log messages when the data pack is loaded.false
containerClassThe fully qualified class name of the container menu class.(required)
gridSlotNumberThe slot number where the grid starts.1
gridSizeThe size of the crafting grid.9
alignToGridThe alignment of the tweak buttons. Can be left, right, top or bottom.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 show any 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