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<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<Entity> filter) Performs a ray trace that checks for entity collisions.World.rayTraceEntities
(Location start, Vector direction, double maxDistance, Predicate<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 TypeMethodDescriptionBlock.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 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.Modifier 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
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.Modifier and TypeMethodDescriptionvoid
Sets the velocity that the entity will have after exiting the portal. -
Uses of Vector in org.bukkit.event.player
Modifier and TypeMethodDescriptionPlayerInteractAtEntityEvent.getClickedPosition()
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) 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.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.