How to compare player speed to 20 blocks/sec

Discussion in 'Plugin Development' started by BefitRaptor8, Dec 3, 2021.

  1. Offline

    BefitRaptor8

    I'm new to programming plugins so sorry if I sound dumb lol

    Basically I'm trying to make a custom anti-cheat for my Minecraft server and learning how to code Minecraft plugins while doing so...

    I am working on the anti-fly bit and I have

    Vector velocity = event.getPlayer().getVelocity();

    For getting player velocity, I am confused on what I would use in the If statement though. Would it be
    If (velocity >= 10)
    or something else?
    (The goal is to detect if a player is going faster than 10 blocks a second, This won't be the final speed, just for testing)
     
  2. Offline

    timtower Administrator Administrator Moderator

    @BefitRaptor8 velocity is a vector, need to get the length of it.
     

Share This Page