# Uses of Class
org.bukkit.util.Vector

Packages that use Vector
Package
Description
com.destroystokyo.paper.entity
com.destroystokyo.paper.event.entity
io.papermc.paper.math
org.bukkit
The root package of the Bukkit API, contains generalized API classes.
org.bukkit.block
Classes used to manipulate the voxels in a `world`, including special states.
org.bukkit.configuration
Classes dedicated to handling a plugin's runtime configuration.
org.bukkit.entity
Interfaces for non-voxel objects that can exist in a `world`, including all players, monsters, projectiles, etc.
org.bukkit.event.block
`Events` relating to when a `block` is changed or interacts with the `world`.
org.bukkit.event.entity
`Events` relating to `entities`, excluding some directly referencing some more specific entity types.
org.bukkit.event.player
`Events` relating to `players`.
org.bukkit.generator
Classes to facilitate `world` generation implementation.
org.bukkit.projectiles
Classes to represent the source of a projectile
org.bukkit.util
Multi and single purpose classes to facilitate various programmatic concepts.

## Uses of Vector in com.destroystokyo.paper.entity

Methods in com.destroystokyo.paper.entity that return Vector
Modifier and Type
Method
Description
`@NotNull Vector`
TargetEntityInfo.`getHitVector()`
Get the position the entity is targeted at
Constructors in com.destroystokyo.paper.entity with parameters of type Vector
Modifier
Constructor
Description
``
`TargetEntityInfo(@NotNull Entity entity, @NotNull Vector hitVec)`

## Uses of Vector in com.destroystokyo.paper.event.entity

Methods in com.destroystokyo.paper.event.entity that return Vector
Modifier and Type
Method
Description
`@NotNull Vector`
EntityKnockbackByEntityEvent.`getAcceleration()`
Constructors in com.destroystokyo.paper.event.entity with parameters of type Vector
Modifier
Constructor
Description
``
`EntityKnockbackByEntityEvent(@NotNull LivingEntity entity, @NotNull Entity hitBy, float knockbackStrength, @NotNull Vector acceleration)`

## Uses of Vector in io.papermc.paper.math

Methods in io.papermc.paper.math that return Vector
Modifier and Type
Method
Description
`default @NotNull Vector`
Position.`toVector()`
Converts this position to a vector

## Uses of Vector in org.bukkit

Methods in org.bukkit that return Vector
Modifier and Type
Method
Description
`@NotNull Vector`
Location.`getDirection()`
Gets a unit-vector pointing in the direction that this Location is facing.
`@NotNull Vector`
Location.`toVector()`
Constructs a new `Vector` based on this Location
Methods in org.bukkit with parameters of type Vector
Modifier and Type
Method
Description
`@NotNull Location`
Location.`add(@NotNull Vector vec)`
Adds the location by a vector.
`@Nullable RayTraceResult`
World.`rayTrace(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, @Nullable Predicate<Entity> filter)`
Performs a ray trace that checks for both block and entity collisions.
`@Nullable RayTraceResult`
World.`rayTraceBlocks(@NotNull Location start, @NotNull Vector direction, double maxDistance)`
Performs a ray trace that checks for block collisions using the blocks' precise collision shapes.
`@Nullable RayTraceResult`
World.`rayTraceBlocks(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode)`
Performs a ray trace that checks for block collisions using the blocks' precise collision shapes.
`@Nullable RayTraceResult`
World.`rayTraceBlocks(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks)`
Performs a ray trace that checks for block collisions using the blocks' precise collision shapes.
`@Nullable RayTraceResult`
World.`rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance)`
Performs a ray trace that checks for entity collisions.
`@Nullable RayTraceResult`
World.`rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, double raySize)`
Performs a ray trace that checks for entity collisions.
`@Nullable RayTraceResult`
World.`rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, double raySize, @Nullable Predicate<Entity> filter)`
Performs a ray trace that checks for entity collisions.
`@Nullable RayTraceResult`
World.`rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, @Nullable Predicate<Entity> filter)`
Performs a ray trace that checks for entity collisions.
`void`
World.`sendGameEvent(@Nullable Entity sourceEntity, @NotNull GameEvent gameEvent, @NotNull Vector position)`
Posts a specified game event at a location
`@NotNull Location`
Location.`setDirection(@NotNull Vector vector)`
Sets the `yaw` and `pitch` to point in the direction of the vector.
`@NotNull Arrow`
World.`spawnArrow(@NotNull Location location, @NotNull Vector direction, float speed, float spread)`
Creates an `Arrow` entity at the given `Location`
`<T extends AbstractArrow>
T`
World.`spawnArrow(@NotNull Location location, @NotNull Vector direction, float speed, float spread, @NotNull Class<T> clazz)`
Creates an arrow entity of the given class at the given `Location`
`@NotNull Location`
Location.`subtract(@NotNull Vector vec)`
Subtracts the location by a vector.

