-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathModZombie.java
87 lines (73 loc) · 2.36 KB
/
ModZombie.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package com.zombiesurvival.mod;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EnumCreatureAttribute;
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
import net.minecraft.entity.ai.EntityAIBreakDoor;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
public class ModZombie extends EntityZombie
{
public ModZombie(World par1World)
{
super(par1World);
this.texture = "/mob/test1.png";
this.moveSpeed = 0.4F;
this.tasks.addTask(0, new EntityAISwimming(this));
this.tasks.addTask(1, new EntityAIBreakDoor(this));
this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, this.moveSpeed, false));
this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
this.tasks.addTask(4, new EntityAIWander(this, this.moveSpeed));
this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 16.0F, 0, true));
}
public int getAttackStrength(Entity par1Entity)
{
return 4;
}
protected boolean isAIEnabled()
{
return true;
}
public int getMaxHealth()
{
return mod_zombiesurvival.i;
}
public EnumCreatureAttribute getCreatureAttribute()
{
return EnumCreatureAttribute.UNDEAD;
}
public String getTexture()
{
return "/mob/test1.png";
}
public int getTotalArmorValue()
{
return 0;
}
protected String getLivingSound()
{
return "mob.zombie.say";
}
protected String getHurtSound()
{
return "mob.zombie.hurt";
}
protected String getDeathSound()
{
return "mob.zombie.death";
}
protected void playStepSound(int par1, int par2, int par3, int par4)
{
this.worldObj.playSoundAtEntity(this, "mob.zombie.step", 0.15F, 1.0F);
}
}