var scriptName = "SFly"; // The name of your script
var scriptVersion = 0.1; // The version of your script 
var scriptAuthor = "Alan"; // The author of your script

var SFly = new SFly();
var SenceClient; { //Utilities
    strafe = moduleManager.getModule("Strafe");
    blink = moduleManager.getModule("Blink");
    player = Java.type("net.minecraft.entity.Entity")

    var C06PlayerPacket = Java.type('net.minecraft.network.play.client.C03PacketPlayer.C06PacketPlayerPosLook');
    var C04PacketPlayerPosition = Java.type('net.minecraft.network.play.client.C03PacketPlayer.C04PacketPlayerPosition')
    var C05PacketPlayerLook = Java.type('net.minecraft.network.play.client.C03PacketPlayer.C05PacketPlayerLook');
    var C03PacketPlayer = Java.type('net.minecraft.network.play.client.C03PacketPlayer');
    var S08PacketPlayerPosLook = Java.type("net.minecraft.network.play.server.S08PacketPlayerPosLook");
    var packet;


    function randomIntFrom(min, max) { // Get a random integer from [min] to [max] 
        return Math.floor(Math.random() * (max - min + 1) + min);
    }
    Math.radians = function (degrees) {
        return degrees * Math.PI / 180;
    };

    Math.degrees = function (radians) { // Converts from radians to degrees.
        return radians * 180 / Math.PI;
    };

    function vClip(offset) {
        mc.thePlayer.setPosition(mc.thePlayer.posX, mc.thePlayer.posY + offset, mc.thePlayer.posZ);
    }

    function hClip(offset) {
        var playerYaw = Math.radians(mc.thePlayer.rotationYaw);
        mc.thePlayer.setPosition(mc.thePlayer.posX - (Math.sin(playerYaw) * offset), mc.thePlayer.posY, mc.thePlayer.posZ + (Math.cos(playerYaw) * offset));
    }

    function hMotion(offset) {
        mc.thePlayer.motionX = parseFloat(Math.cos(Math.radians(mc.thePlayer.rotationYaw + 90.0)) * offset)
        mc.thePlayer.motionZ = parseFloat(Math.sin(Math.radians(mc.thePlayer.rotationYaw + 90.0)) * offset)
    }

    function packetClip(offsetH, offsetY,onGround) {
        var playerYaw = Math.radians(mc.thePlayer.rotationYaw);
        mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX - (Math.sin(playerYaw) * offsetH), mc.thePlayer.posY + offsetY, mc.thePlayer.posZ + (Math.cos(playerYaw) * offsetH), onGround));
    }

    function onlyForward() {
        if (mc.gameSettings.keyBindRight.pressed == false && mc.gameSettings.keyBindForward.pressed && mc.gameSettings.keyBindLeft.pressed == false && mc.gameSettings.keyBindBack.pressed == false) {
            return true;
        } else {
            return false;
        }
    }

    function forwardPressed() {
        if (mc.gameSettings.keyBindForward.pressed) {
            return true;
        } else {
            return false;
        }
    }

    function side() {
        if (mc.gameSettings.keyBindRight.pressed || mc.gameSettings.keyBindLeft.pressed || mc.gameSettings.keyBindBack.pressed) {
            return true;
        } else {
            return false;
        }
    }


    function motion(offset) {
        mc.thePlayer.motionX = 0
        mc.thePlayer.motionZ = 0
        if (mc.gameSettings.keyBindRight.pressed && mc.gameSettings.keyBindForward.pressed == false && mc.gameSettings.keyBindLeft.pressed == false && mc.gameSettings.keyBindBack.pressed == false) {
            mc.thePlayer.motionX = parseFloat(Math.cos(Math.radians(mc.thePlayer.rotationYaw)) * offset * -1)
            mc.thePlayer.motionZ = parseFloat(Math.sin(Math.radians(mc.thePlayer.rotationYaw)) * offset * -1)
        }
        if (mc.gameSettings.keyBindForward.pressed && mc.gameSettings.keyBindRight.pressed == false && mc.gameSettings.keyBindLeft.pressed == false && mc.gameSettings.keyBindBack.pressed == false) {
            mc.thePlayer.motionX = parseFloat(Math.cos(Math.radians(mc.thePlayer.rotationYaw + 90.0)) * offset)
            mc.thePlayer.motionZ = parseFloat(Math.sin(Math.radians(mc.thePlayer.rotationYaw + 90.0)) * offset)
        }
        if (mc.gameSettings.keyBindLeft.pressed && mc.gameSettings.keyBindRight.pressed == false && mc.gameSettings.keyBindForward.pressed == false && mc.gameSettings.keyBindBack.pressed == false) {
            mc.thePlayer.motionX = parseFloat(Math.cos(Math.radians(mc.thePlayer.rotationYaw)) * offset)
            mc.thePlayer.motionZ = parseFloat(Math.sin(Math.radians(mc.thePlayer.rotationYaw)) * offset)
        }
        if (mc.gameSettings.keyBindBack.pressed && mc.gameSettings.keyBindRight.pressed == false && mc.gameSettings.keyBindForward.pressed == false && mc.gameSettings.keyBindLeft.pressed == false) {
            mc.thePlayer.motionX = parseFloat(Math.cos(Math.radians(mc.thePlayer.rotationYaw + 90.0)) * offset * -1)
            mc.thePlayer.motionZ = parseFloat(Math.sin(Math.radians(mc.thePlayer.rotationYaw + 90.0)) * offset * -1)
        }

        if (mc.gameSettings.keyBindRight.pressed && mc.gameSettings.keyBindForward.pressed == false && mc.gameSettings.keyBindLeft.pressed == false && mc.gameSettings.keyBindBack.pressed) {
            mc.thePlayer.motionX = parseFloat(Math.cos(Math.radians(mc.thePlayer.rotationYaw + 90.0) + 90) * offset)
            mc.thePlayer.motionZ = parseFloat(Math.sin(Math.radians(mc.thePlayer.rotationYaw + 90.0) + 90) * offset)
        }
        if (mc.gameSettings.keyBindRight.pressed && mc.gameSettings.keyBindForward.pressed && mc.gameSettings.keyBindLeft.pressed == false && mc.gameSettings.keyBindBack.pressed == false) {
            mc.thePlayer.motionX = parseFloat(Math.cos(Math.radians(mc.thePlayer.rotationYaw + 90.0) + 45) * offset)
            mc.thePlayer.motionZ = parseFloat(Math.sin(Math.radians(mc.thePlayer.rotationYaw + 90.0) + 45) * offset)
        }
        if (mc.gameSettings.keyBindRight.pressed == false && mc.gameSettings.keyBindForward.pressed && mc.gameSettings.keyBindLeft.pressed && mc.gameSettings.keyBindBack.pressed == false) {
            mc.thePlayer.motionX = parseFloat(Math.cos(Math.radians(mc.thePlayer.rotationYaw + 90.0) + -45) * offset)
            mc.thePlayer.motionZ = parseFloat(Math.sin(Math.radians(mc.thePlayer.rotationYaw + 90.0) + -45) * offset)
        }
        if (mc.gameSettings.keyBindRight.pressed == false && mc.gameSettings.keyBindForward.pressed == false && mc.gameSettings.keyBindLeft.pressed && mc.gameSettings.keyBindBack.pressed) {
            mc.thePlayer.motionX = parseFloat(Math.cos(Math.radians(mc.thePlayer.rotationYaw + 90.0) - 90) * offset)
            mc.thePlayer.motionZ = parseFloat(Math.sin(Math.radians(mc.thePlayer.rotationYaw + 90.0) - 90) * offset)
        }
    }

    function isMoving() {
        if (mc.gameSettings.keyBindForward.pressed || mc.gameSettings.keyBindBack.pressed || mc.gameSettings.keyBindLeft.pressed || mc.gameSettings.keyBindRight.pressed) {
            return true;
        } else {
            return false;
        }
    }

}

