Spectator with time

Discussion in 'Spigot Plugin Help' started by JimmYTje, May 5, 2017.

  1. Is there a plugin with Spectatormode for like 5seconds?
     
  2. Use a bukkitrunnable to remove the player from spectator mode.
     
  3. What does that mean?
     
  4. Set the player's gamemode to Spectator. And use this code:

    Code (Text):
                  Bukkit.getScheduler().runTaskLater({instance from your class which extends JavaPlugin}, new Runnable()
                  {            
                    public void run()
                    {        
                               // Setting the player's gamemode to survival
    p.setGameMode(GameMode.SURVIVAL);
                        }
                    }          
                  }, 20*{yourseconds}L);
            }
     
  5. Where? What is bukkitrunnable