Bukkit help with spawning in player NPC

Status
This thread has been locked.

Shattered

old-timer
Supreme
Feedback score
5
Posts
3,486
Reactions
2,059
Resources
0
I would like to customly add player NPC to my server in a plugin I am making, I am stuck on adding npcs of players to the server...

I want it to be when you type a command, for example /test it will spawn in an npc (of themself)where you are standing and it will despawn in 10 seconds....
I am stuck on spawning an an npc, and the part where it disappears after 10 seconds.

If anyone can help me that will be great :)
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Blowns

Premium
Feedback score
1
Posts
1,014
Reactions
526
Resources
0
Code:
        NPC npc = myFancyLib.spawnNpc(location);
       
        new BukkitRunnable() {
            @Override
            public void run() {
                npc.despawn();
            }
        }.runTaskLater(plugin, 20 * 10L);

You're gonna have to find a NPC library such as Citizens to use
 

Shattered

old-timer
Supreme
Feedback score
5
Posts
3,486
Reactions
2,059
Resources
0
Code:
        NPC npc = myFancyLib.spawnNpc(location);
      
        new BukkitRunnable() {
            @Override
            public void run() {
                npc.despawn();
            }
        }.runTaskLater(plugin, 20 * 10L);

You're gonna have to find a NPC library such as Citizens to use
Is it possible to make my own?
 

000Nick

Feedback score
0
Posts
6
Reactions
1
Resources
0
Yes, but it requires extensive knowledge of NMS code and such.
Actually, it doesn't require that much NMS. Just use wiki.vg, and before spawning the actually entity, make sure you add it to the playerlist.
 

Tom

Premium
Feedback score
9
Posts
754
Reactions
481
Resources
0

000Nick

Feedback score
0
Posts
6
Reactions
1
Resources
0
Status
This thread has been locked.
Top