Uses of Class
org.bukkit.util.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
Modifier and TypeMethodDescriptionLocation.getDirection()
Gets a unit-vector pointing in the direction that this Location is facing.Location.toVector()
Constructs a newVector
based on this LocationModifier 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
Modifier and TypeMethodDescriptionBlockFace.getDirection()
Gets the normal vector corresponding to this block face.Modifier 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
Modifier and TypeMethodDescriptionGets the requested Vector by path.Gets the requestedVector
by path, returning a default value if not found. -
Uses of Vector in org.bukkit.entity
Modifier and TypeMethodDescriptionFireball.getAcceleration()
Retrieve the acceleration of this fireball.Minecart.getDerailedVelocityMod()
Gets the derailed velocity modifier.Fireball.getDirection()
Deprecated.Minecart.getFlyingVelocityMod()
Gets the flying velocity modifier.Entity.getVelocity()
Gets this entity's current velocityVehicle.getVelocity()
Gets the vehicle's velocity.Modifier and TypeMethodDescriptionvoid
Fireball.setAcceleration
(Vector acceleration) Sets the acceleration of the fireball.void
Minecart.setDerailedVelocityMod
(Vector derailed) Sets the derailed velocity modifier.void
Fireball.setDirection
(Vector direction) Sets the direction the fireball should be flying towards.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
Modifier and TypeMethodDescriptionBlockDispenseEvent.getVelocity()
Gets the velocity in meters per tick.Modifier and TypeMethodDescriptionvoid
BlockDispenseEvent.setVelocity
(Vector vel) Sets the velocity of the item being dispensed in meters per tick.ModifierConstructorDescriptionBlockDispenseEvent
(Block block, ItemStack dispensed, Vector velocity) -
Uses of Vector in org.bukkit.event.entity
Modifier 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.EntityKnockbackEvent.getFinalKnockback()
Gets the force that will be applied to the entity.EntityKnockbackEvent.getKnockback()
Gets the raw knockback force that will be applied to the entity.Modifier and TypeMethodDescriptionvoid
Sets the velocity that the entity will have after exiting the portal.void
EntityKnockbackEvent.setFinalKnockback
(Vector knockback) Sets the force that will be applied to the entity.ModifierConstructorDescriptionEntityKnockbackByEntityEvent
(LivingEntity entity, Entity source, EntityKnockbackEvent.KnockbackCause cause, double force, Vector rawKnockback, Vector knockback) EntityKnockbackEvent
(LivingEntity entity, EntityKnockbackEvent.KnockbackCause cause, double force, Vector rawKnockback, Vector knockback) -
Uses of Vector in org.bukkit.event.player
Modifier 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
.PlayerRiptideEvent.getVelocity()
Get the velocity applied to the player as a result of this riptide.PlayerVelocityEvent.getVelocity()
Gets the velocity vector that will be sent to the playerModifier and TypeMethodDescriptionvoid
PlayerVelocityEvent.setVelocity
(Vector velocity) Sets the velocity vector in meters per tick that will be sent to the playerModifierConstructorDescriptionPlayerInteractAtEntityEvent
(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) PlayerRiptideEvent
(Player who, ItemStack item, Vector velocity) PlayerVelocityEvent
(Player player, Vector velocity) -
Uses of Vector in org.bukkit.projectiles
Modifier 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
Modifier and TypeClassDescriptionclass
A vector with a hash function that floors the X, Y, Z components, a la BlockVector in WorldEdit.Modifier 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.Vector3dc vector) Gets a vector with components that match the provided JOMLVector3dc
.static Vector
Vector.fromJOML
(org.joml.Vector3f vector) Gets a vector with components that match the provided JOMLVector3f
.static Vector
Vector.fromJOML
(org.joml.Vector3fc vector) Gets a vector with components that match the provided JOMLVector3fc
.static Vector
Vector.fromJOML
(org.joml.Vector3i vector) Gets a vector with components that match the provided JOMLVector3i
.static Vector
Vector.fromJOML
(org.joml.Vector3ic vector) Gets a vector with components that match the provided JOMLVector3ic
.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.Modifier 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.ModifierConstructorDescriptionBlockIterator
(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.
Fireball.getAcceleration()