API Documentation/Setup
This documentation page will show you how you get started for development and make your plugin ready for deployment!
(assuming you have already created a project for your plugin in Eclipse)
Provide the resources to start programming
- download the latest release of ControllableMobsAPI.jar
- place it somewhere you can access it from inside Eclipse
- in Eclipse, add a reference to the file:
- right-click on your project
- select Properties
- select Java Build Path in the list at the left
- click on Add JAR or Add External JAR at the right
- locate the ControllableMobsAPI.jar and confirm it
- expand ControllableMobsAPI.jar in the list and select javadoc location
- click on edit... at the right
- Enter the following URL into Javadoc location path at the right: http://projects.ntcomputer.de/cmapi/javadoc/v <version> ( where you replace <version> with the version you are actually using, e.g. http://projects.ntcomputer.de/cmapi/javadoc/v5 )
- Click OK and OK
- You are ready! Now use the API to build a great plugin!
Use the API while programming
You can use any of the classes the package de.ntcomputer.minecraft.controllablemobs.api contains. Have a look into the following tutorial sections to learn how to use them!
I do not recommend using any classes of de.ntcomputer.minecraft.controllablemobs.implementation, because this is the internal core which references a lot of native minecraft server code.
Compile and Publish
1. method (recommended)
add a dependency to the API plugin
- add "ControllableMobsAPI" to the depend section of your plugin.yml - so the line looks like:
depend: [ControllableMobsAPI]
- compile your plugin and build a jar as you would normally do
- upload it to dev.bukkit.org
- under File management choose Edit relationships
- Set Type to Required dependency, Project to controllable-mobs-api and click on Add
- Your work is done! Let the people use your awesome plugin!
2. method (deprecated)
directly include the API classes
- compile your plugin and build a jar as you would normally do
- manually copy the packages de.ntcomputer.minecraft.controllablemobs.api and de.ntcomputer.minecraft.controllablemobs.implementation from ControllableMobsAPI.jar into your own plugin.jar
- upload it to dev.bukkit.org
- under File management choose Edit relationships
- Set Type to Embedded library, Project to controllable-mobs-api and click on Add
- Your work is done! Let the people use your awesome plugin!