Here is the code
package com.opitems.mob;
import com.opitems.main.ArmorRegistry;
import com.opitems.main.ItemRegistry;
import com.opitems.main.ToolRegistry;
import com.sun.javafx.scene.text.HitInfo;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIMoveThroughVillage;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.boss.IBossDisplayData;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeModContainer;
public class opWarriorBoss extends EntityMob{
public opWarriorBoss(World world) {
super(world);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(6, new EntityAIMoveThroughVillage(this, 1.0D, false));
}
public static double damage = 160.0;
public void changeDamage(){
if(damage < 300.0D && hitByEntity(getLastAttacker())){
damage++;
}
}
protected void applyEntityAttributes(){
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(3000.0D);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D);
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(damage);
this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(64.0D);
this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(0.5D);
}
protected void dropFewItems(boolean p_70628_1_, int p_70628_2_)
{
switch(this.rand.nextInt(3)){
case 0:
this.dropItem(ToolRegistry.opSword, 1);
break;
case 1:
this.dropItem(ToolRegistry.opSword2, 1);
break;
case 2:
this.dropItem(ToolRegistry.opSword2, 1);
}
}
protected void dropRareDrop(int p_70600_1_)
{
switch (this.rand.nextInt(3))
{
case 0:
this.dropItem(Items.nether_star, 5);
break;
case 1:
this.dropItem(ArmorRegistry.opChestplate, 1);
break;
case 2:
this.dropItem(ItemRegistry.opGem, 10);
}
}
protected void addRandomArmor()
{
super.addRandomArmor();
if (this.rand.nextFloat() < (this.worldObj.difficultySetting == EnumDifficulty.HARD ? 0.05F : 0.01F))
{
int i = this.rand.nextInt(3);
if (i == 0)
{
this.setCurrentItemOrArmor(0, new ItemStack(ToolRegistry.opSword));
}
else
{
this.setCurrentItemOrArmor(0, new ItemStack(ToolRegistry.opShovel));
}
}
}
}