
IntelliJ can’t resolve MinecraftClient in Fabric mod (1.20.1) even though the project builds and runs
Hi, I’ve been stuck on this for hours and I’m honestly losing my mind a bit 😅
I’d really appreciate any help.
I’m working on a Fabric mod for Minecraft 1.20.1.
Everything seems to be set up correctly:
- The project builds successfully
- The game runs fine
- My mod initializes and prints logs
BUT in IntelliJ:
net.minecraft.client.MinecraftClient
is red with: "Cannot resolve symbol 'MinecraftClient"
Setup:
- - Minecraft 1.20.1
- - Fabric Loader 0.18.6
- - Loom 1.6- SNAPSHOT
- - Gradle: 8.7
- - IntelliJ IDEA (Community)
- What I've tried:
- - Reload Gradle project
- - Run genSources
- - Invalidate Caches / Restart
- - Reimport project
- - Changing Gradle & Loom versions
- - Full project rebuild
- Important detail:
- - The mod actually runs
- - Logos from onInitializeClient() appear in console
So it seems like: IDE can't see Minecraft sources, but Gradle can.
Question. Is this:
- - a Loom issue?
- -a mappings problem?
- - IntelliJ indexing bug?
- - Did I miss something with client/main source sets?
- - Do I need to manually attach Minecraft sources somehow?
Screenshots:
- - Project Structure
- - External Libraries
- - The red import in code
u/Accomplished_Bid6668 — 3 days ago