2026.2: Dimension ID Check not compiling properly.

Started by Talfor on

Topic category: Troubleshooting, bugs, and solutions

Joined Aug 2026
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
2026.2: Dimension ID Check not compiling properly.

I'm fairly certain that this is a newer, 2026.2 based problem, because I've done it before. I'm trying to check if an entity is in a specific dimension, but it's not compiling properly. After some testing, it looks like an issue with the Dimension Type Block.

The log is below:

2 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava' (registered by plugin class 'org.gradle.api.plugins.JavaBasePlugin').
> Compilation failed; see the compiler output below.
Users\**********\MCreatorWorkspaces\leveled_in_an_instant\src\main\java\net\mcreator\leveledinaninstant\procedures\InitialMobSetupProcedure.java:49: error: double cannot be dereferenced if ((world instanceof Level _lvl ? _lvl.dimension() : (world instanceof WorldGenLevel _wgl ? _wgl.getLevel().dimension() : Level.OVERWORLD)) == Level.OVERWORLD) {
^
Users\**********\MCreatorWorkspaces\leveled_in_an_instant\src\main\java\net\mcreator\leveledinaninstant\procedures\InitialMobSetupProcedure.java:49: error: double cannot be dereferenced if ((world instanceof Level _lvl ? _lvl.dimension() : (world instanceof WorldGenLevel _wgl ? _wgl.getLevel().dimension() : Level.OVERWORLD)) == Level.OVERWORLD) {
^
Note: Recompile with -Xlint:unchecked for details.
2 errors
* Try:
> Check your code and dependencies to fix the compilation error(s)
> Run with --scan to get full insights from a Build Scan (powered by Develocity).
BUILD FAILED in 1s
3 actionable tasks: 1 executed, 2 up-to-date
Configuration cache entry reused.

Joined Aug 2026
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm using Neoforge 26.1.2,…
Mon, 08/24/2026 - 17:52

I'm using Neoforge 26.1.2, however, I'm fairly certain that it is a variable called level.

Yes, I have a variable called level. All fixed, thx!

You are welcome! Uppercase…
Tue, 08/25/2026 - 20:26

You are welcome! Uppercase Level is reserved name in the game, we will add check to not allow this variable name in future versions