Guest User

Untitled

a guest
Jul 29th, 2020
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. public class ChrysoEntity extends AnimalEntity {
  2.  
  3. public static final Ingredient TEMPT_ITEMS = Ingredient.fromItems(
  4. ItemRegistry.PURIFIED_POISON_APPLE.get());
  5.  
  6. public ChrysoEntity(EntityType<? extends AnimalEntity> type, World worldIn) {
  7. super(type, worldIn);
  8. }
  9.  
  10. //func = registerAttributes
  11. public static AttributeModifierMap.MutableAttribute setCustomAttributes(){
  12. return MobEntity.func_233666_p_()
  13. .createMutableAttribute(Attributes.MAX_HEALTH, 20D)
  14. .createMutableAttribute(Attributes.MOVEMENT_SPEED, 1.25D)
  15. .createMutableAttribute(Attributes.ARMOR, 20D);
  16. }
  17. //Goals
  18. @Override
  19. protected void registerGoals() {
  20. super.registerGoals();
  21. this.goalSelector.addGoal(0, new SwimGoal(this));
  22. this.goalSelector.addGoal(1, new FollowParentGoal(this,1.25D));
  23. this.goalSelector.addGoal(2, new PanicGoal(this, 1.25D));
  24. this.goalSelector.addGoal(3, new RandomWalkingGoal(this, 1.25D, 75));
  25. this.goalSelector.addGoal(4, new LookRandomlyGoal(this));
  26. this.goalSelector.addGoal(5, new BreedGoal(this, 1.25D));
  27. this.goalSelector.addGoal(6, new TemptGoal(this, 1.25D, TEMPT_ITEMS, false));
  28. this.goalSelector.addGoal(7, new LookAtGoal(this, PlayerEntity.class, 4.0f));
  29. }
  30.  
  31. @Override
  32. protected int getExperiencePoints(PlayerEntity player) {
  33. return 1 + this.world.rand.nextInt(15);
  34. }
  35.  
  36. @Override
  37. protected SoundEvent getAmbientSound() {
  38. return SoundEvents.ENTITY_SHEEP_AMBIENT;
  39. }
  40.  
  41. @Override
  42. protected SoundEvent getDeathSound() {
  43. return SoundEvents.ENTITY_SHEEP_DEATH;
  44. }
  45.  
  46. @Override
  47. protected SoundEvent getHurtSound(DamageSource damageSourceIn) {
  48. return SoundEvents.ENTITY_SHEEP_HURT;
  49. }
  50.  
  51. @Override
  52. protected void playStepSound(BlockPos pos, BlockState blockIn) {
  53. this.playSound(SoundEvents.ENTITY_SHEEP_STEP, 0.2f, 0.85f);
  54. }
  55.  
  56. @Override
  57. public AgeableEntity createChild(AgeableEntity ageable) {
  58. return EntityRegistry.CHRYSO.get().create(world);
  59. }
  60. }
  61.  
Advertisement
Add Comment
Please, Sign In to add comment