var scriptName = "TimeChanger"; // The name of your script
var scriptVersion = 1.0; // The version of your script 
var scriptAuthor = "Coccocoa's Helper"; // The author of your script (eg. your username)

var S03PacketTimeUpdate = Java.type("net.minecraft.network.play.server.S03PacketTimeUpdate");

function TimeChanger() {
    var Time = value.createInteger("Time", 10000, 0, 20000)
    this.getName = function() {
        return "TimeChanger";
    };

    this.getDescription = function() {
        return "Changes the time visually.";
    };

    this.getCategory = function() {
        return "Fun";
    };

    this.onUpdate = function() {
        mc.theWorld.setWorldTime(Time.get())
    }
    this.onPacket = function(event) {
        var packet = event.getPacket()
        if(packet instanceof S03PacketTimeUpdate) {
            event.cancelEvent()
        }
    }
    this.addValues = function(values) {
        values.add(Time)
    }
}

var TimeChanger = new TimeChanger();

function onEnable() {
    moduleManager.registerModule(TimeChanger);
};

function onDisable() {
    moduleManager.unregisterModule(TimeChanger);
};