Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. package de.Legit.commands;
  2.  
  3. import org.bukkit.Sound;
  4. import org.bukkit.command.Command;
  5. import org.bukkit.command.CommandExecutor;
  6. import org.bukkit.command.CommandSender;
  7. import org.bukkit.entity.Player;
  8.  
  9. public class fly implements CommandExecutor {
  10.  
  11. @Override
  12. public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
  13.  
  14. if(command.getName().equalsIgnoreCase("fly")) {
  15. if(sender instanceof Player) {
  16. Player p = (Player)sender;
  17. if(p.hasPermission("system.fly")) {
  18. if(args.length == 0) {
  19. if(p.getAllowFlight() == true) {
  20. p.setAllowFlight(false);
  21. p.sendMessage("§8» §eSystem §8• §7Du kannst nun §cnicht mehr fliegen§7!");
  22. p.playSound(p.getLocation(), Sound.LEVEL_UP, 3, 2);
  23. return true;
  24. }
  25. if(p.getAllowFlight() == false) {
  26. p.setAllowFlight(true);
  27. p.sendMessage("§8» §eSystem §8• §7Du kannst nun §afliegen§7!");
  28. p.playSound(p.getLocation(), Sound.LEVEL_UP, 3, 2);
  29. return true;
  30. }
  31.  
  32.  
  33.  
  34. } else {
  35. p.sendMessage("§8» §eSystem §8• §7Bitte benutze nur §c/fly");
  36. }
  37. } else {
  38. p.sendMessage("§8» §eSystem §8• §cDu hast dafür keine Rechte!");
  39. }
  40. }
  41. }
  42.  
  43. return false;
  44. }
  45.  
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement