1

My problem is that when I start the game none of my resources are loaded. I use IntelliJ version 2021.2.2 and the 1.12.2 Minecraft Forge MDK version 14.23.5.2855 and I know that IntelliJ is the problem but all I found about this problem is this solution

sourceSets {
    main { output.resourcesDir = output.classesDir }
}

but that solution doesn't work anymore because classesDir is deprecated in Gradle version 4.9 and I don't know what to do anymore. My source code is available on my GitHub. Note: The problem is IntelliJ not how I added the resources because when I build the mod and use it in a normal Minecraft installation the resources are loaded. debug.log

  • 1
    Hi there, please take a look at [How to ask a good question](https://stackoverflow.com/help/how-to-ask). Please give a minimal example and the source code excerpts, which could be the cause. Nobody can answer the question in this form without digging deeper into your project. Thanks. – 0x1C1B Sep 25 '21 at 14:14
  • 1
    Hi! Please post your project in a github repo. It'll be easier to read then. – JustinW Sep 25 '21 at 14:21
  • For future readers: This is the fix: https://stackoverflow.com/a/27624502/3875151 – 9 Guy Jun 14 '22 at 18:51

1 Answers1

0

After lots and lots of research, I finally found a way which is not deprecated. Add this to build.gradle

sourceSets.main.resources { srcDir 'src/generated/resources' }

or

sourceSets.main.resources { srcDir 'src/main/resources' }

Try this, and it should work. If it doesn't, I would recommend upgrading to 1.16.5 MDK or 1.17.1, because they're currently LTS

JustinW
  • 2,567
  • 1
  • 13
  • 29
  • I tried both but both didn't work and I can't upgrade to 1.16.5 or 1.17.1 because I make this mod for a modded server that I'm working on with a few others and when I upgrade we need to upgrade the full modpack and a few of the mods are only available for the 1.12.2 and at this point I think that the problem is the forge version because I tried it in Eclipse and I had the same issue there so I think I will try an older Forge version – Shimizu Izumi Sep 27 '21 at 13:59
  • The problem isn't with Forge as I used to develop mods in 1.12.2 in Eclipse, and it worked properly. (Now I mod in 1.16.5), When you create a new world, click on more options and click on data packs, and see if an item called main resources is listed – JustinW Sep 27 '21 at 15:25
  • Data packs don't exist in 1.12.2 they were added in 1.13 (17w43a) – Shimizu Izumi Sep 27 '21 at 16:07
  • Have you tried it in Eclipse (Because Eclipse is totally fine, I have worked with it), (Btw, delete unnecessary comments, the discussion is too long) – JustinW Sep 27 '21 at 16:12
  • Yes I tried it in Eclipse and had the same problem – Shimizu Izumi Sep 27 '21 at 18:58
  • Hi, it's been 2 days, but I can still help :). Do one thing, when you run minecraft through your IDE, copy and paste the output from the console using https://pastebin.com or https://paste.ee – JustinW Sep 30 '21 at 11:24
  • I added a link to the debug log – Shimizu Izumi Sep 30 '21 at 18:01
  • `Line 1132: Caused by: java.io.FileNotFoundException: cardinalsystem:models/item/ruby.json`, looks like I found the problem. It is not able to locate ruby.json file. – JustinW Oct 01 '21 at 04:24
  • Of course, the file cannot be found if nothing is recognized or loaded from the resources folder – Shimizu Izumi Oct 01 '21 at 14:09