Building Commands Reference¶
This guide provides a comprehensive reference for all in-game building commands available to MAID builders and administrators. Building commands allow you to create, modify, and manage the game world directly from within the game.
Table of Contents¶
- Access Levels
- Target Resolution
- Entity Creation
- Entity Modification
- Room and Exit Management
- Zone Management
- Component Management
- Search and Navigation
- Advanced Editing
- Administration
Access Levels¶
Building commands require elevated access levels:
| Level | Commands Available |
|---|---|
BUILDER |
@create, @destroy, @dig, @describe, @set, @examine, @component, @teleport, @find, @zone, @copy |
ADMIN |
All builder commands plus @purge, @batch, @reload, @profile, @memory, @timing |
SUPERADMIN |
All commands including @rollback and system-critical operations |
Your access level is set by server administrators via the @grant command or the Admin API.
Target Resolution¶
Most building commands require specifying a target entity. MAID supports several targeting syntaxes:
Basic Targets¶
| Syntax | Description | Example |
|---|---|---|
here |
The room you're currently in | @describe here |
me or self |
Your character entity | @examine me |
#<uuid> |
Entity by its UUID | @examine #550e8400-e29b-41d4-a716-446655440000 |
<name> |
Entity by name (current room) | @examine sword |
Extended Targets¶
| Syntax | Description | Example |
|---|---|---|
<name>.<n> |
Nth entity with that name | @examine sword.2 |
<name> in <container> |
Entity inside a container | @examine sword in chest |
room:<name> |
Room by name | @goto room:Town Square |
player:<name> |
Player by username | @teleport player:Bob here |
npc:<name> |
NPC by name | @examine npc:shopkeeper |
Path Targets¶
For setting nested values, use dot notation:
Examples:
Entity Creation¶
@create¶
Create a new entity in the game world.
Syntax:
Entity Types:
- item - Physical items (weapons, armor, consumables)
- npc - Non-player characters
- room - Rooms/locations
- exit - Room exits/doors
- container - Containers (chests, bags)
- object - Generic interactable objects
Examples:
@create item Iron Sword
@create npc Guard Captain
@create container Wooden Chest
@create item Health Potion = potion_template
Using Templates:
Templates are predefined entity configurations:
List available templates:
@copy¶
Clone an existing entity.
Syntax:
Examples:
The new entity is created in your current room.
Entity Modification¶
@destroy¶
Delete an entity from the game world.
Syntax:
Options:
- --force - Delete even if entity has contents or is referenced
Examples:
Note: Players cannot be destroyed with this command. Use player management commands instead.
@describe¶
Set or view an entity's description.
Syntax:
Examples:
@describe here # View current room description
@describe here A cozy tavern with... # Set room description
@describe sword A gleaming blade... # Set item description
For multi-line descriptions, use the @edit command or leave the text blank to open the in-game editor.
@name¶
Rename an entity.
Syntax:
Examples:
@set¶
Set an attribute value on an entity.
Syntax:
Value Types:
- Strings: "text" or 'text' or unquoted
- Numbers: 42 or 3.14
- Booleans: true or false
- Lists: [1, 2, 3] or ["a", "b"]
- Dicts: {"key": "value"}
- Null: null or none
Examples:
@set sword/damage = 10
@set sword/damage.base = 5
@set sword/damage.type = "slashing"
@set npc/hostile = true
@set room/metadata.terrain = "cave"
@set item/value = 100
@set container/locked = true
@set container/key_id = "#550e8400..."
@attribute¶
Manage entity tags/attributes.
Syntax:
Examples:
@attribute sword list # List all tags
@attribute sword add magic # Add 'magic' tag
@attribute sword add cursed # Add 'cursed' tag
@attribute sword remove cursed # Remove 'cursed' tag
@attribute npc add friendly # Mark NPC as friendly
Common tags:
- magic, cursed, blessed - Item properties
- hostile, friendly, neutral - NPC disposition
- hidden, invisible - Visibility
- locked, trapped - State flags
- quest_item, unique - Special markers
Room and Exit Management¶
@dig¶
Create a new room with an exit from your current location.
Syntax:
Directions: north, south, east, west, up, down, northeast, northwest, southeast, southwest, in, out
Examples:
@dig north # Create unnamed room to the north
@dig north = The Grand Hall # Create named room
@dig up = Tower Rooftop
@dig in = Hidden Chamber
The command automatically creates bidirectional exits.
@tunnel¶
Connect your current room to an existing room.
Syntax:
Examples:
@tunnel north #550e8400-e29b-41d4-a716-446655440000
@tunnel east room:Market Square
@tunnel down The Dungeon
@link¶
Create an exit to a destination.
Syntax:
Options:
- --oneway - Create only a one-way exit (no return)
Examples:
@unlink¶
Remove an exit from the current room.
Syntax:
Options:
- --both - Also remove the reverse exit from the destination
Examples:
Zone Management¶
Zones (or areas) are collections of rooms that share properties or belong to a logical region.
@zone create¶
Create a new zone.
Syntax:
Examples:
@zone assign¶
Assign rooms to a zone.
Syntax:
Examples:
@zone assign Darkwood Forest here # Assign current room
@zone assign "Town" room:Inn room:Market # Assign multiple rooms
@zone assign Castle #550e8400... # Assign by UUID
@zone list¶
List all zones.
Syntax:
@zone info¶
Get information about a zone.
Syntax:
Shows: room count, player count, metadata, room list.
@zone rename¶
Rename a zone.
Syntax:
@zone delete¶
Delete a zone (rooms remain, but become unassigned).
Syntax:
Component Management¶
Components are data containers that define entity behavior and properties.
@component list¶
List components on an entity.
Syntax:
Example:
Output:
@component add¶
Add a component to an entity.
Syntax:
Examples:
@component sword add HealthComponent
@component sword add DamageComponent {"base": 10, "type": "slashing"}
@component npc add AIComponent {"behavior": "patrol", "aggro_range": 5}
@component remove¶
Remove a component from an entity.
Syntax:
Examples:
Common Components¶
| Component | Description | Fields |
|---|---|---|
HealthComponent |
Health/HP | max_hp, current_hp |
ManaComponent |
Magic points | max_mana, current_mana |
DamageComponent |
Damage dealing | base, type, dice |
ArmorComponent |
Damage reduction | armor_class, resistances |
InventoryComponent |
Item storage | capacity, items |
PositionComponent |
Location | room_id, x, y, z |
AIComponent |
NPC behavior | behavior, aggro_range, patrol_path |
QuestComponent |
Quest data | quest_id, stage, objectives |
Search and Navigation¶
@examine¶
Get detailed information about an entity.
Syntax:
Examples:
@examine sword # Full entity details
@examine sword DamageComponent # Specific component
@examine here # Current room details
@examine me # Your character
@stat¶
Quick statistics summary.
Syntax:
Shows: type, tags, component count, location, basic stats.
@find¶
Search for entities by type and filters.
Syntax:
Filters:
- name=<pattern> - Match name (supports wildcards)
- tag=<tag> - Has specific tag
- room=<room> - In specific room
- zone=<zone> - In specific zone
- limit=<n> - Limit results
Examples:
@find item # All items in current room
@find item name=*sword* # Items containing "sword"
@find npc tag=hostile # All hostile NPCs
@find item zone="Darkwood Forest" # Items in zone
@find room name=*Inn* limit=10 # Rooms with "Inn" in name
@search¶
Complex entity queries with multiple conditions.
Syntax:
Query Syntax:
Examples:
@search type:item AND tag:weapon
@search type:npc AND tag:hostile AND zone:"Dungeon"
@search type:room AND player_count>0
@teleport¶
Move an entity to a new location.
Syntax:
Examples:
@teleport player:Bob here # Bring player to you
@teleport npc:Guard #550e8400... # Move NPC to room
@teleport me room:Town Square # Teleport yourself
@goto¶
Move yourself to a location.
Syntax:
Examples:
@goto #550e8400-e29b-41d4-a716-446655440000
@goto room:Town Square
@goto player:Bob # Go to player's location
Advanced Editing¶
@edit¶
Open the in-game VI-like text editor for multi-line content.
Syntax:
Examples:
@edit here/description # Edit room description
@edit npc/dialogue # Edit NPC dialogue
@edit item/examine_text # Edit item examine text
Editor Commands:
- :w - Save
- :q - Quit
- :wq - Save and quit
- :q! - Quit without saving
- i - Insert mode
- ESC - Command mode
Administration¶
@purge¶
Mass delete entities matching criteria.
Syntax:
Options:
- --force - Skip confirmation
- --global - Search all rooms (not just current)
- --dry-run - Show what would be deleted
Examples:
@purge type:item tag:junk # Delete junk items in room
@purge type:npc tag:hostile --global # Delete all hostile NPCs
@purge name:*test* --dry-run # Preview deletion
@batch¶
Execute commands from a batch file.
Syntax:
Options:
- --code - Execute as Python code instead of commands
- --dry-run - Validate without executing
- --continue - Continue after errors
Examples:
See Batch File Format for file syntax.
Batch File Format¶
Batch files contain commands to execute sequentially.
Command Format¶
# This is a comment
@create room Town Square
@describe here The central square of the town.
@dig north = Market Street
Variables¶
# Define variables
$town_square = @create room Town Square
# Use variables
@describe $town_square The central square of the town.
@dig north from:$town_square = Market Street
Conditionals¶
# Simple conditions
@if exists room:Town Square
@echo "Town Square already exists"
@else
@create room Town Square
@endif
Loops¶
# Create multiple items
@for $i in 1..10
@create item Potion $i
@endfor
# Create from list
@for $name in ["Inn", "Market", "Temple"]
@create room $name
@endfor
Python Code Mode¶
With --code flag, execute Python directly:
# world_setup.py
from maid_stdlib.commands.building import create_room, dig
# Create town
town_square = create_room("Town Square", "The central square.")
dig(town_square, "north", "Market Street")
dig(town_square, "south", "City Gate")
# Create NPCs
for i in range(5):
create_npc(f"Guard {i}", town_square, {"hostile": False})
Tips and Best Practices¶
Naming Conventions¶
- Use descriptive names:
Iron Swordnotsword1 - Use consistent casing:
Town Square(title case for rooms) - Avoid special characters in names
Organizing Zones¶
- Group related rooms into zones
- Use zones for access control and events
- Name zones clearly:
Darkwood Forest,Castle Dungeon
Component Management¶
- Don't add unnecessary components
- Use templates for consistent entity setup
- Document custom component data structures
Testing Changes¶
- Use
--dry-runwhen available - Test in a development area first
- Keep backups using
@batchexport
Performance¶
- Avoid creating too many entities at once
- Use
@findwith filters to limit searches - Clean up unused entities periodically
See Also¶
- Hot Reload Guide - Reloading code during development
- Profiling Tutorial - Performance analysis
- Admin API Reference - REST API for building
- Example Batch Files - Sample batch scripts