daily pastebin goal
16%
SHARE
TWEET

Untitled

a guest May 21st, 2018 132 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package matrixProjects;
  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 CMD_fly implements CommandExecutor {
  10.  
  11.     @Override
  12.     public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  13.         Player p = (Player)sender;
  14.        
  15.         if(cmd.getName().equalsIgnoreCase("fly")) {
  16.             if(sender instanceof Player) {
  17.                 if(args.length == 0) {
  18.                     if(p.hasPermission("system.fly")) {
  19.                         p.sendMessage("§3Use §e/fly §aon §e/fly §coff");
  20.                         p.playSound(p.getLocation(), Sound.NOTE_BASS, 10.0F, 10.0F);
  21.                     } else if (args[0].equalsIgnoreCase("on")) {
  22.                         p.setAllowFlight(true);
  23.                         p.setFlying(true);
  24.                         p.sendMessage("&8[§4§lFLY&8] &aFly Mode enabled.");
  25.                         p.playSound(p.getLocation(), Sound.LEVEL_UP, 10.0F, 10.0F);
  26.                     } else if (args[0].equalsIgnoreCase("off")) {
  27.                         p.setAllowFlight(false);
  28.                         p.setFlying(false);
  29.                         p.sendMessage("&8[§4§lFLY&8] &4Fly Mode Disabled.");
  30.                         p.playSound(p.getLocation(), Sound.LEVEL_UP, 10.0F, 10.0F);
  31.                     }
  32.                 } else {
  33.                     p.sendMessage("&8[§4§lFLY&8] &4No Permissions.");
  34.                 }
  35.             }
  36.         }
  37.         return false;
  38.     }
  39.  
  40. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top