## Uses of Vector in org.bukkit.block

Methods in org.bukkit.block that return Vector
Modifier and Type
Method
Description
`@NotNull Vector`
BlockFace.`getDirection()`
Gets the normal vector corresponding to this block face.
Methods in org.bukkit.block with parameters of type Vector
Modifier and Type
Method
Description
`@Nullable RayTraceResult`
Block.`rayTrace(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode)`
Performs a ray trace that checks for collision with this specific block in its current state using its precise collision shape.

## Uses of Vector in org.bukkit.configuration

Methods in org.bukkit.configuration that return Vector
Modifier and Type
Method
Description
`@Nullable Vector`
ConfigurationSection.`getVector(@NotNull String path)`
Gets the requested Vector by path.
`@Nullable Vector`
ConfigurationSection.`getVector(@NotNull String path, @Nullable Vector def)`
Gets the requested `Vector` by path, returning a default value if not found.
`@Nullable Vector`
MemorySection.`getVector(@NotNull String path)`
`@Nullable Vector`
MemorySection.`getVector(@NotNull String path, @Nullable Vector def)`
Methods in org.bukkit.configuration with parameters of type Vector
Modifier and Type
Method
Description
`@Nullable Vector`
ConfigurationSection.`getVector(@NotNull String path, @Nullable Vector def)`
Gets the requested `Vector` by path, returning a default value if not found.
`@Nullable Vector`
MemorySection.`getVector(@NotNull String path, @Nullable Vector def)`

## Uses of Vector in org.bukkit.entity

Methods in org.bukkit.entity that return Vector
Modifier and Type
Method
Description
`@NotNull Vector`
Minecart.`getDerailedVelocityMod()`
Gets the derailed velocity modifier.
`@NotNull Vector`
Fireball.`getDirection()`
Retrieve the direction this fireball is heading toward
`@NotNull Vector`
Minecart.`getFlyingVelocityMod()`
Gets the flying velocity modifier.
`Vector`
ShulkerBullet.`getTargetDelta()`
Gets the relative offset that this shulker bullet should move towards, note that this will change each tick as the skulker bullet approaches the target.
`@NotNull Vector`
Entity.`getVelocity()`
Gets this entity's current velocity
`@NotNull Vector`
Vehicle.`getVelocity()`
Gets the vehicle's velocity.
Methods in org.bukkit.entity with parameters of type Vector
Modifier and Type
Method
Description
`void`
Minecart.`setDerailedVelocityMod(@NotNull Vector derailed)`
Sets the derailed velocity modifier.
`void`
Fireball.`setDirection(@NotNull Vector direction)`
Fireballs fly straight and do not take setVelocity(...) well.
`void`
Minecart.`setFlyingVelocityMod(@NotNull Vector flying)`
Sets the flying velocity modifier.
`void`
ShulkerBullet.`setTargetDelta(Vector vector)`
Sets the relative offset that this shulker bullet should move towards, note that this will change each tick as the skulker bullet approaches the target.
`void`
Entity.`setVelocity(@NotNull Vector velocity)`
Sets this entity's velocity in meters per tick
`void`
Vehicle.`setVelocity(@NotNull Vector vel)`
Sets the vehicle's velocity in meters per tick.

## Uses of Vector in org.bukkit.event.block

Methods in org.bukkit.event.block that return Vector
Modifier and Type
Method
Description
`@NotNull Vector`
BlockDispenseEvent.`getVelocity()`
Gets the velocity in meters per tick.
Methods in org.bukkit.event.block with parameters of type Vector
Modifier and Type
Method
Description
`void`
BlockDispenseEvent.`setVelocity(@NotNull Vector vel)`
Sets the velocity of the item being dispensed in meters per tick.
Constructors in org.bukkit.event.block with parameters of type Vector
Modifier
Constructor
Description
``
`BlockDispenseEvent(@NotNull Block block, @NotNull ItemStack dispensed, @NotNull Vector velocity)`

## Uses of Vector in org.bukkit.event.entity

