WickedProduction
9/27/2019 - 11:17 PM

Permissions

package me.illuminatiproductions.spigotsandboxproject.commands;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class God implements CommandExecutor {

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        if (sender instanceof Player){
            Player player = (Player) sender;
            if(player.hasPermission("spigotsandboxproject.god")){
                player.sendMessage("WOOSH");
                player.setInvulnerable(true);
            }else {
                player.sendMessage("You do not have the required permission to execute this command");
            }
        }

        return true;
    }
}