HyCitizens provides a flexible movement system that controls how Citizen NPCs behave when not in combat. Movement is configured through theDocumentation 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.
movementBehavior block on each Citizen, which defines both the movement type and the parameters that govern it. You can make NPCs stand still, roam freely, walk a patrol route, or shadow another Citizen — all tunable down to speed and radius.
Movement Types
SetmovementBehavior.type to one of the following values:
IDLE — Stand still
IDLE — Stand still
The NPC does not move on its own. It remains at its spawn position. When combined with
rotateTowardsPlayer, the NPC will still track the nearest player with its head and body.WANDER — Roam within a radius
WANDER — Roam within a radius
The NPC wanders freely within a circular area defined by
wanderRadius (default 10.0). The center of the wander area is the Citizen’s spawn position.WANDER_CIRCLE — Circular boundary wander
WANDER_CIRCLE — Circular boundary wander
Similar to
WANDER, the NPC roams within a circular boundary. The boundary radius is also controlled by wanderRadius.WANDER_RECT — Rectangular boundary wander
WANDER_RECT — Rectangular boundary wander
The NPC wanders within a rectangular area. The rectangle’s dimensions are set with
wanderWidth (X axis) and wanderDepth (Z axis), both defaulting to 10.0.PATROL — Follow a named path
PATROL — Follow a named path
The NPC follows a named patrol path created with the Patrol Stick tool. Set
pathConfig.pluginPatrolPath to the name of the patrol path. See the Patrols page for full setup instructions.FOLLOW_CITIZEN — Shadow another Citizen
FOLLOW_CITIZEN — Shadow another Citizen
The NPC moves to stay near another Citizen identified by
followCitizenId. The NPC maintains a distance of followDistance units (default 2.0) from the leader. Multiple followers automatically arrange themselves in a ring formation around the leader.Speed Settings
The movement speed of the NPC in blocks per second. When loading a
FOLLOW_CITIZEN Citizen from the config file without an explicit walkSpeed, the config loader defaults to 4.0 to match a typical leader’s pace — but the model’s built-in default is 10.0.The NPC’s run speed, used when the NPC transitions to a faster movement state (for example, during combat chasing). Set via the run threshold in the underlying role template.
Wander Parameters
These fields are only meaningful for wander-type movement behaviors.Radius of the circular wander area for
WANDER and WANDER_CIRCLE modes. The NPC will not stray further than this distance from its spawn position.Width (X dimension) of the rectangular wander boundary for
WANDER_RECT mode.Depth (Z dimension) of the rectangular wander boundary for
WANDER_RECT mode.Follow Settings
The
id of the leader Citizen that this NPC should follow. Must be a valid Citizen ID in the same world. If the referenced Citizen does not exist or is in a different world, the follower stands idle.Target distance in blocks that the NPC tries to maintain from the leader. Minimum value is
0.1.Citizens using
FOLLOW_CITIZEN movement automatically form a ring formation around the leader NPC. When multiple Citizens follow the same leader, they distribute themselves evenly in concentric rings of up to six slots each, preventing them from stacking on top of one another.Animation Behaviors
Animations are defined as a list ofAnimationBehavior entries on the Citizen. Each entry specifies when an animation plays and for how long. Multiple animation behaviors can be active simultaneously across different animation slots.
DEFAULT — Looping animation
DEFAULT — Looping animation
Plays the specified animation continuously. HyCitizens re-sends the animation command every ~2 seconds to keep it active on the client.
TIMED — Interval-based animation
TIMED — Interval-based animation
Plays the animation once every
intervalSeconds seconds.ON_INTERACT — Triggered by player interaction
ON_INTERACT — Triggered by player interaction
Plays once when a player interacts with the NPC (either left-click or F key, depending on interaction trigger settings).
ON_PROXIMITY_ENTER — Player enters range
ON_PROXIMITY_ENTER — Player enters range
Plays once when a player enters within
proximityRange blocks of the NPC.ON_PROXIMITY_EXIT — Player leaves range
ON_PROXIMITY_EXIT — Player leaves range
Plays once when a player moves beyond
proximityRange blocks from the NPC.Animation Fields
| Field | Type | Default | Description |
|---|---|---|---|
animationName | string | "" | The name of the animation to play. |
animationSlot | int | 0 | 0-based animation slot index. Different slots can play independently. |
intervalSeconds | float | 5.0 | Seconds between plays (for TIMED type only). |
proximityRange | float | 8.0 | Detection radius in blocks (for proximity types only). |
stopAfterTime | boolean | false | Whether to automatically transition to a stop animation after a duration. |
stopAnimationName | string | "" | Animation to play after stopTimeSeconds. Falls back to the DEFAULT animation for the same slot if empty. |
stopTimeSeconds | float | 3.0 | How long to play the main animation before switching to stopAnimationName. |