Topic category: Troubleshooting, bugs, and solutions
I've been making this library mod called turtle library and I can't seem to get this code to work
My error:
Executing Gradle task: runClient
Build info: MCreator 2025.2.24711 EAP (24711), neoforge-1.21.1, 64-bit, 16070 MB, Windows 11, JVM 21.0.7, JAVA_HOME: C:\Users\huyajeqwfdsbgtuywerx\Downloads\MCreator.EAP.2025.2.24711.Windows.64bit\MCreatorEAP2025224711\jdk, started on: 2025-06-27-11:40:19
Reusing configuration cache.
> Task :writeClientLegacyClasspath UP-TO-DATE
> Task :downloadAssets UP-TO-DATE
> Task :prepareClientRun UP-TO-DATE
> Task :createMinecraftArtifacts UP-TO-DATE
> Task :processResources UP-TO-DATE
> Task :compileJava FAILED
C:\Users\huyajeqwfdsbgtuywerx\Downloads\turtle_library2\turtle_library2\src\main\java\com\mods\turtle_lib\EntityAnimatorGecko.java:1: error: cannot find symbol import software.bernie.geckolib.GeckoLibNetwork;
^
symbol: class GeckoLibNetwork
location: package software.bernie.geckolib
C:\Users\huyajeqwfdsbgtuywerx\Downloads\turtle_library2\turtle_library2\src\main\java\com\mods\turtle_lib\EntityAnimatorGecko.java:19: error: cannot find symbol GeckoLibNetwork.syncAnimation((GeoEntity) entity, controller, animationName);
^
symbol: variable GeckoLibNetwork
location: class EntityAnimatorGecko
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler output below.
C:\Users\huyajeqwfdsbgtuywerx\Downloads\turtle_library2\turtle_library2\src\main\java\com\mods\turtle_lib\EntityAnimatorGecko.java:1: error: cannot find symbol import software.bernie.geckolib.GeckoLibNetwork;
^
symbol: class GeckoLibNetwork
location: package software.bernie.geckolib
2 errors
* Try:
> Check your code and dependencies to fix the compilation error(s)
> Run with --scan to get full insights.
BUILD FAILED in 738ms
6 actionable tasks: 1 executed, 5 up-to-date
Configuration cache entry reused.
BUILD FAILED
Task completed in 2 seconds
My build.gradle:
plugins {
id 'eclipse'
id 'net.neoforged.moddev' version '2.0.91'
}
version = '1.0'
base.archivesName = "modid"
java.toolchain.languageVersion = JavaLanguageVersion.of(23)
repositories {
// Standard repositories
mavenCentral()
// NeoForged repository
maven {
name = 'NeoForged'
url = 'https://maven.neoforged.net/releases'
}
// GeckoLib repository (official format from GitHub)
maven {
name = 'GeckoLib'
url = 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/'
content {
includeGroup("software.bernie.geckolib")
}
}
}
dependencies {
// GeckoLib dependency - using confirmed working version for NeoForge 1.21.1
implementation "software.bernie.geckolib:geckolib-neoforge-1.21.1:4.7.5.1"
}
neoForge {
version = "21.1.176"
runs {
client {
client()
def mcreatorJvmOptions = System.getenv('MCREATOR_JVM_OPTIONS')
if (mcreatorJvmOptions) {
mcreatorJvmOptions.split("\\s+").findAll { it.trim() }.each { arg ->
jvmArgument(arg)
}
}
}
server {
server()
}
configureEach {
systemProperty 'forge.logging.markers', 'REGISTRIES'
logLevel = org.slf4j.event.Level.DEBUG
}
}
mods {
mcreator {
sourceSet sourceSets.main
}
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
}
apply from: 'mcreator.gradle'
my code:
import software.bernie.geckolib.GeckoLibNetwork;
import software.bernie.geckolib.animatable.GeoEntity;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.Level;
public class EntityAnimatorGecko {
/**
*
* @param level The world level where the entity exists.
* @param entityId The entity ID.
* @param controller The name of the controller (must match your registerControllers name).
* @param animationName The animation name (e.g., "animation.foobar.poop").
*/
public static void execute(Level level, int entityId, String controller, String animationName) {
Entity entity = level.getEntity(entityId);
if (entity instanceof GeoEntity geoEntity) {
GeckoLibNetwork.syncAnimation((GeoEntity) entity, controller, animationName);
}
}
}
Since this is a plugin, you may need plugin support which can't be provided here.
2025.1 supports vanilla entity animations