Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class EntityCutePet extends EntityTameable {
- public EntityCutePet (World par1World) {
- super(par1World);
- setSize(0.7F, 0.9F);
- this.tasks.addTask(1, new EntityAISwimming(this));
- this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true));
- this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
- this.tasks.addTask(7, new EntityAIWander(this, 0.3D));
- this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
- this.tasks.addTask(9, new EntityAILookIdle(this));
- this.tasks.addTask(1, new EntityAIMoveTowardsTarget(this, 0.3D, 32F));
- this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this));
- this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this));
- this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
- this.setTamed(false);
- }
- protected void applyEntityAttributes() {
- super.applyEntityAttributes();
- this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(6.0D);
- this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(32.0D);
- this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.5D);
- }
- public boolean isAIEnabled() {
- return true;
- }
- /**
- * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons
- * use this to react to sunlight and start to burn.
- */
- public void onLivingUpdate() {
- if (!this.onGround && this.motionY < 0.0D) {
- this.motionY *= 0.6D;
- }
- super.onLivingUpdate();
- }
- protected void fall(float p_70069_1_) {
- }
- public EntityCutePet createChild(EntityAgeable p_90011_1_) {
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment