HyCitizens provides a rich interaction system that lets Citizens respond to player input with commands, rich text messages, animations, and more. Each Citizen can be configured with multiple command actions and messages, each independently controlled by trigger type, delay, selection mode, and probability. You can also gate interactions behind permissions and create unique one-time experiences for a player’s very first encounter with an NPC.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ElectroGamesDev/HyCitizens/llms.txt
Use this file to discover all available pages before exploring further.
Interaction Triggers
Every command action and message has aninteractionTrigger field that determines which player input fires it:
| Trigger | When it fires |
|---|---|
LEFT_CLICK | When a player hits or attacks the NPC. |
F_KEY | When a player presses the interaction key (F) near the NPC. |
BOTH | Either a left-click or F key press (default). |
F_KEY or BOTH, HyCitizens automatically adds the [Press F] interaction hint above the NPC. You can force this hint to display regardless of trigger configuration with forceFKeyInteractionText = true.
Command Actions
Command actions run server or player commands when a player interacts with a Citizen. They are defined as a list undercommandActions, with the selection mode set by commandSelectionMode.
The command string to execute, without a leading
/. Supports placeholders (see below).Use the special prefix {SendMessage} to send a rich text message instead of executing a command:
{SendMessage}{GOLD}Welcome, {PlayerName}!When
true, the command is executed with server-level permissions. When false, it runs as the interacting player.How many seconds to wait before executing this command after the interaction fires.
Which input fires this action:
LEFT_CLICK, F_KEY, or BOTH.Probability (0–100) that this action executes when selected. A value of
100 means it always runs; 50 means it runs half the time.Command Selection Mode
ThecommandSelectionMode field controls how multiple command actions are chosen when an interaction fires:
| Mode | Behavior |
|---|---|
ALL | Every qualifying command runs in order. |
RANDOM | One qualifying command is chosen at random. |
SEQUENTIAL | Commands cycle round-robin per player — each interaction picks the next command. |
Message Actions
Message actions send rich text directly to the interacting player’s chat. They are defined undermessagesConfig.messages, with the selection mode set by messagesConfig.selectionMode.
The message text. Supports color codes, markdown-like formatting, and links (see formatting syntax below).
Which input fires this message:
LEFT_CLICK, F_KEY, or BOTH.How many seconds to wait before sending this message.
Probability (0–100) that this message is sent when selected.
Message Selection Mode
SetmessagesConfig.selectionMode to control which messages are sent:
| Mode | Behavior |
|---|---|
ALL | Every qualifying message is sent. |
RANDOM | One qualifying message is chosen at random (default). |
SEQUENTIAL | Messages cycle round-robin per player. |
Message Formatting Syntax
Placeholders
The following placeholders are replaced dynamically in both command and message strings:| Placeholder | Replaced with |
|---|---|
{PlayerName} | The username of the interacting player. |
{CitizenName} | The Citizen’s name field (newlines replaced with spaces). |
{NpcX} | The Citizen’s current X coordinate (2 decimal places). |
{NpcY} | The Citizen’s current Y coordinate (2 decimal places). |
{NpcZ} | The Citizen’s current Z coordinate (2 decimal places). |
Permission
You can gate interactions behind a Hytale permission node.A permission node string. If set and the player does not have this permission, the interaction is blocked and
noPermissionMessage is shown. Leave empty to allow all players.Message shown to players who lack the required permission. Defaults to
"You do not have permissions" if left empty.First Interaction
The first-interaction system lets you fire a completely different set of commands and messages the very first time a player interacts with a Citizen. This is useful for tutorial NPCs, quest starters, or one-time welcome sequences.Enables the first-interaction flow. When
true, the first time a specific player interacts with this Citizen, their UUID is recorded and the first-interaction commands and messages fire instead of (or in addition to) the normal ones.Controls what happens after the first-interaction sequence:
NORMAL— the normal commands and messages also run on subsequent interactions.NONE— after the first interaction, normal commands and messages are skipped until reset.
When
true, the normal commands and messages also run during the very first interaction alongside the first-interaction sequence.firstInteractionCommandSelectionMode and firstInteractionMessagesConfig.selectionMode fields follow the same ALL / RANDOM / SEQUENTIAL logic as the normal interaction flows.
Death Actions
ThedeathConfig block configures what happens when a Citizen is killed. Death events fire independently of normal interactions.
A list of
CommandAction entries that execute when the Citizen dies. Follows the same command, runAsServer, delay, and chancePercent fields as normal command actions.A list of
CitizenMessage entries sent to the player who dealt the killing blow.Items dropped on death. Each entry has:
itemId— the Hytale item ID to drop.quantity— number of items in the stack.chancePercent— probability (0–100) that this item drops.
Selection mode for death commands:
ALL, RANDOM, or SEQUENTIAL.Selection mode for death messages:
ALL, RANDOM, or SEQUENTIAL.