NPCore is a skript API that provides a few functions that allow you to implement NPCs onto your server
- Create NPCs
- Show NPCs only to certain players (clientside)
- Hide NPCs from the tablist
- Remove NPCs
To create an NPC you have to use the function npccreateNPC()
This function will create an NPC object but won't display it to any players.
- a unique id for the NPC so the API can easily distinguish between them
- a location for the NPC to appear (currently not editable but is planned)
- the name displayed above the NPC's head
- any flags (see below) (optional)
Do do this you have to use the function npcshowNPC()
You can manually remove an NPC from a player's tablist (if you previously had it set to show) by using the function npchideNPC(id, player)
- the unique id of a created NPC
- the player to show the NPC to
- whether or not the NPC should appear in the tablist (defaults to false)
- how many ticks to wait before hiding the NPC from the tablist (shouldn't be touched unless you know what you're doing [defaults to 10 ticks])
And finally, to hide an NPC from a player after having shown it, you have to use the function npcdestroyNPC(id, player)
How flags work:
Flags are in the format "id:value" and are separated by spaces e.g.
Currently available flags for when creating an NPC are:
texture: a string containing the texture of a skin
signature: a string containing the signature of a skin (both the texture and signature flags are required for a skin to be used)
uuid: a custom uuid to be used (if not used the NPC will get a random uuid)
skinlayers: the decimal value of a byte which determines what segments of the 2nd layer of a skin to display (defaults to all segments)
(more to be added e.g. different entity NPCs i.e. not only players)
Skript, skript-mirror, Mundosk and protocollib
Note: NPCs will not automatically be re-shown to players if they leave or unload the entity (move far away) and come back
Welcome to skUnity!
Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.
If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!
Now, what are you waiting for? Join the community now!
API NPCore 1.1.1
Create and manage NPCs