
org.bukkit.event.player.PlayerVelocityEvent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of walk-server Show documentation
Show all versions of walk-server Show documentation
A spigot fork to kotlin structure and news.
package org.bukkit.event.player;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.bukkit.util.Vector;
/**
* Called when the velocity of a player changes.
*/
public class PlayerVelocityEvent extends PlayerEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
private boolean cancel = false;
private Vector velocity;
public PlayerVelocityEvent(final Player player, final Vector velocity) {
super(player);
this.velocity = velocity;
}
public static HandlerList getHandlerList() {
return handlers;
}
public boolean isCancelled() {
return cancel;
}
public void setCancelled(boolean cancel) {
this.cancel = cancel;
}
/**
* Gets the velocity vector that will be sent to the player
*
* @return Vector the player will get
*/
public Vector getVelocity() {
return velocity;
}
/**
* Sets the velocity vector that will be sent to the player
*
* @param velocity The velocity vector that will be sent to the player
*/
public void setVelocity(Vector velocity) {
this.velocity = velocity;
}
@Override
public HandlerList getHandlers() {
return handlers;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy