• Our Minecraft servers are offline but we will keep this forum online for any community communication. Site permissions for posting could change at a later date but will remain online.

Regeneration Detector.java [Idea]

Status
Not open for further replies.

Toe

District 13
Joined
Nov 16, 2013
Messages
2,408
Reaction score
1,471
I would read this if I weren’t so flabbergasted already.
 

JWingWangWong

Experienced
Joined
Mar 10, 2013
Messages
274
Reaction score
202
I basically translated your top-down design into basic pseudocode
NOTE: I have no idea what the classes specific details are but if you can understand this there is no need to worry about that.
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
To apply you'd definitely need to understand Java, since Minecraft is done in Java and therefore Minecraft related things are also done in Java.
Actually this is far from true. You do not need to understand anything in Java to write Java but rather understand the concept of algorithms of computing code to understand Java. You could know the whole knowledge of Java but if you do not know how to write algorithms and concepts you basically do not understand Java at all. Computer coding in general is about understanding how to make algorithms and how to make small functions build together into a larger application. That is why if you know one language and the concepts behind it you basically know it all aside from language differences and libraries. My pseudocode is basically written so that a developer could translate this into an actual adt in Java and because of this I basically wrote an algorithm in Java without knowing much Java at all! (Although Java and C++ are very alike)
 
Last edited:

GamerChappy

Experienced
Joined
Apr 10, 2013
Messages
366
Reaction score
180
I basically translated your top-down design into basic pseudocode
NOTE: I have no idea what the classes specific details are but if you can understand this there is no need to worry about that.
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

Actually this is far from true. You do not need to understand anything in Java to write Java but rather understand the concept of algorithms of computing code to understand Java. You could know the whole knowledge of Java but if you do not know how to write algorithms and concepts you basically do not understand Java at all. Computer coding in general is about understanding how to make algorithms and how to make small functions build together into a larger application. That is why if you know one language and the concepts behind it you basically know it all aside from language differences and libraries. My pseudocode is basically written so that a developer could translate this into an actual adt in Java and because of this I basically wrote an algorithm in Java without knowing much Java at all! (Although Java and C++ are very alike)
Although you forgot about the part to check for the status of Regeneration II, I applaud you. If you could add that part of code in, I'll put the code in the first post!

Also, regarding what you said that you pretty much just need to understand the concept of Java to know how to code it, I'm teaching myself Python at the moment. I find it quite simple and have been making little scripts or tasks run by CMD. Would that be a good step towards Java? One thing I'm trying to do is to make a script that makes ASCII art from pictures. :3
 

JWingWangWong

Experienced
Joined
Mar 10, 2013
Messages
274
Reaction score
202
Although you forgot about the part to check for the status of Regeneration II, I applaud you. If you could add that part of code in, I'll put the code in the first post!
This snippet of code from my last message
Code:
        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
checks if regeneration is true or false then checks if change > 4 or if change > 8 depending on those respective circumstances.


Also, regarding what you said that you pretty much just need to understand the concept of Java to know how to code it, I'm teaching myself Python at the moment. I find it quite simple and have been making little scripts or tasks run by CMD. Would that be a good step towards Java? One thing I'm trying to do is to make a script that makes ASCII art from pictures. :3
Python is similar to other languages but scripting all together is expressed differently. You will use a ton of concepts from C++/any other programming languages into Python. I should note now that codes like HTML and CSS are a lot different since their concepts involve more about formatting although class concepts (styles in this case) are familiar. Just keep working at a language that interests you and then once you master it try to understand other languages just from your knowledge of python. You will learn other languages a lot quicker when you do this.
 

GamerChappy

Experienced
Joined
Apr 10, 2013
Messages
366
Reaction score
180
This snippet of code from my last message
Code:
        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
checks if regeneration is true or false then checks if change > 4 or if change > 8 depending on those respective circumstances.




Python is similar to other languages but scripting all together is expressed differently. You will use a ton of concepts from C++/any other programming languages into Python. I should note now that codes like HTML and CSS are a lot different since their concepts involve more about formatting although class concepts (styles in this case) are familiar. Just keep working at a language that interests you and then once you master it try to understand other languages just from your knowledge of python. You will learn other languages a lot quicker when you do this.
Thanks so much for the tips. Sorry I didn't notice the code. Also, does 'hearts' represent 10 hearts, or 20 health points? Because my design referred to health points, not hearts.
 

JWingWangWong

Experienced
Joined
Mar 10, 2013
Messages
274
Reaction score
202
Thanks so much for the tips. Sorry I didn't notice the code. Also, does 'hearts' represent 10 hearts, or 20 health points? Because my design referred to health points, not hearts.
It's based off your design so if you designed it for heart points then that is what the values reflect. I think in Minecraft the programming will always represent hearts as heart points whereas the GUI represents it as 10 hearts.
 

GamerChappy

Experienced
Joined
Apr 10, 2013
Messages
366
Reaction score
180
It's based off your design so if you designed it for heart points then that is what the values reflect. I think in Minecraft the programming will always represent hearts as heart points whereas the GUI represents it as 10 hearts.
Sweet. I'll add your pseudo-code to the first post. ;)
 

Ava

Administrator
Joined
Jan 1, 2013
Messages
1,346
Reaction score
5,399
Regen hacks aren't that simple, considering you can't force the server to apply a potion effect on you as a client.
Anywayyyyyys... regen hacks should hopefully be patched with a NCP update we're doing soon, we just want to be sure that the configuration is tuned properly first.
 
Status
Not open for further replies.

Members online

No members online now.

Forum statistics

Threads
242,193
Messages
2,449,633
Members
523,972
Latest member
Atasci