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.