Posted April 12, 20169 yr I made my custom inventory GUI (extends GuiContainer). It uses mainInventory, but how can I access armorInventory? As I know Slot constructor takes an IInventory, slot index and position in pixels, but armorInventory is an ItemStack[].
April 12, 20169 yr https://github.com/MinecraftForge/MinecraftForge/tree/1.9/src/main/java/net/minecraftforge/items I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
April 13, 20169 yr yoo need to ItemStack inv[] = playerIn.inventory.armorInventory // #########################################################################3 public static ItemStack[] leerInventarioEntidad(Entity ent) { ItemStack inv[] = null; if (ent instanceof EntityPlayer) { EntityPlayer playerIn = (EntityPlayer) ent; // ItemStack dinv[] = playerIn.inventory.mainInventory; ItemStack dinv[] = ArrayUtils.addAll(playerIn.inventory.mainInventory, playerIn.inventory.armorInventory); dinv = ArrayUtils.addAll(dinv, playerIn.inventory.offHandInventory); for (int i = 36; i < 40; i++) { if (dinv[i] == null) { dinv[i] = new ItemStack(MMMateriales.materialesdummyNulo, 1, 0); } } return dinv; } return inv; }
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.