Advertisement
Guest User

Shops

a guest
Mar 6th, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. if (cmd.getName().equalsIgnoreCase("shops")) {
  2.  
  3. if (!(s instanceof Player)) {
  4. s.sendMessage("You can't run this command from the console!");
  5. return true;
  6. }
  7.  
  8. if (args.length == 0) {
  9. // show help
  10. return true;
  11. }
  12.  
  13. if (args[0].equalsIgnoreCase("create")) {
  14. if (args[1] == null) {
  15. p.sendMessage(ChatColor.RED + "Please specify a name!");
  16. return false;
  17. }
  18. final Villager v = TradeVillager.spawn(p.getLocation());
  19. v.setCustomName(args[1]);
  20. v.setCustomNameVisible(true);
  21.  
  22. new BukkitRunnable(){
  23. @Override
  24. public void run() {
  25. ((CraftVillager)v).getHandle().setInvisible(false);
  26. }
  27. }.runTaskLater(this, 3);
  28. p.sendMessage(ChatColor.GREEN + "You have succesfully created a Trade Villager!");
  29. p.sendMessage(ChatColor.GREEN + "Click it to configure!");
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement