1.x/API

From Citizens Wiki

< 1.x

Revision as of 11:33, 2 September 2011 by APunch (talk | contribs) (Created page with "== JavaDocs == Our API documentation can be found [http://jd.citizensnpcs.net here]. For a basic guide on hooking into Citizens, see below. == Using the Citizens API == Hooking ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

JavaDocs

Our API documentation can be found here. For a basic guide on hooking into Citizens, see below.

Using the Citizens API

Hooking into Citizens is the same as hooking into any other Bukkit plugin like PermissionsBukkit or iConomy. Add the latest version of Citizens.jar to your build path. Then, add this code to your onEnable in the main class:

public boolean citizensEnabled = false;

public void onEnable() {
    Plugin test = server.getPluginManager().getPlugin("Citizens");
    if (test != null) {
        citizensEnabled = true;
        System.out.println("Successfully hooked into Citizens!");
    } else {
        System.out.println("Citizens isn't loaded.");
    }

To utilize this class, add the following import to your code:

import net.citizensnpcs.api.CitizensManager