Posted December 29, 20231 yr 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); } }
December 29, 20231 yr 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.
December 29, 20231 yr Author I don't think its an error with geckolib, i think its something to do with my code
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.