Jump to content

My entity will not move, and I have no idea why it isn't. It's an underwater entity btw.


Vulcandium

Recommended Posts

public class Tiamat extends WaterAnimal implements GeoEntity { private AnimatableInstanceCache cache = new SingletonAnimatableInstanceCache(this); public Tiamat(EntityType<? extends Tiamat> pEntityType, Level pLevel) { super(pEntityType, pLevel); this.moveControl = new SmoothSwimmingMoveControl(this, 85, 10, 0.03F, 0.1F, true); this.lookControl = new SmoothSwimmingLookControl(this, 10); } public static AttributeSupplier setAttributes() { return WaterAnimal.createMobAttributes() .add(Attributes.MAX_HEALTH,1) .add(Attributes.ATTACK_DAMAGE,3.0f) .add(Attributes.ATTACK_SPEED,1.0f) .add(Attributes.MOVEMENT_SPEED,5.0f) .add(Attributes.KNOCKBACK_RESISTANCE,2) .add(Attributes.ARMOR_TOUGHNESS,0.4).build(); } @Override protected void registerGoals() { this.goalSelector.addGoal(0, new TryFindWaterGoal(this)); this.goalSelector.addGoal(0, new RandomSwimmingGoal(this, 1.0, 10)); this.goalSelector.addGoal(2,new MeleeAttackGoal(this,1.20,false)); this.goalSelector.addGoal(4,new RandomLookAroundGoal(this)); this.targetSelector.addGoal(1,new NearestAttackableTargetGoal<>( this, Turtle.class,true)); this.targetSelector.addGoal(2,new NearestAttackableTargetGoal<>( this, Dolphin.class,true)); this.targetSelector.addGoal(3,new NearestAttackableTargetGoal<>( this, Player.class,true)); this.targetSelector.addGoal(4,new NearestAttackableTargetGoal<>( this, Tiamat.class,true)); this.targetSelector.addGoal(5,new NearestAttackableTargetGoal<>( this, TropicalFish.class,true)); this.targetSelector.addGoal(6,new NearestAttackableTargetGoal<>( this, Guardian.class,true)); super.registerGoals(); } public Tiamat getBreedOffspring(ServerLevel level, AgeableMob ageableMob) { return ModEntities.TIAMAT.get().create(level); } @Override public void registerControllers(AnimatableManager.ControllerRegistrar controllerRegistrar) { controllerRegistrar.add(new AnimationController<>(this,"controller",0,this::predicate)); } private <T extends GeoAnimatable> PlayState predicate(AnimationState<T> tAnimationState) { if (tAnimationState.isMoving()) { tAnimationState.getController().setAnimation(RawAnimation.begin().then("swimming.anim", Animation.LoopType.LOOP)); return PlayState.CONTINUE; } tAnimationState.getController().setAnimation(RawAnimation.begin().then("tongue.anim1", Animation.LoopType.PLAY_ONCE)); return PlayState.CONTINUE; } @Override public AnimatableInstanceCache getAnimatableInstanceCache() { return cache; } protected PathNavigation createNavigation(Level pLevel) { return new WaterBoundPathNavigation(this, pLevel); } }

Link to comment
Share on other sites

Quote

public class Tiamat extends WaterAnimal implements GeoEntity

Issues with GeckoLib should be directed to them.

Boilerplate:

If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one.

If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install

Large files should be posted to a file sharing site like https://gist.github.com  You should also read the support forum sticky post.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.