Making a timer for dialogue?

Discussion in 'Plugin Development' started by iClipse, Dec 18, 2016.

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

    iClipse

    So I am making a plugin for an adventure map, right? And I want to add a timer for dialogue to appear. Here's what I got: (Keep in mind im doing this blindly, I just found a thread that might help and copied the timer part not knowing if its correct of not)
    Code:
    
        ((Player) event).sendMessage(ChatColor.GREEN +"Victor: Heroes, you've returned at the right time! After Herobrine died, a reincarnation reappeared!");
                timer()
                , 120, 120);
                ((Player) event).sendMessage(ChatColor.GREEN +"Victor: I began to feel his presence at the time these monsters came out of the ground! Please, help us and get rid of him for good!");
                ((Player) event).sendMessage(ChatColor.GREEN +"Victor: A light flashed over by the village to the north, I fear Herobrine has returned.");
                ((Player) event).sendMessage(ChatColor.GREEN +"@r : We'll end him, victor. Just stay out of danger. Don't leave this house until we return!");
        }}}      
    
    So the part of the code, right where is says "timer", is underlined. It says its an "invalid expression". Can someone help me out?
     
  2. Offline

    Zombie_Striker

    @iClipse
    What is this timer? Did you create that method? If so, post that method.
     
  3. Offline

    iClipse

    o. I thought it was already a method, like one of those preset methods in Bukkit, kinda like getDamager().

    Welp. nevermind what I asked, ima quickly make one

    Sorry, abit new to this. What would I fill this method with?
    private boolean timer() {
    //WHAT DO I PUT HERE
    return true;
     
  4. Offline

    timtower Administrator Administrator Moderator

    @iClipse Why are you casting an event to a player?
     
  5. Offline

    iClipse

    I'm sending the message to a player, well, more specifically, all players. Ive never really been told how to send a message in public chat :/
     
  6. Offline

    timtower Administrator Administrator Moderator

    @iClipse You get all players, loop through them.
    Or server#broadcastMessage
     
  7. Offline

    iClipse

    server#broadcastMessage? Never heard or seen that...

    TELL ME MORE
     
  8. Offline

    timtower Administrator Administrator Moderator

Thread Status:
Not open for further replies.

Share This Page