![[IMG]](/proxy/image?url=https%3A%2F%2Fi.imgur.com%2FAxctg8l.png)
NPCForge is a lightweight yet powerful NPC plugin for Spigot servers that integrates with ModelEngine to create interactive NPCs using custom models. Create engaging NPCs that respond to player interactions, execute commands, and add life to your server.
Whats Next?
I actually have no plans for this plugin at all. It does what i wanted it to do, but if you have any ideas or request for features to add, please add a comment below!
Key Features:
• Create NPCs with custom ModelEngine models
• Interactive click commands (player & server execution)
• Dynamic player tracking/looking system
• Easy NPC management with clickable controls
• Full command tab completion
• Simple permission system
• Developer API with events
Commands & Permissions:
Code (Text):
Creation & Management:
/npc create <name> <model> <display> - Create NPC (npcforge.create)
/npc delete <name> - Remove NPC (npcforge.delete)
/npc changeModel <name> <model> - Change model (npcforge.changemodel)
/npc rename <name> <display> - Change display name (npcforge.rename)
Location Controls:
/npc tp <name> - Teleport to NPC (npcforge.tp)
/npc tphere <name> - Teleport NPC to you (npcforge.tphere)
/npc look <name> - Toggle player tracking (npcforge.look)
Interactive Commands:
/npc addcmd <name> <right|left> <server|player> <command> (npcforge.addcmd)
/npc remcmd <name> <right|left> <server|player> <#> (npcforge.remcmd)
/npc clrcmd <name> - Clear all commands (npcforge.clrcmd)
/npc lscmd <name> - List all commands (npcforge.lscmd)
Other:
/npc list - Show all NPCs (npcforge.list)
Developer API
NPCForge provides several events for developers:
Code (Text):
// API Events
public class NPCCreateEvent extends Event {
private final String npcName;
private final String modelName;
private final Location location;
/**
* Called when an NPC is created
* @param npcName Name of the NPC
* @param modelName ModelEngine model name
* @param location Spawn location
*/
public NPCCreateEvent(String npcName, String modelName, Location location) {
this.npcName = npcName;
this.modelName = modelName;
this.location = location;
}
public String getNPCName() { return npcName; }
public String getModelName() { return modelName; }
public Location getLocation() { return location; }
}
public class NPCDeleteEvent extends Event {
private final String npcName;
/**
* Called when an NPC is deleted
* @param npcName Name of the deleted NPC
*/
public NPCDeleteEvent(String npcName) {
this.npcName = npcName;
}
public String getNPCName() { return npcName; }
}
public class NPCRightClickEvent extends Event {
private final String npcName;
private final Player player;
/**
* Called when a player right-clicks an NPC
* @param npcName Name of the clicked NPC
* @param player Player who clicked
*/
public NPCRightClickEvent(String npcName, Player player) {
this.npcName = npcName;
this.player = player;
}
public String getNPCName() { return npcName; }
public Player getPlayer() { return player; }
}
public class NPCLeftClickEvent extends Event {
private final String npcName;
private final Player player;
/**
* Called when a player left-clicks an NPC
* @param npcName Name of the clicked NPC
* @param player Player who clicked
*/
public NPCLeftClickEvent(String npcName, Player player) {
this.npcName = npcName;
this.player = player;
}
public String getNPCName() { return npcName; }
public Player getPlayer() { return player; }
}
// Example Usage:
public class NPCEventListener implements Listener {
@EventHandler
public void onNPCCreate(NPCCreateEvent event) {
String npcName = event.getNPCName();
String modelName = event.getModelName();
Location location = event.getLocation();
// Handle NPC creation...
}
@EventHandler
public void onNPCDelete(NPCDeleteEvent event) {
String npcName = event.getNPCName();
// Handle NPC deletion...
}
@EventHandler
public void onNPCRightClick(NPCRightClickEvent event) {
Player player = event.getPlayer();
String npcName = event.getNPCName();
// Handle right-click...
}
@EventHandler
public void onNPCLeftClick(NPCLeftClickEvent event) {
Player player = event.getPlayer();
String npcName = event.getNPCName();
// Handle left-click...
}
}
Requirements:
• Spigot 1.21.4
• ModelEngine R4.0.3+
Support
For support, contact me on Discord: dvcyn
Or join the server:
https://discord.gg/KtR9vAVgFg
If you find this plugin helpful, please leave a review!