Help Please

Discussion in 'Plugin Development' started by The_Java_Coder, Jul 12, 2012.

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

    The_Java_Coder

    How do I do a wait in java with bukkit? Ask if you want the code.
     
  2. Offline

    OstlerDev

    this.wait(300);

    Yes this will just pause the server basically, but you need to be more specific when asking questions.

    Are you asking how to do delays? Just use the bukkit scheduler.
     
  3. Offline

    The_Java_Coder

    i need it to wait for the next command

    Code:
    public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
            Player player = (Player) sender;
            if(commandLabel.equalsIgnoreCase("god")) {
                if(sender.hasPermission("vip.godmode")) {
                   
                   
                    player.setNoDamageTicks(900000000);
                    player.setFireTicks(0);
                    player.sendMessage(ChatColor.GOLD + "You are in GodMode");
                   
                /*I need it to wait here*/
                if(player.getNoDamageTicks() == 900000000) {
                    player.setNoDamageTicks(0);
                    player.sendMessage(ChatColor.DARK_RED + "You are exiting God mode!");
                }
                }
                   
                    }else {
                        sender.sendMessage(ChatColor.DARK_RED + "You can't use that!");
                    }   
           
           
           
        return false;
        }
    
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 27, 2016
  4. Offline

    SchmidtMathias

    What is that code supposed to do?! You want a player to have god mode for a limited time?
     
Thread Status:
Not open for further replies.

Share This Page