Guest User

Untitled

a guest
Oct 19th, 2014
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.85 KB | None | 0 0
  1. public class EntityCutePet extends EntityTameable {
  2.  
  3.     public EntityCutePet (World par1World) {
  4.         super(par1World);
  5.         setSize(0.7F, 0.9F);
  6.         this.tasks.addTask(1, new EntityAISwimming(this));
  7.         this.tasks.addTask(4, new EntityAIAttackOnCollide(this, 1.0D, true));
  8.         this.tasks.addTask(5, new EntityAIFollowOwner(this, 1.0D, 10.0F, 2.0F));
  9.         this.tasks.addTask(7, new EntityAIWander(this, 0.3D));
  10.         this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
  11.         this.tasks.addTask(9, new EntityAILookIdle(this));
  12.         this.tasks.addTask(1, new EntityAIMoveTowardsTarget(this, 0.3D, 32F));
  13.         this.targetTasks.addTask(1, new EntityAIOwnerHurtByTarget(this));
  14.         this.targetTasks.addTask(2, new EntityAIOwnerHurtTarget(this));
  15.         this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true));
  16.         this.setTamed(false);
  17.     }
  18.  
  19.     protected void applyEntityAttributes() {
  20.         super.applyEntityAttributes();
  21.         this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(6.0D);
  22.         this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(32.0D);
  23.         this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.5D);
  24.     }
  25.  
  26.     public boolean isAIEnabled() {
  27.         return true;
  28.     }
  29.  
  30.     /**
  31.      * Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons
  32.      * use this to react to sunlight and start to burn.
  33.      */
  34.     public void onLivingUpdate() {
  35.  
  36.         if (!this.onGround && this.motionY < 0.0D) {
  37.             this.motionY *= 0.6D;
  38.         }
  39.  
  40.         super.onLivingUpdate();
  41.     }
  42.  
  43.     protected void fall(float p_70069_1_) {
  44.     }
  45.  
  46.     public EntityCutePet createChild(EntityAgeable p_90011_1_) {
  47.         return null;
  48.     }
  49.  
  50. }
Advertisement
Add Comment
Please, Sign In to add comment