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.
CitizenData is the data model that describes a single NPC. Every field — from display name to combat ranges — lives here. You construct a CitizenData instance and hand it to CitizensManager methods such as addCitizen or updateCitizen to create or update Citizens in the world.
Constructor
null for npcUUID and hologramLineUuids when creating a brand-new Citizen. The manager assigns these values automatically after spawning.Quick Start Example
Identity
id — String
id — String
UUID.randomUUID().toString() when creating Citizens programmatically. The ID is used as the storage key and cannot be changed after creation.name — String
name — String
\n for multi-line nametags — each non-empty line becomes a separate hologram entity. Access via getName() / setName(String).modelId — String
modelId — String
"Human", "Player". Access via getModelId() / setModelId(String).worldUUID — UUID
worldUUID — UUID
getWorldUUID() / setWorldUUID(UUID).group — String
group — String
"Town/Guards". Empty string means ungrouped. The path is normalised (back-slashes converted, leading/trailing slashes stripped). Access via getGroup() / setGroup(String).Position & Scale
position — Vector3d
position — Vector3d
currentPosition. Access via getPosition() / setPosition(Vector3d).rotation — Vector3f
rotation — Vector3f
getRotation() / setRotation(Vector3f).scale — float
scale — float
0.01–100.0. Default is 1.0. Access via getScale() / setScale(float).Appearance
Player Model & Skin
Player Model & Skin
| Field | Type | Description |
|---|---|---|
isPlayerModel | boolean | When true the entity uses the Player model type. |
useLiveSkin | boolean | When true the skin is fetched from Mojang and refreshed every 30 minutes. |
skinUsername | String | Mojang username for skin lookup. |
cachedSkin | PlayerSkin | The last fetched skin object. null if not yet fetched. |
lastSkinUpdate | long | Epoch milliseconds of the last skin fetch. |
isPlayerModel(), isUseLiveSkin(), getSkinUsername(), getCachedSkin(), etc.Nametag Visibility
Nametag Visibility
| Field | Type | Default | Description |
|---|---|---|---|
hideNametag | boolean | false | Hides the nametag completely. |
hideNpc | boolean | false | Hides the NPC entity itself (only nametag remains visible if enabled). |
nametagOffset | float | 0 | Vertical offset applied to the hologram position above the NPC head. |
isHideNametag(), isHideNpc(), getNametagOffset() / setNametagOffset(float).Model Nametag
Model Nametag
| Field | Type | Default | Description |
|---|---|---|---|
modelNametagEnabled | boolean | false | Enables the model nametag. |
nametagModelId | String | "" | Asset ID of the model to display. |
nametagModelScale | float | 1.0 | Scale of the nametag model. |
rotateNametagTowardsPlayer | boolean | true | When true, the model nametag rotates to face nearby players. |
isModelNametagEnabled(), getNametagModelId(), etc.Look-At Behaviour
Look-At Behaviour
| Field | Type | Default | Description |
|---|---|---|---|
rotateTowardsPlayer | boolean | false | When true (and movement type is IDLE), the NPC turns to face nearby players. |
lookAtDistance | float | 25.0 | Maximum distance in blocks at which the NPC reacts to a player’s presence. |
getRotateTowardsPlayer() / setRotateTowardsPlayer(boolean) and getLookAtDistance() / setLookAtDistance(float).Equipment
Equipment
| Field | Slot | Description |
|---|---|---|
npcHelmet | Armor slot 0 | Item asset ID or null. |
npcChest | Armor slot 1 | Item asset ID or null. |
npcGloves | Armor slot 2 | Item asset ID or null. |
npcLeggings | Armor slot 3 | Item asset ID or null. |
npcHand | Hotbar slot 0 | Item asset ID or null. |
npcOffHand | Utility slot | Item asset ID or null (reserved). |
getNpcHelmet() / setNpcHelmet(String), and the equivalent getters/setters for each slot.Map Marker
Map Marker
| Field | Type | Default | Description |
|---|---|---|---|
mapMarkerEnabled | boolean | false | Enables a map marker for this Citizen. |
mapMarkerType | String | "PIN" | Icon type. Valid values: PIN, DOT, STAR, DIAMOND, SQUARE, QUESTION, EXCLAMATION, MONEY_SYMBOL, SHOP, TRADER, CHEST, SWORD, SHIELD, HEART, HOME, NPC_TYPE, CUSTOM. |
mapMarkerName | String | "" | Label shown on the map. |
mapMarkerCustomIcon | String | "" | Filename of a custom .png icon (filename only, no path). |
mapMarkerMaxDistance | float | 0.0 | Max distance in blocks at which the marker is visible. 0 means always visible. |
isMapMarkerEnabled(), getMapMarkerType() / setMapMarkerType(String), etc.Behavior
MovementBehavior
MovementBehavior
| Movement Type | Description |
|---|---|
IDLE | Stands in place. Rotate-towards-player is only active in this mode. |
WANDER | Wanders within a sphere of radius wanderRadius. |
WANDER_CIRCLE | Circular wander pattern. |
WANDER_RECT | Rectangular wander area defined by wanderWidth and wanderDepth. |
PATROL | Follows a named patrol path. Requires pathConfig.pluginPatrolPath to be set. |
FOLLOW_CITIZEN | Follows another Citizen. Requires followCitizenId to be set. |
getMovementBehavior() / setMovementBehavior(MovementBehavior).animationBehaviors — List<AnimationBehavior>
animationBehaviors — List<AnimationBehavior>
AnimationBehavior objects that define timed, default, or proximity-triggered animations. Each entry specifies the animation name, slot, trigger type, interval, and optional stop behaviour. Access via getAnimationBehaviors() / setAnimationBehaviors(List).attitude — String
attitude — String
PASSIVE, NEUTRAL, AGGRESSIVE. Default is PASSIVE. Access via getAttitude() / setAttitude(String).Follow Citizen
Follow Citizen
| Field | Type | Default | Description |
|---|---|---|---|
followCitizenEnabled | boolean | false | Legacy field. Movement type FOLLOW_CITIZEN is the preferred approach. |
followCitizenId | String | "" | ID of the Citizen to follow. |
followDistance | float | 2.0 | Desired separation distance in blocks when following. |
isFollowCitizenEnabled(), getFollowCitizenId() / setFollowCitizenId(String), getFollowDistance() / setFollowDistance(float).scheduleConfig — ScheduleConfig
scheduleConfig — ScheduleConfig
getScheduleConfig() / setScheduleConfig(ScheduleConfig).Interactions
commandActions — List<CommandAction>
commandActions — List<CommandAction>
CommandAction has a command string, runAsServer flag, delay in seconds, interaction trigger (LEFT_CLICK, F_KEY, BOTH), and a chance percent. Access via getCommandActions() / setCommandActions(List).commandSelectionMode — String
commandSelectionMode — String
commandActions run per interaction. Valid values: ALL, RANDOM, SEQUENTIAL. Default is ALL. Access via getCommandSelectionMode() / setCommandSelectionMode(String).messagesConfig — MessagesConfig
messagesConfig — MessagesConfig
CitizenMessage objects, a selection mode (ALL, RANDOM, SEQUENTIAL), and an enabled flag. Access via getMessagesConfig() / setMessagesConfig(MessagesConfig).Permissions
Permissions
| Field | Type | Description |
|---|---|---|
requiredPermission | String | Permission node required to interact. Empty string disables permission check. |
noPermissionMessage | String | Message shown to players who lack the required permission. |
getRequiredPermission() / setRequiredPermission(String) and getNoPermissionMessage() / setNoPermissionMessage(String).First Interaction
First Interaction
| Field | Type | Default | Description |
|---|---|---|---|
firstInteractionEnabled | boolean | false | Enables the first-interaction system. |
firstInteractionCommandActions | List<CommandAction> | [] | Commands to run on the first interaction. |
firstInteractionMessagesConfig | MessagesConfig | default | Messages to send on the first interaction. |
firstInteractionCommandSelectionMode | String | "ALL" | ALL or RANDOM. |
postFirstInteractionBehavior | String | "NORMAL" | What happens on subsequent interactions: NORMAL, NONE. |
runNormalOnFirstInteraction | boolean | false | When true, normal interaction commands/messages also fire on first interaction. |
isFirstInteractionEnabled(), getFirstInteractionCommandActions(), etc.Combat & Health
Damage & Health
Damage & Health
| Field | Type | Default | Description |
|---|---|---|---|
takesDamage | boolean | false | When false the NPC is fully invulnerable. |
overrideHealth | boolean | false | When true, uses healthAmount as the max HP. |
healthAmount | float | 100 | Max HP when overrideHealth is true. |
overrideDamage | boolean | false | When true, uses damageAmount as the Citizen’s attack damage. |
damageAmount | float | 10 | Attack damage when overrideDamage is true. |
isTakesDamage(), isOverrideHealth(), getHealthAmount(), etc.Respawn
Respawn
| Field | Type | Default | Description |
|---|---|---|---|
respawnOnDeath | boolean | true | When true, the Citizen respawns after dying. |
respawnDelaySeconds | float | 5.0 | Seconds to wait before respawning. |
isRespawnOnDeath() / setRespawnOnDeath(boolean) and getRespawnDelaySeconds() / setRespawnDelaySeconds(float).Health Regeneration
Health Regeneration
| Field | Type | Default | Description |
|---|---|---|---|
healthRegenEnabled | boolean | false | Enables passive health regeneration. |
healthRegenAmount | float | 1.0 | HP restored per regen tick. |
healthRegenIntervalSeconds | float | 5.0 | Seconds between regen ticks. |
healthRegenDelayAfterDamageSeconds | float | 5.0 | Seconds after taking damage before regen resumes. |
isHealthRegenEnabled(), getHealthRegenAmount(), etc.combatConfig — CombatConfig
combatConfig — CombatConfig
| Field | Type | Default | Description |
|---|---|---|---|
attackType | String | "Root_NPC_Attack_Melee" | Interaction ID used for the attack animation. |
attackDistance | float | 2.0 | Range in blocks at which the Citizen initiates an attack. |
chaseSpeed | float | 0.67 | Relative speed multiplier when chasing a target. |
backOffAfterAttack | boolean | true | When true, the Citizen backs away after attacking. |
backOffDistance | float | 4.0 | Distance to back off in blocks. |
blockAbility | String | "Shield_Block" | Ability ID used for blocking. |
blockProbability | int | 50 | 0–100 percent chance to block incoming attacks. |
new CombatConfig() (defaults apply) and customise via setters. Apply via setCitizenCombatConfig(citizenId, combatConfig).detectionConfig — DetectionConfig
detectionConfig — DetectionConfig
| Field | Type | Default | Description |
|---|---|---|---|
viewRange | float | 15 | Visual detection range in blocks. |
viewSector | float | 180 | Horizontal field-of-view in degrees. |
hearingRange | float | 8 | Hearing detection range in blocks. |
absoluteDetectionRange | float | 2 | Range within which detection is guaranteed regardless of LOS. |
alertedRange | float | 45 | Range within which an alerted NPC will pursue. |
investigateRange | float | 40 | Range for investigation state navigation. |
new DetectionConfig() (defaults) or new DetectionConfig(boolean hostile). Apply via setCitizenDetectionConfig(citizenId, detectionConfig).pathConfig — PathConfig
pathConfig — PathConfig
| Field | Type | Default | Description |
|---|---|---|---|
followPath | boolean | false | When true, the Citizen follows a path defined in the UI path editor. |
pathName | String | "" | Name of the UI-defined path to follow. |
patrol | boolean | false | When true, the Citizen patrols between waypoints. |
loopMode | String | "LOOP" | Patrol end behaviour: LOOP, PING_PONG. |
pluginPatrolPath | String | "" | Name of the plugin-API patrol path (used with startCitizenPatrol). |
pluginPatrolSpeed | float | 2.0 | Walk speed used during plugin-controlled patrol. |
new PathConfig(). Apply via setCitizenPathConfig(citizenId, pathConfig).