HyNPC banner
HyNPC icon

HyNPC

The idea is for the mod to be able to: Spawn NPCs facing the player Have a proper idle animation (not spawning while running) Display the NPC’s name as a...

00Free
hytaleServer2026.01.24mod

HyNPC provides managed server-side NPCs that stay idle, display their names as holograms, and execute stored commands when players press the Use key (F). NPCs spawn facing the creator’s yaw/pitch, clamp velocity/AI to idle each tick, and keep nameplates synchronized with their configured names.

Commands:

  • /npc create <type> <name> spawns a managed NPC using the given role id (BuilderInfo role) at the executor’s position/rotation. Names must be unique.
  • /npc remove <name> despawns the NPC and drops it from the registry.
  • /npc cmd add|remove <name> "<command>" manages the ordered command list executed as the interacting player.
  • /npc text add|remove <name> "<text>" edits stored dialog lines; /npc text show <name> [player] opens the dialog page (Next/Prev/Close) for a player.
  • /npc type <newType> <name> requests a role change in place while keeping transform/nameplate.
  • /npc save writes the managed NPC list to config/npcs.json under the mod data folder; /npc reload reloads the file, updates matching NPCs in place, spawns missing ones, and despawns managed extras to prevent duplication.

Persistence and data shape:

  • Each NPC entry stores name, role id, world name, position, rotation, command list, and text list. The registry is kept in sync with config/npcs.json, and save collects live transforms before writing.

Interaction/UI details:

  • Player Use (F) on a managed NPC immediately runs its stored commands as that player without cancelling the base interaction.
  • Dialog uses the HyNPC_Dialog page (IncludesAssetPack is enabled); text is opened only via /npc text show, not automatically on interaction.

Idle/behavior safeguards:

  • HyNPC NPCs zero velocity, clear active paths, and force idle movement state every tick; the first idle tick stops the movement animation so the default idle pose plays.

Notes:

  • Role ids are validated through the server’s NPC roles; unknown roles are logged and skipped. Dialog and commands are raw strings (no translation keys applied).