Guest User

Untitled

a guest
Aug 18th, 2019
69
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ```package shmoe6.s58.entity;
  2.  
  3. import java.util.Random;
  4.  
  5. import org.apache.http.impl.NoConnectionReuseStrategy;
  6.  
  7. import net.minecraft.entity.EntityAgeable;
  8. import net.minecraft.entity.SharedMonsterAttributes;
  9. import net.minecraft.entity.ai.attributes.IAttributeInstance;
  10. import net.minecraft.entity.monster.EntityPigZombie;
  11. import net.minecraft.entity.player.EntityPlayer;
  12. import net.minecraft.init.SoundEvents;
  13. import net.minecraft.network.datasync.EntityDataManager;
  14. import net.minecraft.util.DamageSource;
  15. import net.minecraft.util.SoundEvent;
  16. import net.minecraft.util.math.MathHelper;
  17. import net.minecraft.world.World;
  18. import shmoe6.s58.util.handlers.SoundsHandler;
  19. public class EntitySCP035 extends EntityPigZombie
  20. {
  21. private int randomSoundDelay;
  22.  
  23. public EntitySCP035(World worldIn)
  24. {
  25. super(worldIn);
  26. }
  27.  
  28. @Override
  29. protected void initEntityAI()
  30. {
  31. super.initEntityAI();
  32. }
  33.  
  34. @Override
  35. protected void applyEntityAttributes()
  36. {
  37. super.applyEntityAttributes();
  38. this.getEntityAttribute(SPAWN_REINFORCEMENTS_CHANCE).setBaseValue(0.0D);
  39. this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25000000417232513D);
  40. this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(7.5D);
  41. }
  42.  
  43. @Override
  44. protected void updateAITasks()
  45. {
  46. if (this.randomSoundDelay > 0 && --this.randomSoundDelay == 0)
  47. {
  48. this.playSound(SoundsHandler.HURT035, this.getSoundVolume() * 0F, ((this.rand.nextFloat() - this.rand.nextFloat()) * 0F + 0F) * 0F);
  49. }
  50. super.updateAITasks();
  51. }
  52.  
  53. /* @Override
  54. public EntityPigZombie createChild(EntityAgeable ageable)
  55. {
  56. return new EntitySCP035(world);
  57. } */
  58.  
  59. @Override
  60. protected SoundEvent getAmbientSound()
  61. {
  62. return null;
  63. }
  64.  
  65. @Override
  66. protected SoundEvent getHurtSound(DamageSource source)
  67. {
  68. int rand035hurt = new Random().nextInt(2);
  69.  
  70. if(rand035hurt == 0)
  71. {
  72. return SoundsHandler.HURT035;
  73. }
  74.  
  75. else if(rand035hurt == 1)
  76. {
  77. return SoundsHandler.COUGH035;
  78. }
  79. return null;
  80.  
  81. }
  82.  
  83. @Override
  84. protected SoundEvent getDeathSound()
  85. {
  86. int rand035hurt = new Random().nextInt(2);
  87.  
  88. if(rand035hurt == 0)
  89. {
  90. return SoundsHandler.HURT035;
  91. }
  92.  
  93. else if(rand035hurt == 1)
  94. {
  95. return SoundsHandler.COUGH035;
  96. }
  97. return null;
  98. }
  99. }```
RAW Paste Data