Advertisement
Guest User

Code

a guest
Nov 26th, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. package me.swiftymove.Command;
  2.  
  3. import net.canarymod.Canary;
  4. import net.canarymod.commandsys.CommandDependencyException;
  5. import net.canarymod.plugin.Plugin;
  6.  
  7. public class Main extends Plugin{
  8.  
  9. @Override
  10. public void disable() {
  11.  
  12. }
  13.  
  14. @Override
  15. public boolean enable() {
  16. try {
  17. Canary.commands().registerCommands(new Commands(), getDescriptor().getPlugin(), false);
  18. } catch (CommandDependencyException e) {
  19. // TODO Auto-generated catch block
  20. e.printStackTrace();
  21. }
  22. return false;
  23. }
  24.  
  25. }
  26.  
  27.  
  28. NEXT PART UNDER HERE
  29.  
  30. package me.swiftymove.Command;
  31.  
  32. import net.canarymod.api.inventory.ItemType;
  33. import net.canarymod.chat.MessageReceiver;
  34. import net.canarymod.commandsys.Command;
  35. import net.canarymod.commandsys.CommandListener;
  36.  
  37. public class Commands implements CommandListener{
  38. @Command(aliases = {"food"},
  39. description = "Give Player Food",
  40. permissions = {"canary.command.food"},
  41. toolTip = "/food",
  42. min = 1)
  43. public void foodComand(MessageReceiver caller, String[] parameters){
  44. new ItemType(ItemType.Bread, 32);
  45. }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement