Posted June 22, 20205 yr Howdy folks I'm currently investigating Forge Capabilities and there's one aspect that I haven't figured out yet. If I want to access a Capability introduced by another mod, how am I supposed to do that? For inbuilt Capability (such as CapabilityItemHandler) it's no problem, but for anything defined by another mod I can't see an obvious way to access the Capability and its interface (unless of course I include the mod source as a library / dependency). How is that intended to work? -TGG
June 22, 20205 yr Author 1 hour ago, diesieben07 said: You use @CapabilityInject to inject the other mod's capability. You can put this annotation on a method too (see the javadocs) and that method will then only be called if the other mod is present. In that method you can then enable your mod's compatibility features. If you put this method in a separate class that class will never load unless the other mod is present. OK. So I still need to include that mod's source (or just the jar?) as a library, but if the other mod isn't present then my code will still run (even though the capability interface isn't present). Could you point me in the direction of a working example? TGG
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.