Item Data Structure
Items are defined in JSON manifests and loaded at runtime. Items are now organized into separate files by type for better maintainability.Item data is managed in
packages/shared/src/data/items.ts and loaded from world/assets/manifests/items/ directory.Data Loading
Items are NOT hardcoded. TheITEMS map is populated at runtime from multiple manifest files:
Manifest Organization
Items are split into separate files by category:Directory-Based Loading
Items are organized by category inpackages/server/world/assets/manifests/items/:
weapons.json- Swords, axes, bows, etc.armor.json- Helmets, bodies, legs, boots, gloves, shields, capes, amulets, ringstools.json- Hatchets, pickaxes, fishing rods, hammer, tinderboxresources.json- Ores, bars, logs, raw fishfood.json- Cooked food, raw food, burnt foodmisc.json- Coins, junk items, quest items
items.json.
Duplicate Detection: The loader validates that no item ID appears in multiple category files.
Item Schema
Each item has the following structure:Tier-Based Requirements
Items with atier property automatically derive level requirements from tier-requirements.json:
TierDataProvider maps tiers to skill requirements, eliminating redundant requirement definitions.
Item Types
Tier-Based Equipment System
Items now use a centralized tier system defined intier-requirements.json. Instead of hardcoding level requirements in each item, equipment references a tier:
tier-requirements.json:
Melee Tiers
Tool Tiers
This centralized approach ensures OSRS-accurate requirements and makes it easy to add new tiers without modifying individual items.
Item Rarity
Equipment Stats
For weapons and armor:Skill Requirements
Items can require skill levels to use:Weapon Types
Attack Speed
Weapons have different attack speeds:Helper Functions
Item Type Detection
Theitem-helpers.ts module provides utilities for detecting item types:
Primary Action Detection
Get Item by ID
Get Items by Type
Get Items by Skill Requirement
Get Items by Level Requirement
Shop Items
Items available in general stores:Noted Items
Items can have “noted” variants for efficient storage:Example Item Definitions
Weapon (weapons.json)
Tool (tools.json)
Tools include atool object specifying the skill and priority. The tier system automatically derives level requirements:
The
tier: "bronze" automatically gives this tool attack: 1 and woodcutting: 1 requirements from tier-requirements.json. Tools with equipSlot: "weapon" can be equipped and used for combat.Resource (resources.json)
Consumable (food.json)
Consumables can includeinventoryActions to define OSRS-style context menu actions:
The first action in
inventoryActions becomes the left-click default. If not specified, the system uses heuristic detection based on item properties (food → Eat, potions → Drink, etc.).Context Menu Color Coding
Context menus use OSRS-accurate color coding for entity names:- “Eat Shrimp” (orange)
- “Attack Goblin” (yellow)
- “Mine Copper rocks” (cyan)
- “Trade Shop keeper” (yellow)
Currency (misc.json)
Adding New Items
1
Choose the right manifest file
- Weapons →
items/weapons.json - Armor →
items/armor.json - Tools →
items/tools.json - Resources (ores, logs, bars, raw fish) →
items/resources.json - Food →
items/food.json - Currency, junk →
items/misc.json
2
Add entry with proper structure
Follow the examples above. For tiered equipment, specify the
tier field instead of hardcoding requirements.3
Create 3D Model (optional)
Generate model in 3D Asset Forge if needed
4
Restart Server
Server must restart to reload manifests
Tool Priority System
Tools use a priority system to determine which tool to use when multiple are available:- Bronze hatchet: priority 1
- Iron hatchet: priority 2
- Steel hatchet: priority 3
- Rune hatchet: priority 6
Inventory Actions System
Items can define explicit context menu actions using theinventoryActions array. This is the OSRS-accurate approach where actions are stored per-item in the manifest.
- First action becomes the left-click default
- Actions appear in context menu in the order specified
- “Cancel” is always added automatically as the last option
- Manifest-defined actions take priority over heuristic detection
Common Action Patterns
Action Handlers
The following actions have built-in handlers inInventoryActionDispatcher:
- Eat: Sends
useItempacket → server validates eat delay (3 ticks) → consumes food → heals player - Drink: Sends
useItempacket → server validates → applies potion effects - Wield: Sends
equipItemnetwork message (weapons/shields) - Wear: Sends
equipItemnetwork message (armor) - Bury: Sends
buryBonesnetwork message - Use: Enters targeting mode for item-on-item/item-on-object interactions
- Drop: Calls
world.network.dropItem() - Examine: Shows examine text in chat and toast
- Cancel: Closes context menu (always added automatically)
Heuristic Fallback
IfinventoryActions is not specified, the system uses type detection helpers from item-helpers.ts:
- Food:
type: "consumable"+healAmount > 0+ not potion - Potions:
type: "consumable"+id.includes("potion") - Weapons:
equipSlot: "weapon"orequipSlot: "2h"orweaponTypedefined - Shields:
equipSlot: "shield" - Armor:
equipable: true+ not weapon/shield - Bones:
id === "bones"orid.endsWith("_bones") - Noted Items: Always use “use” action (cannot eat/equip noted items)
Manifest-defined
inventoryActions take priority over heuristic detection. This allows custom actions for special items.Equipment Slots
Items equip to specific slots:The game now includes full armor sets across all equipment slots. Melee armor (bronze through rune) includes helmets, platebodies, platelegs, boots, gloves, and shields. Ranged armor includes leather and dragonhide pieces. Magic armor includes wizard and mystic robes with boots and gloves.