mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-06 08:28:47 +01:00
Add '/npc position -a' to have the NPC's head assume the position of the Player's head.
This commit is contained in:
parent
2d78bdaad0
commit
e7daa38eef
@ -668,6 +668,7 @@ public class NPCCommands {
|
|||||||
// Assume Player's position
|
// Assume Player's position
|
||||||
if (args.hasFlag('a')) {
|
if (args.hasFlag('a')) {
|
||||||
if (sender instanceof Player) {
|
if (sender instanceof Player) {
|
||||||
|
// Spawn the NPC if it isn't spawned to prevent NPEs
|
||||||
if (!npc.isSpawned())
|
if (!npc.isSpawned())
|
||||||
npc.spawn(npc.getTrait(CurrentLocation.class).getLocation());
|
npc.spawn(npc.getTrait(CurrentLocation.class).getLocation());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user