Код:
package com.alchemy.alchemy;
import net.minecraft.entity.EnumCreatureAttribute;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.*;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.monster.EntitySkeleton;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.world.World;
public class HellHound extends EntityMob //implements IBossDisplayData, IRangedAttackMob
{
World world;
boolean spawn = true;
float speed;
public HellHound(World par1World)
{
super(par1World);
this.setHealth(this.getMaxHealth());
this.isImmuneToFire = true;
this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, speed, false));
this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, speed));
this.tasks.addTask(6, new EntityAIWander(this, speed));
this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(7, new EntityAILookIdle(this));
this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));
this.experienceValue = 100;
}
@Override
public void onUpdate()
{
speed = this.getMaxHealth() - this.getHealth() + 0.25F;
int rand = worldObj.rand.nextInt(75);
if (rand == 0 && spawn)
{
if (!this.worldObj.isRemote)
{
}
}
super.onUpdate();
}
protected boolean isAIEnabled()
{
return true;
}
public EnumCreatureAttribute getCreatureAttribute()
{
return EnumCreatureAttribute.UNDEFINED;
}
@Override
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(2.0F);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(35.0F);
}
/*
protected void dropFewItems(boolean p_70628_1_, int p_70628_2_)
{
int j = this.rand.nextInt(2 + p_70628_2_);
int k;
int i = this.rand.nextInt(2);
for (k = 0; k < j; ++k)
{
this.dropItem(Items.bone, 1);
}
this.dropItem(AlchemyBase.EnchantedSkull, 1);
if (i == 0)
{
this.dropItem(AlchemyBase.DeadStaff, 1);
}
if (i == 1)
{
this.dropItem(AlchemyBase.Cylinder, 1);
}
}
*/
protected String getLivingSound()
{
return "mob.wither.idle";
}
protected String getHurtSound()
{
return "mob.wither.hurt";
}
protected String getDeathSound()
{
return "mob.wither.death";
}
}
Код:
package com.alchemy.alchemy;
import net.minecraft.client.model.ModelWolf;
import net.minecraft.client.renderer.entity.RenderWolf;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
public class HellHoundRender extends RenderWolf
{
private static final ResourceLocation textureLocation = new ResourceLocation(AlchemyBase.MODID + ":textures/model/mob/hell_hound.png");
public HellHoundRender(ModelWolf model, float shadowSize)
{
super(model, model, shadowSize);
}
@Override
protected ResourceLocation getEntityTexture(Entity par1Entity)
{
return textureLocation;
}
}
[merge_posts_bbcode]Добавлено: 29.03.2016 22:32:18[/merge_posts_bbcode]
1 - моб-собака (звуки сменю, да, и дроп тоже)
2 - рендер
Итак, знатоки. У моба в игре нет текстуры, он просто прозрачный