Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.Legit.commands;
- 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 fly implements CommandExecutor {
- @Override
- public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
- if(command.getName().equalsIgnoreCase("fly")) {
- if(sender instanceof Player) {
- Player p = (Player)sender;
- if(p.hasPermission("system.fly")) {
- if(args.length == 0) {
- if(p.getAllowFlight() == true) {
- p.setAllowFlight(false);
- p.sendMessage("§8» §eSystem §8• §7Du kannst nun §cnicht mehr fliegen§7!");
- p.playSound(p.getLocation(), Sound.LEVEL_UP, 3, 2);
- return true;
- }
- if(p.getAllowFlight() == false) {
- p.setAllowFlight(true);
- p.sendMessage("§8» §eSystem §8• §7Du kannst nun §afliegen§7!");
- p.playSound(p.getLocation(), Sound.LEVEL_UP, 3, 2);
- return true;
- }
- } else {
- p.sendMessage("§8» §eSystem §8• §7Bitte benutze nur §c/fly");
- }
- } else {
- p.sendMessage("§8» §eSystem §8• §cDu hast dafür keine Rechte!");
- }
- }
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement