I wan't to make a 'wind' effect so that a player is constantly being pushed to a direction (for example positive x). If I do it like this it will prevent the player from walking in the direction of the wind, a player cant sprint and is slow. It is also hard to walk 'against' the wind, player can't spring and is to slow to walk against it: Code:java public class OnPlayerMove implements Listener { @EventHandler public void onPlayerMove(PlayerMoveEvent e) { Player p = e.getPlayer(); p.setVelocity(p.getVelocity().add(new Vector(0.01, 0, 0))); } } Is there any way I can do this?
@timtower I tried this on command: Code:java new BukkitRunnable() { public void run() { Player p = Bukkit.getPlayer(pName); p.setVelocity(p.getVelocity().add(new Vector(0.01, 0, 0.01))); }}.runTaskTimer(Main.getInstance(), 0, 1); But a player can't move normally, it doesn't accelerate the player when it is sprinting so even when walking in the same direction of the wind, it is slower then without wind
@Banjer_HD You are adding and removing the wind here as well, so that is wrong. Is the start velocity the same as the end velocity in this case?
@timtower Sorry, coppied the wrong code (that code was just for testing if I could sprint) I've eddited it now.
@timtower Oops. mistake. It didn't work because I was in the air (I thought it would work like normal) Gif to demonstrate: https://imgur.com/a/SMeePy4 But there still is one problem, moving in the direction of the wind(/with the wind) is slower than without wind: https://imgur.com/a/yPcP3yB