for (int i = 0; i < stacks.length; ++i) {
if (stacks[i] == null) continue;
ByteTag count = new ByteTag("Count", (byte) stacks[i].getAmount());
ByteTag slot = new ByteTag("Slot", (byte) i);
ShortTag damage = new ShortTag("Damage", stacks[i].getDurability());
ShortTag id = new ShortTag("id", (short) stacks[i].getTypeId());
HashMap<String, Tag> tagMap = new HashMap<String, Tag>();
tagMap.put("Count", count);
tagMap.put("Slot", slot);
tagMap.put("Damage", damage);