Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package matrixProjects;
- import org.bukkit.Sound;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandExecutor;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- public class CMD_fly implements CommandExecutor {
- @Override
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
- Player p = (Player)sender;
- if(cmd.getName().equalsIgnoreCase("fly")) {
- if(sender instanceof Player) {
- if(args.length == 0) {
- if(p.hasPermission("system.fly")) {
- p.sendMessage("§3Use §e/fly §aon §e/fly §coff");
- p.playSound(p.getLocation(), Sound.NOTE_BASS, 10.0F, 10.0F);
- } else if (args[0].equalsIgnoreCase("on")) {
- p.setAllowFlight(true);
- p.setFlying(true);
- p.sendMessage("&8[§4§lFLY&8] &aFly Mode enabled.");
- p.playSound(p.getLocation(), Sound.LEVEL_UP, 10.0F, 10.0F);
- } else if (args[0].equalsIgnoreCase("off")) {
- p.setAllowFlight(false);
- p.setFlying(false);
- p.sendMessage("&8[§4§lFLY&8] &4Fly Mode Disabled.");
- p.playSound(p.getLocation(), Sound.LEVEL_UP, 10.0F, 10.0F);
- }
- } else {
- p.sendMessage("&8[§4§lFLY&8] &4No Permissions.");
- }
- }
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement