Itemstack config

Discussion in 'Plugin Development' started by TheLittleDeveloper, Apr 30, 2015.

Thread Status:
Not open for further replies.
  1. Hey there bukkit developers,

    I want to get the name of the itemstack and the lore out of the config i use this code now but this don't work:

    Code:
      public static ItemStack ach1f()
      {
        ItemStack m = new ItemStack(Material.STAINED_CLAY, 1, (short)14);
        ItemMeta mm = m.getItemMeta();
       
        String achievement = Achievement.plugin.getConfig().getString("Ach1.Naam");
       
        mm.setDisplayName(achievement);
        ArrayList lore = new ArrayList();
        lore.add(Achievement.plugin.getConfig().getString("Ach1.Desc"));
        lore.add(ChatColor.RED + "Nog niet gehaald");
       
        mm.setLore(lore);
       
        m.setItemMeta(mm);
        return m;
      }
    Please help me

    TheLittleDeveloper
     
  2. Offline

    nverdier

    @TheLittleDeveloper ItemStack implements ConfigurationSerializable, so you can just save/load it to the config.
     
  3. Offline

    HungerCraftNL

    Code:
    String path = "This.Item";
    PLUGIN.getConfig().getItemStack(path);
    PLUGIN.getConfig().set(path, ItemStack);
    
     
Thread Status:
Not open for further replies.

Share This Page