Solved How to add permissions

Discussion in 'Plugin Development' started by BladdonB, Jun 23, 2015.

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

    BladdonB

    Hi, I'm making a KitPVP plugin and I want to add permissions to the commands

    Can someone show me how?

    Code:
                //Starter command
            if (cmd.getName().equalsIgnoreCase("noob") && sender instanceof Player) {
                Player p = (Player) sender;
                p.getInventory().clear();
                p.getActivePotionEffects().clear();
                ItemStack startersword = new ItemStack(Material.WOOD_SWORD);
                ItemMeta n = startersword .getItemMeta();
                n.setDisplayName("" + ChatColor.BLUE + ChatColor.BOLD + "Noob" + ChatColor.RESET + ChatColor.AQUA + "SWORD");
                startersword.setItemMeta(n);
                startersword.addUnsafeEnchantment(Enchantment.DURABILITY, 127);
                startersword.addEnchantment(Enchantment.DAMAGE_ALL, 1);
                p.getInventory().addItem(startersword);
                p.getInventory().setChestplate(new ItemStack(Material.LEATHER_CHESTPLATE));
                p.getInventory().setHelmet(new ItemStack(Material.LEATHER_HELMET));
                p.getInventory().setLeggings(new ItemStack(Material.LEATHER_LEGGINGS));
                p.getInventory().setBoots(new ItemStack(Material.LEATHER_BOOTS));
                p.getInventory().addItem(new ItemStack(Material.COOKED_BEEF, 64));
                p.setMaxHealth(40);
                p.setHealth(40);
                p.sendMessage("" + ChatColor.AQUA + "You was given the" + ChatColor.BOLD + " Noob Kit!!!");
            }
            //End Of Starter Command
     
  2. Offline

    sam_0208

    If (p.hasPermission("yourpermission")
     
  3. Offline

    Konato_K

Thread Status:
Not open for further replies.

Share This Page