Hi, I'm attempting to make an armor hotswap mod where if the player right clicks a piece of armor it will replace the armor they currently have on with it. (For example, right clicking diamond boots to replace leather boots that are currently equipped)
I found a thread which talks about how to do this in 1.13+, but I want to achieve this in 1.8.9. The answer there was use
Minecraft.getInstance().player.inventory.armorInventory.set(armorIndex, itemStack);
But in forge 1.8.9 the closest I can get is this:
Minecraft.getMinecraft().thePlayer.inventory.armorInventory
Which is just an ArmorStack array. How do I change the armor? Will simply updating the array do the trick?
Thanks,
- Tral1s (First time modder, 3d year programmer)