Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (cmd.getName().equalsIgnoreCase("shops")) {
- if (!(s instanceof Player)) {
- s.sendMessage("You can't run this command from the console!");
- return true;
- }
- if (args.length == 0) {
- // show help
- return true;
- }
- if (args[0].equalsIgnoreCase("create")) {
- if (args[1] == null) {
- p.sendMessage(ChatColor.RED + "Please specify a name!");
- return false;
- }
- final Villager v = TradeVillager.spawn(p.getLocation());
- v.setCustomName(args[1]);
- v.setCustomNameVisible(true);
- new BukkitRunnable(){
- @Override
- public void run() {
- ((CraftVillager)v).getHandle().setInvisible(false);
- }
- }.runTaskLater(this, 3);
- p.sendMessage(ChatColor.GREEN + "You have succesfully created a Trade Villager!");
- p.sendMessage(ChatColor.GREEN + "Click it to configure!");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement