Solved Halp

Discussion in 'Plugin Development' started by vhbob, Apr 13, 2015.

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

    vhbob

    so. whenever i type my command /ClassSelectThor it says internal error occoured... anyone know why. ive looked in the consol and tried to debug it myself but cant see it. its probably obvious. thanks heres the code :
    Code:
            if (cmd.getName().equalsIgnoreCase("ClassSelectThor")) {
                Player p = (Player) sender;
                p.getInventory().clear();
                if (p.hasPermission("class.thor")) {
                    p.sendMessage(ChatColor.GRAY + "Thor Class Selected!");
                    PlayerInventory i = p.getInventory();
                    ItemStack thor = new ItemStack(Material.IRON_AXE);
                    ItemMeta thorM = thor.getItemMeta();
                    thorM.setDisplayName(ChatColor.YELLOW + "" + ChatColor.BOLD
                            + "Thor's Hammer");
                    thor.setItemMeta(thorM);
                    thor.addEnchantment(Enchantment.DURABILITY, 5);
                    i.addItem(thor);
                } else {
                    p.sendMessage(ChatColor.DARK_RED + "" + ChatColor.BOLD
                            + "NO PERMS!");
                }
            }
    nvm fixed it. its thor.AddUnsafeEnchantment for some reason, i guess bukkit doesnt like axes having unbreaking 5....
     
    Last edited: Apr 13, 2015
  2. Offline

    ItsMattHogan

    Post the stacktrace....
     
  3. Offline

    Evaluations

    You need to supply the stacktrace.
     
Thread Status:
Not open for further replies.

Share This Page