Today while doing some anti-cheat scripts, I implemented the superjump detection and I want to share it, I tested it using 3-block jumps for testing, but it also works for greater heights (such as the superjump hack)
This script detects and blocks “SuperJump” (jumping 3 blocks or more)
- Blocks the data packet (the hacker/glitcher cannot go up).
- Teleports the player back to their last safe position (bounce back to the ground).
- Uses a “suspicion score” system to avoid kicking players due to accidental lag (false positives).
GLOBAL VARIABLES (Adjustable)
MAX_NET_GAIN = 2.9:
- The maximum allowed jump height in blocks.
- (apx 3 blocks, is not legally possible) if you want to be stricter, lower it (not recommended).
SCORE_THRESHOLD = 100:
- Score limit before kick, each suspicious jump adds points.
- This prevents kicking someone for a single map glitch or high ping/false positive.
OFFSET_LEGS = 2.4:
Physical adjustment, in aos the Z position is at the eyes, I add this
to find the feet (do not modify)
HITBOX_R = 0.35:
Player body radius, used to check if the player is touching a block even with the edge of the foot.
HISTORY_SIZE = 6:
How many previous positions the server remembers, helps verify
if the player climbed using strange diagonal ramps or due to packet loss (safety lock).
KICK_MESSAGE:
Message the player will see when kicked.
DECAY_TIME = 60.0:
This is the interval of continuous clean gameplay (in seconds) that the server requires to reduce suspicion on a player.
DECAY_AMOUNT = 10:
This is the number of points subtracted from the aj_score (suspicion score) once the waiting time is fulfilled.
Each time player feet legally touch the ground, the script saves that height as “safe height”. when go up, the script calculates the difference between the current height and that “safe height”.
If the difference is greater than 2.9 blocks (MAX_NET_GAIN), an internal alert is triggered.
The trajectory history (HISTORY_SIZE) acting as a safety lock, also checks the last 6 positions the player were in, it searches those 6 points to see if there was any block or step that player could have used to climb legally (e.g packet loss).
If the history lock shows that player went up into the air without any solid surface nearby, it confirms that he are using superjump.
If the script detects an illegal jump, it instantly teleports the player back to their “safe height”
(the last safe position on the ground), also send a msg to console/IRC/admins.
It adds 15 points for suspicious jumps and 40 for impossible jumps, once it reaches 100, the kick is executed.
anti_superjump.py (5.3 KB)
Thanks.