Hello! In one of my codes i set the player's velocity Code: p.setVelocity(new Vector(0, 1, 2)); but NoCheatsPlus says that the player uses a fly hack. I'm looking for a lightweight solution for that. If you have any idea please tell it. Thanks in advance.
You have a few options. 1. You remove the plugin. 2. You use the NoCheatPlus API for this - you stop NoCheatPlus from checking the player for a few moments. See http://dev.bukkit.org/server-mods/nocheatplus/pages/documentation/api/. 3. You configure NoCheatPlus in such a way that it doesn't bother you.
Have you actually looked at the NCPExemptionManager source (as linked to from the API page)? Looks pretty simple to me, something like NCPExemptionManager.exemptPermanently(player.getEntityId(), CheckType.MOVING_SURVIVALFLY) should do it. Of course, you'll need a sync delayed task to do the unexempt() bit.