Methods in org.bukkit.event.entity that return Vector
Modifier and Type
Method
Description
`@NotNull Vector`
EntityPortalExitEvent.`getAfter()`
Gets a copy of the velocity that the entity will have after exiting the portal.
`@NotNull Vector`
EntityPortalExitEvent.`getBefore()`
Gets a copy of the velocity that the entity has before entering the portal.
Methods in org.bukkit.event.entity with parameters of type Vector
Modifier and Type
Method
Description
`void`
EntityPortalExitEvent.`setAfter(@NotNull Vector after)`
Sets the velocity that the entity will have after exiting the portal.
Constructors in org.bukkit.event.entity with parameters of type Vector
Modifier
Constructor
Description
``
`EntityPortalExitEvent(@NotNull Entity entity, @NotNull Location from, @NotNull Location to, @NotNull Vector before, @NotNull Vector after)`

## Uses of Vector in org.bukkit.event.player

Methods in org.bukkit.event.player that return Vector
Modifier and Type
Method
Description
`@NotNull Vector`
PlayerInteractAtEntityEvent.`getClickedPosition()`
`@NotNull Vector`
PlayerVelocityEvent.`getVelocity()`
Gets the velocity vector that will be sent to the player
Methods in org.bukkit.event.player with parameters of type Vector
Modifier and Type
Method
Description
`void`
PlayerVelocityEvent.`setVelocity(@NotNull Vector velocity)`
Sets the velocity vector in meters per tick that will be sent to the player
Constructors in org.bukkit.event.player with parameters of type Vector
Modifier
Constructor
Description
``
`PlayerInteractAtEntityEvent(@NotNull Player who, @NotNull Entity clickedEntity, @NotNull Vector position)`
``
`PlayerInteractAtEntityEvent(@NotNull Player who, @NotNull Entity clickedEntity, @NotNull Vector position, @NotNull EquipmentSlot hand)`
``
`PlayerVelocityEvent(@NotNull Player player, @NotNull Vector velocity)`

## Uses of Vector in org.bukkit.generator

Methods in org.bukkit.generator with parameters of type Vector
Modifier and Type
Method
Description
`default @NotNull BlockData`
LimitedRegion.`getBlockData(@NotNull Vector vector)`
Gets the `BlockData` of the block at the provided coordinates.
`default @NotNull BlockState`
LimitedRegion.`getBlockState(@NotNull Vector location)`
Gets the `BlockState` at a location.
`default void`
LimitedRegion.`scheduleBlockUpdate(@NotNull Vector location)`
Schedules a block update at a vector location.
`default void`
LimitedRegion.`scheduleFluidUpdate(@NotNull Vector location)`
Schedules a fluid update at a vector location.
`default void`
LimitedRegion.`setBlockData(@NotNull Vector vector, @NotNull BlockData data)`
Sets the block at a vector location to the provided `BlockData`.
`default void`
LimitedRegion.`setBlockState(@NotNull Vector location, @NotNull BlockState state)`
Sets the `BlockState` at a location.

## Uses of Vector in org.bukkit.projectiles

Methods in org.bukkit.projectiles with parameters of type Vector
Modifier and Type
Method
Description
`<T extends Projectile>
T`
ProjectileSource.`launchProjectile(@NotNull Class<? extends T> projectile, @Nullable Vector velocity)`
Launches a `Projectile` from the ProjectileSource with an initial velocity.
`<T extends Projectile>
T`
ProjectileSource.`launchProjectile(@NotNull Class<? extends T> projectile, @Nullable Vector velocity, Consumer<T> function)`
Launches a `Projectile` from the ProjectileSource with an initial velocity, with the supplied function run before the entity is added to the world.

## Uses of Vector in org.bukkit.util

