mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-01 14:08:08 +01:00
Allow npcs to be created unspawned with the -u flag
This commit is contained in:
parent
f2608e3c8d
commit
b90a0f6b45
@ -165,9 +165,9 @@ public class NPCCommands {
|
||||
|
||||
@Command(
|
||||
aliases = { "npc" },
|
||||
usage = "create [name] ((-b) --type (type) --trait ('trait1, trait2...') --b (behaviour))",
|
||||
usage = "create [name] ((-b -u) --type (type) --trait ('trait1, trait2...') --b (behaviour))",
|
||||
desc = "Create a new NPC",
|
||||
flags = "b",
|
||||
flags = "bu",
|
||||
modifiers = { "create" },
|
||||
min = 2,
|
||||
permission = "npc.create")
|
||||
@ -220,7 +220,8 @@ public class NPCCommands {
|
||||
npc.getTrait(Owner.class).setOwner(player.getName());
|
||||
npc.getTrait(MobType.class).setType(type);
|
||||
|
||||
npc.spawn(player.getLocation());
|
||||
if (!args.hasFlag('u'))
|
||||
npc.spawn(player.getLocation());
|
||||
|
||||
PlayerCreateNPCEvent event = new PlayerCreateNPCEvent(player, npc);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
|
Loading…
Reference in New Issue
Block a user