God mode

Discussion in 'Plugin Development' started by robbcap, May 12, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    robbcap

  2. In your listener, you're missing an '@Eventhandler'

    Not sure if it'll fix it but it might be causing some errors
     
  3. Offline

    CRAZYxMUNK3Y

    What jack said should fix it, but you should also allow for a remove god command.
    EG:
    Code:java
    1.  
    2. public boolean onCommand(CommandSender sender, Command command,String label, String[] args) {
    3. if (command.getName().equalsIgnoreCase("god")) {
    4. if (!(sender instanceof Player)) {
    5. sender.sendMessage("You are not a player!");
    6. }else{
    7. if(!(god.godded.contains(Player)sender)){
    8. god.godded.add((Player)sender);
    9. sender.sendMessage(ChatColor.AQUA + "You are now god");
    10. }else{
    11. god.godded.remove((Player)sender);
    12. sender.sendMessage(ChatColor.RED + "You are no longer a god");
    13. }
    14. }
    15.  
    16. return true;
    17.  


    Was written by hand, may contain some errors
     
Thread Status:
Not open for further replies.

Share This Page