I've searched for this, but I couldn't find any good information about game time, but they all talked about real time. So I tried checking the time every second. This is the code I have: Code: public class Main extends JavaPlugin { boolean isNight = false; boolean lastIsNight = true;@Overridepublic void onEnable() { getLogger().info("Loading..."); new BukkitRunnable() { @Overridepublic void run() { Server server = getServer(); long time = server.getWorld("wild").getTime(); if (time > 14000 || time < 1000) { isNight = true; if (lastIsNight == false) { Bukkit.broadcastMessage("It's night!");lastIsNight = true;} } else { isNight = false; if (lastIsNight == true) { Bukkit.broadcastMessage("It's day!");lastIsNight = false;} } } }.runTaskTimer(this, 20, 20);getLogger().info("Loaded!");} @Overridepublic void onDisable() { getLogger().info("Bye!");} } (Bukkit forums for some reason removed some newlines, my code might be hard to read, sorry!) And now this spams NPE every second. Any ideas?
Oh, my testing server was different from the server that will be actually used, thanks! Edit: It works after making the world name editable on config.yml!