Hey guys! I am currently making a custom FAQ plugin for my server and it was going perfect until I hit the item box GUI. Well, I hit that and this happened: http://hastebin.com/tukofepoxi.avrasm <--Look at line 62. On ItemStack ITEM <-it shows an error in Eclipse saying: Duplicate local variable item. Well, what do I do? I am sorry for so many issues. I started Java Saturday. Just a beginner. Never mind that. Fixed. How do I fix something when it says: Duplicate local variable lore (example)? I have had this happen various times. *Bump* EDIT by Moderator: merged posts, please use the edit button instead of double posting.
No it doesn't, that means there are duplicate variable names in the same method|constructor body contained within the same code block or a code block and a nested block within that. You can't have duplicate local variable names, that's not how programming languages work
I did so: http://pastebin.com/x5Wbt0JR but now the Iron Sword doesn't show on the second box and the Zombie Head isn't named MC-IF. Neither does it say Custom and MCInfected. Did I do something wrong? Thanks.
boogagoal1 I think you have to re set the item's meta with item.setMeta(itemMeta); and also, you're adding the iron sword to the player's inventory, not the custom inventory
Uh... I don't know... I actually was just given this code and don't understand it. The itembox GUI. Can you add me on Skype at "ethan.fine1" please? I'd really appreciate it.
boogagoal1 You would just do something like this: Code:java ItemStack item = new ItemStack(Material.SKULL_ITEM, 1, (byte)2 );// Get the metaItemMeta itemMeta = item.getItemMeta();// Do stuff to the metaitemMeta.setDisplayName("MC-IF");List <String> lore = new ArrayList<String>();lore.add("Custom");lore.add("MCInfected");itemMeta.setLore(lore);// Set the meta once your done doing stuff to ititem.setMeta(itemMeta); // Might be setItemMeta