u/Accomplished_Bid6668

IntelliJ can’t resolve MinecraftClient in Fabric mod (1.20.1) even though the project builds and runs
▲ 1 r/IntelliJIDEA+1 crossposts

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

https://preview.redd.it/zcawgnapjxvg1.png?width=2043&format=png&auto=webp&s=2af6bc578ae20da1e15348ba60ccbac4f18ce7d1

https://preview.redd.it/848o76brjxvg1.png?width=2110&format=png&auto=webp&s=a34c485b82462dcefe050a1b10c258cd7b7f1df6

https://preview.redd.it/hzc60jovjxvg1.png?width=473&format=png&auto=webp&s=0aa5cd32a133dd3bc9e1626f4ac48902b41e47cc

reddit.com
u/Accomplished_Bid6668 — 3 days ago