I want to make, when night, players gains like nightvision, I have code, but I don't know where to write it, code: Code:java if(player.getWorld().getTime() == 13000){player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, 600, 2));} Maybe this thing have specific event?
Wingas You could use a runnable to check the time every second, or whatever time interval you want. This should help: http://wiki.bukkit.org/Scheduler_Programming
Wingas There's an example, sorry multiple examples, on here: http://wiki.bukkit.org/Scheduler_Programming
Wingas use a sync repeating task (.runTaskTimer()) with an interval chosen by you (say, every 5 seconds). In that task, check the time - if it's dusk (within the same time range as the interval you chose) then give the player(s) the night vision effect. Do the opposite if it's dawn.
I agree with DannyDog. The are more ways to approach this. I reccomend to start here: http://wiki.bukkit.org/Scheduler_Programming I also understand that you're looking for an example? Here's one: Code:java Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable(){public void run(){// Do desired code here, and of course, define the Player above;}}, <The ticks, i don't know how many ticks a day has :P>(); Warning: May contain mistakes, written by hand!