How do I force a procedure with custom code to compile?

Started by Owls_Parliament on

Topic category: Help with Minecraft modding (Java Edition)

Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I force a procedure with custom code to compile?

This is a custom code question, so it may be more complicated.
I have basic knowledge of Java, but I do not know much about how Minecraft, Forge, or any other system handles its packages and why or why not a file won't compile.
I'm trying to make an addon to my own mod, but to do that, I need to have one mod access resources from the other. From what I can tell, my code is correct, but when I try to compile the mod, MCreator rejects the custom code as an error, not being able to recognize the foreign package. I have the other mod listed as a dependency, so all is well, however, I only get the auto-generated version of my procedure when I try to run it in-game instead of my custom code version. All I am trying to do is access a mob effect from one mod and use it in the other. I found workarounds for everything else (I know of one for this but the performance is lousy). Does anyone have advice? Is my code wrong?
Console log and a code snippet are included

 

The file you are referencing…
Thu, 03/26/2026 - 19:49

The file you are referencing does not seem to exist. You can't force something to work, you need to write correct code

Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The file exists in another…
Thu, 03/26/2026 - 22:07

The file exists in another mod. Apologies for my ignorance, but how to a point it to something within a different mod?

Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Unless you have a plugin…
Fri, 03/27/2026 - 00:12

Unless you have a plugin that adds the mod as a checkbox dependency, dependency mods (e.g. ones you list it in the "additional dependencies" text box), are not automatically downloaded, and you have to provide the mod(s) separately. You can do this by putting the mod's JAR in the run/mods folder, though this sometimes doesn't work.

Hope this helps! :)

Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yeah, it didn't work for me…
Fri, 03/27/2026 - 17:31

Yeah, it didn't work for me for whatever reason, though I have tried many times. Thank you for the help in any case