@Mod(modid = TotemMod.MODID, name = TotemMod.NAME, version = TotemMod.VERSION)
public class TotemMod {
public static final String
MODID = "totem",
NAME = "Totem Mod",
VERSION = "0.5";
@Mod.Instance(MODID)
public static TotemMod instance;
public static final SimpleNetworkWrapper network = NetworkRegistry.INSTANCE.newSimpleChannel(MODID);
public static Item
my_totem1,
my_totem2,
my_totem3,
my_totem4,
my_totem5
;
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
network.registerMessage(EntityStatusMessage.Handler.class, EntityStatusMessage.class, 0, Side.CLIENT);
network.registerMessage(EntityStatusMessage.Handler.class, EntityStatusMessage.class, 0, Side.SERVER);
my_totem1 = new ItemMyTotem() {
{setRegistryName(MODID, "my_totem1").setUnlocalizedName("my_totem1").setCreativeTab(CreativeTabs.MISC);}
public boolean doTotem(EntityPlayer player, ItemStack item) {
player.setHealth(1.0F);
player.clearActivePotions();
player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 900, 1));
player.addPotionEffect(new PotionEffect(MobEffects.ABSORPTION, 100, 1));
return true;
}
};
ForgeRegistries.ITEMS.register(my_totem1);
my_totem2 = new ItemMyTotem() {
{setRegistryName(MODID, "my_totem2").setUnlocalizedName("my_totem2").setCreativeTab(CreativeTabs.MISC);}
public boolean doTotem(EntityPlayer player, ItemStack item) {
player.setHealth(0.5F);
player.clearActivePotions();
player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 500, 1));
player.addPotionEffect(new PotionEffect(MobEffects.ABSORPTION, 40, 1));
return true;
}
};
ForgeRegistries.ITEMS.register(my_totem2);
my_totem3 = new ItemMyTotem() {
{setRegistryName(MODID, "my_totem3").setUnlocalizedName("my_totem3").setCreativeTab(CreativeTabs.MISC);}
public boolean doTotem(EntityPlayer player, ItemStack item) {
player.setHealth(1.5F);
player.clearActivePotions();
player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 900, 1));
player.addPotionEffect(new PotionEffect(MobEffects.ABSORPTION, 140, 1));
return true;
}
};
ForgeRegistries.ITEMS.register(my_totem3);
my_totem4 = new ItemMyTotem() {
{setRegistryName(MODID, "my_totem4").setUnlocalizedName("my_totem4").setCreativeTab(CreativeTabs.MISC);}
public boolean doTotem(EntityPlayer player, ItemStack item) {
player.setHealth(2.0F);
player.clearActivePotions();
player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 1000, 1));
player.addPotionEffect(new PotionEffect(MobEffects.ABSORPTION, 200, 1));
return true;
}
};
ForgeRegistries.ITEMS.register(my_totem4);
my_totem5 = new ItemMyTotem() {
{setRegistryName(MODID, "my_totem5").setUnlocalizedName("my_totem5").setCreativeTab(CreativeTabs.MISC);}
public boolean doTotem(EntityPlayer player, ItemStack item) {
player.setHealth(5.0F);
player.clearActivePotions();
player.addPotionEffect(new PotionEffect(MobEffects.REGENERATION, 500, 1));
player.addPotionEffect(new PotionEffect(MobEffects.ABSORPTION, 200, 1));
return true;
}
};
ForgeRegistries.ITEMS.register(my_totem5);
MinecraftForge.EVENT_BUS.register(new EventsForge());
}
}