DriftNPCs
NPCs that look like players or any mob.
NPCs for Paper and Folia 26.3. Player NPCs with any skin (or each viewer's own), or any living mob, with equipment, glowing, scale, poses and variants, and a list of actions that run when they're clicked. NPCs from FancyNpcs and Citizens can be imported. Part of DriftSuite.
Features
- Player NPCs are Paper's Mannequin entity, so they need no packets and no ProtocolLib. Any living mob
can be an NPC too (
--type zombie); it gets no AI, can't be hurt and makes no sound. - Skins: a player name or UUID,
@mirror(every player sees their own skin), a skin link, a PNG in theskinsfolder, or@none.--slimfor thin arms. Links and files go through MineSkin (free API key). - Never saved with the world: NPC entities aren't stored in chunks. Each NPC is its own file in
npcs/and is put back whenever its chunk loads, so a crash can't leave copies behind. - Looks: MiniMessage display names with PlaceholderAPI (every player sees their own), equipment in all six slots (straight from your hand, custom items included), glowing in any of the 16 colours, scale, collidable, and per-type attributes like pose, baby and variants.
- Behaviour: turn to look at the nearest player, who can see it (everyone, a permission, or only players you pick), and a cooldown between clicks.
- Actions: right-click, left-click and any-click lists with messages, player and console commands, sending to another server, waits, permission checks, sounds and random picks.
- Importers:
/driftnpcs import fancynpcs|citizenscopies NPCs over without touching the other plugin's files. - List menu:
/npc listis a paged menu: click to go there, right-click for every setting. - DriftHolograms:
/hologram edit <name> linkWithNpc <npc>floats a hologram above an NPC and follows it. - Folia: every entity is made, changed and removed on the thread that owns it.
Requirements
- Paper or Folia 26.3 (Java 25)
- Optional: PlaceholderAPI (placeholder names), a MineSkin API key (skins from links and files), a BungeeCord
or Velocity proxy (
send_to_server), DriftHolograms (holograms above NPCs)
Getting started
- Put
DriftNPCs-<version>.jarinplugins/and start the server. It works without any changes: its files are written toplugins/DriftNPCs/(see Folder layout). - Stand where you want it and type
/npc create guide. Give it a skin with/npc skin guide <player name>and a name with/npc displayname guide <text>. - Make clicking it do something with
/npc action guide right_click add message <text>(/npc helplists everything). For skins from image links or PNG files, put a free MineSkin key inmineskin.api-key.
Commands
All /npc commands need driftnpcs.admin. <npc> is an NPC's name (tab-completes).
| Command | What it does |
|---|---|
/npc (alias /npcs) help | The command list |
/npc create <name> [--type <mob>] [--position <x> <y> <z>] [--world <world>] | A new NPC where you stand, or at the spot given (the console has to give one). ~ works |
/npc remove <npc> | Delete an NPC and its file |
/npc copy <npc> <new name> | Copy an NPC to where you stand |
/npc list [--type <mob>] [--sort name|type|world|distance] | Every NPC (a menu for players, chat for the console) |
/npc nearby [--radius <blocks>] | NPCs around you, closest first (30 blocks if not given) |
/npc info <npc> | Every setting |
/npc teleport <npc> | Go to an NPC |
/npc type <npc> <mob> | Make it a player (mannequin) or any living mob |
/npc displayname <npc> <text|@none> | The name above its head (MiniMessage, %placeholders%, & colours) |
/npc skin <npc> <player|uuid|@mirror|@none|link|file> [--slim] | Its skin (player NPCs only) |
/npc equipment <npc> set <slot> <@hand|@none|item> | Slots: head, chest, legs, feet, hand, offhand |
/npc equipment <npc> clear / list | Take everything off / show what it has |
/npc glowing <npc> [colour|disabled] | An outline through walls (no value switches it on or off) |
/npc collidable <npc> [true|false] | Whether players bump into it |
/npc scale <npc> <size> | 0.0625 to 16 (1 is normal) |
/npc attribute <npc> set <attribute> <value> | See Attributes; also remove <attribute> and list |
/npc visibility <npc> <all|permission_required|manual> | Who can see it |
/npc viewer <npc> <add|remove> <player> | Show or hide a manual NPC for one player (until they log out) |
/npc turn_to_player <npc> [true|false] | Look at the nearest player |
/npc turn_to_player_distance <npc> <blocks|default> | How near they have to be |
/npc move_here <npc> | Move it to where you stand |
/npc move_to <npc> <x> <y> <z> [yaw] [pitch] [world] | Move it to a spot (~ works) |
/npc rotate <npc> <yaw> [pitch] | Turn it |
/npc center <npc> | Middle of its block, facing straight ahead |
/npc interaction_cooldown <npc> <seconds> | How long a player waits between clicks |
/npc action <npc> <click> ... | See Actions |
/driftnpcs import <fancynpcs|citizens> | Copy NPCs from another plugin |
/driftnpcs save | Write changed NPCs to their files (with save-on-change off) |
/driftnpcs reload | Reload every file and the NPCs, and say how many problems it found |
/driftnpcs version | Show the version |
/driftnpcs help | The staff commands |
Names are letters, numbers, - and _, up to 32 long. Command names and aliases can be changed in
commands.yml.
show_in_tab isn't there: a Mannequin isn't a real player, so it can't be put in the tab list without sending
fake player packets, which DriftNPCs doesn't do.
Actions
/npc action <npc> <right_click|left_click|any_click> <what>. The any_click list runs after the right or left
list. Positions count from 1, as list shows them.
| What | |
|---|---|
add <type> [value] | Add to the end |
add_before <n> <type> [value] / add_after <n> <type> [value] | Add before or after position n |
set <n> <type> [value] | Replace position n |
remove <n>, move_up <n>, move_down <n> | Remove or move one |
clear, list | Remove all, or show them |
| Type | Value | What it does |
|---|---|---|
message | MiniMessage text | Sends it to the player. {player} and %placeholders% work, [actionbar] at the start shows it above the hotbar |
player_command | a command | The player runs it ({player} and placeholders work) |
console_command | a command | The console runs it. Only {player} is filled in |
send_to_server | a server name | Sends the player to that server on your proxy |
wait | seconds | Waits before the next action (0.5 works) |
block_until_done | The player can't start this NPC's list again until it has finished | |
need_permission | a permission | Stops unless the player has it. !perm stops if they do have it |
play_sound | sound [volume] [pitch] | Plays a sound to the player |
execute_random_action | Runs one of the actions after it, picked at random, then stops |
Running commands as op (player_command_as_op) isn't there on purpose; use console_command with {player}.
Attributes
/npc attribute <npc> list shows what fits the NPC's type.
| Attribute | For |
|---|---|
pose (standing, sneaking, sleeping, swimming, ...), on_fire, invisible | every mob |
baby | mobs that have babies |
main_hand | player NPCs |
sitting | cats, wolves, parrots, foxes and other mobs that sit |
cat_variant, wolf_variant, frog_variant, pig_variant, cow_variant, chicken_variant | those mobs |
villager_profession, villager_type, zombie_villager_profession, zombie_villager_type | villagers |
horse_color, horse_style, fox_type, parrot_variant, axolotl_variant, rabbit_type, llama_color, panda_gene, mooshroom_variant | those mobs |
sheep_color, sheared, collar_color, angry, powered, size, phantom_size | sheep, wolves, creepers, slimes, phantoms |
Permissions
| Permission | Default | What it allows |
|---|---|---|
driftnpcs.admin | op | /npc and /driftnpcs |
driftnpcs.npc.<name>.see | nobody | See an NPC set to visibility permission_required |
Clicking NPCs needs no permission; use a need_permission action for that.
Turning features on and off
The features: section at the top of config.yml:
| Switch | What it does |
|---|---|
npcs | Show NPCs at all. Off hides every NPC (they stay saved) |
placeholders | Work display names out per player when they have %placeholders% |
list-menu | /npc list opens a menu for players (off lists them in chat) |
mineskin | Skins from links and files through MineSkin |
actions | Clicking an NPC runs its actions |
importers | /driftnpcs import |
Settings
| Setting | Default | What it does |
|---|---|---|
save-on-change | true | Write an NPC's file as soon as it changes |
view-distance | 48 | How near a player must be for NPCs made just for them (@mirror, placeholder names) |
name-update-ticks | 100 | How often placeholder names are worked out again |
turn-to-player-distance | 5 | Default distance for turn_to_player |
max-turn-to-player-distance | 64 | The furthest it can be set |
turn-ticks | 2 | How often turning NPCs turn |
check-ticks | 20 | How often each NPC is checked (put back after its chunk loads) |
default-display-name | <name> | The name new NPCs show |
defaults.turn-to-player | false | Whether new NPCs turn to players |
nearby-max-range | 500 | The biggest /npc nearby radius |
mineskin.api-key | empty | Your MineSkin key (https://account.mineskin.org) |
click-gap-ms | 200 | Shortest gap between two clicks that both count |
Can't be exploited
DriftNPCs doesn't store items or money, but NPCs are entities players can reach, so:
- NPCs can't be hurt, killed, set on fire, ridden, leashed, traded with or changed (a villager hit by lightning stays a villager), don't pick up or drop items (chickens lay no eggs), and can't be taken through portals or teleport on their own. Every click on an NPC is cancelled before anything else sees it.
- No leftover entities: NPC entities are never saved into chunks, and any marked entity that turns up in a loading chunk is removed. Each NPC's entities are swapped under a lock with a counter, so a check that started before a change can't leave a double.
- One click, one run: a short gap stops one click arriving twice from running twice; the per-NPC
interaction cooldown and
block_until_donestop spam on top of that. - Console commands get only
{player}, never PlaceholderAPI placeholders, which could carry text a player chose. Running commands as op isn't offered at all. - Per-player NPCs stay private: a player's own copy is hidden from everyone else.
- Safe files: each file is written to a temporary file and moved into place, one write at a time.
- Imports are read-only: the other plugin's files are never changed, and names that already exist are skipped.
Placeholders
DriftNPCs doesn't add PlaceholderAPI placeholders of its own. Display names, message and player_command
actions use other plugins' placeholders for the player who sees or clicks the NPC.
For other plugins
com.itskoazt.driftnpcs.api.DriftNPCsAPI (all static, safe from any thread):
| Method | |
|---|---|
exists(name), names(), type(name) | What NPCs there are |
location(name), height(name) | Where it stands and how tall it is (DriftHolograms uses these) |
npcOf(entity) | The NPC an entity is, or null |
create(name, location, type, save), remove(name), move(name, location) | save false for an NPC that's gone after a restart |
setDisplayName, setSkin, setSkinTextures, setVisibility, show, hide, setActions | Change one |
com.itskoazt.driftnpcs.api.NpcClickEvent fires before an NPC's actions run; cancel it to stop them, or change
getActions().
Configuration files
| File | What's in it |
|---|---|
config.yml | Feature switches and settings |
commands.yml | Command names, aliases and permissions |
messages.yml | Every message (MiniMessage), the prefix and reply sounds |
menus.yml | The /npc list menu |
npcs/<name>.yml | One file per NPC |
skins/ | PNG skins for /npc skin <npc> <file> |
Every file starts with a boxed header saying how to apply changes, is split into sections, and has a note above every option saying what it does, its unit and the values it takes.
When you update, new options are added with their notes and everything you changed is kept. When the notes
themselves change, config.yml, commands.yml, messages.yml and menus.yml are rebuilt once with the new notes
and your values written back in; the old file is kept in data/backups/. Messages you never changed get the new
default wording. NPC files are never rewritten by an update.
Mistakes in the files
A value DriftNPCs can't use never stops the plugin. The console says which file and option, what was wrong and what is used instead, for example:
npcs/guide.yml: glow-color "sparkly" isn't one of the 16 Minecraft colours (like aqua or gold), using "white"
/driftnpcs reload tells you how many problems it found, so you know to look.
Folder layout
plugins/DriftNPCs/
config.yml settings, starting with the features: switches
messages.yml every message
menus.yml every menu
commands.yml command names, aliases and permissions
npcs/ one file per NPC, named after it
skins/ PNG skin images you add for /npc skin <npc> <file>
data/ the plugin's own files, no need to open them
skin-cache.yml skins MineSkin already made, so each image is sent once
backups/ old copies of files DriftNPCs replaced
*.version which version of each file you have
Older versions kept the skin cache in skins/cache.yml and the version markers (.messages.yml.version,
.menus.yml.version) next to config.yml. They are moved into data/ the first time the new version starts (one
console line per file), and nothing is overwritten or deleted. DriftNPCs has no database: everything about an NPC is
in its file.