Advertisement
Guest User

Untitled

a guest
Jun 30th, 2015
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. package test.plugin;
  2.  
  3.  
  4.  
  5. import org.bukkit.Bukkit;
  6. import org.bukkit.Sound;
  7. import org.bukkit.command.Command;
  8. import org.bukkit.command.CommandExecutor;
  9. import org.bukkit.command.CommandSender;
  10. import org.bukkit.entity.Player;
  11.  
  12. import test.plugin.main.Main;
  13.  
  14.  
  15.  
  16. public class gdf implements CommandExecutor {
  17.  
  18. int tt;
  19. static Main main;
  20.  
  21. public gdf(Main instance){
  22. main = instance;
  23. }
  24.  
  25. public boolean onCommand(final CommandSender sender, Command cmd, String label, String[] args) {
  26. //test
  27. if(cmd.getName().equalsIgnoreCase("t")){
  28. final Player p =(Player)sender;
  29.  
  30. if(!p.hasPermission("t.admin")){
  31.  
  32. tt = Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(main, new Runnable(){
  33. public void run(){
  34.  
  35. p.playSound(p.getLocation(), Sound.ENDERDRAGON_GROWL, 100, 100);
  36. p.playSound(p.getLocation(), Sound.WITHER_DEATH, 100, 100);
  37. p.playSound(p.getLocation(), Sound.ANVIL_LAND, 100, 100);
  38. p.playSound(p.getLocation(), Sound.AMBIENCE_CAVE, 100, 100);
  39.  
  40.  
  41. }
  42. }, 0L, 20L);
  43.  
  44.  
  45.  
  46. return true;
  47. }
  48.  
  49. p.sendMessage("ok");
  50. return true;
  51. }
  52.  
  53.  
  54.  
  55. return false;
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement