Discussion in 'Spigot Plugin Development' started by IllegalSloth, Apr 22, 2017.

  1. How do i make it so my OnJoin code runs after the MOTD?
    Code (Text):
        public void onJoin(PlayerJoinEvent e) {
            Player p = e.getPlayer();
            if (p.hasPermission("Quantum.newsletter")) {
                System.out.println("event fired");
                p.sendMessage("§8» &fThe &aApril &fnewletter is available to read. Use the command &a//newsletter&f to read!");
  2. What do you want to run after the motd?
  3. The code I've added into the Message
  4. Im using Essentials for the MOTD
  5. You're making no sense at all.
  6. Ohhh I see,
    You're wanting the essentials MOTD to display after yours?
    Set the priority of the event to highest.
    Code (Text):
    @EventHandler (priority = EventPriority.HIGHEST)
  7. He wants the Essentials MOTD to run before his.
  8. Schedule a delayed task to have the message sent 50 ticks after they join? You could always tweak the time shorter or longer to make it appear when you want it to

    Sent from my iPhone using Tapatalk
  9. Correctino (You get it (xD))
  10. Delay the message by using BukkitRunnable
  11. How do i do that?
  12. Look up bukkitRunnables

    Sent from my iPhone using Tapatalk
  13. new BukkitRunnable{
    public void run(){
    //send message
    }.runTaskLater(yourMainInstance, timeInSecs*20);

    Guys are going to kill me for spoonfeeding :D
  14. Nah, forkfeeding is fine.
    • Funny Funny x 1