var scriptName = "Anticheat flag detector"; 
var scriptVersion = 1.1; 
var scriptAuthor = "soulplexis";

var colorIndex = 0;

function printMessage(message) {
    var availableColors = ["§c[FLAG DETECTOR] §f", "§c[FLAG DETECTOR] §7"];

    var color = availableColors[colorIndex];
    
    colorIndex += 1;
    if (colorIndex >= availableColors.length) {
        colorIndex = 0;
    }

    chat.print(color + message + "§r");

}

var highJump = new HighJump();
var highJumpClient;
var C03PacketPlayer = Java.type('net.minecraft.network.play.client.C03PacketPlayer');

function HighJump() {
	var ticks = 0;
    this.getName = function() {
        return "FlagDetector";
    };

    this.getDescription = function() {
        return "Attempts to detect anticheat setbacks";
    };

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

    this.onUpdate = function() {
		if(mc.thePlayer.motionY == 0 && !mc.thePlayer.capabilities.isFlying) {
			printMessage(" Anticheat setback detected!");
		}
    }
    this.onDisable = function() {
    }
}

function onLoad() {
};

function onEnable() {
    highJumpClient = moduleManager.registerModule(highJump);
};

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