Posted October 12, 20205 yr Is it possible? I want to get some values from other mods, when certain events happen like for example from the mod Nyx I need to know when the Blood Moon is happening, but I don't want to add this mod as a direct dependency in my mod, I want it to only get this variable from the Nyx if the player have the Nyx mod installed. I need that because in fact I need to integrate my mod with a couple of other mods
October 13, 20205 yr 3 hours ago, titaniuns said: I want it to only get this variable from the Nyx if the player have the Nyx mod installed. That's still a dependency, but it's a soft dependency. What you're saying is that 'can I read a variable without a hard dependency'. Yes, you still need to compile your mod with the code and support some information on it; however, it is possible. You will need to add the information in the mods.toml and specify that it isn't mandatory. From there, you will need extra care to make sure that the mod is present through the use of the ModList or OptionalMod.
October 13, 20205 yr Going off of what Ash said, a soft dependency is easy to implement. Below is one way. In your build.gradle, if you add the following plugin line at the top: apply plugin: 'maven-publish' Then in the dependencies section of the same file you can add a line such as (if we were adding the JEI mod): implementation fg.deobf("curse.maven:jei:2995910") Where the string of numbers is part of the web address for the specific version of the mod on curseforge. Then when you refresh your workspace, the mod should download as an external library (if the source is available). The plugin is also used for publishing to a maven repository, but the repository function isn't necessary if you're only using it to add a soft dependency (if you want to use it in that way though, go ahead) Edited October 13, 20205 yr by urbanxx001
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.