Advertisement
Guest User

Untitled

a guest
Apr 27th, 2014
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. package me.IIxUnderWorldxII.Main;
  2.  
  3. import org.bukkit.ChatColor;
  4. import org.bukkit.Sound;
  5. import org.bukkit.command.Command;
  6. import org.bukkit.command.CommandSender;
  7. import org.bukkit.entity.Player;
  8. import org.bukkit.plugin.java.JavaPlugin;
  9.  
  10.  
  11. public class Main extends JavaPlugin {
  12.  
  13.  
  14. public void onEnable() {
  15. getLogger().info("Hub Enabled");
  16. }
  17.  
  18. public void onDisable() {
  19. getLogger().info("Hub Disabled");
  20. }
  21.  
  22. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  23. Player p = (Player) sender;
  24. if(!(sender instanceof Player)){
  25. sender.sendMessage("[Test]" + ChatColor.WHITE + " Unknown command. Type /help for help");
  26. } else {
  27. if(cmd.getName().equalsIgnoreCase("hub")) {
  28. p.teleport(p.getWorld().getSpawnLocation());
  29. p.playSound(p.getLocation(), Sound.ANVIL_LAND , 10, 1);
  30. p.sendMessage(ChatColor.WHITE + "Teleporting you to the server Hub!");
  31. } else if(cmd.getName().equalsIgnoreCase("sethub")) {
  32. p.getWorld().setSpawnLocation(p.getLocation().getBlockX(), p.getLocation().getBlockY(), p.getLocation().getBlockZ());
  33. p.sendMessage(ChatColor.WHITE + "World Hub Set Sucessfully!");
  34. }
  35. }
  36.  
  37. return false;
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement