Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.solegendary.ageofcraft.units;
- import com.solegendary.ageofcraft.units.goals.MoveToCursorBlockGoal;
- import net.minecraft.world.entity.EntityType;
- import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
- import net.minecraft.world.entity.ai.attributes.Attributes;
- import net.minecraft.world.entity.ai.goal.FloatGoal;
- import net.minecraft.world.entity.ai.goal.LookAtPlayerGoal;
- import net.minecraft.world.entity.ai.goal.RandomStrollGoal;
- import net.minecraft.world.entity.player.Player;
- import net.minecraft.world.level.Level;
- public class VillagerUnit extends Unit {
- public VillagerUnit(EntityType<? extends Unit> p_33002_, Level p_33003_) {
- super(p_33002_, p_33003_);
- }
- protected void registerGoals() {
- this.goalSelector.addGoal(1, new FloatGoal(this));
- this.goalSelector.addGoal(2, new LookAtPlayerGoal(this, Player.class, 8.0F));
- this.goalSelector.addGoal(3, new RandomStrollGoal(this, 1.0F));
- //this.goalSelector.addGoal(3, new MoveToCursorBlockGoal(this));
- }
- public static AttributeSupplier.Builder createAttributes() {
- return Unit.createUnitAttributes()
- .add(Attributes.MAX_HEALTH, 10.0D)
- .add(Attributes.MOVEMENT_SPEED, (double)0.25F);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment