public class EntityRealisticZombie extends EntityMob{
public EntityRealisticZombie(World worldIn) {
super(worldIn);
this.tasks.addTask(0, new EntityAISwimming(this));
this.targetTasks.addTask(0, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
this.tasks.addTask(6, new EntityAIMoveThroughVillage(this, 0.5D, false));
this.tasks.addTask(2, new EntityAIAttackMelee(this, 0.6D, true));
this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityWolf.class, 50.0F, 1.0d, 1.0d));
this.tasks.addTask(0, new EntityAIWander(this, 1.0d));
this.tasks.addTask(4, new EntityAIBreakDoor(this));
this.experienceValue = 50;
}
Are you sure it's just not rendering the weapon? Add a printout to the entity update method to print whether or not there is an item in the main hand.
If you can't tell what I mean by this, you may be taking things too fast.
I'm asking how you KNOW the mob isn't holding the weapon: just by looking, or by actually getting the code to tell you what the mob is holding. Do the second one to confirm what is going on.
If you made this post simply because you did not see it holding a weapon, that can actually be caused by several things -- including failure to render held items in the render class.
Rollback Post to RevisionRollBack
Click this banner for a list of illegal mod distributors -- only download from legal sites!
hey, i want to make my zombie hold a weapon. but i doesn't hold it
here is my mob class
package com.realism.mod.entity;
import com.realism.mod.init.RMItems;
import com.realism.mod.init.Sounds;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIAttackMelee;
import net.minecraft.entity.ai.EntityAIAvoidEntity;
import net.minecraft.entity.ai.EntityAIBreakDoor;
import net.minecraft.entity.ai.EntityAIMoveThroughVillage;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntityIronGolem;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.entity.passive.EntityWolf;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.SoundEvent;
import net.minecraft.world.World;
public class EntityRealisticZombie extends EntityMob{
public EntityRealisticZombie(World worldIn) {
super(worldIn);
this.tasks.addTask(0, new EntityAISwimming(this));
this.targetTasks.addTask(0, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
this.tasks.addTask(6, new EntityAIMoveThroughVillage(this, 0.5D, false));
this.tasks.addTask(2, new EntityAIAttackMelee(this, 0.6D, true));
this.tasks.addTask(3, new EntityAIAvoidEntity(this, EntityWolf.class, 50.0F, 1.0d, 1.0d));
this.tasks.addTask(0, new EntityAIWander(this, 1.0d));
this.tasks.addTask(4, new EntityAIBreakDoor(this));
this.experienceValue = 50;
}
public boolean isAIEnabled(){
return true;
}
protected void applyEntityAttributes(){
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(3.0D);
this.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(32.0D);
this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(16.0D);
this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.5D);
}
protected void addRandomArmor(){
this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(RMItems.IronDoubleSidedBattleAxe));
}
protected Item getDropItem(){
return RMItems.Knife;
}
protected void dropRareDrop(int Item){
this.dropItem(RMItems.Plutonium, 2);
}
protected SoundEvent getAmbientSound(){
return Sounds.RealZombieAmbient;
}
protected SoundEvent getHurtSound(){
return SoundEvents.ENTITY_ZOMBIE_HURT;
}
protected SoundEvent getDeathSound(){
return SoundEvents.ENTITY_ZOMBIE_DEATH;
}
}
Are you sure it's just not rendering the weapon? Add a printout to the entity update method to print whether or not there is an item in the main hand.
what do you mean by that
If you can't tell what I mean by this, you may be taking things too fast.
I'm asking how you KNOW the mob isn't holding the weapon: just by looking, or by actually getting the code to tell you what the mob is holding. Do the second one to confirm what is going on.
If you made this post simply because you did not see it holding a weapon, that can actually be caused by several things -- including failure to render held items in the render class.