Geckolib Entity fails building

Started by TDO on

Topic category: Help with MCreator software

Last seen on 17:17, 16. Sep 2024
Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Geckolib Entity fails building

I created a custom Geckolib model with custom animations. but it causes the build to fail. heres the Build log :

> Task :compileJava 
C:\Users\onyxl\MCreatorWorkspaces\tdos_additional_features\src\main\java\net\mcreator\tdosadditionalfeatures\entity\PhoenixEntity.java:311: error: cannot find symbol 
            (entityType, world, reason, pos, random) -> (world.getBlockState(pos.below()).getMaterial() == Material.GRASS && world.getRawBrightness(pos, 0) > 8)); 
                                                                                         ^ 
  symbol:   method getMaterial() 
  location: class BlockState 
C:\Users\onyxl\MCreatorWorkspaces\tdos_additional_features\src\main\java\net\mcreator\tdosadditionalfeatures\entity\PhoenixEntity.java:311: error: cannot find symbol 
            (entityType, world, reason, pos, random) -> (world.getBlockState(pos.below()).getMaterial() == Material.GRASS && world.getRawBrightness(pos, 0) > 8)); 
                                                                                                                   ^ 
  symbol:   variable GRASS 
  location: class Material 
C:\Users\onyxl\MCreatorWorkspaces\tdos_additional_features\src\main\java\net\mcreator\tdosadditionalfeatures\entity\PhoenixEntity.java:329: error: cannot find symbol 
         if (!this.isOnGround()) { 
                  ^ 
  symbol: method isOnGround() 
C:\Users\onyxl\MCreatorWorkspaces\tdos_additional_features\src\main\java\net\mcreator\tdosadditionalfeatures\entity\PhoenixEntity.java:343: error: level has private access in Entity 
         this.lastSwing = level.getGameTime(); 
                          ^ 
C:\Users\onyxl\MCreatorWorkspaces\tdos_additional_features\src\main\java\net\mcreator\tdosadditionalfeatures\entity\PhoenixEntity.java:345: error: level has private access in Entity 
      if (this.swinging && this.lastSwing + 7L <= level.getGameTime()) {
Last seen on 16:12, 15. Oct 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Are you using the latest…
Sat, 11/11/2023 - 15:59

Are you using the latest snapshot version of Geckolib for 1.20? A lot of the calls it's using are outdated for some reason and don't work, meaning some animation types will cause build errors unless you manually lock and fix the elements.

I've seen some of these before; "this.isOnGround" should be replaced with "this.onGround," and any mention of "level" should be replaced with "level()". I'm not sure about the first two.

Last seen on 16:12, 15. Oct 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You may want to try making a…
Sat, 11/11/2023 - 16:02

You may want to try making a regular entity element and examining the code to see what's changed in the latest version; this is how I figured out which of Geckolib's functions weren't working. But yeah, it's annoying, and it doesn't look like the plugin's going to be updated for awhile. Best of luck.

Last seen on 17:17, 16. Sep 2024
Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@Mindthemoods thanks i think…
Sat, 11/11/2023 - 17:40

@Mindthemoods thanks i think it'll help me a lot.

Last seen on 17:17, 16. Sep 2024
Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@Mindthemoods I FINALLY GOT…
Sat, 11/11/2023 - 18:18

@Mindthemoods

I FINALLY GOT IT TO WORK

Thanks a lot

The fact that Geckolib isn't updated is so anoying bruh wth

Btw thanks Have a great day

Last seen on 17:17, 16. Sep 2024
Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Mindthemoods Fnck it It…
Sat, 11/11/2023 - 18:21

Mindthemoods Fnck it It builds properly but now whenever i launch the game it crashes instantly... I think im gonna burst my desk  into ashes, but still thanks though

Last seen on 16:12, 15. Oct 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There can still be game…
Sat, 11/11/2023 - 18:25

There can still be game crashing issues even if the code is compiling- procedures that loop endlessly, entity checks that don't actually return an entity, that sort of thing. What is the error message when the game crashes? There are other solutions you could try. 

Last seen on 17:17, 16. Sep 2024
Joined Dec 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Mindthemoods it tells me…
Sat, 11/11/2023 - 21:51

Mindthemoods it tells me that   this.lastSwing = level.getGameTime();  and if (this.swinging && this.lastSwing + 7L <= level.getGameTime()) {are private, but as you can see i already set it public.

    public PlayState attackingPredicate(AnimationState event) {

double d1 = this.getX() - this.xOld;
double d0 = this.getZ() - this.zOld;
float velocity = (float) Math.sqrt(d1 * d1 + d0 * d0);
if (getAttackAnim(event.getPartialTick()) > 0f && !this.swinging) {
this.swinging = true;
this.lastSwing = level.getGameTime();
}
if (this.swinging && this.lastSwing + 7L <= level.getGameTime()) {
this.swinging = false;
}
if (this.swinging && event.getController().getAnimationState() == AnimationController.State.STOPPED) {
event.getController().forceAnimationReset();
return event.setAndContinue(RawAnimation.begin().thenPlay("attack"));
}
return PlayState.CONTINUE;
Last seen on 16:12, 15. Oct 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Try replacing the 'level' in…
Mon, 11/13/2023 - 02:12

Try replacing the 'level' in 'level.getGameTime' with 'level(),' if it's these lines specifically that are referenced in the error log.

Last seen on 23:58, 15. Oct 2024
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
That was fixed in the latest…
Mon, 11/13/2023 - 09:49

That was fixed in the latest patches.

Last seen on 16:12, 15. Oct 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It is indeed! Thanks a bunch…
Mon, 11/13/2023 - 16:24

It is indeed! Thanks a bunch @Nerdy, this fixes a lot of trouble I was having with locked code! @TDO, I've tried the latest version of Geckolib, and it works just fine with unlocked mod elements in 2023.3.

Last seen on 11:08, 25. Mar 2024
Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm having the same problem…
Mon, 03/11/2024 - 01:20

I'm having the same problem. I'm using blockbench to model with the plugin version 3.0.7 while both McCreator (2023.4) and the geckolib plugin (5.4.3) are at their latest version. I followed the instructions step by step but i keep getting tons of errors of the kind "cannot find symbol" and some others. I've tried to understand why for the last couple of days while browsing for answers but all in vain. My model and my animations should work well, the animations names are the same as they are called in McCreator. I've read that the limbs in blockbench should be named in lowercase and should not have spaces between words so i changed that. I need help.