Skip to main content
The Crafting component provides a flexible system for creating crafting benches where players can combine items to create new ones. Supports recipes, cooldowns, restrictions, and schematics.

Overview

Access via Crafting (server-side only).

Crafting Benches

Register custom crafting locations

Recipes

Define item combination recipes

Cooldowns

Per-bench, per-recipe cooldowns

Restrictions

Job, reputation, item requirements
Server-Side Only: All crafting operations must be performed on the server for security.

Crafting Benches

RegisterBench

Register a crafting bench with recipes and restrictions. Syntax:
Parameters: Recipe Structure:
Example:
Restrictions Structure:

AddRecipeToBench

Add a recipe to an existing bench. Syntax:
Parameters: Example:

Crafting Operations

Craft.Start

Start crafting an item (called internally by framework). Syntax:
Parameters: Returns: Example:

Complete Examples

Gun Crafting Bench

Drug Processing Bench

Advanced Electronics Bench

Food Preparation Station

Lockpicking Tools Bench


Client Integration

Opening Crafting Bench


Cooldown Management

Cooldowns are automatically managed by the framework. They are stored in the database and persist across restarts. Cooldown Features:
  • Per-recipe cooldowns
  • Stored in database (crafting_cooldowns table)
  • Automatic cleanup of expired cooldowns
  • Admin commands to clear cooldowns
Admin Command:

Best Practices

Balanced Recipes

Security

Item Balance


Next Steps

Inventory - Exports

Main inventory operations

Inventory - Events

Inventory-related events

Item Definition

Creating and defining items

Reputation System

Reputation requirements
Recipe IDs: Use descriptive recipe IDs like craft_pistol instead of recipe1. Makes debugging and admin management easier.
Cooldowns Persist: Cooldowns are stored in the database and survive server restarts. Plan cooldown durations carefully for game balance.