Accessing the API
Since 1.0.0
The easier way to access the MCUtils API is to extend MCPlugin
instead of JavaPlugin
on your main class, functionality remains the same but doing this provides easy access to all of MCUtils features directly from your main class, here is an example.
Once your plugin is extending the MCPlugin class, you can register commands, events, files, GUIs and so on directly from your main plugin class. As a first step we are going to check if the server is on 1.12 or higher, you can obviously use whatever version is the lowest that your plugin supports.
Note that both methods used here are static
, this is because some classes may benefit from this methods by changing behaviour depending on server version but may not want to store an instance of the plugin for this one purpose only. Don't get used to static
methods on MCUtils though, these are pretty much the only two, excluding of course utility only classes such as MCStrings, MCLists and MCNumbers.
Last updated