mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-23 02:55:45 +01:00
Add /npc jump and /npc wander
This commit is contained in:
parent
eb5adf9667
commit
91feca62c7
@ -135,6 +135,7 @@ import net.citizensnpcs.trait.SlimeSize;
|
||||
import net.citizensnpcs.trait.VillagerProfession;
|
||||
import net.citizensnpcs.trait.WitherTrait;
|
||||
import net.citizensnpcs.trait.WolfModifiers;
|
||||
import net.citizensnpcs.trait.waypoint.Waypoints;
|
||||
import net.citizensnpcs.util.Anchor;
|
||||
import net.citizensnpcs.util.Messages;
|
||||
import net.citizensnpcs.util.NMS;
|
||||
@ -1158,6 +1159,18 @@ public class NPCCommands {
|
||||
Messaging.sendTr(sender, Messages.ITEM_SET, Util.prettyEnum(mat));
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = { "npc" },
|
||||
usage = "jump",
|
||||
desc = "Makes the NPC jump",
|
||||
modifiers = { "jump" },
|
||||
min = 1,
|
||||
max = 1,
|
||||
permission = "citizens.npc.jump")
|
||||
public void jump(CommandContext args, CommandSender sender, NPC npc) {
|
||||
NMS.setShouldJump(npc.getEntity());
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = { "npc" },
|
||||
usage = "leashable",
|
||||
@ -2812,6 +2825,20 @@ public class NPCCommands {
|
||||
Messaging.sendTr(sender, key, npc.getName());
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = { "npc" },
|
||||
usage = "wander",
|
||||
desc = "Sets the NPC to wander around",
|
||||
modifiers = { "wander" },
|
||||
min = 1,
|
||||
max = 1,
|
||||
permission = "citizens.npc.wander")
|
||||
public void wander(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
|
||||
Waypoints trait = npc.getOrAddTrait(Waypoints.class);
|
||||
trait.setWaypointProvider(trait.getCurrentProviderName().equals("wander") ? "wander" : "linear");
|
||||
Messaging.sendTr(sender, Messages.WAYPOINT_PROVIDER_SET, trait.getCurrentProviderName());
|
||||
}
|
||||
|
||||
@Command(
|
||||
aliases = { "npc" },
|
||||
usage = "wither (--invulnerable [true|false]) (--arrow-shield [true|false])",
|
||||
|
Loading…
Reference in New Issue
Block a user