# 类的使用
org.bukkit.Location

使用Location的程序包
程序包
说明
org.bukkit
Bukkit API的顶级程序包, 包含通用的API类和接口.
org.bukkit.block
用于操作在`世界`内的三位像素(方块)，包括一些特定的状态.
org.bukkit.block.data
各种方块的 BlockData 类.
org.bukkit.boss
与创建Boss血量条(出现在玩家客户端屏幕顶部)有关的类.
org.bukkit.command
与处理玩家输入的非聊天消息(即命令)相关的类.
org.bukkit.configuration
专门用于处理插件运行时配置的类.
org.bukkit.damage
Classes concerning damage types and sources applicable to living entities.
org.bukkit.entity
为在`世界`内存在的非三维像素单位(实体)提供的接口，包含玩家、怪物、抛射物等.
org.bukkit.entity.memory
与实体的持久化内存有关的类, 目前仅与村民有关.
org.bukkit.event.block
与`方块`被改变或与`世界`进行交互等情况相关的`事件`.
org.bukkit.event.entity
与`实体`相关的`事件`，不包括 一些直接引用的更具体的实体类型.
org.bukkit.event.player
与`玩家`相关的`事件`.
org.bukkit.event.vehicle
与`载具实体`相关的`事件`.
org.bukkit.event.world
与`世界`状态和变化有关的`事件`.
org.bukkit.generator
简化`世界`生成实现的类.
org.bukkit.inventory
参与操作玩家物品栏和物品交互的类.
org.bukkit.inventory.meta
用于操作可以存储在`物品堆`的额外数据的接口.
org.bukkit.loot
与战利品表产生与操作有关的类 (Minecraft Wiki - 战利品表).
org.bukkit.structure
Classes related to creating or using `structures` without creating `Structure blocks` in the world.
org.bukkit.util
提供多种目的和单一目的的类以简化各种编程概念.
org.spigotmc.event.player
Spigot特有的玩家事件.

- ## org.bukkit中Location的使用

  返回Location的org.bukkit中的方法
  修饰符和类型
  方法
  说明
  `@NotNull Location`
  Location.`add(double x, double y, double z)`
  将本位置的坐标加上另一个位置的坐标.
  `@NotNull Location`
  Location.`add(@NotNull Location vec)`
  将本位置的坐标加上另一个位置的坐标.
  `@NotNull Location`
  Location.`add(@NotNull Vector vec)`
  将本位置的坐标加上一个向量的坐标.
  `@NotNull Location`
  Location.`clone()`
  `static @NotNull Location`
  Location.`deserialize(@NotNull Map<String,Object> args)`
  实现配置序列化与反序列化所需方法.
  `@Nullable Location`
  OfflinePlayer.`getBedSpawnLocation()`
  已过时。
  误导性的方法名称.
  `@NotNull Location`
  WorldBorder.`getCenter()`
  得到当前边界的中心.
  `@Nullable Location`
  OfflinePlayer.`getLastDeathLocation()`
  Gets the player's last death location.
  `@Nullable Location`
  OfflinePlayer.`getLocation()`
  Gets the player's current location.
  `@NotNull Location`
  Raid.`getLocation()`
  获取袭击的中心位置.
  `@NotNull Location`
  Vibration.Destination.BlockDestination.`getLocation()`
  `@NotNull Location`
  Vibration.`getOrigin()`
  Get the origin of the vibration.
  `@Nullable Location`
  OfflinePlayer.`getRespawnLocation()`
  Gets the Location where the player will spawn at, null if they don't have a valid respawn point.
  `@NotNull Location`
  World.`getSpawnLocation()`
  获取这个世界的默认出生点`位置`.
  `@Nullable Location`
  World.`locateNearestStructure(@NotNull Location origin, StructureType structureType, int radius, boolean findUnexplored)`
  已过时。
  Use `World.locateNearestStructure(Location, Structure, int, boolean)` or `World.locateNearestStructure(Location, StructureType, int, boolean)` instead.
  `@NotNull Location`
  Location.`multiply(double m)`
  坐标数乘, 将所有坐标轴上扩展某个倍数.
  `@NotNull Location`
  Location.`setDirection(@NotNull Vector vector)`
  将`偏航角`和`俯仰角`设为指向某一向量的方向.
  `@NotNull Location`
  Location.`subtract(double x, double y, double z)`
  从本位置的坐标中减去另一个位置的坐标.
  `@NotNull Location`
  Location.`subtract(@NotNull Location vec)`
  将本位置的坐标减去另一个位置的坐标.
  `@NotNull Location`
  Location.`subtract(@NotNull Vector vec)`
  从本位置的坐标中减去向量的坐标.
  `@NotNull Location`
  Location.`zero()`
  清零此位置的xyz坐标数值.
  参数类型为Location的org.bukkit中的方法
  修饰符和类型
  方法
  说明
  `@NotNull Location`
  Location.`add(@NotNull Location vec)`
  将本位置的坐标加上另一个位置的坐标.
  `<T extends Entity>
  T`
  RegionAccessor.`createEntity(@NotNull Location location, @NotNull Class<T> clazz)`
  Creates an entity of a specific class at the given `Location` but does not spawn it in the world.
  `static @NotNull ItemStack`
  Bukkit.`createExplorerMap(@NotNull World world, @NotNull Location location, @NotNull StructureType structureType)`
  Create a new explorer map targeting the closest nearby structure of a given `StructureType`.
  `static @NotNull ItemStack`
  Bukkit.`createExplorerMap(@NotNull World world, @NotNull Location location, @NotNull StructureType structureType, int radius, boolean findUnexplored)`
  Create a new explorer map targeting the closest nearby structure of a given `StructureType`.
  `@NotNull ItemStack`
  Server.`createExplorerMap(@NotNull World world, @NotNull Location location, @NotNull StructureType structureType)`
  Create a new explorer map targeting the closest nearby structure of a given `StructureType`.
  `@NotNull ItemStack`
  Server.`createExplorerMap(@NotNull World world, @NotNull Location location, @NotNull StructureType structureType, int radius, boolean findUnexplored)`
  Create a new explorer map targeting the closest nearby structure of a given `StructureType`.
  `boolean`
  World.`createExplosion(@NotNull Location loc, float power)`
  在指定坐标生成指定威力的爆炸.
  `boolean`
  World.`createExplosion(@NotNull Location loc, float power, boolean setFire)`
  在指定的坐标生成指定威力的爆炸并设置方块是否会着火.
  `boolean`
  World.`createExplosion(@NotNull 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(@NotNull Location loc, float power, boolean setFire, boolean breakBlocks, @Nullable Entity source)`
  Creates explosion at given coordinates with given power and optionally setting blocks on fire or breaking blocks.
  `double`
  Location.`distance(@NotNull Location o)`
  获取本位置与与另一个位置之间的距离.
  `double`
  Location.`distanceSquared(@NotNull Location o)`
  获取本位置与与另一个位置之间的距离的平方.
  `@NotNull Item`
  World.`dropItem(@NotNull Location location, @NotNull ItemStack item)`
  在指定的`位置`丢出一个物品.
  `@NotNull Item`
  World.`dropItem(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer<? super Item> function)`
  Drops an item at the specified `Location` Note that functions will run before the entity is spawned
  `@NotNull Item`
  World.`dropItemNaturally(@NotNull Location location, @NotNull ItemStack item)`
  在指定的`位置`丢出一个随机偏移的物品.
  `@NotNull Item`
  World.`dropItemNaturally(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer<? super Item> function)`
  Drops an item at the specified `Location` with a random offset Note that functions will run before the entity is spawned
  `boolean`
  RegionAccessor.`generateTree(@NotNull Location location, @NotNull Random random, @NotNull TreeType type)`
  Creates a tree at the given `Location`
  `boolean`
  RegionAccessor.`generateTree(@NotNull Location location, @NotNull Random random, @NotNull TreeType type, @Nullable Consumer<? super BlockState> stateConsumer)`
  Creates a tree at the given `Location`
  `boolean`
  RegionAccessor.`generateTree(@NotNull Location location, @NotNull Random random, @NotNull TreeType type, @Nullable Predicate<? super BlockState> statePredicate)`
  Creates a tree at the given `Location`
  `boolean`
  World.`generateTree(@NotNull Location location, @NotNull TreeType type)`
  在指定的`位置`创建一颗树.
  `boolean`
  World.`generateTree(@NotNull Location loc, @NotNull TreeType type, @NotNull BlockChangeDelegate delegate)`
  已过时。
  this method does not handle tile entities (bee nests)
  `@NotNull Biome`
  RegionAccessor.`getBiome(@NotNull Location location)`
  获取指定`位置`的`生物群系`.
  `@NotNull Block`
  World.`getBlockAt(@NotNull Location location)`
  获取指定`位置`的`方块`.
  `@NotNull BlockData`
  RegionAccessor.`getBlockData(@NotNull Location location)`
  Gets the `BlockData` at the given `Location`.
  `@NotNull BlockState`
  RegionAccessor.`getBlockState(@NotNull Location location)`
  Gets the `BlockState` at the given `Location`.
  `@NotNull Chunk`
  World.`getChunkAt(@NotNull Location location)`
  获取给定`位置`所在的`区块`.
  `@NotNull Block`
  World.`getHighestBlockAt(@NotNull Location location)`
  获取指定`位置`最高处不是空气且不可逾越的方块.
  `@NotNull Block`
  World.`getHighestBlockAt(@NotNull Location location, @NotNull HeightMap heightMap)`
  Gets the highest block corresponding to the `HeightMap` at the given coordinates.
  `int`
  RegionAccessor.`getHighestBlockYAt(@NotNull Location location)`
  Gets the highest non-empty (impassable) coordinate at the given `Location`.
  `int`
  RegionAccessor.`getHighestBlockYAt(@NotNull Location location, @NotNull HeightMap heightMap)`
  Gets the highest coordinate corresponding to the `HeightMap` at the given `Location`.
  `@NotNull Collection<Entity>`
  World.`getNearbyEntities(@NotNull Location location, double x, double y, double z)`
  返回一个以这个位置为中心的包围着的所有实体的列表(译注:这个可能不太好理解，就是在这个位置，按指定的搜索范围，搜索这个范围里的所有实体).
  `@NotNull Collection<Entity>`
  World.`getNearbyEntities(@NotNull Location location, double x, double y, double z, @Nullable Predicate<? super Entity> filter)`
  Returns a list of entities within a bounding box centered around a Location.
  `@NotNull Material`
  RegionAccessor.`getType(@NotNull Location location)`
  Gets the type of the block at the given `Location`.
  `boolean`
  WorldBorder.`isInside(@NotNull Location location)`
  检查指定的位置是否在这个边界里面.
  `@Nullable BiomeSearchResult`
  World.`locateNearestBiome(@NotNull Location origin, int radius, int horizontalInterval, int verticalInterval, @NotNull Biome... biomes)`
  Find the closest nearby location with a biome matching the provided `Biome`(s).
  `@Nullable BiomeSearchResult`
  World.`locateNearestBiome(@NotNull Location origin, int radius, @NotNull Biome... biomes)`
  Find the closest nearby location with a biome matching the provided `Biome`(s).
  `@Nullable Raid`
  World.`locateNearestRaid(@NotNull Location location, int radius)`
  寻找与给定位置相距最近的袭击.
  `@Nullable StructureSearchResult`
  World.`locateNearestStructure(@NotNull Location origin, @NotNull Structure structure, int radius, boolean findUnexplored)`
  Find the closest nearby structure of a given `Structure`.
  `@Nullable StructureSearchResult`
  World.`locateNearestStructure(@NotNull Location origin, @NotNull StructureType structureType, int radius, boolean findUnexplored)`
  Find the closest nearby structure of a given `StructureType`.
  `@Nullable Location`
  World.`locateNearestStructure(@NotNull Location origin, StructureType structureType, int radius, boolean findUnexplored)`
  已过时。
  Use `World.locateNearestStructure(Location, Structure, int, boolean)` or `World.locateNearestStructure(Location, StructureType, int, boolean)` instead.
  `void`
  World.`playEffect(@NotNull Location location, @NotNull Effect effect, int data)`
  向以指定位置为圆心的默认半径内的所有玩家施加(给予)一个效果.
  `void`
  World.`playEffect(@NotNull Location location, @NotNull Effect effect, int data, int radius)`
  向在以指定位置为圆心的指定半径内的所有玩家施加(给予)一个效果。
  `<T> void`
  World.`playEffect(@NotNull Location location, @NotNull Effect effect, T data)`
  向在以指定位置为圆心的默认半径内的所有玩家施加(给予)一个效果。
  `<T> void`
  World.`playEffect(@NotNull Location location, @NotNull Effect effect, T data, int radius)`
  向在以指定位置为圆心的指定半径内的所有玩家施加(给予)一个效果。
  `void`
  World.`playNote(@NotNull Location loc, @NotNull Instrument instrument, @NotNull Note note)`
  Play a note at the provided Location in the World.
  `void`
  World.`playSound(@NotNull Location location, @NotNull String sound, float volume, float pitch)`
  Play a Sound at the provided Location in the World.
  `void`
  World.`playSound(@NotNull Location location, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch)`
  Play a Sound at the provided Location in the World.
  `void`
  World.`playSound(@NotNull Location location, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch, long seed)`
  Play a Sound at the provided Location in the World.
  `void`
  World.`playSound(@NotNull Location location, @NotNull Sound sound, float volume, float pitch)`
  在世界中指定的位置播放一个声音。
  `void`
  World.`playSound(@NotNull Location location, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch)`
  Play a Sound at the provided Location in the World.
  `void`
  World.`playSound(@NotNull Location location, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch, long seed)`
  Play a Sound at the provided Location in the World.
  `@Nullable RayTraceResult`
  World.`rayTrace(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, @Nullable Predicate<? super Entity> filter)`
  执行射线跟踪, 检查方块碰撞和实体碰撞.
  `@Nullable RayTraceResult`
  World.`rayTraceBlocks(@NotNull Location start, @NotNull Vector direction, double maxDistance)`
  执行射线跟踪, 使用方块的精确碰撞形状来检查方块碰撞.
  `@Nullable RayTraceResult`
  World.`rayTraceBlocks(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode)`
  执行射线跟踪, 使用方块的精确碰撞形状来检查方块碰撞.
  `@Nullable RayTraceResult`
  World.`rayTraceBlocks(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks)`
  执行射线跟踪, 使用方块的精确碰撞形状来检查方块碰撞.
  `@Nullable RayTraceResult`
  World.`rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance)`
  执行检查实体碰撞的射线跟踪.
  `@Nullable RayTraceResult`
  World.`rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, double raySize)`
  执行检查实体碰撞的射线跟踪.
  `@Nullable RayTraceResult`
  World.`rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, double raySize, @Nullable Predicate<? super Entity> filter)`
  执行检查实体碰撞的射线跟踪.
  `@Nullable RayTraceResult`
  World.`rayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, @Nullable Predicate<? super Entity> filter)`
  执行检查实体碰撞的射线跟踪.
  `void`
  RegionAccessor.`setBiome(@NotNull Location location, @NotNull Biome biome)`
  设置指定`位置`的`生物群系`.
  `void`
  RegionAccessor.`setBlockData(@NotNull Location location, @NotNull BlockData blockData)`
  Sets the `BlockData` at the given `Location`.
  `void`
  WorldBorder.`setCenter(@NotNull Location location)`
  设置新的边界中心
  `boolean`
  World.`setSpawnLocation(@NotNull Location location)`
  设置这个世界的出生点位置.
  `void`
  RegionAccessor.`setType(@NotNull Location location, @NotNull Material material)`
  Sets the `Material` at the given `Location`.
  `<T extends Entity>
  T`
  RegionAccessor.`spawn(@NotNull Location location, @NotNull Class<T> clazz)`
  在指定的`位置`根据给定的类生成一个实体.
  `<T extends Entity>
  T`
  RegionAccessor.`spawn(@NotNull Location location, @NotNull Class<T> clazz, boolean randomizeData, @Nullable Consumer<? super T> function)`
  Creates a new entity at the given `Location` with the supplied function run before the entity is added to the world.
  `<T extends Entity>
  T`
  RegionAccessor.`spawn(@NotNull Location location, @NotNull Class<T> clazz, @Nullable Consumer<? super T> function)`
  Spawn an entity of a specific class at the given `Location`, with the supplied function run before the entity is added to the world.
  `<T extends LivingEntity>
  T`
  World.`spawn(@NotNull Location location, @NotNull Class<T> clazz, CreatureSpawnEvent.SpawnReason spawnReason, boolean randomizeData, @Nullable Consumer<? super T> function)`
  Creates a new entity at the given `Location` with the supplied function run before the entity is added to the world.
  `@NotNull Arrow`
  World.`spawnArrow(@NotNull Location location, @NotNull Vector direction, float speed, float spread)`
  在指定的`位置`创建一个`箭`的实体.
  `<T extends AbstractArrow>
  T`
  World.`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 given `Location`
  `@NotNull Entity`
  RegionAccessor.`spawnEntity(@NotNull Location location, @NotNull EntityType type)`
  在指定的`位置`创建一个实体.
  `@NotNull Entity`
  RegionAccessor.`spawnEntity(@NotNull Location loc, @NotNull EntityType type, boolean randomizeData)`
  Creates a new entity at the given `Location`.
  `@NotNull FallingBlock`
  World.`spawnFallingBlock(@NotNull Location location, @NotNull BlockData data)`
  在指定的`位置`根据给定的`BlockData`生成一个`掉落中的方块`实体。
  `@NotNull FallingBlock`
  World.`spawnFallingBlock(@NotNull Location location, @NotNull MaterialData data)`
  Spawn a `FallingBlock` entity at the given `Location` of the specified `MaterialData`.
  `@NotNull FallingBlock`
  World.`spawnFallingBlock(@NotNull Location location, @NotNull Material material, byte data)`
  已过时。
  不安全的参数
  `void`
  World.`spawnParticle(@NotNull Particle particle, @NotNull Location location, int count)`
  Spawns the particle (the number of times specified by count) at the target location.
  `void`
  World.`spawnParticle(@NotNull Particle particle, @NotNull 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(@NotNull Particle particle, @NotNull 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(@NotNull Particle particle, @NotNull 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(@NotNull Particle particle, @NotNull 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(@NotNull Particle particle, @NotNull 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(@NotNull Particle particle, @NotNull Location location, int count, T data)`
  Spawns the particle (the number of times specified by count) at the target location.
  `@NotNull LightningStrike`
  World.Spigot.`strikeLightning(@NotNull Location loc, boolean isSilent)`
  已过时。
  sound is now client side and cannot be removed
  `@NotNull LightningStrike`
  World.`strikeLightning(@NotNull Location loc)`
  在指定的`位置`劈下闪电.
  `@NotNull LightningStrike`
  World.Spigot.`strikeLightningEffect(@NotNull Location loc, boolean isSilent)`
  已过时。
  sound is now client side and cannot be removed
  `@NotNull LightningStrike`
  World.`strikeLightningEffect(@NotNull Location loc)`
  在指定的`位置`劈下不会造成伤害的闪电.
  `@NotNull Location`
  Location.`subtract(@NotNull Location vec)`
  将本位置的坐标减去另一个位置的坐标.
  参数类型为Location的org.bukkit中的构造器
  限定符
  构造器
  说明
  ``
  `BlockDestination(@NotNull Location block)`
  ``
  `Vibration(@NotNull Location origin, @NotNull Vibration.Destination destination, int arrivalTime)`

- ## org.bukkit.block中Location的使用

  返回Location的org.bukkit.block中的方法
  修饰符和类型
  方法
  说明
  `@Nullable Location`
  EndGateway.`getExitLocation()`
  获取当实体进入折跃门时被传送到的位置.
  `@Nullable Location`
  Beehive.`getFlower()`
  获取花的位置.
  `@NotNull Location`
  Block.`getLocation()`
  获取这个方块的位置.
  `@Nullable Location`
  Block.`getLocation(@Nullable Location loc)`
  存储此方块的位置到到给定的位置实例中.
  `@NotNull Location`
  BlockState.`getLocation()`
  获取此方块状态的位置.
  `@Nullable Location`
  BlockState.`getLocation(@Nullable Location loc)`
  存储此方块状态的位置到给定的位置实例中.
  `@NotNull Location`
  DoubleChest.`getLocation()`
  参数类型为Location的org.bukkit.block中的方法
  修饰符和类型
  方法
  说明
  `@NotNull BlockState`
  BlockState.`copy(@NotNull Location location)`
  Copies the state to another block as an unplaced BlockState.
  `@Nullable Location`
  Block.`getLocation(@Nullable Location loc)`
  存储此方块的位置到到给定的位置实例中.
  `@Nullable Location`
  BlockState.`getLocation(@Nullable Location loc)`
  存储此方块状态的位置到给定的位置实例中.
  `@Nullable RayTraceResult`
  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.
  `void`
  EndGateway.`setExitLocation(@Nullable Location location)`
  设置进入折跃门时传送的位置.
  `void`
  Beehive.`setFlower(@Nullable Location location)`
  设置花的位置.

- ## org.bukkit.block.data中Location的使用

  参数类型为Location的org.bukkit.block.data中的方法
  修饰符和类型
  方法
  说明
  `boolean`
  BlockData.`isSupported(@NotNull Location location)`
  检查如果此状态下的方块放置在给定的 `Location` 的方块上，它是否会被正常支撑。

- ## org.bukkit.boss中Location的使用

  返回Location的org.bukkit.boss中的方法
  修饰符和类型
  方法
  说明
  `@Nullable Location`
  DragonBattle.`getEndPortalLocation()`
  Get the location of the end portal.

- ## org.bukkit.command中Location的使用

  参数类型为Location的org.bukkit.command中的方法
  修饰符和类型
  方法
  说明
  `@NotNull List<String>`
  Command.`tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args, @Nullable Location location)`
  对此命令进行tab补全并返回补全项列表.
  `@Nullable List<String>`
  CommandMap.`tabComplete(@NotNull CommandSender sender, @NotNull String cmdLine, @Nullable Location location)`
  Looks for the requested command and executes an appropriate tab-completer if found.
  `@Nullable List<String>`
  SimpleCommandMap.`tabComplete(@NotNull CommandSender sender, @NotNull String cmdLine, @Nullable Location location)`

- ## org.bukkit.configuration中Location的使用

  返回Location的org.bukkit.configuration中的方法
  修饰符和类型
  方法
  说明
  `@Nullable Location`
  ConfigurationSection.`getLocation(@NotNull String path)`
  Gets the requested Location by path.
  `@Nullable Location`
  ConfigurationSection.`getLocation(@NotNull String path, @Nullable Location def)`
  Gets the requested `Location` by path, returning a default value if not found.
  `@Nullable Location`
  MemorySection.`getLocation(@NotNull String path)`
  `@Nullable Location`
  MemorySection.`getLocation(@NotNull String path, @Nullable Location def)`
  参数类型为Location的org.bukkit.configuration中的方法
  修饰符和类型
  方法
  说明
  `@Nullable Location`
  ConfigurationSection.`getLocation(@NotNull String path, @Nullable Location def)`
  Gets the requested `Location` by path, returning a default value if not found.
  `@Nullable Location`
  MemorySection.`getLocation(@NotNull String path, @Nullable Location def)`

- ## org.bukkit.damage中Location的使用

  返回Location的org.bukkit.damage中的方法
  修饰符和类型
  方法
  说明
  `@Nullable Location`
  DamageSource.`getDamageLocation()`
  Get the `Location` from where the damage originated.
  `@Nullable Location`
  DamageSource.`getSourceLocation()`
  Get the `Location` from where the damage originated.
  参数类型为Location的org.bukkit.damage中的方法
  修饰符和类型
  方法
  说明
  `@NotNull DamageSource.Builder`
  DamageSource.Builder.`withDamageLocation(@NotNull Location location)`
  Set the `Location` of the source of damage.

- ## org.bukkit.entity中Location的使用

  返回Location的org.bukkit.entity中的方法
  修饰符和类型
  方法
  说明
  `@Nullable Location`
  Sniffer.`findPossibleDigLocation()`
  Try to get a possible location where the sniffer can dig.
  `@Nullable Location`
  EnderCrystal.`getBeamTarget()`
  Gets the location that this end crystal is pointing its beam to.
  `@NotNull Location`
  HumanEntity.`getBedLocation()`
  Gets the location of the bed the player is currently sleeping in
  `@Nullable Location`
  Player.`getBedSpawnLocation()`
  已过时。
  Misleading name.
  `@Nullable Location`
  Vex.`getBound()`
  Gets the bound of this entity.
  `@NotNull Location`
  Player.`getCompassTarget()`
  得到玩家指南针的指向的位置(`Location`).
  `@NotNull Location`
  LivingEntity.`getEyeLocation()`
  获取生物实体眼睛的详细方位的Location对象.
  `@Nullable Location`
  Bee.`getFlower()`
  获取蜜蜂盘旋的花的位置.
  `@Nullable Location`
  Bee.`getHive()`
  获取蜜蜂的家(蜂巢)的位置.
  `@Nullable Location`
  Allay.`getJukebox()`
  Gets the jukebox the allay is set to dance to.
  `@Nullable Location`
  HumanEntity.`getLastDeathLocation()`
  Gets the player's last death location.
  `@NotNull Location`
  Entity.`getLocation()`
  获取实体当前位置
  `@Nullable Location`
  Entity.`getLocation(@Nullable Location loc)`
  将实体的当前位置存储到提供的Location中.
  `@Nullable Location`
  Player.`getRespawnLocation()`
  Gets the Location where the player will spawn at, null if they don't have a valid respawn point.
  `@NotNull Location`
  EnderSignal.`getTargetLocation()`
  获取末影之眼移向的位置.
  返回变量类型为Location的类型的org.bukkit.entity中的方法
  修饰符和类型
  方法
  说明
  `@NotNull Collection<Location>`
  Sniffer.`getExploredLocations()`
  Gets the locations explored by the sniffer.
  参数类型为Location的org.bukkit.entity中的方法
  修饰符和类型
  方法
  说明
  `void`
  Sniffer.`addExploredLocation(@NotNull Location location)`
  Add a location to the explored locations.
  `@NotNull Entity`
  Entity.`copy(@NotNull Location to)`
  Creates a copy of this entity and all its data.
  `@NotNull Entity`
  EntitySnapshot.`createEntity(@NotNull Location to)`
  Creates an entity using this template and spawns it at the provided location.
  `@Nullable Location`
  Entity.`getLocation(@Nullable Location loc)`
  将实体的当前位置存储到提供的Location中.
  `@Nullable InventoryView`
  HumanEntity.`openEnchanting(@Nullable Location location, boolean force)`
  打开一个空白附魔台物品栏界面, 玩家物品栏(背包)在底部.
  `@Nullable InventoryView`
  HumanEntity.`openWorkbench(@Nullable Location location, boolean force)`
  打开一个空白工作台物品栏界面, 玩家物品栏(背包)在底部.
  `void`
  Player.`playEffect(@NotNull Location loc, @NotNull Effect effect, int data)`
  已过时。
  不安全的参数
  `<T> void`
  Player.`playEffect(@NotNull Location loc, @NotNull Effect effect, T data)`
  在某个位置(`Location`)向玩家播放一个粒子效果(`Effect`).
  `void`
  Player.`playNote(@NotNull Location loc, byte instrument, byte note)`
  已过时。
  不安全的参数
  `void`
  Player.`playNote(@NotNull Location loc, @NotNull Instrument instrument, @NotNull Note note)`
  在指定位置处为玩家播放一个音符.
  `void`
  Player.`playSound(@NotNull Location location, @NotNull String sound, float volume, float pitch)`
  向玩家在某个位置播放一个声音.
  `void`
  Player.`playSound(@NotNull Location location, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch)`
  向玩家在指定位置播放声音.
  `void`
  Player.`playSound(@NotNull Location location, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch, long seed)`
  Play a sound for a player at the location.
  `void`
  Player.`playSound(@NotNull Location location, @NotNull Sound sound, float volume, float pitch)`
  向玩家在某个位置播放一个声音.
  `void`
  Player.`playSound(@NotNull Location location, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch)`
  向玩家在指定位置播放声音.
  `void`
  Player.`playSound(@NotNull Location location, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch, long seed)`
  Play a sound for a player at the location.
  `void`
  Sniffer.`removeExploredLocation(@NotNull Location location)`
  Remove a location of the explored locations.
  `void`
  Player.`sendBlockChange(@NotNull Location loc, @NotNull BlockData block)`
  向该玩家发送一个伪造的指定位置的方块(`Block`)更改数据包.这不会改变世界中的方块.
  `void`
  Player.`sendBlockChange(@NotNull Location loc, @NotNull Material material, byte data)`
  已过时。
  不安全的参数
  `void`
  Player.`sendBlockDamage(@NotNull Location loc, float progress)`
  Send block damage.
  `void`
  Player.`sendBlockDamage(@NotNull Location loc, float progress, int sourceId)`
  Send block damage.
  `void`
  Player.`sendBlockDamage(@NotNull Location loc, float progress, @NotNull Entity source)`
  Send block damage.
  `void`
  Player.`sendBlockUpdate(@NotNull Location loc, @NotNull TileState tileState)`
  Send a TileState change.
  `void`
  Player.`sendSignChange(@NotNull Location loc, @Nullable String[] lines)`
  向该玩家发送一个伪造的牌子(`Sign`)上的字的更改数据包.这不会改变世界中的任何方块.
  `void`
  Player.`sendSignChange(@NotNull Location loc, @Nullable String[] lines, @NotNull DyeColor dyeColor)`
  向该玩家发送一个伪造的牌子(`Sign`)上的字的更改数据包.这不会改变世界中的任何方块.
  `void`
  Player.`sendSignChange(@NotNull Location loc, @Nullable String[] lines, @NotNull DyeColor dyeColor, boolean hasGlowingText)`
  向该玩家发送一个伪造的牌子(`Sign`)上的字的更改数据包.这不会改变世界中的任何方块.
  `void`
  EnderCrystal.`setBeamTarget(@Nullable Location location)`
  Sets the location that this end crystal is pointing to.
  `void`
  Player.`setBedSpawnLocation(@Nullable Location location)`
  已过时。
  Misleading name.
  `void`
  Player.`setBedSpawnLocation(@Nullable Location location, boolean force)`
  已过时。
  Misleading name.
  `void`
  Vex.`setBound(@Nullable Location location)`
  Sets the bound of this entity.
  `void`
  Player.`setCompassTarget(@NotNull Location loc)`
  设置玩家指南针的指向的位置(`Location`).
  `void`
  Warden.`setDisturbanceLocation(@NotNull Location location)`
  Make the warden sense a disturbance in the force at the location given.
  `void`
  Bee.`setFlower(@Nullable Location location)`
  设置蜜蜂盘旋的花的位置.
  `void`
  Bee.`setHive(@Nullable Location location)`
  设置蜜蜂所住蜂巢的位置.
  `void`
  HumanEntity.`setLastDeathLocation(@Nullable Location location)`
  Sets the player's last death location.
  `void`
  Player.`setRespawnLocation(@Nullable Location location)`
  Sets the Location where the player will respawn.
  `void`
  Player.`setRespawnLocation(@Nullable Location location, boolean force)`
  Sets the Location where the player will respawn.
  `void`
  EnderSignal.`setTargetLocation(@NotNull Location location)`
  设置末影之眼移向的位置.
  `boolean`
  HumanEntity.`sleep(@NotNull Location location, boolean force)`
  Attempts to make the entity sleep at the given location.
  `boolean`
  Villager.`sleep(@NotNull Location location)`
  Attempts to make this villager sleep at the given location.
  `void`
  Player.`spawnParticle(@NotNull Particle particle, @NotNull Location location, int count)`
  在指定位置产生粒子效果 (the number of times specified by count).
  `void`
  Player.`spawnParticle(@NotNull Particle particle, @NotNull 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(@NotNull Particle particle, @NotNull 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(@NotNull Particle particle, @NotNull 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(@NotNull Particle particle, @NotNull 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`
  Player.`spawnParticle(@NotNull Particle particle, @NotNull 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(@NotNull Particle particle, @NotNull Location location, int count, T data)`
  在指定位置产生粒子效果 (the number of times specified by count).
  `void`
  Allay.`startDancing(@NotNull Location location)`
  Causes the allay to start dancing because of the provided jukebox location.
  `boolean`
  Entity.`teleport(@NotNull Location location)`
  将此实体传送到给定位置.
  `boolean`
  Entity.`teleport(@NotNull Location location, @NotNull PlayerTeleportEvent.TeleportCause cause)`
  将此实体传送到给定位置.

- ## org.bukkit.entity.memory中Location的使用

  类型参数类型为Location的org.bukkit.entity.memory中的字段
  修饰符和类型
  字段
  说明
  `static final MemoryKey<Location>`
  MemoryKey.`HOME`
  `static final MemoryKey<Location>`
  MemoryKey.`JOB_SITE`
  `static final MemoryKey<Location>`
  MemoryKey.`LIKED_NOTEBLOCK_POSITION`
  `static final MemoryKey<Location>`
  MemoryKey.`MEETING_POINT`
  `static final MemoryKey<Location>`
  MemoryKey.`POTENTIAL_JOB_SITE`
  `static final MemoryKey<Location>`
  MemoryKey.`SNIFFER_EXPLORED_POSITIONS`

- ## org.bukkit.event.block中Location的使用

  返回Location的org.bukkit.event.block中的方法
  修饰符和类型
  方法
  说明
  `@NotNull Location`
  BlockPistonRetractEvent.`getRetractLocation()`
  已过时。

- ## org.bukkit.event.entity中Location的使用

  返回Location的org.bukkit.event.entity中的方法
  修饰符和类型
  方法
  说明
  `@NotNull Location`
  EntityTeleportEvent.`getFrom()`
  获取实体传送起始位置.
  `@NotNull Location`
  EntityExplodeEvent.`getLocation()`
  返回爆炸发生的位置.
  `@NotNull Location`
  EntityPortalEnterEvent.`getLocation()`
  获取实体接触的传送门方块.
  `@NotNull Location`
  EntitySpawnEvent.`getLocation()`
  获取实体出生的位置.
  `@NotNull Location`
  ItemDespawnEvent.`getLocation()`
  获取即将消失的掉落物.
  `@Nullable Location`
  EntityTeleportEvent.`getTo()`
  获取实体传送目标位置.
  参数类型为Location的org.bukkit.event.entity中的方法
  修饰符和类型
  方法
  说明
  `void`
  EntityTeleportEvent.`setFrom(@NotNull Location from)`
  设置实体传送起始位置.
  `void`
  EntityTeleportEvent.`setTo(@Nullable Location to)`
  设置实体传送目标位置.
  参数类型为Location的org.bukkit.event.entity中的构造器
  限定符
  构造器
  说明
  ``
  `EntityExplodeEvent(@NotNull Entity what, @NotNull Location location, @NotNull List<Block> blocks, float yield, @NotNull ExplosionResult result)`
  ``
  `EntityPortalEnterEvent(@NotNull Entity entity, @NotNull Location location)`
  ``
  `EntityPortalEvent(@NotNull Entity entity, @NotNull Location from, @Nullable Location to)`
  ``
  `EntityPortalEvent(@NotNull Entity entity, @NotNull Location from, @Nullable Location to, int searchRadius)`
  ``
  `EntityPortalEvent(@NotNull Entity entity, @NotNull Location from, @Nullable Location to, int searchRadius, boolean canCreatePortal, int creationRadius)`
  ``
  `EntityPortalExitEvent(@NotNull Entity entity, @NotNull Location from, @NotNull Location to, @NotNull Vector before, @NotNull Vector after)`
  ``
  `EntityTeleportEvent(@NotNull Entity what, @NotNull Location from, @Nullable Location to)`
  ``
  `ItemDespawnEvent(@NotNull Item despawnee, @NotNull Location loc)`
  ``
  `ItemSpawnEvent(@NotNull Item spawnee, Location loc)`
  已过时。

- ## org.bukkit.event.player中Location的使用

  返回Location的org.bukkit.event.player中的方法
  修饰符和类型
  方法
  说明
  `@NotNull Location`
  PlayerMoveEvent.`getFrom()`
  得到玩家发生移动前的位置.
  `@Nullable Location`
  PlayerSpawnChangeEvent.`getNewSpawn()`
  Gets the new spawn to be set.
  `@NotNull Location`
  PlayerRespawnEvent.`getRespawnLocation()`
  获取当前重生的位置.
  `@Nullable Location`
  PlayerMoveEvent.`getTo()`
  得到玩家移动到的位置.
  参数类型为Location的org.bukkit.event.player中的方法
  修饰符和类型
  方法
  说明
  `void`
  PlayerMoveEvent.`setFrom(@NotNull Location from)`
  设置玩家将要移动到此位置之前的位置.
  `void`
  PlayerSpawnChangeEvent.`setNewSpawn(@Nullable Location newSpawn)`
  Sets the new spawn location.
  `void`
  PlayerRespawnEvent.`setRespawnLocation(@NotNull Location respawnLocation)`
  设置一个新的重生位置.
  `void`
  PlayerMoveEvent.`setTo(@NotNull Location to)`
  设置玩家将要移动的位置.
  参数类型为Location的org.bukkit.event.player中的构造器
  限定符
  构造器
  说明
  ``
  `PlayerMoveEvent(@NotNull Player player, @NotNull Location from, @Nullable Location to)`
  ``
  `PlayerPortalEvent(@NotNull Player player, @NotNull Location from, @Nullable Location to)`
  ``
  `PlayerPortalEvent(@NotNull Player player, @NotNull Location from, @Nullable Location to, @NotNull PlayerTeleportEvent.TeleportCause cause)`
  ``
  `PlayerPortalEvent(@NotNull Player player, @NotNull Location from, @Nullable Location to, @NotNull PlayerTeleportEvent.TeleportCause cause, int getSearchRadius, boolean canCreatePortal, int creationRadius)`
  ``
  `PlayerRespawnEvent(@NotNull Player respawnPlayer, @NotNull Location respawnLocation, boolean isBedSpawn)`
  已过时。
  ``
  `PlayerRespawnEvent(@NotNull Player respawnPlayer, @NotNull Location respawnLocation, boolean isBedSpawn, boolean isAnchorSpawn)`
  已过时。
  ``
  `PlayerRespawnEvent(@NotNull Player respawnPlayer, @NotNull Location respawnLocation, boolean isBedSpawn, boolean isAnchorSpawn, @NotNull PlayerRespawnEvent.RespawnReason respawnReason)`
  ``
  `PlayerSpawnChangeEvent(@NotNull Player player, @Nullable Location newSpawn, boolean forced, @NotNull PlayerSpawnChangeEvent.Cause cause)`
  ``
  `PlayerTeleportEvent(@NotNull Player player, @NotNull Location from, @Nullable Location to)`
  ``
  `PlayerTeleportEvent(@NotNull Player player, @NotNull Location from, @Nullable Location to, @NotNull PlayerTeleportEvent.TeleportCause cause)`

- ## org.bukkit.event.vehicle中Location的使用

  返回Location的org.bukkit.event.vehicle中的方法
  修饰符和类型
  方法
  说明
  `@NotNull Location`
  VehicleMoveEvent.`getFrom()`
  获取载具的上一个位置.
  `@NotNull Location`
  VehicleMoveEvent.`getTo()`
  获取载具新的位置.
  参数类型为Location的org.bukkit.event.vehicle中的构造器
  限定符
  构造器
  说明
  ``
  `VehicleMoveEvent(@NotNull Vehicle vehicle, @NotNull Location from, @NotNull Location to)`

- ## org.bukkit.event.world中Location的使用

  返回Location的org.bukkit.event.world中的方法
  修饰符和类型
  方法
  说明
  `@NotNull Location`
  GenericGameEvent.`getLocation()`
  获取事件发生所在的位置.
  `@NotNull Location`
  StructureGrowEvent.`getLocation()`
  获取这个结构的位置.
  `@NotNull Location`
  SpawnChangeEvent.`getPreviousLocation()`
  获取之前的出生点位置.
  参数类型为Location的org.bukkit.event.world中的构造器
  限定符
  构造器
  说明
  ``
  `GenericGameEvent(@NotNull GameEvent event, @NotNull Location location, @Nullable Entity entity, int radius, boolean isAsync)`
  ``
  `SpawnChangeEvent(@NotNull World world, @NotNull Location previousLocation)`
  ``
  `StructureGrowEvent(@NotNull Location location, @NotNull TreeType species, boolean bonemeal, @Nullable Player player, @NotNull List<BlockState> blocks)`

- ## org.bukkit.generator中Location的使用

  返回Location的org.bukkit.generator中的方法
  修饰符和类型
  方法
  说明
  `@Nullable Location`
  ChunkGenerator.`getFixedSpawnLocation(@NotNull World world, @NotNull Random random)`
  获取一个固定出生方位用于一个指定的世界。
  参数类型为Location的org.bukkit.generator中的方法
  修饰符和类型
  方法
  说明
  `boolean`
  LimitedRegion.`isInRegion(@NotNull Location location)`
  Checks if the given `Location` is in the region.

- ## org.bukkit.inventory中Location的使用

  返回Location的org.bukkit.inventory中的方法
  修饰符和类型
  方法
  说明
  `@Nullable Location`
  Inventory.`getLocation()`
  获得对应于此物品栏的方块或实体的位置.

- ## org.bukkit.inventory.meta中Location的使用

  返回Location的org.bukkit.inventory.meta中的方法
  修饰符和类型
  方法
  说明
  `@Nullable Location`
  CompassMeta.`getLodestone()`
  获取指南针指向的位置.
  参数类型为Location的org.bukkit.inventory.meta中的方法
  修饰符和类型
  方法
  说明
  `void`
  CompassMeta.`setLodestone(@Nullable Location lodestone)`
  设置指南针指向的位置.

- ## org.bukkit.loot中Location的使用

  返回Location的org.bukkit.loot中的方法
  修饰符和类型
  方法
  说明
  `@NotNull Location`
  LootContext.`getLocation()`
  The `Location` to store where the loot will be generated.
  参数类型为Location的org.bukkit.loot中的构造器
  限定符
  构造器
  说明
  ``
  `Builder(@NotNull Location location)`
  Creates a new LootContext.Builder instance to facilitate easy creation of `LootContext`s.

- ## org.bukkit.structure中Location的使用

  参数类型为Location的org.bukkit.structure中的方法
  修饰符和类型
  方法
  说明
  `void`
  Structure.`fill(@NotNull Location corner1, @NotNull Location corner2, boolean includeEntities)`
  Fills the structure from an area in a world.
  `void`
  Structure.`fill(@NotNull Location origin, @NotNull BlockVector size, boolean includeEntities)`
  Fills the Structure from an area in a world, starting at the specified origin and extending in each axis according to the specified size vector.
  `void`
  Structure.`place(@NotNull Location location, boolean includeEntities, @NotNull StructureRotation structureRotation, @NotNull Mirror mirror, int palette, float integrity, @NotNull Random random)`
  Place a structure in the world.
  `void`
  Structure.`place(@NotNull Location location, boolean includeEntities, @NotNull StructureRotation structureRotation, @NotNull Mirror mirror, int palette, float integrity, @NotNull Random random, @NotNull Collection<BlockTransformer> blockTransformers, @NotNull Collection<EntityTransformer> entityTransformers)`
  Place a structure in the world.

- ## org.bukkit.util中Location的使用

  返回Location的org.bukkit.util中的方法
  修饰符和类型
  方法
  说明
  `@NotNull Location`
  BiomeSearchResult.`getLocation()`
  Return the location of the biome.
  `@NotNull Location`
  StructureSearchResult.`getLocation()`
  Return the location of the structure.
  `@NotNull Location`
  Vector.`toLocation(@NotNull World world)`
  将向量转换为 Location, 其自转角(也叫偏航角,Yaw)、旋进角(也叫进动角、俯仰角,Pitch)为0.
  `@NotNull Location`
  Vector.`toLocation(@NotNull World world, float yaw, float pitch)`
  将向量转换为 Location.
  参数类型为Location的org.bukkit.util中的方法
  修饰符和类型
  方法
  说明
  `static @NotNull BoundingBox`
  BoundingBox.`of(@NotNull Location center, double x, double y, double z)`
  Creates a new bounding box using the given center and extents.
  `static @NotNull BoundingBox`
  BoundingBox.`of(@NotNull Location corner1, @NotNull Location corner2)`
  Creates a new bounding box using the coordinates of the given locations as corners.
  `@NotNull BoundingBox`
  BoundingBox.`shift(@NotNull Location shift)`
  Shifts this bounding box by the given amounts.
  `@NotNull BoundingBox`
  BoundingBox.`union(@NotNull Location position)`
  Expands this bounding box to contain (or border) the specified position.
  参数类型为Location的org.bukkit.util中的构造器
  限定符
  构造器
  说明
  ``
  `BlockIterator(@NotNull Location loc)`
  BlockIterator的构造函数.
  ``
  `BlockIterator(@NotNull Location loc, double yOffset)`
  BlockIterator的构造函数.
  ``
  `BlockIterator(@NotNull Location loc, double yOffset, int maxDistance)`
  BlockIterator的构造函数.

- ## org.spigotmc.event.player中Location的使用

  返回Location的org.spigotmc.event.player中的方法
  修饰符和类型
  方法
  说明
  `@NotNull Location`
  PlayerSpawnLocationEvent.`getSpawnLocation()`
  获取玩家的出生点.
  参数类型为Location的org.spigotmc.event.player中的方法
  修饰符和类型
  方法
  说明
  `void`
  PlayerSpawnLocationEvent.`setSpawnLocation(@NotNull Location location)`
  设置玩家的出生点 (仅在本事件中生效).
  参数类型为Location的org.spigotmc.event.player中的构造器
  限定符
  构造器
  说明
  ``
  `PlayerSpawnLocationEvent(@NotNull Player who, @NotNull Location spawnLocation)`