However, I am at a loss for making code that will do the thing that I was thinking of doing with the food exhaustion limit when I added it. That thing is making each piece of leather armor add 1F to the player's foodExhaustionLimit as long as it is equipped. This would mean that the more leather armor you have on, the longer it takes for you to get hungry.
public boolean OnTickInGame(Minecraft minecraft)
{
ItemStack boots = minecraft.thePlayer.inventory.armorInventory[0];
ItemStack legs = minecraft.thePlayer.inventory.armorInventory[1];
ItemStack chest = minecraft.thePlayer.inventory.armorInventory[2];
ItemStack helm = minecraft.thePlayer.inventory.armorInventory[3];
if(helm != null && helm.itemID == helmetLeather.shiftedIndex)
{
minecraft.thePlayer.isImmuneToFire = true;
}
if(chest != null && chest.itemID == plateLeather.shiftedIndex)
{
minecraft.thePlayer.isImmuneToFire = true;
}
if(legs != null && legs.itemID == legsLeather.shiftedIndex)
{
minecraft.thePlayer.isImmuneToFire = true;
}
if(boots != null && boots.itemID == bootsLeather.shiftedIndex)
{
minecraft.thePlayer.isImmuneToFire = true;
}
return true;
}
Here is some code that I am starting out with and for a start I want to make sure that I am able to give leather armor an effect at all, specifically immunity to fire for purposes of testing. However, it won't recognize the leather armor, how do I get it to recognize the leather armor? It won't go into italics and it keeps saying "bootsLeather cannot be resolved to a variable" for each of the equipment respectively.














