Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ChrysoEntity extends AnimalEntity {
- public static final Ingredient TEMPT_ITEMS = Ingredient.fromItems(
- ItemRegistry.PURIFIED_POISON_APPLE.get());
- public ChrysoEntity(EntityType<? extends AnimalEntity> type, World worldIn) {
- super(type, worldIn);
- }
- //func = registerAttributes
- public static AttributeModifierMap.MutableAttribute setCustomAttributes(){
- return MobEntity.func_233666_p_()
- .createMutableAttribute(Attributes.MAX_HEALTH, 20D)
- .createMutableAttribute(Attributes.MOVEMENT_SPEED, 1.25D)
- .createMutableAttribute(Attributes.ARMOR, 20D);
- }
- //Goals
- @Override
- protected void registerGoals() {
- super.registerGoals();
- this.goalSelector.addGoal(0, new SwimGoal(this));
- this.goalSelector.addGoal(1, new FollowParentGoal(this,1.25D));
- this.goalSelector.addGoal(2, new PanicGoal(this, 1.25D));
- this.goalSelector.addGoal(3, new RandomWalkingGoal(this, 1.25D, 75));
- this.goalSelector.addGoal(4, new LookRandomlyGoal(this));
- this.goalSelector.addGoal(5, new BreedGoal(this, 1.25D));
- this.goalSelector.addGoal(6, new TemptGoal(this, 1.25D, TEMPT_ITEMS, false));
- this.goalSelector.addGoal(7, new LookAtGoal(this, PlayerEntity.class, 4.0f));
- }
- @Override
- protected int getExperiencePoints(PlayerEntity player) {
- return 1 + this.world.rand.nextInt(15);
- }
- @Override
- protected SoundEvent getAmbientSound() {
- return SoundEvents.ENTITY_SHEEP_AMBIENT;
- }
- @Override
- protected SoundEvent getDeathSound() {
- return SoundEvents.ENTITY_SHEEP_DEATH;
- }
- @Override
- protected SoundEvent getHurtSound(DamageSource damageSourceIn) {
- return SoundEvents.ENTITY_SHEEP_HURT;
- }
- @Override
- protected void playStepSound(BlockPos pos, BlockState blockIn) {
- this.playSound(SoundEvents.ENTITY_SHEEP_STEP, 0.2f, 0.85f);
- }
- @Override
- public AgeableEntity createChild(AgeableEntity ageable) {
- return EntityRegistry.CHRYSO.get().create(world);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment