Uses of Class
org.bukkit.Location
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 concerning the creation of boss bars that appear at the top of the
player's screen.
Classes relating to handling specialized non-chat player input.
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 concerning an entity's persistent memory.
Events
relating to vehicular entities
.Classes to facilitate
world
generation
implementation.Classes involved in manipulating player inventories and item interactions.
The interfaces used when manipulating extra data can can be stored inside
item stacks
.Classes relevant to loot table manipulation and generation.
Multi and single purpose classes to facilitate various programmatic
concepts.
Spigot-specific player events.
-
Uses of Location in org.bukkit
Modifier and TypeMethodDescriptionLocation.add(double x, double y, double z)
Adds the location by another.Adds the location by another.Adds the location by a vector.Location.clone()
static Location
Location.deserialize(Map<String,Object> args)
Required method for deserializationOfflinePlayer.getBedSpawnLocation()
Gets the Location where the player will spawn at their bed, null if they have not slept in one or their current bed spawn is invalid.WorldBorder.getCenter()
Gets the current border center.Raid.getLocation()
Gets the center location where the raid occurs.World.getSpawnLocation()
Gets the default spawnLocation
of this worldWorld.locateNearestStructure(Location origin, StructureType structureType, int radius, boolean findUnexplored)
Find the closest nearby structure of a givenStructureType
.Location.multiply(double m)
Performs scalar multiplication, multiplying all components with a scalar.Location.setDirection(Vector vector)
Location.subtract(double x, double y, double z)
Subtracts the location by another.Subtracts the location by another.Subtracts the location by a vector.Location.zero()
Zero this location's components.Modifier and TypeMethodDescriptionAdds the location by another.static ItemStack
Bukkit.createExplorerMap(World world, Location location, StructureType structureType)
Create a new explorer map targeting the closest nearby structure of a givenStructureType
.static ItemStack
Bukkit.createExplorerMap(World world, Location location, StructureType structureType, int radius, boolean findUnexplored)
Create a new explorer map targeting the closest nearby structure of a givenStructureType
.Server.createExplorerMap(World world, Location location, StructureType structureType)
Create a new explorer map targeting the closest nearby structure of a givenStructureType
.Server.createExplorerMap(World world, Location location, StructureType structureType, int radius, boolean findUnexplored)
Create a new explorer map targeting the closest nearby structure of a givenStructureType
.boolean
World.createExplosion(Location loc, float power)
Creates explosion at given coordinates with given powerboolean
World.createExplosion(Location loc, float power, boolean setFire)
Creates explosion at given coordinates with given power and optionally setting blocks on fire.boolean
World.createExplosion(Location loc, float power, boolean setFire, boolean breakBlocks)
Creates explosion at given coordinates with given power and optionally setting blocks on fire or breaking blocks.boolean
World.createExplosion(Location loc, float power, boolean setFire, boolean breakBlocks, Entity source)
Creates explosion at given coordinates with given power and optionally setting blocks on fire or breaking blocks.double
Get the distance between this location and another.double
Location.distanceSquared(Location o)
Get the squared distance between this location and another.Drops an item at the specifiedLocation
Drops an item at the specifiedLocation
Note that functions will run before the entity is spawnedWorld.dropItemNaturally(Location location, ItemStack item)
Drops an item at the specifiedLocation
with a random offsetWorld.dropItemNaturally(Location location, ItemStack item, Consumer<Item> function)
Drops an item at the specifiedLocation
with a random offset Note that functions will run before the entity is spawnedboolean
World.generateTree(Location location, TreeType type)
Creates a tree at the givenLocation
boolean
World.generateTree(Location loc, TreeType type, BlockChangeDelegate delegate)
Creates a tree at the givenLocation
World.getBlockAt(Location location)
World.getChunkAt(Location location)
World.getHighestBlockAt(Location location)
Gets the highest non-empty (impassable) block at the given coordinates.World.getHighestBlockAt(Location location, HeightMap heightMap)
Gets the highest block corresponding to theHeightMap
at the given coordinates.int
World.getHighestBlockYAt(Location location)
Gets the highest non-empty (impassable) coordinate at the givenLocation
.int
World.getHighestBlockYAt(Location location, HeightMap heightMap)
World.getNearbyEntities(Location location, double x, double y, double z)
Returns a list of entities within a bounding box centered around a Location.World.getNearbyEntities(Location location, double x, double y, double z, Predicate<Entity> filter)
Returns a list of entities within a bounding box centered around a Location.boolean
Check if the specified location is inside this border.World.locateNearestRaid(Location location, int radius)
Finds the nearest raid close to the given location.World.locateNearestStructure(Location origin, StructureType structureType, int radius, boolean findUnexplored)
Find the closest nearby structure of a givenStructureType
.void
World.playEffect(Location location, Effect effect, int data)
Plays an effect to all players within a default radius around a given location.void
World.playEffect(Location location, Effect effect, int data, int radius)
Plays an effect to all players within a given radius around a location.<T> void
World.playEffect(Location location, Effect effect, T data)
Plays an effect to all players within a default radius around a given location.<T> void
World.playEffect(Location location, Effect effect, T data, int radius)
Plays an effect to all players within a given radius around a location.void
Play a Sound at the provided Location in the World.void
World.playSound(Location location, String sound, SoundCategory category, float volume, float pitch)
Play a Sound at the provided Location in the World.void
Play a Sound at the provided Location in the Worldvoid
World.playSound(Location location, Sound sound, SoundCategory category, float volume, float pitch)
Play a Sound at the provided Location in the World.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.void
Sets the new border center.boolean
World.setSpawnLocation(Location location)
Sets the spawn location of the world.<T extends Entity>
TSpawn an entity of a specific class at the givenLocation
<T extends Entity>
TSpawn an entity of a specific class at the givenLocation
, with the supplied function run before the entity is added to the world.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
World.spawnEntity(Location loc, EntityType type)
Creates a entity at the givenLocation
World.spawnFallingBlock(Location location, BlockData data)
World.spawnFallingBlock(Location location, MaterialData data)
World.spawnFallingBlock(Location location, Material material, byte data)
Deprecated.Magic valuevoid
World.spawnParticle(Particle particle, Location location, int count)
Spawns the particle (the number of times specified by count) at the target location.void
World.spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ)
Spawns the particle (the number of times specified by count) at the target location.void
World.spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra)
Spawns the particle (the number of times specified by count) at the target location.<T> void
World.spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data)
Spawns the particle (the number of times specified by count) at the target location.<T> void
World.spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force)
Spawns the particle (the number of times specified by count) at the target location.<T> void
World.spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, T data)
Spawns the particle (the number of times specified by count) at the target location.<T> void
World.spawnParticle(Particle particle, Location location, int count, T data)
Spawns the particle (the number of times specified by count) at the target location.World.Spigot.strikeLightning(Location loc, boolean isSilent)
Strikes lightning at the givenLocation
and possibly without soundWorld.strikeLightning(Location loc)
Strikes lightning at the givenLocation
World.Spigot.strikeLightningEffect(Location loc, boolean isSilent)
Strikes lightning at the givenLocation
without doing damage and possibly without soundWorld.strikeLightningEffect(Location loc)
Strikes lightning at the givenLocation
without doing damageSubtracts the location by another. -
Uses of Location in org.bukkit.block
Modifier and TypeMethodDescriptionEndGateway.getExitLocation()
Gets the location that entities are teleported to when entering the gateway portal.Beehive.getFlower()
Get the hive's flower location.Block.getLocation()
Gets the Location of the blockBlock.getLocation(Location loc)
Stores the location of the block in the provided Location object.BlockState.getLocation()
Gets the location of this block state.BlockState.getLocation(Location loc)
Stores the location of this block state in the provided Location object.DoubleChest.getLocation()
Modifier and TypeMethodDescriptionBlock.getLocation(Location loc)
Stores the location of the block in the provided Location object.BlockState.getLocation(Location loc)
Stores the location of this block state in the provided Location object.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.void
EndGateway.setExitLocation(Location location)
Sets the exit location that entities are teleported to when they enter the gateway portal.void
Set the hive's flower location. -
Uses of Location in org.bukkit.boss
Modifier and TypeMethodDescriptionDragonBattle.getEndPortalLocation()
Get the location of the end portal. -
Uses of Location in org.bukkit.command
Modifier and TypeMethodDescriptionCommand.tabComplete(CommandSender sender, String alias, String[] args, Location location)
Executed on tab completion for this command, returning a list of options the player can tab through.CommandMap.tabComplete(CommandSender sender, String cmdLine, Location location)
Looks for the requested command and executes an appropriate tab-completer if found.SimpleCommandMap.tabComplete(CommandSender sender, String cmdLine, Location location)
-
Uses of Location in org.bukkit.configuration
Modifier and TypeMethodDescriptionConfigurationSection.getLocation(String path)
Gets the requested Location by path.ConfigurationSection.getLocation(String path, Location def)
Gets the requestedLocation
by path, returning a default value if not found.MemorySection.getLocation(String path)
MemorySection.getLocation(String path, Location def)
Modifier and TypeMethodDescriptionConfigurationSection.getLocation(String path, Location def)
Gets the requestedLocation
by path, returning a default value if not found.MemorySection.getLocation(String path, Location def)
-
Uses of Location in org.bukkit.entity
Modifier and TypeMethodDescriptionEnderCrystal.getBeamTarget()
Gets the location that this end crystal is pointing its beam to.HumanEntity.getBedLocation()
Gets the location of the bed the player is currently sleeping inPlayer.getBedSpawnLocation()
Gets the Location where the player will spawn at their bed, null if they have not slept in one or their current bed spawn is invalid.Player.getCompassTarget()
Get the previously set compass target.LivingEntity.getEyeLocation()
Get a Location detailing the current eye position of the living entity.Bee.getFlower()
Get the bee's flower location.Bee.getHive()
Get the bee's hive location.Entity.getLocation()
Gets the entity's current positionEntity.getLocation(Location loc)
Stores the entity's current position in the provided Location object.EnderSignal.getTargetLocation()
Get the location this EnderSignal is moving towards.Modifier and TypeMethodDescriptionEntity.getLocation(Location loc)
Stores the entity's current position in the provided Location object.HumanEntity.openEnchanting(Location location, boolean force)
Opens an empty enchanting inventory window with the player's inventory on the bottom.HumanEntity.openWorkbench(Location location, boolean force)
Opens an empty workbench inventory window with the player's inventory on the bottom.void
Player.playEffect(Location loc, Effect effect, int data)
Deprecated.Magic value<T> void
Player.playEffect(Location loc, Effect effect, T data)
Plays an effect to just this player.void
Deprecated.Magic valuevoid
Player.playNote(Location loc, Instrument instrument, Note note)
Play a note for a player at a location.void
Play a sound for a player at the location.void
Player.playSound(Location location, String sound, SoundCategory category, float volume, float pitch)
Play a sound for a player at the location.void
Play a sound for a player at the location.void
Player.playSound(Location location, Sound sound, SoundCategory category, float volume, float pitch)
Play a sound for a player at the location.void
Player.sendBlockChange(Location loc, BlockData block)
Send a block change.void
Player.sendBlockChange(Location loc, Material material, byte data)
Deprecated.Magic valuevoid
Player.sendBlockDamage(Location loc, float progress)
Send block damage.boolean
Player.sendChunkChange(Location loc, int sx, int sy, int sz, byte[] data)
Deprecated.Magic valuevoid
Player.sendSignChange(Location loc, String[] lines)
Send a sign change.void
Player.sendSignChange(Location loc, String[] lines, DyeColor dyeColor)
Send a sign change.void
EnderCrystal.setBeamTarget(Location location)
Sets the location that this end crystal is pointing to.void
Player.setBedSpawnLocation(Location location)
Sets the Location where the player will spawn at their bed.void
Player.setBedSpawnLocation(Location location, boolean force)
Sets the Location where the player will spawn at their bed.void
Player.setCompassTarget(Location loc)
Set the target of the player's compass.void
Set the bee's flower location.void
Set the bee's hive location.void
EnderSignal.setTargetLocation(Location location)
Set theLocation
this EnderSignal is moving towards.boolean
Attempts to make the entity sleep at the given location.boolean
Attempts to make this villager sleep at the given location.void
Player.spawnParticle(Particle particle, Location location, int count)
Spawns the particle (the number of times specified by count) at the target location.void
Player.spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ)
Spawns the particle (the number of times specified by count) at the target location.void
Player.spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra)
Spawns the particle (the number of times specified by count) at the target location.<T> void
Player.spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data)
Spawns the particle (the number of times specified by count) at the target location.<T> void
Player.spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, T data)
Spawns the particle (the number of times specified by count) at the target location.<T> void
Player.spawnParticle(Particle particle, Location location, int count, T data)
Spawns the particle (the number of times specified by count) at the target location.boolean
Teleports this entity to the given location.boolean
Entity.teleport(Location location, PlayerTeleportEvent.TeleportCause cause)
Teleports this entity to the given location. -
Uses of Location in org.bukkit.entity.memory
-
Uses of Location in org.bukkit.event.block
-
Uses of Location in org.bukkit.event.entity
Modifier and TypeMethodDescriptionEntityTeleportEvent.getFrom()
Gets the location that this entity moved fromEntityExplodeEvent.getLocation()
Returns the location where the explosion happened.EntityPortalEnterEvent.getLocation()
Gets the portal block the entity is touchingEntitySpawnEvent.getLocation()
Gets the location at which the entity is spawning.ItemDespawnEvent.getLocation()
Gets the location at which the item is despawning.EntityTeleportEvent.getTo()
Gets the location that this entity moved toModifier and TypeMethodDescriptionvoid
Sets the location that this entity moved fromvoid
Sets the location that this entity moved toModifierConstructorDescriptionEntityExplodeEvent(Entity what, Location location, List<Block> blocks, float yield)
EntityPortalEnterEvent(Entity entity, Location location)
EntityPortalEvent(Entity entity, Location from, Location to)
EntityPortalEvent(Entity entity, Location from, Location to, int searchRadius)
EntityTeleportEvent(Entity what, Location from, Location to)
ItemDespawnEvent(Item despawnee, Location loc)
ItemSpawnEvent(Item spawnee, Location loc)
Deprecated. -
Uses of Location in org.bukkit.event.player
Modifier and TypeMethodDescriptionPlayerMoveEvent.getFrom()
Gets the location this player moved fromPlayerRespawnEvent.getRespawnLocation()
Gets the current respawn locationPlayerMoveEvent.getTo()
Gets the location this player moved toModifier and TypeMethodDescriptionvoid
Sets the location to mark as where the player moved fromvoid
PlayerRespawnEvent.setRespawnLocation(Location respawnLocation)
Sets the new respawn locationvoid
Sets the location that this player will move toModifierConstructorDescriptionPlayerMoveEvent(Player player, Location from, Location to)
PlayerPortalEvent(Player player, Location from, Location to)
PlayerPortalEvent(Player player, Location from, Location to, PlayerTeleportEvent.TeleportCause cause)
PlayerPortalEvent(Player player, Location from, Location to, PlayerTeleportEvent.TeleportCause cause, int getSearchRadius, boolean canCreatePortal, int creationRadius)
PlayerRespawnEvent(Player respawnPlayer, Location respawnLocation, boolean isBedSpawn)
Deprecated.PlayerRespawnEvent(Player respawnPlayer, Location respawnLocation, boolean isBedSpawn, boolean isAnchorSpawn)
PlayerTeleportEvent(Player player, Location from, Location to)
PlayerTeleportEvent(Player player, Location from, Location to, PlayerTeleportEvent.TeleportCause cause)
-
Uses of Location in org.bukkit.event.vehicle
-
Uses of Location in org.bukkit.event.world
Modifier and TypeMethodDescriptionStructureGrowEvent.getLocation()
Gets the location of the structure.SpawnChangeEvent.getPreviousLocation()
Gets the previous spawn locationModifierConstructorDescriptionSpawnChangeEvent(World world, Location previousLocation)
StructureGrowEvent(Location location, TreeType species, boolean bonemeal, Player player, List<BlockState> blocks)
-
Uses of Location in org.bukkit.generator
Modifier and TypeMethodDescriptionChunkGenerator.getFixedSpawnLocation(World world, Random random)
Gets a fixed spawn location to use for a given world. -
Uses of Location in org.bukkit.inventory
Modifier and TypeMethodDescriptionInventory.getLocation()
Get the location of the block or entity which corresponds to this inventory. -
Uses of Location in org.bukkit.inventory.meta
Modifier and TypeMethodDescriptionCompassMeta.getLodestone()
Gets the location that this compass will point to.Modifier and TypeMethodDescriptionvoid
CompassMeta.setLodestone(Location lodestone)
Sets the location this lodestone compass will point to. -
Uses of Location in org.bukkit.loot
Modifier and TypeMethodDescriptionLootContext.getLocation()
TheLocation
to store where the loot will be generated.ModifierConstructorDescriptionCreates a new LootContext.Builder instance to facilitate easy creation ofLootContext
s. -
Uses of Location in org.bukkit.util
Modifier and TypeMethodDescriptionVector.toLocation(World world)
Gets a Location version of this vector with yaw and pitch being 0.Vector.toLocation(World world, float yaw, float pitch)
Gets a Location version of this vector.Modifier and TypeMethodDescriptionstatic 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 locations as corners.Shifts this bounding box by the given amounts.Expands this bounding box to contain (or border) the specified position.ModifierConstructorDescriptionBlockIterator(Location loc)
Constructs the BlockIterator.BlockIterator(Location loc, double yOffset)
Constructs the BlockIterator.BlockIterator(Location loc, double yOffset, int maxDistance)
Constructs the BlockIterator. -
Uses of Location in org.spigotmc.event.player
Modifier and TypeMethodDescriptionPlayerSpawnLocationEvent.getSpawnLocation()
Gets player's spawn location.Modifier and TypeMethodDescriptionvoid
PlayerSpawnLocationEvent.setSpawnLocation(Location location)
Sets player's spawn location.