Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1.  
  2. public class CakeEater extends Plugin {
  3. private CakeEater.PluginListen listener = new CakeEater.PluginListen();
  4.  
  5. public void initialize() {
  6. etc.getLoader().addListener(PluginLoader.Hook.COMMAND,this.listener,this,PluginListener.Priority.MEDIUM);
  7. }
  8.  
  9. public void enable() {
  10. }
  11.  
  12. public void disable() {
  13. }
  14.  
  15. public class PluginListen extends PluginListener {
  16.  
  17.  
  18. public boolean onCommand(Player player, String[] split) {
  19. if ((split[0].equalsIgnoreCase("/cake")) && (player.canUseCommand("/cake"))) {
  20. player.sendMessage("LET THEM EAT CAKE!!!");
  21. for (Player a : etc.getServer().getPlayerList()){
  22. a.giveItem(354, 1);
  23. return false;
  24. }
  25. }
  26. return false;
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement