small medium large xlarge

Generic-user-small
07 Jul 2017, 20:16
Andre Menhard (2 posts)

Hey, i tried all to do the Simple plugin. I copied all from mySimple to the simple.

This is the Simple code i have made:

package MySimple; import net.canarymod.plugin.Plugin;//(1) import net.canarymod.logger.Logman; import net.canarymod.Canary; import net.canarymod.commandsys.*; import net.canarymod.chat.MessageReceiver; import net.canarymod.api.entity.living.humanoid.Player; import net.canarymod.api.world.effects.SoundEffect; import net.canarymod.api.world.position.Location; import com.pragprog.ahmine.ez.EZPlugin;

public class MySimple extends EZPlugin {

@Command(aliases = { “mysimple” }, description = “Displays Andy’s simple variable assignments”, permissions = { “” }, toolTip = “/mysimple”) public void mysimpleCommand(MessageReceiver caller, String[] parameters) { if (caller instanceof Player) { Player me = (Player)caller; // Put your code after this line:

  int myAge = 14;
  int myAgeDoubled = myAge * 2;
  float volume = 0.1f;
  float pitch = 1.0f;
  double dayOnIo = 152853.5047;
  String myName = "Andre Menhard";
  
  me.chat("My age " + myAge);
  me.chat("My age doubled " + myAgeDoubled);
  me.chat("A day on Io " + dayOnIo);    
  me.chat("My name " + myName);
  
  Location loc = me.getLocation();
  playSound(loc, SoundEffect.Type.GHAST_SCREAM, 0.1f, 1.0f);
  
  // ...and finish your code before this line.
}   } }

but when i try the ./build.sh command there is this error:

~/desktop/Simple $ ./build.sh Compiling with javac… src\simple\Simple.java:12: error: class MySimple is public, should be declared i n a file named MySimple.java public class MySimple extends EZPlugin { ^ 1 error

PLEASE HELP ME

Andy-talking_pragsmall
07 Jul 2017, 21:20
Andrew Hunt (227 posts)

Well, for starters, perhaps do what the error message says? The name of the file has to match the declaration.

You must be logged in to comment