Immune to Fire
MC Modding :: Modding :: Multiplayer Modding :: Requests
Page 1 of 1
Immune to Fire
Hey everyone! It's nice to be here. I wanted to say hi in an official place, but I guess there is no section for hello's. Oh well. I have recently started modding, and these tutorials have helped so much! Especially the armor one. I have a question about armor abilities, I want to make the player immune to fire when he wears the chest piece, and it works great in single player, but when I turn it into a server mod, it doesn't work. My code is as follows:
Also, in this manner, the person is no longer immune to fire when he takes off the chest, unlike in the original tutorial I saw on here where the player would remain on fire even after removing everything. The problem is of course that it doesn't transfer to multiplayer, like the rest of my armor pieces. I was wondering if anyone could help me out with that. I would greatly appreciate it!
- Spoiler:
- Code:
package net.minecraft.src;
import java.util.Random;
import net.minecraft.client.Minecraft;
public class mod_FireProofChest extends BaseMod
{
public String Version()
{
return "Mod";
}
public mod_FireProofChest()
{
ModLoader.SetInGameHook(this, true, false);
}
public boolean OnTickInGame(Minecraft minecraft)
{
minecraft.thePlayer.isImmuneToFire = false;
ItemStack chest = null;
chest = minecraft.thePlayer.inventory.armorInventory[2];
if(chest == null)
{
return true;
}
if(chest.itemID == mod_Mod.Chest.shiftedIndex)
{
minecraft.thePlayer.isImmuneToFire = true;
}
return true;
}
}
Also, in this manner, the person is no longer immune to fire when he takes off the chest, unlike in the original tutorial I saw on here where the player would remain on fire even after removing everything. The problem is of course that it doesn't transfer to multiplayer, like the rest of my armor pieces. I was wondering if anyone could help me out with that. I would greatly appreciate it!
Krozjin- Member
- Posts : 4
Join date : 2011-11-10
MC Modding :: Modding :: Multiplayer Modding :: Requests
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum