Advertisement
Guest User

Untitled

a guest
May 5th, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 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. this.getCommand("hub").setExecutor(this);
  14. }
  15.  
  16. public void onDisable() {
  17. getLogger().info("Plugin Disabled");
  18.  
  19. }
  20.  
  21. public boolean onCommand(Command sender, Command cmd, String label, String[] args) {
  22. if(sender instanceof Player) {
  23. Player player = (Player) sender;
  24. if(cmd.getName().equalsIgnoreCase("hub")) {
  25. String hub = "spawn " + player.getName();
  26. Bukkit.dispatchCommand(Bukkit.getConsoleSender(), hub);
  27. player.sendMessage(ChatColor.AQUA + "Returning to Hub");
  28. }
  29. }
  30. return false;
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement