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

  1. download the latest release of ControllableMobsAPI.jar
  2. place it somewhere you can access it from inside Eclipse
  3. in Eclipse, add a reference to the file:
    1. right-click on your project
    2. select Properties
    3. select Java Build Path in the list at the left
    4. click on Add JAR or Add External JAR at the right
    5. locate the ControllableMobsAPI.jar and confirm it
    6. expand ControllableMobsAPI.jar in the list and select javadoc location
    7. click on edit... at the right
    8. 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 )
    9. Click OK and OK
  4. 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

  1. add "ControllableMobsAPI" to the depend section of your plugin.yml - so the line looks like:
    depend: [ControllableMobsAPI]
    
  2. compile your plugin and build a jar as you would normally do
  3. upload it to dev.bukkit.org
  4. under File management choose Edit relationships
  5. Set Type to Required dependency, Project to controllable-mobs-api and click on Add
  6. Your work is done! Let the people use your awesome plugin!

2. method (deprecated)

directly include the API classes

  1. compile your plugin and build a jar as you would normally do
  2. manually copy the packages de.ntcomputer.minecraft.controllablemobs.api and de.ntcomputer.minecraft.controllablemobs.implementation from ControllableMobsAPI.jar into your own plugin.jar
  3. upload it to dev.bukkit.org
  4. under File management choose Edit relationships
  5. Set Type to Embedded library, Project to controllable-mobs-api and click on Add
  6. Your work is done! Let the people use your awesome plugin!