1.8.8 NoFall

Discussion in 'Spigot Plugin Development' started by LewisBros101, Jan 15, 2020.

Thread Status:
Not open for further replies.
  1. Hello everyone, I hope you're having a great day! I am here on a topic that I've found very difficult and cannot find the solution to. I have been looking and testing for hours and hours on how to prevent the NoFall hack, even going into the NoCheatPlus source code and still can't find out how to do it. If anyone has any ideas or pointers they want to throw at me go ahead because I'm up for anything I can grab at this point.

    Thanks so much!
  2. I’m not good at making anti cheat plugins, I haven’t done anything similar.
    But I think you can just create a new BukkitRunnable that runs every tick, then every tick save all the players locations in a map
    After that, for each player check if the block below them is air and, if it is and he’s Y coordinates aren’t different from the previous, just kick or ban it.
    I disn’t tested it and I can’t write you the code, I’m on the phone.
    Hope this work
    • Funny Funny x 1
  3. Basically banning 90% of the players? (Standing, moving in x or z)
  4. No, you check onyl the y coordinate
    I repeat, I writed it on the phone and had no time to check, so I don't know if it work
  5. That's what I am trying to say, you can't determine if a player uses hacks just based on the fact that they do not move in the y axis.
  6. I said that it bans the player only if the block below him is made of air or the block where he stands is not solid and the Y coordinates are not perfect (45.54 instead of 45)
    • Funny Funny x 1
  7. actually you need to check the 3x3 area below the player, since players can crouch.

    and what about the water or lava?
  8. I appreciate the responses, however, I'm a little confused... My main issue is that I don't know how to check if a player falls and they don't take damage. For example, if there was a way to check if a player fell >= the fall distance it takes in order to take damage AND they do not take damage from that distance, that would be nice. If anyone knows how to do so then that would be a-m-a-z-i-n-g!
  9. I repeat, I'm not good at making this type of plugin. If you are doing this for a minigame server, you can just perform a basic check and save the check results, then just wait that someone report the hacker and then you cam ban him

    If I remember correctly, the location is taken at the player feet, so if he crouches the location doesn't change
    #9 TheWolvesKing, Jan 16, 2020
    Last edited by a moderator: Jan 17, 2020
  10. Yes but he can go to the edge of the block, so resulting in him standing on a air block not falling
    • Like Like x 1
  11. Never made any attemt at making an anticheat but you should try to reverse engineer how minecraft determines the falldamage and decide where you want to either hook into the process or if thats not possible try to gain data parallel to the running process.

    Who determines the damage? (Client/Server) Are there any packets sent? How is the damage determined etc.

    From the minecraft wiki:
    "Fall damage is calculated based on distance fallen rather than on velocity when hitting the ground. The distance is accumulated based on change in position each tick and rising does not reduce the accumulator, thus an entity bouncing in mid-air on the end of a lead accumulates fatal amounts of fall distance despite never being more than a few blocks above the ground."

    Just make sure you think about stuff like:
    "Teleporting due to a thrown ender pearl resets fall distance, however the teleportation itself causes 5 fall damage to players."

    Some ideas on data collection/processing.
    If you dont need the player to be punished immediately you can collect the data on the main thread, pack them in batches and send them to another thread for computation. The other thread also maintains a "suspicion level" for each UUID. Maybe mapped in its own object like
    EnumMap<SuspiciousActivity, Integer> where SuspiciousActivity is your checked activity (eg SuspiciousActivity.BYPASS_FALL)
    And the int is the suspicion level.
    Then you can weight certain activities and take actions at certain threshholds.
    There should also be recursion to other weights. Maybe the object also maintains a trust level (some double that multiplies suspicion level computation).
    If he uses one hack then chances are high that he uses others too.
  12. a way to detect it is check fall distance of player and make your own falling detector, which knows when fall distance should reset and similar, so if the player's fall distance reduces during mid-fall without them hitting water or anything like that, it means they are using nofall. because the way how nofall works is send fake fall distance packets, for example constantly sending that they are falling only by 2 blocks and no more

    but this could still be bypassed, by simply teleporting down instead of falling (imitate internet lag)
  13. Now, the question is: Why is the client that sends fall packets? This has no sense. Why Mojang do not put all the fall, movement and so on validating system in the server executables, not in the client? In this way, 3/4 of the cheating systems will be uneffective, because they edit only the client side
  14. We don’t know, ask Mojang plz :/

    My guesses would be
    1. The vanilla server is in fact a single-thread model that simply cannot hold such kinda complicated computations
    2. There is latency and Mojang wants to prevent player’s experience being ruined by it so some illegal behaviors are tolerated (e.g. a player staying at air for a couple of seconds would not be kicked immediately)

    So the mojang eliminated the validation and left the calculation to the client
    #15 NascentNova, Jan 16, 2020
    Last edited: Jan 16, 2020
  15. I just exposed a thought
  16. I updated my post
  17. First of all it isn't single thread. It has different threads (one for game, one for estsblishing and accepting connection and various for worlds)
    But I think that, those computations aren't sp difficult, so the experience won't be affected. Btw, we were here to help, not to have discussions about mojang internal cheat prevention
  18. It is. Although there are other threads like the network thread, file i/o thread and authentication thread, they don’t affect gameplay like the world thread, which is a single thread ticking system. Such model ensures that everything happened in a world has an order.

    I didn’t mean that the experience would be affected just because of the check. The devil is NETWORK LATENCY. How long could you say that a player is supposed to be standing still in the air? If the player has a 3000ms ping (sometimes it happens when your router is busy) I would say like five seconds? But if the player has 10 ms latency then, at least much fewer than five seconds. The relationship between latency and the tolerance is pretty vague and subject to various kinds of network situations and if mojang failed to consider one among them it’d be a disaster.

    But that’s you who asked why mojang didn’t integrate the check?
    #19 NascentNova, Jan 16, 2020
    Last edited: Jan 16, 2020
  19. various for worlds? I think you got wrong information
Thread Status:
Not open for further replies.