GameRule-Extensions
An extension library to allow mod developers to more easily add custom gamerules, with additional datatype support.
Usage (Mod Developers Only)
Adding a new game rule
- Add the API jar as a dependency to your project.
- Call
dev.rndmorris.gameruleexts.api.GameRulesApi.registerGameRule(...)
to add a new gamerule for your mod. Theapi.rules
package contains basic implementations for declaring boolean, numerical, and string gamerules. - If necessary, write your own
IGameRule
implementation.
Reading a game rule
- Call
dev.rndmorris.gameruleexts.api.GameRulesApi.getGameRules(...)
. - The returned
IGameRules
object can be used to retrieve and update gamerules by their name.
Credits
- rndmorris (primary author)
- The GTNH team, for the project template