Spigot how to push player code example
Example: Spigot how to push player
Vector unitVector = new Vector(player.getLocation().getDirection().getX(), 0, player.getLocation().getDirection().getZ());
unitVector = unitVector.normalize();
player.setVelocity(unitVector.multiply(2));