GamerChappy
Experienced
- Joined
- Apr 10, 2013
- Messages
- 366
- Reaction score
- 180
Ava, please look at this.
One thing I'm surprised NCP hasn't implemented yet is a universal regeneration hacker detection script.
And seeing as it hasn't been put in as a Feature Suggestion, I decided to make this thread along with my thought of how the script would run.
In my head, the script would go something like this:
'Regeneration Detector.java'
In simpler terms:
In Minecraft, you have a maximum of 20 health points, or 10 hearts (). Every 5 seconds, Minecraft checks whether you have less than 20 health points. If you do, Minecraft will check whether you have at least 18 hunger points, or 9 'bars' of hunger (). If both of these check out, you will regenerate 1 health point, or half a heart ().
Regeneration hacking works by making your game 'ticking', or measure of time run faster. 'Ticking' is used in games to measure time. Obviously, Minecraft uses this. Normally, you will regenerate half a heart () every 100 ticks (5 seconds), but a regeneration hack could make your game 'ticking' run 50 times faster, meaning that you would regenerate half a heart every 2 ticks (0.1 of a second). This means you could gain 10 hearts () in 40 ticks (or 2 seconds)!
The (only) flaw to regeneration hacking is that EVERYTHING in Minecraft that relies on the game 'ticking' will go just as fast. For the following examples, I'm going to pretend that I made Minecraft's 'ticking' run 50 times faster:
Running out of breath underwater: 0.3 seconds.
Drowning after running out of breath (with 20 health points, or 10 hearts () to start with): 0.2 seconds.
"Attempting to swim in lava" (with 4 health points, or 2 hearts (
) taken every half second): 0.05 seconds.
Stop burning (after being lit on fire with a flint and steel, and having 8 health points, or 4 hearts () taken away): 0.08 seconds.
How my script works:
Every 5 seconds, the server checks your amount of health points. If you have regenerated too many health points between two checks, you get kicked from the server. If you have eaten a golden apple, the script will know that, and will allow the amount of regenerated health points to be higher.
Notes:
I have been told that regeneration hacks can now have their speeds controlled. This would eliminate those sneaky ones, but still catch the obvious ones.
I have taken into consideration the possibility of lag, noting that the extra 3 health points of compensation is added due to the possibility of a 15 second lag spike (the longest possible time allowed before a timeout exception).
I have also compensated for the use of Golden Apples, and in turn said for the script to modify the detection algorithm.
Leave suggestions, constructive criticism or anything else you have to say below!
NOTE: My idea is just an idea. I do not know how to code java, let alone any sort of programming language. You could not just copy and paste these into the server files and make them magically run!
Thanks,
GamerChappy.
EDIT: Changed the command from 1 week ban to kick.
EDIT: Explained how my script would work (in English terms).
EDIT: Added in JWangWingWong's pseudo-code.
One thing I'm surprised NCP hasn't implemented yet is a universal regeneration hacker detection script.
And seeing as it hasn't been put in as a Feature Suggestion, I decided to make this thread along with my thought of how the script would run.
In my head, the script would go something like this:
'Regeneration Detector.java'
- 1. Check [player] [health points(1)]
- 2. Sleep 5 seconds.
- 3. Check [player] [health points(2)]
- 4a. If [potion] 'Regeneration II' status = false, perform [step] 5a;
- 4b. If [potion] 'Regeneration II' status = true, perform [step] 5b;
- 5a. If '[player] [amount of hearts(2)]' - '[player] [amount of hearts(1)' > 4 {You regenerate half a heart every 5 seconds with a full bar of hunger, but just to be on the safe side, you'd be better off adding three more health points (or one and a half hearts)} say '/kick [player] Detected increased Regeneration Speed'
- 5b. If '[player] [amount of hearts(2)' - '[player] [amount of hearts(1)]' > 8 {An added 4 health points in total is given to the player over 5 seconds} say '/kick [player] Detected increased Regeneration Speed'
- 6a. If '[player] [amount of hearts(2)]' - '[player] [amount of hearts(1)]' ≤ 4, re-run 'Regeneration Detector.java'
- 6b. If '[player] [amount of hearts(2)]' - '[player] [amount of hearts(1)]' ≤ 8, re-run 'Regeneration Detector.java'
Code:
Algorithm RegenHackDetector(namePlayer)
Detects if a player is regenerating health in an exploitive way
Pre:
namePlayer :: a reference to Player class
Post:
Nothing
Return:
False if player is not regenerating hearts in an exploitive manner
True if a player is regenerating hearts in an exploitive manner
while(namePlayer.online is true)
regenTime <- 5 //set to seconds
temp1 <- namePlayer.hearts
counter(regenTime)
temp2 <- namePlayer.hearts
//Gives the number of change
change <- temp2 - temp1
if(namePlayer.status.regeneration2 is false)
if(change > 4)
print "/kick namePlayer.name "Detected increased regeneration speed""
return true
end if
else if (namePlayer.status.regeneration2 is true)
if(change > 8)
print "/kick namePlayer.name "Detected increased regeneration speed""
return true
end if
//no need to do 6a and 6b if the player is offline
end while
return false
end
In Minecraft, you have a maximum of 20 health points, or 10 hearts (). Every 5 seconds, Minecraft checks whether you have less than 20 health points. If you do, Minecraft will check whether you have at least 18 hunger points, or 9 'bars' of hunger (). If both of these check out, you will regenerate 1 health point, or half a heart ().
Regeneration hacking works by making your game 'ticking', or measure of time run faster. 'Ticking' is used in games to measure time. Obviously, Minecraft uses this. Normally, you will regenerate half a heart () every 100 ticks (5 seconds), but a regeneration hack could make your game 'ticking' run 50 times faster, meaning that you would regenerate half a heart every 2 ticks (0.1 of a second). This means you could gain 10 hearts () in 40 ticks (or 2 seconds)!
The (only) flaw to regeneration hacking is that EVERYTHING in Minecraft that relies on the game 'ticking' will go just as fast. For the following examples, I'm going to pretend that I made Minecraft's 'ticking' run 50 times faster:
Running out of breath underwater: 0.3 seconds.
Drowning after running out of breath (with 20 health points, or 10 hearts () to start with): 0.2 seconds.
"Attempting to swim in lava" (with 4 health points, or 2 hearts (
Stop burning (after being lit on fire with a flint and steel, and having 8 health points, or 4 hearts () taken away): 0.08 seconds.
How my script works:
Every 5 seconds, the server checks your amount of health points. If you have regenerated too many health points between two checks, you get kicked from the server. If you have eaten a golden apple, the script will know that, and will allow the amount of regenerated health points to be higher.
Notes:
I have been told that regeneration hacks can now have their speeds controlled. This would eliminate those sneaky ones, but still catch the obvious ones.
I have taken into consideration the possibility of lag, noting that the extra 3 health points of compensation is added due to the possibility of a 15 second lag spike (the longest possible time allowed before a timeout exception).
I have also compensated for the use of Golden Apples, and in turn said for the script to modify the detection algorithm.
Leave suggestions, constructive criticism or anything else you have to say below!
NOTE: My idea is just an idea. I do not know how to code java, let alone any sort of programming language. You could not just copy and paste these into the server files and make them magically run!
Thanks,
GamerChappy.
EDIT: Changed the command from 1 week ban to kick.
EDIT: Explained how my script would work (in English terms).
EDIT: Added in JWangWingWong's pseudo-code.
Last edited: