I boken “Svenska adelns ättar-taflor” från Gabirel Angrep kan man läsa följande om adelsätten Skraggensköld;

Om Skraggeslägtens upphof är den berättelse, att då en Konung i Skottland blifvit af sina fiender fördrifven och med ett skepp kommit till en obebodd ö, hvarpå ej annat funnits än vilda getter, skall Konungen…

The Spigot/Bukkit API does not expose an event to which you can react to jumps. When creating my MushPoof plugin for Minecraft, I needed a way to detect it.

After some investigation, I noticed that when a user is not jumping, the Y value of the velocity object is constant at -0.0784000015258789.

So I’ve set this as a variable in my file;

final double STILL = -0.0784000015258789;

Then, we need to listen to the PlayerMoveEvent. And in this, we check that the Y value of the velocity of the player is bigger than the STILL variable defined above;

@EventHandler
public void onPlayerMove(PlayerMoveEvent event) {
Player player = event.getPlayer();
boolean isJumping = player.getVelocity().getY() > STILL;
}

Jeremy Karlsson

Scripting connoisseur at TIDAL. Writing the web app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store