LoudPacks Posted August 9, 2016 Share Posted August 9, 2016 (edited) private List<String> getOthersEquipment(Player p) { List<String> equipmentList = new LinkedList<String>(); if(p != null) { int[] equipment = p.getDefinition().getAppearance(); for (int i = 0; i < equipment.length; i++) { if (equipment[i] - 512 > 0) equipmentList.add(ItemDefinition.forId(equipment[i] - 512).getName()); } } return equipmentList; } Note: int[] equipment = p.getDefinition().getAppearance(); Index Order: [0] = helmet [1] = cape [2] = necklace [3] = weapon [4] = chest [5] = shield [7] = legs [9] = gloves [10] = boots - Can only grab visible items (no ring or ammo, etc.) - Each value from getAppearance() needs to have 512 subtracted from it in order to get the item id Or if you want it so you can grab specific pieces: private HashMap<EquipmentSlot, String> getOthersEquipment(Player p) { HashMap<EquipmentSlot, String> equipmentList = new HashMap<EquipmentSlot, String>(); if (p != null) { int[] equipment = p.getDefinition().getAppearance(); for (int i = 0; i < equipment.length; i++) { if(equipment[i] - 512 > 0){ switch(i){ case 0: equipmentList.put(EquipmentSlot.HAT, ItemDefinition.forId(equipment[i] - 512).getName()); break; case 1: equipmentList.put(EquipmentSlot.CAPE, ItemDefinition.forId(equipment[i] - 512).getName()); break; case 2: equipmentList.put(EquipmentSlot.AMULET, ItemDefinition.forId(equipment[i] - 512).getName()); break; case 3: equipmentList.put(EquipmentSlot.WEAPON, ItemDefinition.forId(equipment[i] - 512).getName()); break; case 4: equipmentList.put(EquipmentSlot.CHEST, ItemDefinition.forId(equipment[i] - 512).getName()); break; case 5: equipmentList.put(EquipmentSlot.SHIELD, ItemDefinition.forId(equipment[i] - 512).getName()); break; case 7: equipmentList.put(EquipmentSlot.LEGS, ItemDefinition.forId(equipment[i] - 512).getName()); break; case 9: equipmentList.put(EquipmentSlot.HANDS, ItemDefinition.forId(equipment[i] - 512).getName()); break; case 10: equipmentList.put(EquipmentSlot.FEET, ItemDefinition.forId(equipment[i] - 512).getName()); break; } } } } return equipmentList; } Edited August 18, 2016 by LoudPacks 19 Quote Link to comment Share on other sites More sharing options...
Chris Posted August 9, 2016 Share Posted August 9, 2016 god damn. god bless loudpacks Quote Link to comment Share on other sites More sharing options...
qverkk Posted August 10, 2016 Share Posted August 10, 2016 wow this is a good one Quote Link to comment Share on other sites More sharing options...
Prolax Posted August 15, 2016 Share Posted August 15, 2016 When is this useful? Quote Link to comment Share on other sites More sharing options...
Dog_ Posted August 15, 2016 Share Posted August 15, 2016 When is this useful? when you need to access another players equipment 5 Quote Link to comment Share on other sites More sharing options...
LoudPacks Posted August 15, 2016 Author Share Posted August 15, 2016 When is this useful? When you want to tele away from scary people trying to kill you with equipment 1 Quote Link to comment Share on other sites More sharing options...
GaetanoH Posted August 17, 2016 Share Posted August 17, 2016 Holy shit nice dude! Quote Link to comment Share on other sites More sharing options...
darkxor Posted May 15, 2017 Share Posted May 15, 2017 Thank you helped alot! Quote Link to comment Share on other sites More sharing options...