ModsJava
✅ [API] Player NPC ✅ [1.17 - 1.20.1]
Java mod listed for Minecraft 1.17–1.20. Downloads from the MC Java Mods app on Android.
⬇ Download on Spigot
PlayerNPC is a simple NPC API for Spigot, that allows you to create your own NPC per player.
This plugin was developed by SergiFerry
This plugin was developed by SergiFerry
/npclib - Let you customize the NPCLib.
Permission: playernpc.command
/npcglobal - Let you customize the Global NPCs.
Permission: playernpc.command
- All changes made to Persistent NPC will be saved when the server restarts.
/npcpersonal - Let you customize the Personal NPCs.
Permission: playernpc.command
- This is an experimental command, and it's only for developer testing purposes.
- Changes will not be saved when the server restarts.
Spoiler: Plugins using PlayerNPC API
- Corpses - Developed by SergiFerry
- RandomTeleport - Developed by SergiFerry
- Graves - Developed by Ranull
All JavaDocs are available at:
https://sergiferry.github.io/PlayerNPC/
Put the PlayerNPC.jar on your server's /plugins and add the jar to the llibary of your Java Project.
Maven:
https://sergiferry.github.io/PlayerNPC/
Put the PlayerNPC.jar on your server's /plugins and add the jar to the llibary of your Java Project.
Maven:
Code (Text):
<repository>
<id>ranull-repo-external</id>
<url>https://repo.ranull.com/maven/external/</url>
</repository>
<dependency>
<groupId>dev.sergiferry</groupId>
<artifactId>playernpc</artifactId>
<version>2023.4</version>
<scope>provided</scope>
</dependency>
<id>ranull-repo-external</id>
<url>https://repo.ranull.com/maven/external/</url>
</repository>
<dependency>
<groupId>dev.sergiferry</groupId>
<artifactId>playernpc</artifactId>
<version>2023.4</version>
<scope>provided</scope>
</dependency>
First of all, register your Plugin to the NPCLib
Step 1, generate the NPC instance
Step 2, modify the NPC attributes
Step 3, if you are using Personal NPCs, you need to create and show it to the player.
You can listen for player interact with the NPC, but it's better to use ClickActions
You can hide it temporally or destroy it permanent.
You can change the NPC skin, even when if it's created and shown.
You can change where the NPC looks at
You can change the NPC location
You can change the Text above the NPC
Remember that some changes at the NPC instance will not have effect on the player client until you update the npc.
Code (Java):
NPCLib.
getInstance
(
).
registerPlugin
(plugin
)
;
Code (Java):
NPC.
Global npc
= NPCLib.
getInstance
(
).
generateGlobalNPC
(plugin, id, location
)
;
//or
NPC. Personal npc = NPCLib. getInstance ( ). generatePersonalNPC (player, plugin, id, location ) ;
//or
NPC. Personal npc = NPCLib. getInstance ( ). generatePersonalNPC (player, plugin, id, location ) ;
Code (Java):
npc.
setSkin
(texture, signature
)
;
//Use https://mineskin.org/
npc. setItem (NPC. Slot, ItemStack ) ;
npc. setText ( String... ) ;
npc. setGlowing ( boolean, ChatColor ) ;
npc. setCollidable ( boolean ) ;
npc. setGazeTrackingType (NPC. GazeTrackingType ) ;
npc. setCustomTabListName ( String, boolean ) ;
npc. setHideDistance ( double ) ;
npc. setShowOnTabList ( boolean ) ;
npc. setInteractCooldown ( long ) ;
npc. setLineSpacing ( double ) ;
npc. setTextOpacity (NPC. Hologram. Opacity ) ;
npc. setTextAlignment ( Vector ) ;
npc. setPose (NPC. Pose ) ;
npc. addCustomClickAction (NPC. Interact. ClickType, CustomAction ) ;
npc. setItem (NPC. Slot, ItemStack ) ;
npc. setText ( String... ) ;
npc. setGlowing ( boolean, ChatColor ) ;
npc. setCollidable ( boolean ) ;
npc. setGazeTrackingType (NPC. GazeTrackingType ) ;
npc. setCustomTabListName ( String, boolean ) ;
npc. setHideDistance ( double ) ;
npc. setShowOnTabList ( boolean ) ;
npc. setInteractCooldown ( long ) ;
npc. setLineSpacing ( double ) ;
npc. setTextOpacity (NPC. Hologram. Opacity ) ;
npc. setTextAlignment ( Vector ) ;
npc. setPose (NPC. Pose ) ;
npc. addCustomClickAction (NPC. Interact. ClickType, CustomAction ) ;
Code (Java):
npc.
create
(
)
;
npc. show ( ) ;
npc. show ( ) ;
You can listen for player interact with the NPC, but it's better to use ClickActions
Code (Java):
@EventHandler
public void onNPCInteract (NPC. Events. Interact event ) {
Player player = event. getPlayer ( ) ;
NPC npc = event. getNPC ( ) ;
NPC. Interact. ClickType clickType = event. getClickType ( ) ;
}
public void onNPCInteract (NPC. Events. Interact event ) {
Player player = event. getPlayer ( ) ;
NPC npc = event. getNPC ( ) ;
NPC. Interact. ClickType clickType = event. getClickType ( ) ;
}
Code (Java):
npc.
hide
(
)
;
npc. destroy ( ) ;
npc. destroy ( ) ;
Code (Java):
npc.
setSkin
(NPC.
Skin
)
;
npc. forceUpdate ( ) ;
npc. forceUpdate ( ) ;
Code (Java):
npc.
lookAt
(location
)
;
npc. update ( ) ;
npc. update ( ) ;
Code (Java):
npc.
teleport
(location
)
;
Code (Java):
npc.
setText
(
String...
)
;
npc. setLineOpacity ( Integer, NPC. Hologram. Opacity ) ;
npc. updateText ( ) ; //if the text have the same amount of lines
npc. forceUpdateText ( ) ; //if the text have different amount of lines
npc. setHideText ( boolean ) ; //you can also hide the text and then show it later
npc. setLineOpacity ( Integer, NPC. Hologram. Opacity ) ;
npc. updateText ( ) ; //if the text have the same amount of lines
npc. forceUpdateText ( ) ; //if the text have different amount of lines
npc. setHideText ( boolean ) ; //you can also hide the text and then show it later
Code (Java):
npc.
update
(
)
;
npc. forceUpdate ( ) ;
npc. forceUpdate ( ) ;
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft versions listed: 1.17, 1.18, 1.19
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
✅ [API] Player NPC ✅ [1.17 - 1.20.1] is a free Minecraft Java mod. Compatible with Minecraft 1.17, 1.18, 1.19, 1.20. Downloaded 65,414 times (via Spigot). Download it and open it directly in the game.