Topic category: Troubleshooting, bugs, and solutions
No matter what I do, this bug never fails to appear whenever I try importing a custom JAVA entity model into my mod.
1.18.2 or 1.16.5, it does not. stop. appearing. It's so infuriating as it kills my motivation to mod every time knowing how much I depend on custom models for visuals, which cannot be done if this thing is not fix.
I beg of you to explain why this is happening, why it isn't happening to others and how I could possibly fix it.
Thank you,
> Task :compileJava FAILED
C:\Users\vami\MCreatorWorkspaces\yan\src\main\java\net\mcreator\yan\client\model\ModelArchbowProjectile.java:6: error: a type with the same simple name is already defined by the single-type-import of Main import net.minecraft.data.Main;
^
C:\Users\vami\MCreatorWorkspaces\yan\src\main\java\net\mcreator\yan\client\model\ModelArchbowProjectile.java:16: error: a type with the same simple name is already defined by the single-type-import of Main import net.minecraft.client.main.Main;
^
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
1 actionable task: 1 executed
BUILD FAILED
Task completed in 1 second
Hi, it happened a few minutes ago and I just fixed it by realising something, so the fix that worked for me and hopefully will work for you too is:
go in blockbench to the workspace of your model, then click file and in file click on project, on export version there's two choices for your version, MCP or mojmaps, for me I first selected mojmaps 1.15-1.16 and it didn't work, I changed it to MCP 1.15-1.16 and when I saved it, re-exported it from blockbench to re-imported it in mcreator it worked without any :couldn't build/build failed blablabla
So I'm sry for being late by 15 days of your post but I hope I could have helped you get it fixed
Hello, I wanted to inform you that it now doesn't work for me again, so if you continue to have that problem then I'm sry to not give valuable information and if I find anything helpful I will inform you
Hey guys, after having this problem i tried removing all my cubes from their folders in blockbench and it works now! Hope this helps.
I'm getting the exact same error. I tried reloading the model, I tried to clear the entire gradle project but nothing worked.
for some reason this only happened with the .Java models, not JSON or OBJ.
Executing Gradle task: build
Build info: MCreator 2023.4.52316, forge-1.20.1, 64-bit, 32564 MB, Windows 11, JVM 17.0.9, JAVA_HOME: D:\Apps\MinecraftModding\MCreator\jdk, started on: 2024-01-12-10:39:29
> Task :compileJava FAILED
C:\Users\******\MCreatorWorkspaces\starcraftmc\src\main\java\net\mcreator\starcraftmc\client\model\Modelterranscv.java:6: error: a type with the same simple name is already defined by the single-type-import of Main import net.minecraft.data.Main;
^
C:\Users\******\MCreatorWorkspaces\starcraftmc\src\main\java\net\mcreator\starcraftmc\client\model\Modelterranscv.java:16: error: a type with the same simple name is already defined by the single-type-import of Main import net.minecraft.client.main.Main;
^
2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
1 actionable task: 1 executed
BUILD FAILED
Task completed in 2 seconds
Never Mind. I tried taking out the cubes from their folders but it didn't work. sense I'm a java dev myself I saw the problem in the source code. The problem was that the project string Identifier just saw a number at the end of my cube folders so it added an underscore and that was detected as an error in the build.
FIX:
Just remove any numbers from the blockbench cube folders.