question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] How to load extra mod with mod

See original GitHub issue

Here’s what I tried:

  1. Running as a language adapter. Implement ModCandidateFinder and inject the mods to FabricLoaderImpl#mods. Working in 1.16, 1.17.
    • Throw ClassNotFoundException with FabricLoader class loader. My classes not in classpath.
    • Throw SecurityException after I add my classes to classpath.
  2. Set system properties for using ArgumentModCandidateFinder. But it’s called before language adapter.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:20 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
EZForevercommented, Jun 20, 2022

Author of ThatOrThis here. I’m 110% against using hacks to inject mods into the loader, but it just can’t be done the other way back when the mod is out. Now that Fabric Loader has evolved to support loading mods from additional directories, and class injection just got much harder with that package signature (just why?), I’m willing to do a rewrite. However there are other problems yet to be solved.

You’ll have to wait for us to add the appropriate APIs to have a clean solution.

I actually don’t think it’s the loader’s job to provide the APIs. Fabric Loader has one job - loading mods into Minecraft - and it’s doing it well enough. All we need is a way to tell the loader which mods to load, and we have fabric.addMods now. Though I’d admit it will be painful to write a wrapper (with Knot, the entrypoint, being an implementation detail) or even half a game launcher to utilize just that. Besides, considering that #81 is still open after 3 years, I guess there’s just more important stuffs for the loader devs to do. btw, being harsh really isn’t going to help anybody.

1reaction
warjortcommented, Jun 17, 2022

Ok, this is caused by fabric loader signing the jar https://github.com/FabricMC/fabric-loader/blob/d713b2a801ad142394ac0eb1d1eaa452fc783021/build.gradle#L278

That kind of seals the packages. You can’t add new classes into those packages in the same classloader unless you also sign your jar with the same signature. Of course you can’t do that because you don’t have access to fabric’s private key.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to install MODS natively on the quest 2 (NO PC NO ...
In this video ill show, you how to add mods to almost any game on the Quest 2 without a pc or laptopVR...
Read more >
How To Manually Install Mods In TLauncher (Using ... - YouTube
In today's new video, I will show you all how to manually install mods in TLauncher in 2022! This tutorial is super easy...
Read more >
Quest Modding | BSMG Wiki
If you can't press the Play button on a map press the question mark at the top right to see which mods are...
Read more >
How to Make a Minecraft Mod: Fun Tutorial - Create & Learn
LearnToMod is a website that sends the mods directly to your own server without the need to install anything extra. These mods run...
Read more >
Sodium Extra - Mods - Minecraft - CurseForge
Common Questions ; Do I need Sodium installed for this mod to work? You will need to download Sodium for this mod to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found