Advertisement
Guest User

Untitled

a guest
May 4th, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. package me.antondubek.simple;
  2.  
  3. import org.bukkit.Bukkit;
  4. import org.bukkit.ChatColor;
  5. import org.bukkit.command.Command;
  6. import org.bukkit.entity.Player;
  7. import org.bukkit.plugin.java.JavaPlugin;
  8.  
  9. public class main extends JavaPlugin{
  10.  
  11. public void onEnable() {
  12. getLogger().info("Plugin Enabled");
  13. }
  14.  
  15. public void onDisable() {
  16. getLogger().info("Plugin Disabled");
  17.  
  18. }
  19.  
  20. public boolean onCommand(Command sender, Command cmd, String label, String[] args) {
  21. if(sender instanceof Player) {
  22. Player player = (Player) sender;
  23. if(cmd.getName().equalsIgnoreCase("hub")) {
  24. String hub = "spawn " + player.getName();
  25. Bukkit.dispatchCommand(Bukkit.getConsoleSender(), hub);
  26. player.sendMessage(ChatColor.AQUA + "Returning to Hub");
  27. }
  28. }
  29. return false;
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement