YAULTMA
Members-
Posts
9 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
YAULTMA's Achievements
Tree Puncher (2/8)
0
Reputation
-
Like this? public int someCheck(EntityPlayer player, String lorePar, Item item) { ItemStack itemInHand = player.inventory.getCurrentItem(); NBTTagList nbt = itemInHand.getTagCompound().getCompoundTag("display").getCompoundTag("Lore").getTagList("TAG_STRING"); if (nbt != null){ ArrayList<String> lore = new ArrayList<String>(); for(int i = 0; i < nbt.tagCount(); i++){ lore.add(nbt.tagAt(i).getName()); } if(item.equals(itemInHand) && lore!=null && lore.contains(lorePar)){ return 1; } } return 0; }
-
Please tell me how to get List<String> from Item, I can't understand how to move through NBT tree What about this? ItemStack itemInHand = player.inventory.getCurrentItem(); NBTTagList nbt = itemInHand.getTagCompound().getCompoundTag("display").getTagList("Lore"); if (nbt != null){ ArrayList<String> lore = new ArrayList<String>(); lore.add("a"); for(int i = 0; i < nbt.tagCount(); i++){ lore.add(nbt.tagAt(i).toString()); } if(item.equals(itemInHand) && lore!=null && lore.contains(lorePar)){ return 1; } }
-
Yep, but I don't understand it. What method return list?
-
How to get it? public int someCheck(EntityPlayer player, String lorePar) { ItemStack item = new ItemStack(Item.swordDiamond, 1); ItemStack itemInHand = player.inventory.getCurrentItem(); List<String> lore = itemInHand.// <--------- ; if(item.equals(itemInHand) && lore!=null && lore.contains(lorePar)){ return 1; } return 0; }
-
I understand how to create my own NBT file, but how to use exist one?
-
Ok. What I can do with this info? No examples. Really. Help me.
-
I don't understand how to do it. Can you write some code?
-
I got plugin that uses lore how can I get lore from item using mod?