Subclasses of Vector in org.bukkit.util
Modifier and Type
Class
Description
`class`
`BlockVector`
A vector with a hash function that floors the X, Y, Z components, a la BlockVector in WorldEdit.
Methods in org.bukkit.util that return Vector
Modifier and Type
Method
Description
`@NotNull Vector`
Vector.`add(@NotNull Vector vec)`
Adds a vector to this one
`@NotNull Vector`
Vector.`clone()`
Get a new vector.
`@NotNull Vector`
Vector.`copy(@NotNull Vector vec)`
Copies another vector
`@NotNull Vector`
Vector.`crossProduct(@NotNull Vector o)`
Calculates the cross product of this vector with another.
`static @NotNull Vector`
Vector.`deserialize(@NotNull Map<String,Object> args)`
`@NotNull Vector`
Vector.`divide(@NotNull Vector vec)`
Divides the vector by another.
`@NotNull Vector`
BoundingBox.`getCenter()`
Gets the center of the bounding box.
`@NotNull Vector`
Vector.`getCrossProduct(@NotNull Vector o)`
Calculates the cross product of this vector with another without mutating the original.
`@NotNull Vector`
RayTraceResult.`getHitPosition()`
Gets the exact position of the hit.
`@NotNull Vector`
BoundingBox.`getMax()`
Gets the maximum corner as vector.
`static @NotNull Vector`
Vector.`getMaximum(@NotNull Vector v1, @NotNull Vector v2)`
Gets the maximum components of two vectors.
`@NotNull Vector`
Vector.`getMidpoint(@NotNull Vector other)`
Gets a new midpoint vector between this vector and another.
`@NotNull Vector`
BoundingBox.`getMin()`
Gets the minimum corner as vector.
`static @NotNull Vector`
Vector.`getMinimum(@NotNull Vector v1, @NotNull Vector v2)`
Gets the minimum components of two vectors.
`static @NotNull Vector`
Vector.`getRandom()`
Gets a random vector with components having a random value between 0 and 1.
`@NotNull Vector`
Vector.`midpoint(@NotNull Vector other)`
Sets this vector to the midpoint between this vector and another.
`@NotNull Vector`
Vector.`multiply(double m)`
Performs scalar multiplication, multiplying all components with a scalar.
`@NotNull Vector`
Vector.`multiply(float m)`
Performs scalar multiplication, multiplying all components with a scalar.
`@NotNull Vector`
Vector.`multiply(int m)`
Performs scalar multiplication, multiplying all components with a scalar.
`@NotNull Vector`
Vector.`multiply(@NotNull Vector vec)`
Multiplies the vector by another.
`@NotNull Vector`
Vector.`normalize()`
Converts this vector to a unit vector (a vector with length of 1).
`@NotNull Vector`
Vector.`rotateAroundAxis(@NotNull Vector axis, double angle)`
Rotates the vector around a given arbitrary axis in 3 dimensional space.
`@NotNull Vector`
Vector.`rotateAroundNonUnitAxis(@NotNull Vector axis, double angle)`
Rotates the vector around a given arbitrary axis in 3 dimensional space.
`@NotNull Vector`
Vector.`rotateAroundX(double angle)`
Rotates the vector around the x axis.
`@NotNull Vector`
Vector.`rotateAroundY(double angle)`
Rotates the vector around the y axis.
`@NotNull Vector`
Vector.`rotateAroundZ(double angle)`
Rotates the vector around the z axis
`@NotNull Vector`
Vector.`setX(double x)`
Set the X component.
`@NotNull Vector`
Vector.`setX(float x)`
Set the X component.
`@NotNull Vector`
Vector.`setX(int x)`
Set the X component.
`@NotNull Vector`
Vector.`setY(double y)`
Set the Y component.
`@NotNull Vector`
Vector.`setY(float y)`
Set the Y component.
`@NotNull Vector`
Vector.`setY(int y)`
Set the Y component.
`@NotNull Vector`
Vector.`setZ(double z)`
Set the Z component.
`@NotNull Vector`
Vector.`setZ(float z)`
Set the Z component.
`@NotNull Vector`
Vector.`setZ(int z)`
Set the Z component.
`@NotNull Vector`
Vector.`subtract(@NotNull Vector vec)`
Subtracts a vector from this one.
`@NotNull Vector`
Vector.`zero()`
Zero this vector's components.
Methods in org.bukkit.util with parameters of type Vector
Modifier and Type
Method
Description
`@NotNull Vector`
Vector.`add(@NotNull Vector vec)`
Adds a vector to this one
`float`
Vector.`angle(@NotNull Vector other)`
Gets the angle between this vector and another in radians.
`boolean`
BoundingBox.`contains(@NotNull Vector position)`
Checks if this bounding box contains the specified position.
`boolean`
BoundingBox.`contains(@NotNull Vector min, @NotNull Vector max)`
Checks if this bounding box fully contains the bounding box that is defined by the given corners.
`@NotNull Vector`
Vector.`copy(@NotNull Vector vec)`
Copies another vector
`@NotNull Vector`
Vector.`crossProduct(@NotNull Vector o)`
Calculates the cross product of this vector with another.
`double`
Vector.`distance(@NotNull Vector o)`
Get the distance between this vector and another.
`double`
Vector.`distanceSquared(@NotNull Vector o)`
Get the squared distance between this vector and another.
`@NotNull Vector`
Vector.`divide(@NotNull Vector vec)`
Divides the vector by another.
`double`
Vector.`dot(@NotNull Vector other)`
Calculates the dot product of this vector with another.
`@NotNull BoundingBox`
BoundingBox.`expand(@NotNull Vector expansion)`
Expands this bounding box uniformly by the given values in both positive and negative directions.
`@NotNull BoundingBox`
BoundingBox.`expand(@NotNull Vector direction, double expansion)`
Expands this bounding box in the specified direction.
`@NotNull BoundingBox`
BoundingBox.`expandDirectional(@NotNull Vector direction)`
Expands this bounding box in the specified direction.
`@NotNull Vector`
Vector.`getCrossProduct(@NotNull Vector o)`
Calculates the cross product of this vector with another without mutating the original.
`static @NotNull Vector`
Vector.`getMaximum(@NotNull Vector v1, @NotNull Vector v2)`
Gets the maximum components of two vectors.
`@NotNull Vector`
Vector.`getMidpoint(@NotNull Vector other)`
Gets a new midpoint vector between this vector and another.
`static @NotNull Vector`
Vector.`getMinimum(@NotNull Vector v1, @NotNull Vector v2)`
Gets the minimum components of two vectors.
`boolean`
Vector.`isInAABB(@NotNull Vector min, @NotNull Vector max)`
Returns whether this vector is in an axis-aligned bounding box.
`boolean`
Vector.`isInSphere(@NotNull Vector origin, double radius)`
Returns whether this vector is within a sphere.
`@NotNull Vector`
Vector.`midpoint(@NotNull Vector other)`
Sets this vector to the midpoint between this vector and another.
`@NotNull Vector`
Vector.`multiply(@NotNull Vector vec)`
Multiplies the vector by another.
`static @NotNull BoundingBox`
BoundingBox.`of(@NotNull Vector center, double x, double y, double z)`
Creates a new bounding box using the given center and extents.
`static @NotNull BoundingBox`
BoundingBox.`of(@NotNull Vector corner1, @NotNull Vector corner2)`
Creates a new bounding box using the coordinates of the given vectors as corners.
`boolean`
BoundingBox.`overlaps(@NotNull Vector min, @NotNull Vector max)`
Checks if this bounding box overlaps with the bounding box that is defined by the given corners.
`@Nullable RayTraceResult`
BoundingBox.`rayTrace(@NotNull Vector start, @NotNull Vector direction, double maxDistance)`
Calculates the intersection of this bounding box with the specified line segment.
`@NotNull Vector`
Vector.`rotateAroundAxis(@NotNull Vector axis, double angle)`
Rotates the vector around a given arbitrary axis in 3 dimensional space.
`@NotNull Vector`
Vector.`rotateAroundNonUnitAxis(@NotNull Vector axis, double angle)`
Rotates the vector around a given arbitrary axis in 3 dimensional space.
`@NotNull BoundingBox`
BoundingBox.`shift(@NotNull Vector shift)`
Shifts this bounding box by the given amounts.
`@NotNull Vector`
Vector.`subtract(@NotNull Vector vec)`
Subtracts a vector from this one.
`@NotNull BoundingBox`
BoundingBox.`union(@NotNull Vector position)`
Expands this bounding box to contain (or border) the specified position.
Constructors in org.bukkit.util with parameters of type Vector
Modifier
Constructor
Description
``
`BlockIterator(@NotNull World world, @NotNull Vector start, @NotNull Vector direction, double yOffset, int maxDistance)`
Constructs the BlockIterator.
``
`BlockVector(@NotNull Vector vec)`
Construct the vector with another vector.
``
`RayTraceResult(@NotNull Vector hitPosition)`
Creates a RayTraceResult.
``
`RayTraceResult(@NotNull Vector hitPosition, @Nullable BlockFace hitBlockFace)`
Creates a RayTraceResult.
``
`RayTraceResult(@NotNull Vector hitPosition, @Nullable Block hitBlock, @Nullable BlockFace hitBlockFace)`
Creates a RayTraceResult.
``
`RayTraceResult(@NotNull Vector hitPosition, @Nullable Entity hitEntity)`
Creates a RayTraceResult.
``
`RayTraceResult(@NotNull Vector hitPosition, @Nullable Entity hitEntity, @Nullable BlockFace hitBlockFace)`
Creates a RayTraceResult.