Hello i am having trouble setting item lores!!! heres my code: which is not working Code (Text): ItemStack Knight = new ItemStack(Material.IRON_CHESTPLATE); ItemMeta KnightMeta = Knight.getItemMeta(); KnightMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&7Kit - &8&lFighter")); Knight.setItemMeta(KnightMeta); KnightLore.add(ChatColor.RED + "OMG SO COOL!"); KnightMeta.setLore(KnightLore);
Either your getMessagesConfig() is not returning anything or .getString("DeathMSG2") is not returning anything. Check if you saved/created those properly.
I see you've created a FileConfiguration config = getConfig(); Maybe try creating the Messages config and Player config also.
Check if the killer is a player using this: Code (Text): if(e.getEntity().getKiller() instanceof Player) { // code }
If you haven't set this as the display name in the item meta of the itemstack, then this is the default item name and thus not a display name. Which makes the getDisplayName method return null
@UnthinkableR Less static abuse Use primitive types rather than their boxed types (int rather than Integer Why the whole if statements thing while you can just get "DeathMSG" + random int. Variables should be in lowerCamelCase.