Java Reference
In-Depth Information
Plugin: Simple
package simple;
import net.canarymod.plugin.Plugin;
import net.canarymod.logger.Logman;
import net.canarymod.Canary;
import net.canarymod.commandsys.*;
import com.pragprog.ahmine.ez.EZPlugin;
public class Simple extends EZPlugin {
@Command(aliases = { "simple" },
description = "Displays simple variable assignments" ,
permissions = { "" },
toolTip = "/simple" )
public void simpleCommand(MessageReceiver caller, String[] parameters) {
if (caller instanceof Player) {
Player me = (Player)caller;
// Put your code after this line:
// ...and finish your code before this line.
Don't worry about all that extra program text yet. We'll talk about that more
as we go along. For now just put new code on the lines as shown, and it will
work fine. Here's what you're going to do:
First, add two import statements at the top of the file, after the other import
lines at . Type in the following:
Next, after where it says //Putyourcodeafterthisline: at , do this:
Create an integer variable named myAge and set it to whatever your age is.
Make another integer variable named twiceMyAge and set it equal to myAge
multiplied by 2.
Create a float variable named volume and set it equal to 0.1 .
Create a float variable named pitch and set it equal to 1.0 .
Search WWH ::

Custom Search