error: cannot find symbol

Started by JowoJo on

Topic category: Troubleshooting, bugs, and solutions

Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
error: cannot find symbol

 

Hello everyone,

I'm encountering an issue with MCreator while working on a Minecraft mod. Everything was working fine until recently, but now I’m facing a compilation error. I'm getting numerous "cannot find symbol" errors related to the OcmModBlocks class, where all of my blocks are registered.

Here’s an example of the errors I'm seeing:
 

Executing Gradle task: build
Build info: MCreator 2024.2.32117, forge-1.20.1, 64-bit, 16303 MB, Windows 10, JVM 21.0.3, JAVA_HOME: C:\Program Files\Pylo\MCreator\jdk, started on: 2024-09-22-01:29:43


BUILD FAILED
Task completed in 3 minutes and 44 seconds

> Task :compileJava
D:\dev\ocm-mod 1.20.1\src\main\java\net\mcreator\ocmd\OcmMod.java:34: error: cannot find symbol import net.mcreator.ocmd.init.OcmModBlocks;
^
symbol: class OcmModBlocks
location: package net.mcreator.ocmd.init
 


Here is pasterbin link : https://pastebin.com/Y35vDYqj
 

The OcmModBlocks class does exist in the correct directory (src/main/java/net/mcreator/ocmd/init/), and all the blocks are correctly registered in this class. However, it seems that other files in the project are no longer able to recognize it, and I get errors wherever this class is used.

Here’s what I’ve already tried to fix the issue:

  1. I cleaned and rebuilt the project using the ./gradlew clean and ./gradlew build commands.
  2. I checked that the import statement is correctly declared in all the relevant files: import net.mcreator.ocmd.init.OcmModBlocks.
  3. The OcmModBlocks class seems to be correctly defined, and all the blocks are registered.

I'm using MCreator with Forge for Minecraft 1.20.1. If anyone has experienced this issue before or has any ideas on how to solve it, I’d greatly appreciate your help!

Thanks in advance for any suggestions!

Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
  Nop :c
Sun, 09/22/2024 - 12:59

 

Nop :c

Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I was able to fix the issue…
Sun, 09/22/2024 - 16:43

I was able to fix the issue by removing about thirty decorative blocks from my mod that weren't particularly important. After that, the error resolved itself and the compilation went through without any problems.

For your information, my mod currently contains 1838 blocks and a total of 5700 elements (blocks, items, etc.). I'm wondering if there's a known limit to how many elements you can add in MCreator? Does anyone know if there's an implicit limit where compilation errors start to occur?

Thanks again for the help!