Mod APIs
To allow for easy interoperability between mods, OWML provides an API system where mods can provide and consume APIs from eachother easily.
Creating an API
Section titled “Creating an API”To create an API start by making an interface with all the methods your API will have.
Now create a class that implements the API
Finally, override the GetApi method and have it return an instance of your API
Your mod now provides the API to consumers!
Consuming APIs
Section titled “Consuming APIs”First, define the interface for the API, usually the mod will have it available somewhere to copy and paste.
Now, use ModHelper.Interaction.TryGetModApi to obtain the API for the mod. For example if I wanted to get the API for the mod Bwc9876.MyCoolMod, I would make the following call to TryGetModApi.