[SOLVED] Help me with Item Meta and Public Static

Discussion in 'BungeeCord Plugin Development' started by Pyshicon, Jun 15, 2015.

  1. Hey... so i got something that're pretty confusing for me, i thought that you guys might be able to help:
    So i need to create this item call it a test sword, i installed/set the item meta in another class but when i use a command(in another class) that give the specific item that the meta set to. But it gives me nothing, it just gives me a plain sword.. any help ?
     
  2. You can't give players a item through a Bungeecord plugin.
     
  3. Not a bungeecord plugin, i mean like setting the item meta in a different class then giving the items(in another class).
    But it gives nothing, just basic item meta, not the item meta that i've set
     
  4. Well wrong category...
    How about posting some code?
     
  5. Have set the item meta in:
    SwordsMeta.class
    Code (Text):
    SwordsMeta.testsword.setItemMeta(tsim);
    But when i give the item to a player in the different class:
    Swords.class
    Code (Text):
    if(cmdS.equalsIgnoreCase("testsword") && !p.getInventory().contains(SwordsMeta.testsword)){
            p.getInventory().setItem(0, SwordsMeta.testsword);
    It does not give the item with the meta
     
  6. Could you maybe post the whole SwordsMeta class?
     
  7. Code (Text):
                ItemMeta tsim = SwordsMeta.testsword.getItemMeta();
                List<String> tsimll = new ArrayList<String>();
                tsim.setDisplayName(ChatColor.GOLD + "Captain Slayer");
                tsimll.add(ChatColor.RED + "[Type]"  + ChatColor.GRAY + "      Sword");
                tsimll.add(ChatColor.RED + "[Damage]" +  ChatColor.GRAY + "   35-39");
                tsimll.add(ChatColor.RED + "[Class]" +  ChatColor.GRAY + "     Warrior");
                tsimll.add(ChatColor.DARK_GRAY + "Captain Slayer, a sword that brings");
                tsimll.add(ChatColor.DARK_GRAY + "the nation to its war victory");
                tsim.setLore(tsimll);
                SwordsMeta.testsword.setItemMeta(tsim);
     
  8. Is the method ever used to set the ItemMeta?
     
  9. it is setting the item meta
     
  10. Where is this used?
     
  11. Code (Text):
    SwordsMeta.testsword.setItemMeta(tsim);
    in the SwordsMeta.class
     
  12. Nvm, got a fix !