bipnix_fr

Create a professional Minecraft server plugin named NaitikPlugin whose primary purpose is to provide a complete player NPC system similar in functionality and workflow to Citizens.

Do not add unrelated features. Focus exclusively on building a powerful, reliable, player-style NPC framework.

Do not copy Citizens' source code. Implement the functionality independently using appropriate Minecraft server APIs and, where technically necessary, packet/server-internal systems.

NPC Creation

Provide a complete NPC creation system.

Example:

"/npc create <name>"

When created, the NPC should appear as a realistic Minecraft player character.

Support:

  • Custom NPC names.
  • Player-style appearance.
  • Player skins.
  • Custom skin textures.
  • Player UUID handling.
  • NPC selection.
  • NPC deletion.
  • NPC listing.
  • NPC teleportation.
  • NPC spawning/despawning.
  • NPC persistence.

NPC Selection

Implement a selection system similar to professional NPC plugins.

Example:

"/npc select <name>"

Allow administrators to select an NPC and then use commands on the selected NPC without repeatedly entering its name.

Provide clear feedback showing which NPC is currently selected.

NPC Appearance

NPCs should look as close to real Minecraft players as technically possible.

Support:

  • Custom skins.
  • Custom names.
  • Name tags.
  • Sneaking.
  • Player pose.
  • Head rotation.
  • Body rotation.
  • Arm movement.
  • Damage animation.
  • Swing animation.
  • Item holding.
  • Main-hand item.
  • Off-hand item.
  • Full armor equipment.

Equipment must visually appear on the NPC correctly.

NPC Movement

Implement smooth player-style NPC movement.

Support:

  • Walking.
  • Running.
  • Jumping.
  • Looking around.
  • Looking at players.
  • Moving to coordinates.
  • Following players.
  • Returning to a location.
  • Configurable movement speed.
  • Idle behavior.
  • Wander behavior.

NPC movement should be smooth and natural.

Do not artificially reduce movement speed.

NPC Behaviors

Provide configurable behavior types similar to professional NPC frameworks:

  • Stationary.
  • Wander.
  • Follow.
  • Look-at-player.
  • Move-to-location.
  • Return-to-location.
  • Attack behavior where supported.
  • Custom scripted behavior.

Behaviors should be independently configurable.

NPC Interaction

Players should be able to interact with NPCs.

Support:

  • Right-click interaction.
  • Left-click interaction.
  • Custom interaction actions.
  • Commands executed by the NPC.
  • Commands executed when a player interacts.
  • Messages.
  • Sounds.
  • Effects.
  • Server commands.
  • Player commands where appropriate.

Example command structure:

"/npc action add <action>"

"/npc action remove <action>"

"/npc action list"

Allow multiple actions per NPC.

NPC Commands

Implement a professional command framework with commands similar to:

"/npc create <name>"

"/npc remove <name>"

"/npc removeall"

"/npc list"

"/npc select <name>"

"/npc deselect"

"/npc skin <skin>"

"/npc rename <name>"

"/npc teleport"

"/npc move <x> <y> <z>"

"/npc look"

"/npc follow <player>"

"/npc speed <value>"

"/npc equip"

"/npc behavior <type>"

"/npc action"

"/npc reload"

Add complete tab completion and permission handling.

Persistence

NPCs must remain after a server restart.

Save all important NPC information:

  • NPC name.
  • Location.
  • World.
  • Skin.
  • UUID/internal identifier.
  • Equipment.
  • Movement settings.
  • Behavior settings.
  • Interaction actions.
  • Appearance settings.

Automatically restore NPCs when the server starts.

Performance

The plugin must be highly optimized.

Do not run expensive calculations every tick unnecessarily.

Use efficient scheduling, entity tracking, pathfinding, and player detection.

NPCs should remain smooth even when many NPCs are active.

Properly cancel tasks and release resources when NPCs are removed.

Prevent memory leaks and orphaned NPC data.

Architecture

Use a professional modular architecture.

Separate:

  • NPC manager.
  • NPC entity/controller.
  • NPC registry.
  • NPC selection system.
  • Skin manager.
  • Movement system.
  • Behavior system.
  • Interaction system.
  • Equipment system.
  • Persistence system.
  • Command system.
  • Event listeners.
  • Configuration system.

Do not put the entire implementation into one class.

Configuration

Create a clean configuration system for:

  • Default NPC settings.
  • Movement speed.
  • Skin behavior.
  • Interaction settings.
  • Behavior settings.
  • Persistence.
  • Performance options.
  • Debug logging.

