Uses of Class
org.bukkit.util.Vector
Packages that use Vector
Package
Description
The root package of the Bukkit API, contains generalized API classes.
Classes used to manipulate the voxels in a
world
,
including special states.Classes dedicated to handling a plugin's runtime configuration.
Interfaces for non-voxel objects that can exist in a
world
, including all players, monsters, projectiles, etc.Classes to represent the source of a projectile
Multi and single purpose classes to facilitate various programmatic
concepts.
-
Uses of Vector in org.bukkit
Methods in org.bukkit that return VectorModifier and TypeMethodDescriptionLocation.getDirection()
Gets a unit-vector pointing in the direction that this Location is facing.Location.toVector()
Constructs a newVector
based on this LocationMethods in org.bukkit with parameters of type VectorModifier and TypeMethodDescriptionAdds the location by a vector.World.rayTrace
(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, Predicate<? super Entity> filter) Performs a ray trace that checks for both block and entity collisions.World.rayTraceBlocks
(Location start, Vector direction, double maxDistance) Performs a ray trace that checks for block collisions using the blocks' precise collision shapes.World.rayTraceBlocks
(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode) Performs a ray trace that checks for block collisions using the blocks' precise collision shapes.World.rayTraceBlocks
(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks) Performs a ray trace that checks for block collisions using the blocks' precise collision shapes.World.rayTraceEntities
(Location start, Vector direction, double maxDistance) Performs a ray trace that checks for entity collisions.World.rayTraceEntities
(Location start, Vector direction, double maxDistance, double raySize) Performs a ray trace that checks for entity collisions.World.rayTraceEntities
(Location start, Vector direction, double maxDistance, double raySize, Predicate<? super Entity> filter) Performs a ray trace that checks for entity collisions.World.rayTraceEntities
(Location start, Vector direction, double maxDistance, Predicate<? super Entity> filter) Performs a ray trace that checks for entity collisions.Location.setDirection
(Vector vector) World.spawnArrow
(Location location, Vector direction, float speed, float spread) <T extends AbstractArrow>
TWorld.spawnArrow
(Location location, Vector direction, float speed, float spread, Class<T> clazz) Creates an arrow entity of the given class at the givenLocation
Subtracts the location by a vector. -
Uses of Vector in org.bukkit.block
Methods in org.bukkit.block that return VectorModifier and TypeMethodDescriptionBlockFace.getDirection()
Gets the normal vector corresponding to this block face.Methods in org.bukkit.block with parameters of type VectorModifier and TypeMethodDescriptionint
Gets the appropriate slot based on a vector relative to this block.
Will return -1 if the given vector is not within the bounds of any slot.Block.rayTrace
(Location start, Vector direction, double maxDistance, 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 VectorModifier and TypeMethodDescriptionGets the requested Vector by path.Gets the requestedVector
by path, returning a default value if not found.Methods in org.bukkit.configuration with parameters of type Vector -
Uses of Vector in org.bukkit.entity
Methods in org.bukkit.entity that return VectorModifier and TypeMethodDescriptionMinecart.getDerailedVelocityMod()
Gets the derailed velocity modifier.Fireball.getDirection()
Retrieve the direction this fireball is heading towardMinecart.getFlyingVelocityMod()
Gets the flying velocity modifier.Entity.getVelocity()
Gets this entity's current velocityVehicle.getVelocity()
Gets the vehicle's velocity.Methods in org.bukkit.entity with parameters of type VectorModifier and TypeMethodDescriptionvoid
Minecart.setDerailedVelocityMod
(Vector derailed) Sets the derailed velocity modifier.void
Fireball.setDirection
(Vector direction) Fireballs fly straight and do not take setVelocity(...) well.void
Minecart.setFlyingVelocityMod
(Vector flying) Sets the flying velocity modifier.void
Entity.setVelocity
(Vector velocity) Sets this entity's velocity in meters per tickvoid
Vehicle.setVelocity
(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 VectorModifier and TypeMethodDescriptionBlockDispenseEvent.getVelocity()
Gets the velocity in meters per tick.Methods in org.bukkit.event.block with parameters of type VectorModifier and TypeMethodDescriptionvoid
BlockDispenseEvent.setVelocity
(Vector vel) Sets the velocity of the item being dispensed in meters per tick.Constructors in org.bukkit.event.block with parameters of type VectorModifierConstructorDescriptionBlockDispenseEvent
(Block block, ItemStack dispensed, Vector velocity) -
Uses of Vector in org.bukkit.event.entity
Methods in org.bukkit.event.entity that return VectorModifier and TypeMethodDescriptionEntityPortalExitEvent.getAfter()
Gets a copy of the velocity that the entity will have after exiting the portal.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 VectorModifier and TypeMethodDescriptionvoid
Sets the velocity that the entity will have after exiting the portal.Constructors in org.bukkit.event.entity with parameters of type Vector -
Uses of Vector in org.bukkit.event.player
Methods in org.bukkit.event.player that return VectorModifier and TypeMethodDescriptionPlayerInteractAtEntityEvent.getClickedPosition()
PlayerInteractEvent.getClickedPosition()
Gets the exact position on the block the player interacted with, this will be null outside ofAction.RIGHT_CLICK_BLOCK
.PlayerVelocityEvent.getVelocity()
Gets the velocity vector that will be sent to the playerMethods in org.bukkit.event.player with parameters of type VectorModifier and TypeMethodDescriptionvoid
PlayerVelocityEvent.setVelocity
(Vector velocity) Sets the velocity vector in meters per tick that will be sent to the playerConstructors in org.bukkit.event.player with parameters of type VectorModifierConstructorDescriptionPlayerInteractAtEntityEvent
(Player who, Entity clickedEntity, Vector position) PlayerInteractAtEntityEvent
(Player who, Entity clickedEntity, Vector position, EquipmentSlot hand) PlayerInteractEvent
(Player who, Action action, ItemStack item, Block clickedBlock, BlockFace clickedFace, EquipmentSlot hand, Vector clickedPosition) PlayerVelocityEvent
(Player player, Vector velocity) -
Uses of Vector in org.bukkit.projectiles
Methods in org.bukkit.projectiles with parameters of type VectorModifier and TypeMethodDescription<T extends Projectile>
TProjectileSource.launchProjectile
(Class<? extends T> projectile, Vector velocity) Launches aProjectile
from the ProjectileSource with an initial velocity. -
Uses of Vector in org.bukkit.util
Subclasses of Vector in org.bukkit.utilModifier and TypeClassDescriptionclass
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 VectorModifier and TypeMethodDescriptionAdds a vector to this oneVector.clone()
Get a new vector.Copies another vectorVector.crossProduct
(Vector o) Calculates the cross product of this vector with another.static Vector
Vector.deserialize
(Map<String, Object> args) Divides the vector by another.static Vector
Vector.fromJOML
(org.joml.Vector3d vector) Gets a vector with components that match the provided JOMLVector3d
.static Vector
Vector.fromJOML
(org.joml.Vector3f vector) Gets a vector with components that match the provided JOMLVector3f
.static Vector
Vector.fromJOML
(org.joml.Vector3i vector) Gets a vector with components that match the provided JOMLVector3i
.BoundingBox.getCenter()
Gets the center of the bounding box.Vector.getCrossProduct
(Vector o) Calculates the cross product of this vector with another without mutating the original.RayTraceResult.getHitPosition()
Gets the exact position of the hit.BoundingBox.getMax()
Gets the maximum corner as vector.static Vector
Vector.getMaximum
(Vector v1, Vector v2) Gets the maximum components of two vectors.Vector.getMidpoint
(Vector other) Gets a new midpoint vector between this vector and another.BoundingBox.getMin()
Gets the minimum corner as vector.static Vector
Vector.getMinimum
(Vector v1, Vector v2) Gets the minimum components of two vectors.static Vector
Vector.getRandom()
Gets a random vector with components having a random value between 0 and 1.Sets this vector to the midpoint between this vector and another.Vector.multiply
(double m) Performs scalar multiplication, multiplying all components with a scalar.Vector.multiply
(float m) Performs scalar multiplication, multiplying all components with a scalar.Vector.multiply
(int m) Performs scalar multiplication, multiplying all components with a scalar.Multiplies the vector by another.Vector.normalize()
Converts this vector to a unit vector (a vector with length of 1).Vector.rotateAroundAxis
(Vector axis, double angle) Rotates the vector around a given arbitrary axis in 3 dimensional space.Vector.rotateAroundNonUnitAxis
(Vector axis, double angle) Rotates the vector around a given arbitrary axis in 3 dimensional space.Vector.rotateAroundX
(double angle) Rotates the vector around the x axis.Vector.rotateAroundY
(double angle) Rotates the vector around the y axis.Vector.rotateAroundZ
(double angle) Rotates the vector around the z axisVector.setX
(double x) Set the X component.Vector.setX
(float x) Set the X component.Vector.setX
(int x) Set the X component.Vector.setY
(double y) Set the Y component.Vector.setY
(float y) Set the Y component.Vector.setY
(int y) Set the Y component.Vector.setZ
(double z) Set the Z component.Vector.setZ
(float z) Set the Z component.Vector.setZ
(int z) Set the Z component.Subtracts a vector from this one.Vector.zero()
Zero this vector's components.Methods in org.bukkit.util with parameters of type VectorModifier and TypeMethodDescriptionAdds a vector to this onefloat
Gets the angle between this vector and another in radians.boolean
Checks if this bounding box contains the specified position.boolean
Checks if this bounding box fully contains the bounding box that is defined by the given corners.Copies another vectorVector.crossProduct
(Vector o) Calculates the cross product of this vector with another.double
Get the distance between this vector and another.double
Vector.distanceSquared
(Vector o) Get the squared distance between this vector and another.Divides the vector by another.double
Calculates the dot product of this vector with another.Expands this bounding box uniformly by the given values in both positive and negative directions.Expands this bounding box in the specified direction.BoundingBox.expandDirectional
(Vector direction) Expands this bounding box in the specified direction.Vector.getCrossProduct
(Vector o) Calculates the cross product of this vector with another without mutating the original.static Vector
Vector.getMaximum
(Vector v1, Vector v2) Gets the maximum components of two vectors.Vector.getMidpoint
(Vector other) Gets a new midpoint vector between this vector and another.static Vector
Vector.getMinimum
(Vector v1, Vector v2) Gets the minimum components of two vectors.boolean
Returns whether this vector is in an axis-aligned bounding box.boolean
Vector.isInSphere
(Vector origin, double radius) Returns whether this vector is within a sphere.Sets this vector to the midpoint between this vector and another.Multiplies the vector by another.static BoundingBox
Creates a new bounding box using the given center and extents.static BoundingBox
Creates a new bounding box using the coordinates of the given vectors as corners.boolean
Checks if this bounding box overlaps with the bounding box that is defined by the given corners.Calculates the intersection of this bounding box with the specified line segment.Vector.rotateAroundAxis
(Vector axis, double angle) Rotates the vector around a given arbitrary axis in 3 dimensional space.Vector.rotateAroundNonUnitAxis
(Vector axis, double angle) Rotates the vector around a given arbitrary axis in 3 dimensional space.Shifts this bounding box by the given amounts.Subtracts a vector from this one.Expands this bounding box to contain (or border) the specified position.Constructors in org.bukkit.util with parameters of type VectorModifierConstructorDescriptionBlockIterator
(World world, Vector start, Vector direction, double yOffset, int maxDistance) Constructs the BlockIterator.BlockVector
(Vector vec) Construct the vector with another vector.RayTraceResult
(Vector hitPosition) Creates a RayTraceResult.RayTraceResult
(Vector hitPosition, BlockFace hitBlockFace) Creates a RayTraceResult.RayTraceResult
(Vector hitPosition, Block hitBlock, BlockFace hitBlockFace) Creates a RayTraceResult.RayTraceResult
(Vector hitPosition, Entity hitEntity) Creates a RayTraceResult.RayTraceResult
(Vector hitPosition, Entity hitEntity, BlockFace hitBlockFace) Creates a RayTraceResult.