The Meaning of Life, the Universe, and Everything.
Join Date:
8/5/2015
Posts:
42
Member Details
Hey guys its me GoldenThugPig here and I have a problem.For some reason with my mob that I'm making it won't do its tasks.The tasks I set it to was for it to swim,attack on collide,and attack leap but it won't do them.Here is the coding for the mob below.
public EntityApeMob(World par1World) {
super(par1World);
this.setSize(0.7f, 0.4f);
this.getNavigator().setAvoidsWater(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAILeapAtTarget(this, 0.4F));
this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0D, true));
this.tasks.addTask(3, new EntityAIWander(this, 1.0D));
this.tasks.addTask(4, new EntityAILookIdle(this));
}
/**
* Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
* par2 - Level of Looting used to kill this mob.
*/
protected void Item(boolean p_70628_1_, int p_70628_2_)
{
int j = this.rand.nextInt(3) + this.rand.nextInt(1 + p_70628_2_);
int k;
for (k = 0; k < j; ++k)
{
this.dropItem(MItems.aBlood, 1); }
}
public EntityAgeable createChild(EntityAgeable p_90011_1_) {
return null;
}
Hey guys its me GoldenThugPig here and I have a problem.For some reason with my mob that I'm making it won't do its tasks.The tasks I set it to was for it to swim,attack on collide,and attack leap but it won't do them.Here is the coding for the mob below.
public EntityApeMob(World par1World) {
super(par1World);
this.setSize(0.7f, 0.4f);
this.getNavigator().setAvoidsWater(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAILeapAtTarget(this, 0.4F));
this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0D, true));
this.tasks.addTask(3, new EntityAIWander(this, 1.0D));
this.tasks.addTask(4, new EntityAILookIdle(this));
}
/**
* Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
* par2 - Level of Looting used to kill this mob.
*/
protected void Item(boolean p_70628_1_, int p_70628_2_)
{
int j = this.rand.nextInt(3) + this.rand.nextInt(1 + p_70628_2_);
int k;
for (k = 0; k < j; ++k)
{
this.dropItem(MItems.aBlood, 1); }
}
public EntityAgeable createChild(EntityAgeable p_90011_1_) {
return null;
}
}
EntityAnimal's don't attack. Use EntityMob instead.
Hey guys its me GoldenThugPig here and I have a problem.For some reason with my mob that I'm making it won't do its tasks.The tasks I set it to was for it to swim,attack on collide,and attack leap but it won't do them.Here is the coding for the mob below.
package com.ninjapiggaming.mob;
import com.ninjapiggaming.item.MItems;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
import net.minecraft.entity.ai.EntityAILeapAtTarget;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.world.World;
public class EntityApeMob extends EntityAnimal{
public EntityApeMob(World par1World) {
super(par1World);
this.setSize(0.7f, 0.4f);
this.getNavigator().setAvoidsWater(true);
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAILeapAtTarget(this, 0.4F));
this.tasks.addTask(2, new EntityAIAttackOnCollide(this, 1.0D, true));
this.tasks.addTask(3, new EntityAIWander(this, 1.0D));
this.tasks.addTask(4, new EntityAILookIdle(this));
}
public boolean isAIEnabled(){
return true;
}
protected void applyEntityAttributes(){
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(4.0f);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.25D);
}
protected Item getDropItem()
{
return MItems.aBlood;
}
/**
* Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
* par2 - Level of Looting used to kill this mob.
*/
protected void Item(boolean p_70628_1_, int p_70628_2_)
{
int j = this.rand.nextInt(3) + this.rand.nextInt(1 + p_70628_2_);
int k;
for (k = 0; k < j; ++k)
{
this.dropItem(MItems.aBlood, 1); }
}
public EntityAgeable createChild(EntityAgeable p_90011_1_) {
return null;
}
}
EntityAnimal's don't attack. Use EntityMob instead.