Reliability

The plugin must safely handle:

  • NPCs being removed.
  • Worlds unloading.
  • Server restarts.
  • Invalid NPC names.
  • Invalid players.
  • Missing NPC data.
  • Invalid commands.
  • Configuration errors.
  • Skin loading failures.

Never crash the server because of an NPC error.

Final Requirement

The finished plugin should provide the same general user experience and core NPC workflow associated with Citizens:

Create NPC → Select NPC → Customize NPC → Give it a skin → Equip it → Configure movement/behavior → Add interactions → Save it → NPC remains available after restart.

Make the implementation original, professional, stable, optimized, and production-ready.

Do not add unrelated plugin systems or features.

Kodari AI
KodariAug 16 at 2:30 am 3
PlayerNPCFramework
A comprehensive Minecraft plugin providing a Citizens-style player NPC system. Features include NPC creation with custom skins and names, selection system, smooth movement with walking/running/jumping, configurable behaviors (stationary, wander, follow, look-at-player), full equipment support, interaction actions (commands, messages, sounds), complete command framework with tab completion, persistent storage across restarts, and modular architecture separating manager, entity, registry, skin, movement, behavior, interaction, equipment, persistence, command, listener, and configuration systems. Optimized performance with efficient scheduling and resource cleanup.
  1. Core plugin and configuration: create the Gradle project, plugin metadata, and defaults.

  2. NPC domain and persistence: add data models, registry, storage, skins, and equipment handling.

  3. Runtime systems: add entity control, movement/behaviors, interactions, selection, and lifecycle management.

  4. Administration workflow: add /npc commands, tab completion, permissions, and event handling.

Created the initial NaitikPlugin NPC framework with:

  • Gradle project configuration, plugin.yml, permissions, and default configuration.

  • Modular NPC architecture covering:

    • NPC data and registry

    • Persistence in npcs.yml

    • NPC selection

    • Skin and equipment management

    • Movement and behavior controllers

    • Interaction actions

    • Entity lifecycle management

    • World unload and player quit handling

  • /npc command framework with tab completion:

    • create, remove, removeall, list

    • select, deselect

    • skin, rename, teleport

    • move, look, follow, speed

    • equip, behavior, action, reload

  • Supported behaviors:

    • Stationary

    • Wander

    • Follow

    • Look-at-player

    • Move-to-location

    • Return-to-location

    • Attack/custom behavior types reserved for extension

  • Persistent custom names, locations, UUIDs, skins, textures, equipment, movement settings, behaviors, and actions.

The current runtime controller uses persistent armor-stand entities through the public Paper API. True fake-player entities with full player-model skin rendering require an additional version-specific NMS/packet layer.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
20 1,484
src/main/java/com/naitik/npc/NaitikPlugin.java
package com.naitik.npc;

import com.naitik.npc.command.NPCCommand;
import com.naitik.npc.config.PluginConfig;
import com.naitik.npc.listener.NPCListener;
import com.naitik.npc.manager.NPCManager;
import com.naitik.npc.persistence.NPCStorage;
import com.naitik.npc.registry.NPCRegistry;
import com.naitik.npc.selection.NPCSelectionManager;
import com.naitik.npc.skin.SkinManager;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public final class NaitikPlugin extends JavaPlugin {
    private PluginConfig pluginConfig;
    private NPCManager npcManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        pluginConfig = new PluginConfig(this);
        SkinManager skinManager = new SkinManager(this, pluginConfig);
        NPCStorage storage = new NPCStorage(this);
        NPCRegistry registry = new NPCRegistry();
        NPCSelectionManager selectionManager = new NPCSelectionManager();
        npcManager = new NPCManager(this, pluginConfig, registry, selectionManager, storage, skinManager);

        NPCCommand command = new NPCCommand(this, npcManager);
        if (getCommand("npc") != null) {
            getCommand("npc").setExecutor(command);
            getCommand("npc").setTabCompleter(command);
        }
        Bukkit.getPluginManager().registerEvents(new NPCListener(npcManager), this);
        npcManager.load();
        npcManager.start();
    }

    @Override
    public void onDisable() {
        if (npcManager != null) {
            npcManager.shutdown();
        }
    }

    public PluginConfig pluginConfig() {
        return pluginConfig;
    }

    public NPCManager npcManager() {
        return npcManager;
    }
}