function SFly() {
    { //SFly Utilities
        var Mode = value.createList("Mode", ["OldNCP", "CubecraftInf", "CubecraftWtf", "Verus", "CubecraftVert", "MCCentral", "MushMC", "NCPLongJump", "MineplexLongJump", "Hypixel", "VerusFlag", "Matrix", "AnticheatReloaded", "Rionic"], "OldNCP");
        var CubecraftInfDmg = value.createBoolean("CubecraftInfDmg", false);
        var CubecraftInfFallCheckBypass = value.createBoolean("CubecraftInfFallCheckBypass", false);
        var GhostBlockJumpInteract = value.createBoolean("GhostBlockJumpInteract", false);
        var GhostBlockJumpSlow = value.createBoolean("GhostBlockJumpSlow", false);
    }

    this.getTag = function () {
        return Mode.get()
    }

    this.addValues = function (sence) {
        sence.add(Mode);
        sence.add(CubecraftInfDmg);
        sence.add(CubecraftInfFallCheckBypass);
        sence.add(GhostBlockJumpInteract);
        sence.add(GhostBlockJumpSlow);
    }

    this.getName = function () {
        return "SFly";
    };

    this.getDescription = function () {
        return "SFly";
    };

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

    this.onUpdate = function () {
        { //Utilities
            ticks += 1; //ticks

            if (hurted) {
                afterticks += 1;
            }

            if (mc.thePlayer.hurtTime == 9) {
                hurted = true;
            }

            if (mc.thePlayer.onGround) {
                offGroundTicks = 0;
            } else {
                offGroundTicks += 1;
            }
        }

        switch (Mode.get()) {
            case "OldNCP": {
                mc.thePlayer.motionY = 0;
                if (mc.thePlayer.ticksExisted % 2 == 0 && mc.thePlayer.onGround == false) {
                    mc.thePlayer.motionY = -0.0001;
                } else {
                    mc.thePlayer.motionY = 0.0001;
                }
                mc.thePlayer.onGround = true;
                break;
            }
            case "CubecraftInf": {
                if (ticks > 1) {
                    if (CubecraftInfFallCheckBypass.get() || !CubecraftInfFallCheckBypass.get()) {
                        mc.thePlayer.motionY = 0;
                        if (mc.thePlayer.ticksExisted % 3 == 0) {
                            mc.thePlayer.motionY = 0.15;
                            mc.timer.timerSpeed = 0.5;
                            if (forwardPressed()) {
                                motion(2.95);
                            } else if (side()) {
                                motion(1);
                            }
                        } else {
                            mc.timer.timerSpeed = 1.1;
                            mc.thePlayer.motionY = -0.075;
                            motion(0.25);
                        }

                        if (mc.thePlayer.onGround || mc.thePlayer.ticksExisted < 5) {
                            OPosX = mc.thePlayer.posX;
                            OPosY = mc.thePlayer.posY;
                            OPosZ = mc.thePlayer.posZ;
                        }
                        if (mc.thePlayer.posY > OPosY - 1.65 && !CubecraftInfFallCheckBypass.get()) {
                            if (mc.thePlayer.getDistance(OPosX, mc.thePlayer.posY, OPosZ) > 45 && !hurted) {
                                chat.print("§4Make sure to fall 1.5 blocks when landing to avoid bans.")
                            }
                        }
                        if (mc.gameSettings.keyBindSneak.pressed) {
                            mc.gameSettings.keyBindSneak.pressed = false;
                        }
                    }

                    if (CubecraftInfDmg.get()) {
                        mc.timer.timerSpeed = 0.5;
                    }
                }
                break;
            }
            case "CubecraftVert": {
                if (ticks > 1) {
                    mc.timer.timerSpeed = 0.3;
                    motion(0.14);
                    mc.thePlayer.motionY = -0.16;
                    if (mc.thePlayer.ticksExisted % 3 == 0) {
                        mc.thePlayer.motionY = 0.42;
                        motion(2);
                    }

                    if (mc.gameSettings.keyBindJump.pressed) {
                        mc.thePlayer.motionY = 0.39;
                        if (mc.thePlayer.ticksExisted % 3 == 0) {
                            mc.thePlayer.motionY = 0.42;
                        }
                    }
                    if (mc.gameSettings.keyBindSneak.pressed) {
                        mc.thePlayer.motionY = -0.39;
                        if (mc.thePlayer.ticksExisted % 3 == 0) {
                            mc.thePlayer.motionY = -0.42;
                        }
                    }
                }
                break;
            }
            case "MCCentral": {
                if (mc.thePlayer.posY < sPosY + 0.6 && mc.gameSettings.keyBindSneak.pressed == false || mc.gameSettings.keyBindJump.pressed && mc.gameSettings.keyBindSneak.pressed == false) {
                    mc.thePlayer.motionY += 0.12;
                    mc.thePlayer.motionX *= 1.1;
                    mc.thePlayer.motionZ *= 1.1;
                    if (mc.gameSettings.keyBindJump.pressed || mc.gameSettings.keyBindSneak.pressed) {
                        sPosY = mc.thePlayer.posY
                    }
                }
                if (!isMoving()) {
                    motion(0);
                }
                mc.gameSettings.keyBindSneak.pressed = false;
                break;
            }
            case "MushMC": {
                mc.timer.timerSpeed = 1.4;
                motion(0);
                mc.thePlayer.motionY = -0.2;
                if (mc.thePlayer.ticksExisted % 10 != 0) {
                    motion(9);
                    mc.thePlayer.motionY = -0.1;
                } else if (mc.gameSettings.keyBindJump.pressed == false) {
                    mc.thePlayer.motionY = 0.5;
                }

                if (mc.thePlayer.ticksExisted % 10 != 0 && mc.gameSettings.keyBindJump.pressed) {
                    mc.thePlayer.motionY = 3;
                    motion(0);
                }

                if (mc.gameSettings.keyBindSneak.pressed) {
                    mc.thePlayer.motionY = -2.5;
                    motion(0);
                }

                if (mc.gameSettings.keyBindSneak.pressed == false && mc.gameSettings.keyBindJump.pressed == false && mc.gameSettings.keyBindForward.pressed == false && mc.thePlayer.ticksExisted % 2 == 0) {
                    mc.thePlayer.motionY = 0.3;
                }
                break;
            }
            case "CubecraftWtf": {
                mc.timer.timerSpeed = 1;
                if (mc.thePlayer.onGround) {
                    motion(0.1);
                }
                if (ticks == 1) {
                    motion(-0.1);
                    mc.thePlayer.motionY = -0.8;
                    if (mc.thePlayer.onGround) {
                        for (var i = 0; i < 80; ++i) { //DMG
                            mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 0.0510000001, mc.thePlayer.posZ, false));
                            mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, false));
                        }
                    }
                }
                if (ticks == 2) {
                    if (mc.thePlayer.onGround) {
                        mc.thePlayer.jump();
                        wasonground = true;
                        mc.thePlayer.motionY = 0.43;
                    }
                }
                if (ticks == 3 && wasonground) {
                    motion(4.5);
                }
                if (!isMoving()) {
                    motion(0);
                }

                if (mc.thePlayer.motionY < 0.3 && mc.thePlayer.fallDistance < 1) {
                    mc.thePlayer.motionY += 0.02;
                }

                if (mc.thePlayer.onGround || mc.thePlayer.ticksExisted < 5) {
                    OPosX = mc.thePlayer.posX;
                    OPosY = mc.thePlayer.posY;
                    OPosZ = mc.thePlayer.posZ;
                }
                if (mc.thePlayer.fallDistance < 1 && offGroundTicks > 2) {
                    if (mc.thePlayer.motionY < 0) {
                        mc.thePlayer.motionY += 0.03;
                    } else {
                        if (offGroundTicks > 3) {
                            mc.thePlayer.motionY += 0.01;
                        }
                    }
                }
                break;
            }
            case "GhostBlockJump": {
                mc.timer.timerSpeed = 1.0;
                if (mc.thePlayer.onGround){
                    OPosY = mc.thePlayer.posY;
                }
                OPosY = Math.floor(OPosY);
                if (mc.thePlayer.ticksExisted % 10 == 0) {
                    if (mc.gameSettings.keyBindJump.pressed) {
                        OPosY++;
                    }
                    if (mc.gameSettings.keyBindSneak.pressed) {
                        OPosY--;
                    }
                }
                if (mc.thePlayer.posY + mc.thePlayer.motionY < OPosY && jumped == true || mc.thePlayer.onGround) {
                    chat.print(OPosY);
                    jumped = false;
                    mc.timer.timerSpeed = 1.0;
                    mc.thePlayer.setPosition(mc.thePlayer.posX, OPosY, mc.thePlayer.posZ);

                    offGroundTicks = 0;
                    mc.thePlayer.onGround = true;
                    packetClip(0,0,true);
                    if (GhostBlockJumpSlow.get()){
                        mc.thePlayer.motionY = 0.42;
                    }else{
                        mc.thePlayer.jump();
                    }
                    if (GhostBlockJumpInteract.get()){
                        mc.playerController.sendUseItem(mc.thePlayer, mc.theWorld, mc.thePlayer.getHeldItem());
                    }
                }else{
                    jumped = true;
                }
                break;
            }
            case "NCPLongJump": {
                if (isMoving()) {
                    if (mc.thePlayer.onGround && jumped == false) {
                        mc.thePlayer.jump();
                        jumped = true;
                    } else if (offGroundTicks == 2) {
                        motion(0.929);
                    }
                }
                break;
            }
            case "Hypixel": {
                if (ticks > 3) {
                    mc.thePlayer.motionY = 0;
                    if (mc.thePlayer.ticksExisted % 3 == 0 && mc.thePlayer.onGround == false) {
                        mc.thePlayer.setPosition(mc.thePlayer.posX, mc.thePlayer.posY - 0.01700000000000000000000002005, mc.thePlayer.posZ);
                        mc.thePlayer.setPosition(mc.thePlayer.posX, mc.thePlayer.posY - 0.001100000058005, mc.thePlayer.posZ);
                    } else {
                        mc.thePlayer.setPosition(mc.thePlayer.posX, mc.thePlayer.posY + 0.0050012000000055, mc.thePlayer.posZ);
                        mc.thePlayer.setPosition(mc.thePlayer.posX, mc.thePlayer.posY - 0.0000000002000000055, mc.thePlayer.posZ);
                        mc.thePlayer.setPosition(mc.thePlayer.posX, mc.thePlayer.posY - 0.000000050004000000025, mc.thePlayer.posZ);
                        mc.thePlayer.setPosition(mc.thePlayer.posX, mc.thePlayer.posY + 0.00000002000000025, mc.thePlayer.posZ);
                        mc.thePlayer.setPosition(mc.thePlayer.posX, mc.thePlayer.posY - 0.000010004000000015, mc.thePlayer.posZ);
                    }
                }
                if (ticks == 1) {
                    if (mc.thePlayer.onGround) {
                        for (var i = 0; i < 85; ++i) { //DMG
                            mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 0.0490000001, mc.thePlayer.posZ, false));
                            mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, false));
                        }
                    }
                }
                if (ticks == 3) {
                    mc.getNetHandler().addToSendQueue(new C03PacketPlayer(true))
                    motion(1.25);
                }
                if (ticks == 2) {
                    mc.thePlayer.jump();
                }
                if (ticks == 1) {
                    mc.timer.timerSpeed = 1;
                }
                if (ticks == 15) {
                    mc.timer.timerSpeed = 1;
                }
                if (ticks == 16) {
                    mc.timer.timerSpeed = 1;
                }
                mc.thePlayer.speedInAir = 0.02;
                if (ticks < 25) {
                    mc.thePlayer.speedInAir = 0.04591;
                }
                break;
            }
            case "MineplexLongJump": {
                mc.thePlayer.speedInAir = 0.042;
                mc.timer.timerSpeed = 1;
                if (mc.gameSettings.keyBindForward.pressed || mc.gameSettings.keyBindBack.pressed || mc.gameSettings.keyBindLeft.pressed || mc.gameSettings.keyBindRight.pressed) {
                    if (mc.thePlayer.onGround) {
                        wasonground = true;
                        mc.thePlayer.jump();
                        jumped = true;
                        hMotion(0.0001);
                        mc.thePlayer.onGround = false;
                    } else {
                        if (wasonground) {
                            wasonground = false;
                        }
                    }
                    if (offGroundTicks == 1 && jumped) {
                        motion(0.699);
                    }

                } else {
                    motion(0);
                }

                if (mc.thePlayer.onGround == false && offGroundTicks >= 1) {
                    mc.thePlayer.motionY += 0.038;
                }
                if (mc.thePlayer.motionY < 0 && offGroundTicks > 1) {
                    if (mc.thePlayer.fallDistance < 2) {
                        mc.thePlayer.motionY -= 0.009;
                    } else {
                        mc.thePlayer.motionY -= 0.038;
                    }

                }
                break;
            }
            case "Verus": {
                if (mc.thePlayer.onGround) {
                    mc.thePlayer.jump();
                }
                mc.timer.timerSpeed = 0.3;
                motion(0.2);
                if (mc.thePlayer.ticksExisted % 9 == 0) {
                    motion(5);
                } else if (mc.thePlayer.motionY < 0 && mc.thePlayer.ticksExisted % 3 != 0) {
                    mc.thePlayer.motionY = 0;
                }
                break;
            }
            case "Matrix": {
                if (mc.thePlayer.fallDistance > 0.1) {
                    mc.thePlayer.motionY *= 0.1;
                    mc.thePlayer.fallDistance = 0;
                }
                break;
            }
            case "AnticheatReloaded": {
                if (mc.thePlayer.ticksExisted % 2 == 0) {
                    mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, true));
                    mc.timer.timerSpeed = 0.65;
                }
                motion(0.35);
                mc.thePlayer.motionY = 0;
                if (mc.gameSettings.keyBindJump.pressed) {
                    mc.thePlayer.motionY = 0.35;
                }
                if (mc.gameSettings.keyBindSneak.pressed) {
                    mc.thePlayer.motionY = -0.35;
                }
                break;
            }

            case "Rionic": {
                if (ticks > 1) {
                    mc.thePlayer.motionY = 0;
                    if (mc.thePlayer.ticksExisted % 3 == 0) {
                        mc.thePlayer.motionY = 0.15;
                        mc.timer.timerSpeed = 0.5;
                        motion(2);
                    } else {
                        mc.timer.timerSpeed = 1.1;
                        mc.thePlayer.motionY = -0.075;
                        motion(0.1);
                    }

                    if (mc.gameSettings.keyBindSneak.pressed) {
                        mc.gameSettings.keyBindSneak.pressed = false;
                    }
                }
                break;
            }
            default:
        }
    }

    this.onDisable = function () {
        //Activates on disabling module
        { //Utilities
            mc.timer.timerSpeed = 1.0;
            mc.thePlayer.speedInAir = 0.02;
        }
        if (Mode.get() != "GhostBlockJump") {
            motion(0.2);
        }
        switch (Mode.get()) {
            case "Verus": {
                motion(0.1);
                break;
            }
            case "CubecraftWtf": {
                motion(0.1);
                mc.timer.timerSpeed = 1;
                strafe.setState(false);
                break;
            }
            case "Hypixel": {
                mc.thePlayer.motionY = -0.1;
                blink.setState(false);
                break;
            }
            case "CubecraftVert": {
                mc.thePlayer.motionY = -0.2;
                commandManager.executeCommand(".sfly mode " + OriginalMode);
                break;
            }
            case "MushMC": {
                mc.thePlayer.motionY = -0.1;
                motion(0);
                break;
            }
            case "MCCentral": {
                strafe.setState(false);
                break;
            }
            case "NCPLongJump": {
                blink.setState(false);
                strafe.setState(false);
                break;
            }
            case "CubecraftInf": {
                mc.timer.timerSpeed = 1;
                motion(0.1);
                mc.thePlayer.motionY = -0.1;
                break;
            }
            case "MineplexLongJump": {
                strafe.setState(false);
                mc.timer.timerSpeed = 1;
                motion(0.1);
                break;
            }
            default:
        }
    }
    this.onEnable = function () {
        { //Utilities
            chat.print("§6Script coded by §56Sence §5and §5HackingBros")
            hasFlaged = false;
            ticks = 0;
            afterticks = 0;
            hurted = false;
            Speed = 8;
            stop = false;
            jumped = false;
            afterdmgticks = 0;
            OPosX = mc.thePlayer.posX;
            OPosY = mc.thePlayer.posY;
            OPosZ = mc.thePlayer.posZ;
            offGroundTicks = 0;
            sPosY = mc.thePlayer.posY;
            TPBackPosX = mc.thePlayer.posX;
            TPBackPosY = mc.thePlayer.posY;
            TPBackPosZ = mc.thePlayer.posZ;
            OriginalMode = Mode.get();
        }

        switch (Mode.get()) {
            case "MineplexLongJump": {
                strafe.setState(true);
                break;
            }
            case "MCCentral": {
                strafe.setState(true);
                break;
            }
            case "Hypixel": {

                break;
            }
            case "CubecraftInf": {
                if (CubecraftInfDmg.get()) {
                    mc.thePlayer.motionX = 0;
                    mc.thePlayer.motionZ = 0;
                    if (mc.thePlayer.onGround) {
                        for (var i = 0; i < 85; ++i) { //DMG
                            mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 0.0510000001, mc.thePlayer.posZ, false));
                            mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, false));
                        }
                    }
                }
                break;
            }
            case "CubecraftWtf": {
                offGroundTicks = 0;
                ticks = 0;
                strafe.setState(true);
                break;
            }
            case "CubecraftVert": {
                chat.print("§9Experince The sSentinel §2Minesense Disabled!")
                mc.thePlayer.motionX = 0;
                mc.thePlayer.motionZ = 0;
                if (mc.thePlayer.onGround) {
                    for (var i = 0; i < 85; ++i) { //DMG
                        mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY + 0.0510000001, mc.thePlayer.posZ, false));
                        mc.thePlayer.sendQueue.addToSendQueue(new C04PacketPlayerPosition(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, false));
                    }
                }
                break;
            }
            case "Verus": {
                startedOnGround = false;
                startedOnGround = mc.thePlayer.onGround;
                break;
            }
            case "NCPLongJump": {
                jumped = false;
                blink.getValue("pulse").set(false);
                blink.setState(true);
                strafe.setState(true);
                break;
            }
            default:
        }

    }
}

function onLoad() {
    // Currently this event has to be in every script even if it is not directly needed.
};

function onEnable() {
    SenceClient = moduleManager.registerModule(SFly);

};

function onDisable() {
    moduleManager.unregisterModule(SenceClient);

};