Give a player items from config

Discussion in 'Plugin Development' started by 8803286, Dec 30, 2013.

Thread Status:
Not open for further replies.
  1. Hi i'm trying to load items from the config and then give it to the player when he logs in, but nothing happen.

    Config:
    Items:
    - STONE x 1

    String[] item = itemLore.get(i).split(" x ");

    //item is giving me STONE(item[0]) and 1(item[1])

    if(Material.getMaterial(item[0]) == null){
    Bukkit.broadcastMessage(ChatColor.RED+"ITEM: "+ChatColor.GOLD+item[0]+ChatColor.RED+" was not Found!");
    }else{

    player.getInventory().addItem(new ItemStack(Material.valueOf(item[0]),Integer.parseInt(item[1])));
    }

    It's just saying null
     
Thread Status:
Not open for further replies.

Share This Page