The npc edit command allows you to modify existing entities (such as NPCs) using various modes: GUI-based panels, specialized editors, or direct value injection via CLI arguments.
Usage Patterns
1. GUI-based Editing (Panels)
To open a visual editing interface, use the following action types:
main: Opens the basic entity panel.traits: Opens the traits management panel.public-meta: Opens the public metadata panel.private-meta: Opens the private metadata panel.move: Opens the movement/positioning panel.controller: Opens the PresetController interface.
Syntax: npc edit <id> <action>:<page>
Example: npc edit e:123 main:1 (Opens page 1 of the main panel for entity ID e:123)
2. Visual Meta Editing (e action)
Opens a specific MetaEditor for a metadata key. This supports automatic detection of the editor type.
Syntax: npc edit <id> e:<key>-><default_value> <EditType>
<key>: The metadata key to edit.<default_value>: The value to use as a default.<EditType>: (Optional) The specific editor class to use (e.g., AUTO).
Example: npc edit e:123 e:skin->default
3. Quick Value Modification (m action)
Directly sets a metadata value without opening a GUI. Use @RESET to revert a value to its default.
Syntax: npc edit <id> m:<key>-><value>
<key>: The metadata key.<value>: The new value. Use @RESET to reset.
Example: npc edit e:123 m:hand->RESET (Resets the 'hand' metadata)
4. Trait Editing (t action)
Modifies specific entity traits.
Syntax: npc edit <id> t:<trait_id>
sit, title, command, view-condition: Opens the respective trait editor.title-height: Prompts for a new title height via sign input.patrols: Opens the patrol trait editor.patrols-wait-time: Prompts for a new patrol wait time via sign input.patrols-update: Refreshes the patrol nodes.
5. Contextual Editing
- Nearest Entity: Running
npc edit without an ID targets the nearest entity that passes the filter. - Targeted Entity: Running
npc edit <id> opens the default EditPanel for that specific entity.
# Open main panel for NPC with ID 123, page 1
npc edit 123 main:1
# Quick reset of metadata
npc edit 123 m:hand->RESET
# Edit a trait
npc edit 123 t:sit