NEED Help with Permissions

Discussion in 'Bukkit Help' started by Paulus_De_Gross, Jun 14, 2020.

Thread Status:
Not open for further replies.
  1. Offline


    Hi Guys, i need help, how do i give a Player permissions through a command, which i have created, i have put my current code below, and i am playing and coding in 1.15.2, thank you fopr your help in advance!

    import org.bukkit.command.Command;
    import org.bukkit.command.CommandExecutor;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.permissions.PermissionAttachment;
    public class GetPerms implements CommandExecutor{
        public Main plugin;
        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
            if(sender instanceof Player) {
                Player p = (Player) sender;
                    if(args.length == 0) {
                        PermissionAttachment attachment = p.addAttachment(plugin);
                        attachment.setPermission("test", true);
            return false;
    Last edited by a moderator: Jun 14, 2020
  2. Offline

    timtower Administrator Administrator Moderator

Thread Status:
Not open for further replies.

Share This Page