Skip to main content
Want players to craft items by dragging one item over another? This guide shows you how, step-by-step. This feature allows players to craft items by dragging a source item over a target item in the same inventory. When the recipe matches, the items are combined and the result is created.
This functionality is provided by the _hooks/sv_craftings.lua hook. You just need to add your recipes to the CRAFTING_RECIPES table.

How it works

1

Drag source onto target

Player drags a source item over a target item in the same inventory.
2

Recipe check

The system checks if there’s a matching recipe.
3

Crafting happens

If the recipe matches and quantities are sufficient, the crafting happens.
4

Items are consumed

Source and/or target items are removed (based on recipe settings).
5

Result is added

The result item is added to the inventory.

Step-by-step guide

1

Open the crafting hook

Navigate to: jaksam_inventory/_hooks/sv_craftings.lua
2

Find the recipes table

Find the CRAFTING_RECIPES table (it’s near the top of the file).
3

Add your recipe

Add your recipe following this format:
4

Restart

Save the file and restart the script/reload the server.
That’s it! Now players can drag the source item over the target item to craft.

Recipe properties explained

number
How many of the source item are needed for the recipe
boolean
Set to true if the source item should be removed after crafting, false to keep it
string
The exact name (as defined in items.lua) of the item you drag the source item onto
number
How many of the target item are needed for the recipe
boolean
Set to true if the target item should be removed after crafting, false to keep it
string
The exact name (as defined in items.lua) of the item that will be created
number
How many result items will be created

Examples

Combine a wrench with an advanced scope to create a thermal scope:
How to use: Drag the wrench over the advanced scope → thermal scope is created, wrench stays, advanced scope is removed.

Important notes

Same inventory only

Crafting only works when both items are in the same inventory (you can’t drag from player inventory to vehicle inventory)

Item names must match

The targetItem and resultItem names must exactly match the item names in _data/items.lua

Quantity checks

The system automatically checks if you have enough items before crafting

Multiple recipes

You can add as many recipes as you want to the CRAFTING_RECIPES table
One source, multiple targets: Each source item can only have one recipe. If you need multiple recipes for the same source item, you’ll need to use different source items or create separate crafting systems.