S✦SHADYCRAFT HUBWIKI & FIELD GUIDEMinecraft Java 26.2
ENBG
Login

New mods · GUIDE

SP NPC

Version 0.1.0 Under construction

World-scoped NPC creation, patrols, guards and persistent death lifecycle through SP Admin.

Required mods

These mods are mandatory. This mod cannot load without them.

Game & platform requirements

Minecraft Java 26.2Java ≥ 25Fabric Loader ≥ 0.19.5Fabric API ≥ 0.160.0+26.2

Administration

The SP NPC module has seven pages:

Page Controls
Identity Create a unique ID, choose a preset, search by ID/display name, edit visible name, optional title and independent six-digit RGB colors.
Combat Maximum health, melee attack damage, armor, armor toughness, movement speed, detection range, knockback resistance and immortality.
Behavior Stationary, Guard or Patrol; Passive, Neutral or Aggressive; targets Players, Monsters or Both; maximum home leash.
Route Append your current server position as a waypoint, remove the last point, or confirm clearing the route.
Equipment Main hand, off hand, head, chest, legs and feet item IDs. Blank removes an item.
Lifecycle Edit automatic respawn and delay; Manage offers Spawn here, Move here, Despawn, Revive and Countdown; Delete requires typing the exact NPC ID.
Dialogue Edit a plain right-click greeting, up to 512 characters.

A new NPC starts Despawned. Open Lifecycle → Manage → SPAWN_HERE to activate it at your current position. The server owns all positions; the client cannot submit arbitrary coordinates. Administration is world-wide and does not require standing beside an existing NPC. Route points and placement use the administrator's actual dimension and position.

IDs are immutable lowercase identifiers, for example gorth_market and gorth_castle. Both can display Gorth. A title such as Merchant appears above the name and has no automatic gameplay meaning. Search matches either display name or internal ID. Clear the search text to list every NPC. This version supports up to 64 definitions per world and 64 waypoints per NPC.

Commands and placement

  • /npcspawn <name> activates an existing definition at your current position and direction. name is the unique internal ID. It replaces an active instance, restores full health, saves a new home/post and clears the old route. It never intentionally adds a second active instance. Use Create first.
  • /npcdelete <name> permanently removes the definition and active instance. The command itself is immediate; the panel additionally requires typed confirmation.

MOVE_HERE preserves health and lifecycle status, moves home/post, and translates every route point by the same offset. It works within the existing dimension. Use SPAWN_HERE for a dimension change. Despawn retains the definition, cancels a respawn deadline and removes the instance. Revive restores a Dead or Respawning NPC at its saved home, at full health. Spawn and revive wait safely if placement is blocked or the relevant chunk is unavailable.

Combat and equipment

All NPCs currently use one adult zombie humanoid appearance. They do not burn in sunlight, convert underwater, call reinforcements, pick up loot or naturally despawn. They use a separate sp_npc:npc entity type in the Misc category. They retain zombie/undead properties such as potion and enchantment interactions.

Melee attacks have a fixed one-second interval and require line of sight and proximity. An attack-speed attribute is deliberately not presented as a working control. Detection range controls acquisition; the home leash bounds the NPC and its target. Creative and spectator players and other SP NPCs are excluded. Neutral NPCs retaliate only against the chosen eligible target categories. Passive NPCs never acquire or retaliate.

Equipment is visual: item attribute modifiers are stripped. Your configured damage, armor and toughness remain authoritative; holding a diamond sword does not silently add damage. Items have no custom components or enchantments, do not drop, and NPCs award no built-in loot or XP. Normal Minecraft armor calculations, difficulty and third-party combat rules can still affect final damage. Immortality blocks ordinary damage; administrative removal remains possible.

Movement

  • Stationary remains fixed at home, with no navigation or knockback displacement. It can attack only a nearby eligible target.
  • Guard leaves its post for combat, then navigates home and restores its saved facing.
  • Patrol follows the ordered cyclic route. Combat interrupts the route; after disengaging it returns home, then resumes the retained route index.

Each waypoint must be in the home dimension and within the home leash. Movement never requests forced chunk tickets. A path into an unloaded chunk waits. When movement makes no progress for ten seconds, Patrol skips a blocked waypoint; Guard may return by teleport only to a loaded, collision-free home. Targets outside the leash are dropped. NPCs cannot use portals or vanilla cross-dimension transfers; use Spawn here to deliberately change dimension. This is ground navigation; there are no flying, swimming or mounted NPC modes.

Death, persistence and restart

The panel shows ALIVE, DEAD, RESPAWNING or DESPAWNED. Respawning includes its persisted UTC deadline; Lifecycle → Manage → COUNTDOWN reports remaining seconds. The countdown is requested on demand, rather than an automatically ticking panel widget. An expired respawn waits at zero until home is loaded and clear. An Alive NPC may also be waiting for its saved position to become loaded and clear.

With automatic respawn enabled, death saves an absolute wall-clock timestamp and the definition remains intact. With it disabled, the NPC stays Dead until Revive or an explicit Spawn here. Changing the respawn settings applies to future deaths; an already scheduled deadline is retained. Delete and Despawn are separate from death and never schedule a resurrection.

Definitions, identity, status, deadline, health, route index and position live in <world>/sp-npc/npcs.json. Each server/world has its own ledger. Mutations are atomically written before becoming live; invalid or corrupted data is preserved and prevents loading. Back up the world directory. Do not edit the file while the server runs.

NPC entities are reconstructed from that ledger and are deliberately excluded from vanilla entity saves. Unload cleanup and ownership reconciliation also discard hidden or stale runtime instances, preventing them from returning after Delete, Despawn or replacement. Unload and clean shutdown checkpoint health/position/route progress; regular checkpoints run every five seconds. An abrupt process crash may lose up to five seconds of movement or health progress. Lifecycle changes are saved immediately. A persistence failure stops the server to avoid continuing with contradictory ownership data. No player inventory or personal world is migrated automatically.

Compatibility and limits

  • MMORPG 0.8.3 does not assign random RPG levels to the Misc NPC type.
  • With VitalView 0.9.1, SP NPC owns its two-line nameplate. Its optional compatibility mixin excludes NPCs from VitalView's entity HUD, including its NPC health bars/popups, to avoid overlapping labels. Other entities are unaffected.
  • Both name/title lines use depth-tested rendering and an additional camera-to-NPC obstruction test. They do not intentionally render through terrain.
  • The original logo is branding; the in-game NPC appearance in this release is a vanilla zombie, not the illustrated hooded character.
  • Human skins, alternative mob appearances, ranged attacks, spells, healing, loot/reward editors, NPC factions, NPC-versus-NPC targeting, advanced dialogue choices and direct Shop/Quests/Dungeons actions are not implemented.
  • Shop and Quests expose internal screen-opening methods, but there is no shared stable NPC action contract spanning all three systems. SP NPC does not write to their stores and does not run client-supplied commands. Integration is deferred rather than simulated by a title or a preset.

In-game screenshots

All screenshots use the English game interface.

Checked against the repository · 2026-10-24
xMrShadyx / Minecraft · revision 955960a1