RedM documentation

Murphy's Craft

Crafting System

Tool Durability System


Tools used in crafting recipes can now have a limited number of uses before being consumed from the player's inventory.

Configuration

In your recipe config, add a uses field to any tool:

lua
recipes = {
{
name = "Iron Sword",
item = "iron_sword",
amount = 1,
category = "blacksmith",
ressources = {
{ name = "Iron Ingot", item = "iron_ingot", neededQuantity = 3 },
},
tools = {
{ name = "Hammer", item = "hammer", uses = 10 }, -- consumed after 10 crafts
{ name = "Anvil", item = "anvil" }, -- never consumed
},
},
}
Field Type Required Description
name string yes Display name of the tool
item string yes Item identifier in your inventory system
uses number no Maximum number of crafts before the tool is removed. If omitted, the tool is never consumed (default behavior).

How It Works

  1. When a player crafts an item, the server checks that all required tools are in the player's inventory (unchanged behavior).
  2. After a successful craft, each tool with a uses value has its durability decremented.
  3. Durability is tracked via item metadata using the key craft_uses (integer, remaining uses).
  4. When craft_uses reaches 0, the tool is removed from the inventory.

Fresh / Legacy Tools

If a tool has no craft_uses metadata (e.g. it was in the inventory before this update, or it was obtained from a shop), it is treated as a brand new tool with the full uses count on first use.

Example with uses = 10:

  • Player has a hammer with no metadata -> first craft sets craft_uses to 9
  • Next craft -> craft_uses = 8
  • ...
  • Last craft -> craft_uses reaches 0 -> hammer is removed

Metadata Reference

Framework Metadata location Key
VORP item.metadata.craft_uses craft_uses
RSG Core item.info.craft_uses craft_uses
REDEMRP 2k23 ItemData.ItemMeta.craft_uses craft_uses

Last updated: March 3, 2026