程序包 | 说明 |
---|---|
org.bukkit |
Bukkit的常用类.
|
org.bukkit.block |
用于操作在
世界 内的三位像素(方块),包括一些特定的状态. |
org.bukkit.command |
与处理玩家输入的非聊天消息(即命令)相关的类.
|
org.bukkit.entity |
为在
世界 内存在的非三维像素单位(实体)提供的接口,包含玩家、怪物、抛射物等. |
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.util |
提供多种目的和单一目的的类以简化各种编程概念.
|
限定符和类型 | 方法和说明 |
---|---|
Location |
Location.add(double x,
double y,
double z)
将本位置的坐标加上另一个位置的坐标.
|
Location |
Location.add(Location vec)
将本位置的坐标加上另一个位置的坐标.
|
Location |
Location.add(Vector vec)
将本位置的坐标加上一个向量的坐标.
|
Location |
Location.clone() |
static Location |
Location.deserialize(java.util.Map<java.lang.String,java.lang.Object> args)
实现配置序列化与反序列化所需方法.
|
Location |
TravelAgent.findOrCreate(Location location)
尝试寻找指定方位附近的传送门,如果找不到则会尝试生成一个。
|
Location |
TravelAgent.findPortal(Location location)
尝试寻找指定方位附近的传送门。
|
Location |
OfflinePlayer.getBedSpawnLocation()
获取该玩家在床的重生点的Location对象,但如果该玩家从未使用过床或该重生点无效,则会返回null
原文: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.
|
Location |
WorldBorder.getCenter()
得到当前边界的中心.
|
Location |
World.getSpawnLocation()
获取这个世界的默认出生点
位置 . |
Location |
Location.multiply(double m)
坐标数乘, 将所有坐标轴上扩展某个倍数.
|
Location |
Location.setDirection(Vector vector)
|
Location |
Location.subtract(double x,
double y,
double z)
从本位置的坐标中减去另一个位置的坐标.
|
Location |
Location.subtract(Location vec)
将本位置的坐标减去另一个位置的坐标.
|
Location |
Location.subtract(Vector vec)
从本位置的坐标中减去向量的坐标.
|
Location |
Location.zero()
清零此位置的xyz坐标数值.
|
限定符和类型 | 方法和说明 |
---|---|
Location |
Location.add(Location vec)
将本位置的坐标加上另一个位置的坐标.
|
boolean |
World.createExplosion(Location loc,
float power)
在指定坐标生成指定威力的爆炸.
|
boolean |
World.createExplosion(Location loc,
float power,
boolean setFire)
在指定的坐标生成指定威力的爆炸并设置方块是否会着火.
|
boolean |
TravelAgent.createPortal(Location location)
尝试在指定方位附近生成一个传送门。
|
double |
Location.distance(Location o)
获取本位置与与另一个位置之间的距离.
|
double |
Location.distanceSquared(Location o)
获取本位置与与另一个位置之间的距离的平方.
|
Item |
World.dropItem(Location location,
ItemStack item)
在指定的
位置 丢出一个物品. |
Item |
World.dropItemNaturally(Location location,
ItemStack item)
在指定的
位置 丢出一个随机偏移的物品. |
Location |
TravelAgent.findOrCreate(Location location)
尝试寻找指定方位附近的传送门,如果找不到则会尝试生成一个。
|
Location |
TravelAgent.findPortal(Location location)
尝试寻找指定方位附近的传送门。
|
boolean |
World.generateTree(Location location,
TreeType type)
在指定的
位置 创建一颗树. |
boolean |
World.generateTree(Location loc,
TreeType type,
BlockChangeDelegate delegate)
已过时。
该API很少使用,基本上是出于实现自身功能的目的而创造的
|
Block |
World.getBlockAt(Location location)
|
int |
World.getBlockTypeIdAt(Location location)
已过时。
不安全的参数
|
Chunk |
World.getChunkAt(Location location)
|
Block |
World.getHighestBlockAt(Location location)
获取指定
位置 的最顶上的方块(不是空气). |
int |
World.getHighestBlockYAt(Location location)
Gets the y coordinate of the lowest block at the given
Location
such that the block and all blocks above it are transparent for lighting
purposes. |
java.util.Collection<Entity> |
World.getNearbyEntities(Location location,
double x,
double y,
double z)
返回一个以这个位置为中心的包围着的所有实体的列表(译注:这个可能不太好理解,就是在这个位置,按指定的搜索范围,搜索这个范围里的所有实体).
|
boolean |
WorldBorder.isInside(Location location)
检查指定的位置是否在这个边界里面.
|
void |
World.playEffect(Location location,
Effect effect,
int data)
向以指定位置为圆心的默认半径内的所有玩家施加(给予)一个效果.
|
void |
World.playEffect(Location location,
Effect effect,
int data,
int radius)
向在以指定位置为圆心的指定半径内的所有玩家施加(给予)一个效果。
|
<T> void |
World.playEffect(Location location,
Effect effect,
T data)
向在以指定位置为圆心的默认半径内的所有玩家施加(给予)一个效果。
|
<T> void |
World.playEffect(Location location,
Effect effect,
T data,
int radius)
向在以指定位置为圆心的指定半径内的所有玩家施加(给予)一个效果。
|
void |
World.playSound(Location location,
Sound sound,
float volume,
float pitch)
在世界中指定的位置播放一个声音。
|
void |
World.playSound(Location location,
Sound sound,
SoundCategory category,
float volume,
float pitch)
Play a Sound at the provided Location in the World.
|
void |
World.playSound(Location location,
java.lang.String sound,
float volume,
float pitch)
Play a Sound at the provided Location in the World.
|
void |
World.playSound(Location location,
java.lang.String sound,
SoundCategory category,
float volume,
float pitch)
Play a Sound at the provided Location in the World.
|
void |
WorldBorder.setCenter(Location location)
设置新的边界中心
原文:Sets the new border center.
|
boolean |
World.setSpawnLocation(Location location)
设置这个世界的出生点位置.
|
<T extends Entity> |
World.spawn(Location location,
java.lang.Class<T> clazz)
在指定的
位置 根据给定的类生成一个实体. |
<T extends Entity> |
World.spawn(Location location,
java.lang.Class<T> clazz,
Consumer<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. |
Arrow |
World.spawnArrow(Location location,
Vector direction,
float speed,
float spread)
|
<T extends Arrow> |
World.spawnArrow(Location location,
Vector direction,
float speed,
float spread,
java.lang.Class<T> clazz)
Creates an arrow entity of the given class at the given
Location |
Entity |
World.spawnEntity(Location loc,
EntityType type)
在指定的
位置 创建一个实体. |
FallingBlock |
World.spawnFallingBlock(Location location,
int blockId,
byte blockData)
已过时。
不安全的参数
|
FallingBlock |
World.spawnFallingBlock(Location location,
Material material,
byte data)
已过时。
不安全的参数
|
FallingBlock |
World.spawnFallingBlock(Location location,
MaterialData data)
|
void |
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,
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.
|
LightningStrike |
World.strikeLightning(Location loc)
在指定的
位置 劈下闪电. |
LightningStrike |
World.strikeLightningEffect(Location loc)
在指定的
位置 劈下不会造成伤害的闪电. |
Location |
Location.subtract(Location vec)
将本位置的坐标减去另一个位置的坐标.
|
限定符和类型 | 方法和说明 |
---|---|
Location |
EndGateway.getExitLocation()
Gets the location that entities are teleported to when
entering the gateway portal.
|
Location |
BlockState.getLocation()
Gets the location of this block state.
|
Location |
DoubleChest.getLocation() |
Location |
Block.getLocation()
获取方块的位置信息.
|
Location |
BlockState.getLocation(Location loc)
Stores the location of this block state in the provided Location object.
|
Location |
Block.getLocation(Location loc)
Stores the location of the block in the provided Location object.
|
限定符和类型 | 方法和说明 |
---|---|
Location |
BlockState.getLocation(Location loc)
Stores the location of this block state in the provided Location object.
|
Location |
Block.getLocation(Location loc)
Stores the location of the block in the provided Location object.
|
void |
EndGateway.setExitLocation(Location location)
Sets the exit location that entities are teleported to when
they enter the gateway portal.
|
限定符和类型 | 方法和说明 |
---|---|
java.util.List<java.lang.String> |
CommandMap.tabComplete(CommandSender sender,
java.lang.String cmdLine,
Location location)
Looks for the requested command and executes an appropriate
tab-completer if found.
|
java.util.List<java.lang.String> |
SimpleCommandMap.tabComplete(CommandSender sender,
java.lang.String cmdLine,
Location location) |
java.util.List<java.lang.String> |
Command.tabComplete(CommandSender sender,
java.lang.String alias,
java.lang.String[] args,
Location location)
执行此命令的tab补全时返回选项列表.
|
限定符和类型 | 方法和说明 |
---|---|
Location |
EnderCrystal.getBeamTarget()
Gets the location that this end crystal is pointing its beam to.
|
Location |
Player.getBedSpawnLocation()
得到玩家上一次睡觉的床的位置(
Location ). |
Location |
Player.getCompassTarget()
得到玩家指南针的指向的位置(
Location ). |
Location |
LivingEntity.getEyeLocation()
获取生物实体眼睛的详细方位的Location对象。
|
Location |
Entity.getLocation()
Gets the entity's current position
|
Location |
Entity.getLocation(Location loc)
Stores the entity's current position in the provided Location object.
|
Location |
EnderSignal.getTargetLocation()
Get the location this EnderSignal is moving towards.
|
限定符和类型 | 方法和说明 |
---|---|
Location |
Entity.getLocation(Location loc)
Stores the entity's current position in the provided Location object.
|
InventoryView |
HumanEntity.openEnchanting(Location location,
boolean force)
打开一个空白附魔台物品栏界面, 玩家物品栏(背包)在底部.
|
InventoryView |
HumanEntity.openWorkbench(Location location,
boolean force)
打开一个空白工作台物品栏界面, 玩家物品栏(背包)在底部.
|
void |
Player.playEffect(Location loc,
Effect effect,
int data)
已过时。
不安全的参数
|
<T> void |
Player.playEffect(Location loc,
Effect effect,
T data)
|
void |
Player.playNote(Location loc,
byte instrument,
byte note)
已过时。
不安全的参数
|
void |
Player.playNote(Location loc,
Instrument instrument,
Note note)
Play a note for a player at a location.
|
void |
Player.playSound(Location location,
Sound sound,
float volume,
float pitch)
向玩家在某个位置播放一个声音.
|
void |
Player.playSound(Location location,
Sound sound,
SoundCategory category,
float volume,
float pitch)
Play a sound for a player at the location.
|
void |
Player.playSound(Location location,
java.lang.String sound,
float volume,
float pitch)
向玩家在某个位置播放一个声音.
|
void |
Player.playSound(Location location,
java.lang.String sound,
SoundCategory category,
float volume,
float pitch)
Play a sound for a player at the location.
|
void |
Player.sendBlockChange(Location loc,
int material,
byte data)
已过时。
不安全的参数
|
void |
Player.sendBlockChange(Location loc,
Material material,
byte data)
已过时。
不安全的参数
|
boolean |
Player.sendChunkChange(Location loc,
int sx,
int sy,
int sz,
byte[] data)
已过时。
不安全的参数
|
void |
Player.sendSignChange(Location loc,
java.lang.String[] lines)
向该玩家发送一个伪造的牌子(
Sign )上的字的更改数据包.这不会改变世界中的任何方块. |
void |
EnderCrystal.setBeamTarget(Location location)
Sets the location that this end crystal is pointing to.
|
void |
Player.setBedSpawnLocation(Location location)
设置玩家上一次睡觉的床的位置(
Location ). |
void |
Player.setBedSpawnLocation(Location location,
boolean force)
设置玩家上一次睡觉的床的位置.
|
void |
Player.setCompassTarget(Location loc)
设置玩家指南针的指向的位置(
Location ). |
void |
EnderSignal.setTargetLocation(Location location)
Set the
Location this EnderSignal is moving towards. |
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 |
Entity.teleport(Location location)
Teleports this entity to the given location.
|
boolean |
Entity.teleport(Location location,
PlayerTeleportEvent.TeleportCause cause)
Teleports this entity to the given location.
|
限定符和类型 | 方法和说明 |
---|---|
Location |
BlockPistonRetractEvent.getRetractLocation()
已过时。
|
限定符和类型 | 方法和说明 |
---|---|
Location |
EntityTeleportEvent.getFrom()
Gets the location that this entity moved from
|
Location |
CreatureSpawnEvent.getLocation()
返回生物出生的位置
原文:
Gets the location at which the creature is spawning.
|
Location |
ItemSpawnEvent.getLocation()
Gets the location at which the item is spawning.
|
Location |
ItemDespawnEvent.getLocation()
Gets the location at which the item is despawning.
|
Location |
EntityExplodeEvent.getLocation()
返回爆炸发生的位置.
|
Location |
EntityPortalEnterEvent.getLocation()
获取实体接触的传送门方块.
|
Location |
EntityTeleportEvent.getTo()
Gets the location that this entity moved to
|
限定符和类型 | 方法和说明 |
---|---|
void |
EntityTeleportEvent.setFrom(Location from)
Sets the location that this entity moved from
|
void |
EntityTeleportEvent.setTo(Location to)
Sets the location that this entity moved to
|
构造器和说明 |
---|
EntityExplodeEvent(Entity what,
Location location,
java.util.List<Block> blocks,
float yield) |
EntityPortalEnterEvent(Entity entity,
Location location) |
EntityPortalEvent(Entity entity,
Location from,
Location to,
TravelAgent pta) |
EntityPortalExitEvent(Entity entity,
Location from,
Location to,
Vector before,
Vector after) |
EntityTeleportEvent(Entity what,
Location from,
Location to) |
ItemDespawnEvent(Item despawnee,
Location loc) |
ItemSpawnEvent(Item spawnee,
Location loc) |
限定符和类型 | 方法和说明 |
---|---|
Location |
PlayerMoveEvent.getFrom()
得到玩家移动到此位置之前的位置.
|
Location |
PlayerRespawnEvent.getRespawnLocation()
获取当前重生的位置.
|
Location |
PlayerMoveEvent.getTo()
得到玩家移动到的位置.
|
限定符和类型 | 方法和说明 |
---|---|
void |
PlayerMoveEvent.setFrom(Location from)
设置玩家将要移动到此位置之前的位置.
|
void |
PlayerRespawnEvent.setRespawnLocation(Location respawnLocation)
设置一个新的重生位置.
|
void |
PlayerMoveEvent.setTo(Location to)
设置玩家将要移动的位置.
|
构造器和说明 |
---|
PlayerMoveEvent(Player player,
Location from,
Location to) |
PlayerPortalEvent(Player player,
Location from,
Location to,
TravelAgent pta) |
PlayerPortalEvent(Player player,
Location from,
Location to,
TravelAgent pta,
PlayerTeleportEvent.TeleportCause cause) |
PlayerRespawnEvent(Player respawnPlayer,
Location respawnLocation,
boolean isBedSpawn) |
PlayerTeleportEvent(Player player,
Location from,
Location to) |
PlayerTeleportEvent(Player player,
Location from,
Location to,
PlayerTeleportEvent.TeleportCause cause) |
限定符和类型 | 方法和说明 |
---|---|
Location |
VehicleMoveEvent.getFrom()
获取载具的上一个位置.
|
Location |
VehicleMoveEvent.getTo()
获取载具新的位置.
|
构造器和说明 |
---|
VehicleMoveEvent(Vehicle vehicle,
Location from,
Location to) |
限定符和类型 | 方法和说明 |
---|---|
Location |
StructureGrowEvent.getLocation()
获取这个结构的位置.
|
Location |
SpawnChangeEvent.getPreviousLocation()
获取之前的出生点位置.
|
构造器和说明 |
---|
SpawnChangeEvent(World world,
Location previousLocation) |
StructureGrowEvent(Location location,
TreeType species,
boolean bonemeal,
Player player,
java.util.List<BlockState> blocks) |
限定符和类型 | 方法和说明 |
---|---|
Location |
ChunkGenerator.getFixedSpawnLocation(World world,
java.util.Random random)
获取一个固定出生方位用于一个指定的世界。
|
限定符和类型 | 方法和说明 |
---|---|
Location |
Inventory.getLocation()
获得对应于此物品栏的方块或实体的位置.
|
限定符和类型 | 方法和说明 |
---|---|
Location |
Vector.toLocation(World world)
将向量转换为 Location,
其自转角(也叫偏航角,Yaw)、旋进角(也叫进动角、俯仰角,Pitch)为0.
|
Location |
Vector.toLocation(World world,
float yaw,
float pitch)
将向量转换为 Location.
|
构造器和说明 |
---|
BlockIterator(Location loc)
BlockIterator的构造函数.
|
BlockIterator(Location loc,
double yOffset)
BlockIterator的构造函数.
|
BlockIterator(Location loc,
double yOffset,
int maxDistance)
BlockIterator的构造函数.
|