Skip to content

NoClassDefFoundError / IllegalStateException when initializing IEMCProxy on NeoForge 1.21.1 #2460

Description

@zxy-pixel

Description:
ProjectE causes a client crash when hovering over any item in the creative inventory (or any item tooltip trigger). The error indicates that IEMCProxy cannot be initialized because no valid service implementation is found.

Steps to Reproduce:

Install ProjectE 1.1.0 for Minecraft 1.21.1 on NeoForge 21.1.220.

Launch the game and enter any world or creative mode.

Open the creative inventory and hover over any item.

The game crashes with the attached error.

Expected behavior:
ProjectE initializes correctly and item tooltips (EMC values) appear without crashing.

Actual behavior:
Crash with java.lang.NoClassDefFoundError: Could not initialize class moze_intel.projecte.api.proxy.IEMCProxy.

Crash Report Snippet:

text
java.lang.NoClassDefFoundError: Could not initialize class moze_intel.projecte.api.proxy.IEMCProxy
at moze_intel.projecte.events.ToolTipEvent.tTipEvent(ToolTipEvent.java:52)
Caused by: java.lang.ExceptionInInitializerError
at moze_intel.projecte.api.proxy.IEMCProxy.lambda$static$0(IEMCProxy.java:22)
Caused by: java.lang.IllegalStateException: No valid ServiceImpl for IEMCProxy found, ProjectE may be absent, damaged, or outdated
Environment:

Minecraft: 1.21.1

Mod Loader: NeoForge 21.1.220

ProjectE version: 1.21.1-PE1.1.0 (downloaded from CurseForge)

Java: 21.0.9

OS: Windows 11

Additional Notes:

No other mods seem to interfere – the issue occurs even with ProjectE as the only mod (tested in a minimal environment).

The class net.minecraft.advancements.criterion.SimpleCriterionTrigger (which caused issues with other mods earlier) is not involved here; this is specific to ProjectE's service loading mechanism.

The problem appears to be that the service locator (ServiceLoader) cannot find an implementation of IEMCProxy at runtime, likely due to a missing or broken service definition in the mod JAR.

Suggested Fix:
Check the service loader registration (META-INF/services/moze_intel.projecte.api.proxy.IEMCProxy) and ensure the implementing class is present and correctly referenced for NeoForge 1.21.1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions