Java Reference
In-Depth Information
Here is the Java source code for our HelloWorld plugin, which is already typed
in for you in the file ~/Desktop/code/HelloWorld/src/helloworld/ . There's a
lot of weird stuff in here. (If you haven't downloaded the code for this topic to
your Desktop yet, grab it now from . You can use unzip from the command line to unpack the archive
and create all the files.)
package helloworld;
import net.canarymod.plugin.Plugin;
import net.canarymod.logger.Logman;
import net.canarymod.Canary;
import net.canarymod.commandsys.*;
public class HelloWorld extends Plugin implements CommandListener {
public static Logman logger;
public HelloWorld() {
logger = getLogman();
public boolean enable() { "Starting up" );
try {
Canary.commands().registerCommands(this, this, false);
} catch (CommandDependencyException e) {
logger.error( "Duplicate command name" );
return true;
public void disable() {
@Command(aliases = { "hello" },
description = "Displays the hello world message." ,
permissions = { "" },
toolTip = "/hello" )
public void helloCommand(MessageReceiver caller, String[] parameters) {
String msg = "That'sss a very niccce EVERYTHING you have there..." ;
Search WWH ::

Custom Search