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.Events
relating to vehicular entities
.Classes to facilitate
world
generation
implementation.Classes to represent the source of a projectile
Multi and single purpose classes to facilitate various programmatic
concepts.
-
Uses of Vector in com.destroystokyo.paper.entity
Modifier and TypeMethodDescriptionTargetEntityInfo.getHitVector()
Deprecated, for removal: This API element is subject to removal in a future version.Get the position the entity is targeted atModifierConstructorDescriptionTargetEntityInfo
(@NotNull Entity entity, @NotNull Vector hitVec) Deprecated, for removal: This API element is subject to removal in a future version. -
Uses of Vector in com.destroystokyo.paper.event.entity
ModifierConstructorDescriptionEntityKnockbackByEntityEvent
(@NotNull LivingEntity entity, @NotNull Entity hitBy, float knockbackStrength, @NotNull Vector acceleration) -
Uses of Vector in com.destroystokyo.paper.event.player
Modifier and TypeMethodDescriptionPlayerUseUnknownEntityEvent.getClickedRelativePosition()
Returns the position relative to the entity that was clicked, or null if not available.ModifierConstructorDescriptionPlayerUseUnknownEntityEvent
(@NotNull Player who, int entityId, boolean attack, @NotNull EquipmentSlot hand, @Nullable Vector clickedPosition) -
Uses of Vector in io.papermc.paper.event.entity
Modifier and TypeMethodDescriptionEntityPushedByEntityAttackEvent.getAcceleration()
Gets the acceleration that will be applied to the affected entity. -
Uses of Vector in io.papermc.paper.math
-
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
(@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.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.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.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.World.rayTraceEntities
(@NotNull Location start, @NotNull Vector direction, double maxDistance) Performs a ray trace that checks for entity collisions.World.rayTraceEntities
(@NotNull Location start, @NotNull Vector direction, double maxDistance, double raySize) Performs a ray trace that checks for entity collisions.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.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 locationLocation.setDirection
(@NotNull Vector vector) World.spawnArrow
(@NotNull Location location, @NotNull Vector direction, float speed, float spread) <T extends AbstractArrow>
TWorld.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 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
(@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
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.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.Entity.getVelocity()
Gets this entity's current velocityVehicle.getVelocity()
Gets the vehicle's velocity.Modifier and TypeMethodDescriptionvoid
Makes this projectile hit a specific entity from a specific point.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 tickvoid
Vehicle.setVelocity
(@NotNull 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
(@NotNull Vector vel) Sets the velocity of the item being dispensed in meters per tick. -
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()
PlayerInteractEvent.getClickedPosition()
Deprecated.PlayerVelocityEvent.getVelocity()
Gets the velocity vector that will be sent to the playerModifier and TypeMethodDescriptionvoid
PlayerVelocityEvent.setVelocity
(@NotNull Vector velocity) Sets the velocity vector in meters per tick that will be sent to the playerModifierConstructorDescriptionPlayerInteractAtEntityEvent
(@NotNull Player who, @NotNull Entity clickedEntity, @NotNull Vector position) PlayerInteractAtEntityEvent
(@NotNull Player who, @NotNull Entity clickedEntity, @NotNull Vector position, @NotNull EquipmentSlot hand) PlayerInteractEvent
(@NotNull Player who, @NotNull Action action, @Nullable ItemStack item, @Nullable Block clickedBlock, @NotNull BlockFace clickedFace, @Nullable EquipmentSlot hand, @Nullable Vector clickedPosition) PlayerVelocityEvent
(@NotNull Player player, @NotNull Vector velocity) -
Uses of Vector in org.bukkit.event.vehicle
Modifier and TypeMethodDescriptionVehicleBlockCollisionEvent.getVelocity()
Gets velocity at which the vehicle collided with the block -
Uses of Vector in org.bukkit.generator
Modifier and TypeMethodDescriptionLimitedRegion.getBlockData
(@NotNull Vector vector) Gets theBlockData
of the block at the provided coordinates.default @NotNull BlockState
LimitedRegion.getBlockState
(@NotNull Vector location) Gets theBlockState
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 providedBlockData
.default void
LimitedRegion.setBlockState
(@NotNull Vector location, @NotNull BlockState state) Sets theBlockState
at a location. -
Uses of Vector in org.bukkit.projectiles
Modifier and TypeMethodDescription<T extends Projectile>
TProjectileSource.launchProjectile
(@NotNull Class<? extends T> projectile, @Nullable Vector velocity) Launches aProjectile
from the ProjectileSource with an initial velocity.<T extends Projectile>
TProjectileSource.launchProjectile
(@NotNull Class<? extends T> projectile, @Nullable Vector velocity, Consumer<T> function) Launches aProjectile
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
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
(@NotNull Vector o) Calculates the cross product of this vector with another.Vector.deserialize
(@NotNull Map<String, Object> args) Divides the vector by another.Gets a vector with components that match the provided JOMLVector3d
.Gets a vector with components that match the provided JOMLVector3f
.Gets a vector with components that match the provided JOMLVector3i
.BoundingBox.getCenter()
Gets the center of the bounding box.Vector.getCrossProduct
(@NotNull 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.Vector.getMaximum
(@NotNull Vector v1, @NotNull Vector v2) Gets the maximum components of two vectors.Vector.getMidpoint
(@NotNull Vector other) Gets a new midpoint vector between this vector and another.BoundingBox.getMin()
Gets the minimum corner as vector.Vector.getMinimum
(@NotNull Vector v1, @NotNull Vector v2) Gets the minimum components of two vectors.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
(@NotNull Vector axis, double angle) Rotates the vector around a given arbitrary axis in 3 dimensional space.Vector.rotateAroundNonUnitAxis
(@NotNull 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
(@NotNull Vector o) Calculates the cross product of this vector with another.double
Get the distance between this vector and another.double
Vector.distanceSquared
(@NotNull 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
(@NotNull Vector direction) Expands this bounding box in the specified direction.Vector.getCrossProduct
(@NotNull Vector o) Calculates the cross product of this vector with another without mutating the original.Vector.getMaximum
(@NotNull Vector v1, @NotNull Vector v2) Gets the maximum components of two vectors.Vector.getMidpoint
(@NotNull Vector other) Gets a new midpoint vector between this vector and another.Vector.getMinimum
(@NotNull Vector v1, @NotNull Vector v2) Gets the minimum components of two vectors.boolean
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.Sets this vector to the midpoint between this vector and another.Multiplies the vector by another.static @NotNull BoundingBox
Creates a new bounding box using the given center and extents.static @NotNull 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
(@NotNull Vector axis, double angle) Rotates the vector around a given arbitrary axis in 3 dimensional space.Vector.rotateAroundNonUnitAxis
(@NotNull 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
(@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.
PlayerInteractEvent.getInteractionPoint()