Add /npc pathto

This commit is contained in:
fullwall 2020-09-17 23:31:44 +08:00
parent 8c1b51da98
commit ace484636a

View File

@ -1389,6 +1389,22 @@ public class NPCCommands {
Messaging.sendTr(sender, Messages.PATHFINDING_RANGE_SET, range);
}
@Command(
aliases = { "npc" },
usage = "pathto [x] [y] [z]",
desc = "Starts pathfinding to a certain location",
modifiers = { "pathto" },
min = 4,
max = 4,
permission = "citizens.npc.pathto")
public void pathto(CommandContext args, CommandSender sender, NPC npc) {
Location loc = npc.getStoredLocation();
loc.setX(args.getDouble(1));
loc.setY(args.getDouble(2));
loc.setZ(args.getDouble(3));
npc.getNavigator().setTarget(loc);
}
@Command(
aliases = { "npc" },
usage = "playerlist (-a,r)",