Create Your First Item Template
This guide walks through the smallest useful Moongate item template from zero.
By the end, you will:
- create one JSON file under your shard root
- validate it with
moongate-template - spawn the item in game with
.spawn_item
Before You Start
- your shard root is
~/moongate moongate-templateis installed- your server is configured to run against
~/moongate - you can log in with an account that can run
.spawn_itemon your shard
Step 1: Create A Tutorial Folder
Create this folder in your shard root:
~/moongate/templates/items/tutorial/
Inside it, create:
~/moongate/templates/items/tutorial/first_item.json
Step 2: Paste A Complete Minimal Template
Put this content in the file:
[
{
"type": "item",
"id": "tutorial_brick",
"name": "Tutorial Brick",
"category": "tutorial",
"description": "My first Moongate item template.",
"tags": ["tutorial", "test"],
"itemId": "0x1F9E",
"hue": "0",
"goldValue": "0",
"weight": 1,
"scriptId": "none",
"isMovable": true
}
]
This file is a JSON array with one item template object inside it. Keep the outer [ and ].
Why these fields matter:
type: tells Moongate this document contains an item templateid: the template id you will use later with.spawn_itemname: the in-game display namecategory: groups the template for humans and toolingdescription: short human-facing note about what this template is fortags: optional labels you can use later for organization or loot/tag-based selectionitemId: the Ultima Online art/body id for the itemhue: the color;0means default huegoldValue: economic value metadata;0is fine for a tutorial itemweight: item weightscriptId:nonemeans this first tutorial item does not use Lua hooks yetisMovable: whether players can move the item
Step 3: Validate The Template
Run:
moongate-template validate --root-directory ~/moongate
Expected result:
- the command exits with success
- the validator reports the shard root and the validation summary
If validation fails, stop and fix the file before trying to spawn the item.
Step 4: Restart The Server
If your server is already running, restart it so the tutorial template is definitely loaded.
This guide intentionally uses restart instead of more advanced reload flows.
Step 5: Spawn The Item In Game
Log in with an account that can run in-game admin item commands and type:
.spawn_item tutorial_brick
Then click a nearby ground tile.
Expected result:
- the item appears at the location you clicked
- single-clicking it shows the name
Tutorial Brick
Common Mistakes
- Forgetting the outer JSON array
[] - Using a duplicate
idthat already exists elsewhere in your shard - Writing
itemIdwithout quotes or without the0xformat - Validating the wrong root directory
Next Step
If you want to keep going into NPC authoring, continue with Create Your First NPC Brain.