Killer_7968

EntityClass

Jan 28th, 2022
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. package com.Killer.killersblocksnstuff.entity.customEntities;
  2.  
  3. import net.minecraft.block.*;
  4. import net.minecraft.entity.*;
  5. import net.minecraft.entity.ai.attributes.*;
  6. import net.minecraft.entity.ai.goal.*;
  7. import net.minecraft.entity.merchant.villager.*;
  8. import net.minecraft.entity.monster.*;
  9. import net.minecraft.entity.passive.*;
  10. import net.minecraft.entity.player.*;
  11. import net.minecraft.util.*;
  12. import net.minecraft.util.math.*;
  13. import net.minecraft.world.*;
  14. import net.minecraftforge.api.distmarker.*;
  15. import net.minecraftforge.fml.common.*;
  16.  
  17. @Mod.EventBusSubscriber(modid = "kbns", bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT)
  18. public class MiniBossEntity extends ZombieEntity {
  19. public MiniBossEntity(EntityType<? extends ZombieEntity> type, World worldIn) {
  20. super(type, worldIn);
  21. }
  22.  
  23. public static AttributeModifierMap.MutableAttribute registerAttributes() {
  24. return MonsterEntity.createMobAttributes()
  25. .add(Attributes.MAX_HEALTH, 20.0D)
  26. .add(Attributes.MOVEMENT_SPEED, 0.33D)
  27. .add(Attributes.ATTACK_DAMAGE, 13.0D)
  28. .add(Attributes.FOLLOW_RANGE, 50.0D)
  29. .add(Attributes.SPAWN_REINFORCEMENTS_CHANCE);
  30. }
  31.  
  32. @Override
  33. protected void registerGoals() {
  34. super.registerGoals();
  35. this.goalSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, PlayerEntity.class, true));
  36. this.goalSelector.addGoal(2, new ZombieAttackGoal(this, 1.0D, false));
  37. this.goalSelector.addGoal(7, new WaterAvoidingRandomWalkingGoal(this, 1.0D));
  38. this.targetSelector.addGoal(2, new NearestAttackableTargetGoal<>(this, PlayerEntity.class, true));
  39. this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, AbstractVillagerEntity.class, false));
  40. this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, IronGolemEntity.class, true));
  41. }
  42.  
  43. @Override
  44. protected int getExperienceReward(PlayerEntity player) {
  45. return 3;
  46. }
  47.  
  48. @Override
  49. protected SoundEvent getAmbientSound() {
  50. return SoundEvents.HOGLIN_AMBIENT;
  51. }
  52.  
  53.  
  54. @Override
  55. protected SoundEvent getDeathSound() {
  56. return SoundEvents.HOGLIN_DEATH;
  57. }
  58.  
  59. @Override
  60. protected SoundEvent getHurtSound(DamageSource damageSourceIn) {
  61. return SoundEvents.IRON_GOLEM_HURT;
  62. }
  63.  
  64. @Override
  65. protected void playStepSound(BlockPos pos, BlockState blockIn) {
  66. this.playSound(SoundEvents.HOGLIN_STEP, 0.20F, 0.5F);
  67. }
  68.  
  69. }
  70.  
Advertisement
Add Comment
Please, Sign In to add comment