Advertisement
ButterAleks

EntityPoacher

Mar 31st, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. package com.afm.AfmMod.entity;
  2.  
  3. import net.minecraft.entity.SharedMonsterAttributes;
  4. import net.minecraft.entity.ai.EntityAILeapAtTarget;
  5. import net.minecraft.entity.ai.EntityAILookIdle;
  6. import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
  7. import net.minecraft.entity.ai.EntityAISwimming;
  8. import net.minecraft.entity.ai.EntityAIWanderAvoidWater;
  9. import net.minecraft.entity.ai.EntityAIWatchClosest;
  10. import net.minecraft.entity.monster.EntityMob;
  11. import net.minecraft.entity.player.EntityPlayer;
  12. import net.minecraft.nbt.NBTTagCompound;
  13. import net.minecraft.util.DamageSource;
  14. import net.minecraft.util.ResourceLocation;
  15. import net.minecraft.util.SoundEvent;
  16. import net.minecraft.world.World;
  17.  
  18. public class EntityPoacher extends EntityMob
  19. {
  20. public EntityPoacher(World worldIn)
  21. {
  22. super(worldIn);
  23. this.setSize(0.6F, 1.95F);
  24. }
  25.  
  26.  
  27. public void writeEntityToNBT(NBTTagCompound compound)
  28. {
  29. super.writeEntityToNBT(compound);
  30. }
  31.  
  32. public void readEntityFromNBT(NBTTagCompound compound)
  33. {
  34. super.readEntityFromNBT(compound);
  35. }
  36.  
  37.  
  38. @Override
  39. protected void initEntityAI()
  40. {
  41. this.tasks.addTask(0, new EntityAISwimming(this));
  42. this.tasks.addTask(7, new EntityAILeapAtTarget(this, 0.3F));
  43. this.tasks.addTask(9, new EntityAILookIdle(this));
  44. this.tasks.addTask(10, new EntityAIWanderAvoidWater(this, 0.8D, 1.0000001E-5F));
  45. this.tasks.addTask(11, new EntityAIWatchClosest(this, EntityPlayer.class, 10.0F));
  46. this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityMonkey.class, true));
  47. this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
  48. }
  49.  
  50. public void entityInit()
  51. {
  52. super.entityInit();
  53. }
  54. protected boolean canDespawn()
  55. {
  56. return true;
  57. }
  58.  
  59. @Override
  60. protected void applyEntityAttributes()
  61. {
  62. super.applyEntityAttributes();
  63. this.getEntityAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(10.0D);
  64. this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(5.0D);
  65. }
  66.  
  67. @Override
  68. protected ResourceLocation getLootTable()
  69. {
  70. return null;
  71. }
  72.  
  73.  
  74. protected SoundEvent getAmbientSound()
  75. {
  76. return null;
  77. }
  78.  
  79. @Override
  80. protected SoundEvent getHurtSound(DamageSource source)
  81. {
  82. return null;
  83. }
  84.  
  85. @Override
  86. protected SoundEvent getDeathSound()
  87. {
  88. return null;
  89. }
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement