接口 World
- 所有超级接口:
Metadatable
,PluginMessageRecipient
-
嵌套类概要
-
方法概要
修饰符和类型方法说明boolean
获取建筑物是否会被生成。boolean
createExplosion
(double x, double y, double z, float power) 在指定坐标生成指定威力的爆炸.boolean
createExplosion
(double x, double y, double z, float power, boolean setFire) 在指定的坐标生成指定威力的爆炸并设置方块是否会着火.boolean
createExplosion
(double x, double y, double z, float power, boolean setFire, boolean breakBlocks) 在指定的坐标生成指定威力的爆炸并设置方块是否会着火或被破坏.boolean
createExplosion
(Location loc, float power) 在指定坐标生成指定威力的爆炸.boolean
createExplosion
(Location loc, float power, boolean setFire) 在指定的坐标生成指定威力的爆炸并设置方块是否会着火.在指定的位置
丢出一个物品.dropItemNaturally
(Location location, ItemStack item) 在指定的位置
丢出一个随机偏移的物品.boolean
generateTree
(Location location, TreeType type) 在指定的位置
创建一颗树.boolean
generateTree
(Location loc, TreeType type, BlockChangeDelegate delegate) 已过时。该API很少使用,基本上是出于实现自身功能的目的而创造的boolean
获取动物能不能在这个世界生成。boolean
获取怪物能不能在这个世界生成。int
获取这个世界一个区块内周围的怪物的生成数限制。int
获取这个世界一个区块内的动物生成数限制。getBiome
(int x, int z) 获取指定方块坐标的生物群系。getBlockAt
(int x, int y, int z) 获取坐标所指的方块
.getBlockAt
(Location location) int
getBlockTypeIdAt
(int x, int y, int z) 已过时。不安全的参数int
getBlockTypeIdAt
(Location location) 已过时。不安全的参数getChunkAt
(int x, int z) 获取给定坐标所在的区块
.getChunkAt
(Block block) getChunkAt
(Location location) 获取世界的游戏难度。getEmptyChunkSnapshot
(int x, int z, boolean includeBiome, boolean includeBiomeTempRain) 获取空区块的快照(相当于所有空气方块),可设置包含有效生物群系数据。获取一个这个世界所有实体的列表.<T extends Entity>
Collection<T>getEntitiesByClass
(Class<T> cls) 获取一个在这个世界的所有与指定的类/接口相匹配的实体的集合.<T extends Entity>
Collection<T>getEntitiesByClass
(Class<T>... classes) 已过时。getEntitiesByClasses
(Class<?>... classes) 获取一个在这个世界的所有与任一指定的类/接口相匹配的实体的集合.获取世界的环境
类型.long
获取这个世界完整的游戏时间.String[]
获取当前的游戏规则。getGameRuleValue
(String rule) 获取指定游戏规则的当前状态。获取世界的区块生成器.getHighestBlockAt
(int x, int z) 获取指定坐标的最顶上的方块(不是空气).getHighestBlockAt
(Location location) 获取指定位置
的最顶上的方块(不是空气).int
getHighestBlockYAt
(int x, int z) Gets the y coordinate of the lowest block at this position such that the block and all blocks above it are transparent for lighting purposes.int
getHighestBlockYAt
(Location location) Gets the y coordinate of the lowest block at the givenLocation
such that the block and all blocks above it are transparent for lighting purposes.double
getHumidity
(int x, int z) 获取指定方块坐标的湿度。boolean
获取世界的出生点是否会在内存中保存加载。获取一个这个世界所有生物实体的列表.Chunk[]
获取一个所有被加载的区块
的数组.int
获取这个世界的最大高度。int
获取这个世界一个区块内的怪物生成数限制。getName()
获取世界的唯一名称.getNearbyEntities
(Location location, double x, double y, double z) 返回一个以这个位置为中心的包围着的所有实体的列表(译注:这个可能不太好理解,就是在这个位置,按指定的搜索范围,搜索这个范围里的所有实体).获取一个这个世界的所有玩家的列表.获取一个这个世界使用的所有方块填充器
的列表.boolean
getPVP()
获取世界当前的PVP设置.int
获取世界的海平面。long
getSeed()
获取世界的种子.获取这个世界的默认出生点位置
.double
getTemperature
(int x, int z) 获取指定方块坐标的温度。int
获取这个世界打雷的持续时间.long
获取世界生成动物的时间间隔(单位为tick)。long
获取世界生成怪物的时间间隔(单位为tick)。long
getTime()
获取这个世界在游戏中的相对时间.getUID()
获取世界的唯一UUID.int
获取这个世界一个区块内的水生动物生成数限制。int
获取当前天气的剩余时间,单位为tick.获取这个世界的世界边界对象。获取这个世界保存在磁盘的哪个文件夹。获取世界类型。boolean
hasStorm()
返回世界现在是否有雷暴.boolean
获取世界是否会自动保存。boolean
isChunkInUse
(int x, int z) 检查指定坐标的区块
是否被加载且被一个或更多的玩家使用.boolean
isChunkLoaded
(int x, int z) 检查在指定坐标的区块
是否被加载.boolean
isChunkLoaded
(Chunk chunk) 检查指定区块
是否已经被加载.boolean
isGameRule
(String rule) 检查字符串是否是一个有效的游戏规则。boolean
返回这个世界是否在打雷.void
loadChunk
(int x, int z) 加载指定坐标的区块
.boolean
loadChunk
(int x, int z, boolean generate) 加载指定坐标的区块
.void
加载指定的区块
.void
playEffect
(Location location, Effect effect, int data) 向以指定位置为圆心的默认半径内的所有玩家施加(给予)一个效果.void
playEffect
(Location location, Effect effect, int data, int radius) 向在以指定位置为圆心的指定半径内的所有玩家施加(给予)一个效果。<T> void
playEffect
(Location location, Effect effect, T data) 向在以指定位置为圆心的默认半径内的所有玩家施加(给予)一个效果。<T> void
playEffect
(Location location, Effect effect, T data, int radius) 向在以指定位置为圆心的指定半径内的所有玩家施加(给予)一个效果。void
Play a Sound at the provided Location in the World.void
playSound
(Location location, String sound, SoundCategory category, float volume, float pitch) Play a Sound at the provided Location in the World.void
在世界中指定的位置播放一个声音。void
playSound
(Location location, Sound sound, SoundCategory category, float volume, float pitch) Play a Sound at the provided Location in the World.boolean
refreshChunk
(int x, int z) 已过时。这个方法不能保证在所有的客户端接口都正常地工作。boolean
regenerateChunk
(int x, int z) 重新生成指定坐标的区块
.void
save()
保存世界到磁盘.void
setAmbientSpawnLimit
(int limit) 设置这个世界一个区块内周围的怪物的生成数限制。void
setAnimalSpawnLimit
(int limit) 设置这个世界一个区块内的动物生成数限制。void
setAutoSave
(boolean value) 设置世界是否会自动保存。void
设置指定方块坐标的生物群系void
setDifficulty
(Difficulty difficulty) 设置世界的游戏难度。void
setFullTime
(long time) 设置服务器的游戏时间.boolean
setGameRuleValue
(String rule, String value) 将指定的游戏规则设置为指定数值。void
setKeepSpawnInMemory
(boolean keepLoaded) 设置世界的出生点是否会在内存中保存加载。void
setMonsterSpawnLimit
(int limit) 设置这个世界一个区块内的怪物生成数限制。void
setPVP
(boolean pvp) 设置世界的PVP设置.void
setSpawnFlags
(boolean allowMonsters, boolean allowAnimals) 为这个世界设置出生标识。boolean
setSpawnLocation
(int x, int y, int z) 设置这个世界的出生点位置.boolean
setSpawnLocation
(Location location) 设置这个世界的出生点位置.void
setStorm
(boolean hasStorm) 设置是否有风暴。void
setThunderDuration
(int duration) 设置这个世界打雷持续时间。void
setThundering
(boolean thundering) 设置这个世界是否在打雷.void
setTicksPerAnimalSpawns
(int ticksPerAnimalSpawns) 设置世界生成动物的时间间隔(单位为tick)。void
setTicksPerMonsterSpawns
(int ticksPerMonsterSpawns) 设置世界生成怪物的时间间隔(单位为tick)。void
setTime
(long time) 设置服务器的在游戏中的相对时间.void
setWaterAnimalSpawnLimit
(int limit) 设置这个世界一个区块内的水生动物生成数限制。void
setWeatherDuration
(int duration) 设置当前天气的剩余时间,单位为tick.<T extends Entity>
T在指定的位置
根据给定的类生成一个实体.<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.spawnArrow
(Location location, Vector direction, float speed, float spread) <T extends Arrow>
TspawnArrow
(Location location, Vector direction, float speed, float spread, Class<T> clazz) Creates an arrow entity of the given class at the givenLocation
spawnEntity
(Location loc, EntityType type) 在指定的位置
创建一个实体.spawnFallingBlock
(Location location, int blockId, byte blockData) 已过时。不安全的参数spawnFallingBlock
(Location location, MaterialData data) spawnFallingBlock
(Location location, Material material, byte data) 已过时。不安全的参数void
spawnParticle
(Particle particle, double x, double y, double z, int count) Spawns the particle (the number of times specified by count) at the target location.void
spawnParticle
(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ) Spawns the particle (the number of times specified by count) at the target location.void
spawnParticle
(Particle particle, double x, double y, double z, 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
spawnParticle
(Particle particle, double x, double y, double z, 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
spawnParticle
(Particle particle, double x, double y, double z, 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
spawnParticle
(Particle particle, double x, double y, double z, int count, T data) Spawns the particle (the number of times specified by count) at the target location.void
spawnParticle
(Particle particle, Location location, int count) Spawns the particle (the number of times specified by count) at the target location.void
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
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
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
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
spawnParticle
(Particle particle, Location location, int count, T data) Spawns the particle (the number of times specified by count) at the target location.strikeLightning
(Location loc) 在指定的位置
劈下闪电.在指定的位置
劈下不会造成伤害的闪电.boolean
unloadChunk
(int x, int z) 安全的卸载并保存指定坐标的区块
.boolean
unloadChunk
(int x, int z, boolean save) 安全的卸载并选择是否保存指定坐标的区块
.boolean
unloadChunk
(int x, int z, boolean save, boolean safe) 已过时。移除一个正在使用的区块从不安全boolean
unloadChunk
(Chunk chunk) 安全的卸载并保存指定坐标的区块
.boolean
unloadChunkRequest
(int x, int z) 安全地将卸载指定坐标的区块
列入队列.boolean
unloadChunkRequest
(int x, int z, boolean safe) 将卸载指定坐标的区块
列入队列.从接口继承的方法 org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadata
从接口继承的方法 org.bukkit.plugin.messaging.PluginMessageRecipient
getListeningPluginChannels, sendPluginMessage
-
方法详细资料
-
getBlockAt
- 参数:
x
- 方块的X坐标y
- 方块的Y坐标z
- 方块的Z坐标- 返回:
- 在指定坐标的方块
- 另请参阅:
-
getBlockAt
- 参数:
location
- 要获取的方块的位置- 返回:
- 在指定位置的方块
- 另请参阅:
-
getBlockTypeIdAt
已过时。不安全的参数获取指定坐标的方块ID.原文:Gets the block type ID at the given coordinates
- 参数:
x
- 方块的X坐标y
- 方块的Y坐标z
- 方块的Z坐标- 返回:
- 指定坐标所在的方块的ID
- 另请参阅:
-
getBlockTypeIdAt
已过时。不安全的参数- 参数:
location
- 要获取的方块ID的位置- 返回:
- 指定位置的方块的ID
- 另请参阅:
-
getHighestBlockYAt
int getHighestBlockYAt(int x, int z) Gets the y coordinate of the lowest block at this position such that the block and all blocks above it are transparent for lighting purposes.- 参数:
x
- X-coordinate of the blocksz
- Z-coordinate of the blocks- 返回:
- Y-coordinate of the described block
-
getHighestBlockYAt
Gets the y coordinate of the lowest block at the givenLocation
such that the block and all blocks above it are transparent for lighting purposes.- 参数:
location
- Location of the blocks- 返回:
- Y-coordinate of the highest non-air block
-
getHighestBlockAt
获取指定坐标的最顶上的方块(不是空气).译注:就是说,获取某个坐标最上面的方块.Essentials插件的top就是这个原理.
原文:Gets the highest non-empty block at the given coordinates
- 参数:
x
- X坐标z
- Z坐标- 返回:
- x,z坐标内,最上面的一个不是空气的方块
-
getHighestBlockAt
获取指定位置
的最顶上的方块(不是空气).译注:相当于getHightestBlockYAt(location),只不过那是获得方块Y坐标,而这个是获取方块对象. 原文:Gets the highest non-empty block at the given coordinates
- 参数:
location
- 需要获取最高的方块的位置- 返回:
- 最高的不是空气的方块
-
getChunkAt
- 参数:
x
- X坐标z
- Z坐标- 返回:
- 给定坐标所在的区块
-
getChunkAt
- 参数:
location
- 方块的位置- 返回:
- 给定位置的区块
-
getChunkAt
- 参数:
block
- 需要检测的方块- 返回:
- 方块所处的区块
-
isChunkLoaded
- 参数:
chunk
- 需要检查的区块- 返回:
- 如果区块已经被加载则返回true,否则返回false
-
getLoadedChunks
Chunk[] getLoadedChunks()- 返回:
- 包含所有被加载区块的数组Chunk[]
-
loadChunk
- 参数:
chunk
- 待加载的区块
-
isChunkLoaded
boolean isChunkLoaded(int x, int z) - 参数:
x
- 区块的x坐标z
- 区块的z坐标- 返回:
- 如果区块已经被加载则返回true,否则返回false
-
isChunkInUse
boolean isChunkInUse(int x, int z) 检查指定坐标的区块
是否被加载且被一个或更多的玩家使用.原文: Checks if the
Chunk
at the specified coordinates is loaded and in use by one or more players- 参数:
x
- 区块的x坐标z
- 区块的z坐标- 返回:
- 如果区块被加载且被一个或更多的玩家使用则返回true,否则返回false
-
loadChunk
void loadChunk(int x, int z) 加载指定坐标的区块
.如果区块不存在则会被生成。
这个方法类似于当generate值为true时的
loadChunk(int, int, boolean)
.原文: Loads the
Chunk
at the specified coordinatesIf the chunk does not exist, it will be generated.
This method is analogous to
loadChunk(int, int, boolean)
where generate is true.- 参数:
x
- 区块的x坐标z
- 区块的z坐标
-
loadChunk
boolean loadChunk(int x, int z, boolean generate) - 参数:
x
- 区块的x坐标z
- 区块的z坐标generate
- 如果区块不存在是否生成- 返回:
- 如果区块被成功加载则返回true,否则返回false
-
unloadChunk
安全的卸载并保存指定坐标的区块
.这个方法类似于当safe值和saveis值为true时的
unloadChunk(int, int, boolean,boolean)
原文: Safely unloads and saves the
Chunk
at the specified coordinatesThis method is analogous to
unloadChunk(int, int, boolean, boolean)
where safe and saveis true- 参数:
chunk
- 卸载的区块- 返回:
- 如果区块被成功卸载则返回true,否则返回false
-
unloadChunk
boolean unloadChunk(int x, int z) 安全的卸载并保存指定坐标的区块
.这个方法类似于当safe值和saveis值为true时的
unloadChunk(int, int, boolean,boolean)
原文: Safely unloads and saves the
Chunk
at the specified coordinatesThis method is analogous to
unloadChunk(int, int, boolean, boolean)
where safe and saveis true- 参数:
x
- 区块的x坐标z
- 区块的z坐标- 返回:
- 如果区块被成功卸载则返回true,否则返回false
-
unloadChunk
boolean unloadChunk(int x, int z, boolean save) 安全的卸载并选择是否保存指定坐标的区块
.这个方法类似于当safe值为true时的
unloadChunk(int, int, boolean,boolean)
原文: Safely unloads and optionally saves the
Chunk
at the specified coordinatesThis method is analogous to
unloadChunk(int, int, boolean, boolean)
where save is true- 参数:
x
- 区块的x坐标z
- 区块的z坐标save
- 是否保存区块- 返回:
- 如果区块被成功卸载则返回true,否则返回false
-
unloadChunk
已过时。移除一个正在使用的区块从不安全- 参数:
x
- 区块的x坐标z
- 区块的z坐标save
- 控制是否保存区块safe
- 控制当附近有玩家时是否卸载区块- 返回:
- 如果区块被成功卸载则返回true,否则返回false
-
unloadChunkRequest
boolean unloadChunkRequest(int x, int z) 安全地将卸载指定坐标的区块
列入队列.这个方法类似于当safe值为true时的
unloadChunkRequest(int, int,boolean)
原文: Safely queues the
Chunk
at the specified coordinates for unloadingThis method is analogous to
unloadChunkRequest(int, int, boolean)
where safe is true- 参数:
x
- 区块的x坐标z
- 区块的z坐标- 返回:
- 如果尝试列入队列成功则返回true,否则返回false
-
unloadChunkRequest
boolean unloadChunkRequest(int x, int z, boolean safe) - 参数:
x
- 区块的x坐标z
- 区块的z坐标safe
- 控制当附近有玩家时是否卸载区块- 返回:
- 区块是否真的被列入队列
-
regenerateChunk
boolean regenerateChunk(int x, int z) - 参数:
x
- 区块的x坐标z
- 区块的z坐标- 返回:
- 区块是否真的被重新生成
-
refreshChunk
已过时。这个方法不能保证在所有的客户端接口都正常地工作。- 参数:
x
- 区块的x坐标z
- 区块的z坐标- 返回:
- 区块是否真的被刷新
-
dropItem
- 参数:
location
- 丢出物品的位置item
- 丢出的物品堆- 返回:
- 这个方法会创建一个ItemDrop(物品掉落)实体作为结果
-
dropItemNaturally
- 参数:
location
- 丢出物品的位置item
- 丢出的物品堆- 返回:
- 这个方法会创建一个ItemDrop(物品掉落)实体作为结果
-
spawnArrow
- 参数:
location
- 生成箭的位置direction
- 箭射向的方向speed
- 箭的射速,建议为0.6spread
- 箭存在的时间(箭在多久后会消失)- 返回:
- 这个方法会生成一个Arrow(箭)实体作为结果
-
spawnArrow
<T extends Arrow> T spawnArrow(Location location, Vector direction, float speed, float spread, Class<T> clazz) Creates an arrow entity of the given class at the givenLocation
- 类型参数:
T
- type of arrow to spawn- 参数:
location
- Location to spawn the arrowdirection
- Direction to shoot the arrow inspeed
- Speed of the arrow. A recommend speed is 0.6spread
- Spread of the arrow. A recommend spread is 12clazz
- the Entity class for the arrowSpectralArrow
,Arrow
,TippedArrow
- 返回:
- Arrow entity spawned as a result of this method
-
generateTree
- 参数:
location
- 生成树的位置type
- 创建的树的类型- 返回:
- 如果树被成功生成则返回true,否则返回false
-
generateTree
已过时。该API很少使用,基本上是出于实现自身功能的目的而创造的- 参数:
loc
- 生成树的位置type
- 创建的树的类型delegate
- 这个方法会返回一个用于调用每个方块的改变的类作为结果- 返回:
- 如果树被成功生成则返回true,否则返回false
-
spawnEntity
- 参数:
loc
- 生成实体的位置type
- 生成的实体- 返回:
- 生成成功则返回此方法创建的实体,否则返回null
-
strikeLightning
- 参数:
loc
- 劈下闪电的位置- 返回:
- lightning(闪电)实体
-
strikeLightningEffect
- 参数:
loc
- 劈下闪电的位置- 返回:
- lightning(闪电)实体
-
getEntities
获取一个这个世界所有实体的列表.原文: Get a list of all entities in this World
- 返回:
- 一个当前处在这个世界的所有实体的列表
-
getLivingEntities
List<LivingEntity> getLivingEntities()获取一个这个世界所有生物实体的列表.原文: Get a list of all living entities in this World
- 返回:
- 一个当前处在这个世界的所有生物实体的列表
-
getEntitiesByClass
已过时。获取一个在这个世界的所有与指定的类/接口相匹配的实体的集合.原文: Get a collection of all entities in this World matching the given class/interface
- 类型参数:
T
- 一个实体子类- 参数:
classes
- 用于匹配的表示实体类型的类- 返回:
- 一个当前处在这个世界的所有与指定的类/接口相匹配的实体的列表
-
getEntitiesByClass
获取一个在这个世界的所有与指定的类/接口相匹配的实体的集合.原文: Get a collection of all entities in this World matching the given class/interface
- 类型参数:
T
- 一个实体子类- 参数:
cls
- 用于匹配的表示实体类型的类- 返回:
- 一个当前处在这个世界的所有与指定的类/接口相匹配的实体的列表
-
getEntitiesByClasses
获取一个在这个世界的所有与任一指定的类/接口相匹配的实体的集合.原文: Get a collection of all entities in this World matching any of the given classes/interfaces
- 参数:
classes
- 用于匹配的表示实体类型的类- 返回:
- 一个当前处在这个世界的所有与一个或更多指定的类/接口相匹配的实体的列表
-
getPlayers
获取一个这个世界的所有玩家的列表.原文: Get a list of all players in this World
- 返回:
- 一个当前处在这个世界的所有玩家的列表
-
getNearbyEntities
返回一个以这个位置为中心的包围着的所有实体的列表(译注:这个可能不太好理解,就是在这个位置,按指定的搜索范围,搜索这个范围里的所有实体).一些实现可能会对搜索的范围的大小施加限制.
原文: Returns a list of entities within a bounding box centered around a Location. Some implementations may impose artificial restrictions on the size of the search bounding box.
- 参数:
location
- 搜索范围的中心x
- 搜索范围的x半轴长度y
- 搜索范围的y半轴长度z
- 搜索范围的z半轴长度- 返回:
- 在位置附近的实体的集合,一般不为空
-
getName
String getName()获取世界的唯一名称.原文: Gets the unique name of this world
- 返回:
- 世界的名称
-
getUID
UUID getUID()获取世界的唯一UUID.原文: Gets the Unique ID of this world
- 返回:
- 世界的唯一UUID
-
getSpawnLocation
Location getSpawnLocation()- 返回:
- 这个世界的出生点位置
-
setSpawnLocation
设置这个世界的出生点位置.
提供的位置所处世界必须与这个世界相同.原文:Sets the spawn location of the world.
The location provided must be equal to this world.- 参数:
location
- 要设置的出生点位置- 返回:
- 若成功设置返回true
-
setSpawnLocation
boolean setSpawnLocation(int x, int y, int z) 设置这个世界的出生点位置.原文: Sets the spawn location of the world
- 参数:
x
- x坐标y
- y坐标z
- z坐标- 返回:
- 如果成功设置则返回true
-
getTime
long getTime()获取这个世界在游戏中的相对时间.相对时间类似于小时数*1000(译注:意思是,如果这个世界在游戏中的时间为一个小时则相对时间显示为1000,一小时十二分为1200).
原文: Gets the relative in-game time of this world.
The relative time is analogous to hours * 1000
- 返回:
- 当前相对时间
- 另请参阅:
-
setTime
void setTime(long time) 设置服务器的在游戏中的相对时间.相对时间类似于小时数*1000(译注:意思是,如果这个世界在游戏中的时间为一个小时则相对时间显示为1000,一小时十二分为1200).
注意设置的相对时间如果小于当前相对时间则实际上是将时钟向前移动了一天。如果你要倒回时间,请使用
setFullTime(long)
.原文: Sets the relative in-game time on the server.
The relative time is analogous to hours * 1000
Note that setting the relative time below the current relative time will actually move the clock forward a day. If you require to rewind time, please see
setFullTime(long)
- 参数:
time
- 设置的在游戏中的新的相对时间(格式为小时数*1000)- 另请参阅:
-
getFullTime
long getFullTime()获取这个世界完整的游戏时间.原文: Gets the full in-game time on this world
- 返回:
- 当前绝对时间
- 另请参阅:
-
setFullTime
void setFullTime(long time) 设置服务器的游戏时间.注意这是设置全世界的时间,可能产生不好的影响,比如破坏红石钟或任一预定事件.
原文: Sets the in-game time on the server
Note that this sets the full time of the world, which may cause adverse effects such as breaking redstone clocks and any scheduled events
- 参数:
time
- 设置的世界的新绝对时间- 另请参阅:
-
hasStorm
boolean hasStorm()返回世界现在是否有雷暴.原文: Returns whether the world has an ongoing storm.
- 返回:
- 是否有雷暴
-
setStorm
void setStorm(boolean hasStorm) 设置是否有风暴。会为当前新的天气设置一段持续时间.原文: Set whether there is a storm. A duration will be set for the new current conditions.
- 参数:
hasStorm
- 是否下雨或下雪
-
getWeatherDuration
int getWeatherDuration()获取当前天气的剩余时间,单位为tick.原文: Get the remaining time in ticks of the current conditions.
- 返回:
- 时间,单位为tick
-
setWeatherDuration
void setWeatherDuration(int duration) 设置当前天气的剩余时间,单位为tick.原文: Set the remaining time in ticks of the current conditions.
- 参数:
duration
- 时间,单位为tick
-
isThundering
boolean isThundering()返回这个世界是否在打雷.原文: Returns whether there is thunder.
- 返回:
- 是否打雷
-
setThundering
void setThundering(boolean thundering) 设置这个世界是否在打雷.原文: Set whether it is thundering.
- 参数:
thundering
- 是否打雷
-
getThunderDuration
int getThunderDuration()获取这个世界打雷的持续时间.原文: Get the thundering duration.
- 返回:
- 持续时间,单位为tick
-
setThunderDuration
void setThunderDuration(int duration) 设置这个世界打雷持续时间。原文: Set the thundering duration.
- 参数:
duration
- 持续时间,单位为tick
-
createExplosion
boolean createExplosion(double x, double y, double z, float power) 在指定坐标生成指定威力的爆炸.原文: Creates explosion at given coordinates with given power
- 参数:
x
- x坐标y
- y坐标z
- z坐标power
- 爆炸的威力,一个TNT当量为4F- 返回:
- 如果爆炸被取消则返回false,否则返回true
-
createExplosion
boolean createExplosion(double x, double y, double z, float power, boolean setFire) 在指定的坐标生成指定威力的爆炸并设置方块是否会着火.原文: Creates explosion at given coordinates with given power and optionally setting blocks on fire.
- 参数:
x
- x坐标y
- y坐标z
- z坐标power
- 爆炸的威力,一个TNT当量为4FsetFire
- 方块是否会着火- 返回:
- 如果爆炸被取消则返回false,否则返回true
-
createExplosion
boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks) 在指定的坐标生成指定威力的爆炸并设置方块是否会着火或被破坏.原文: Creates explosion at given coordinates with given power and optionally setting blocks on fire or breaking blocks.
- 参数:
x
- x坐标y
- y坐标z
- z坐标power
- 爆炸的威力,一个TNT当量为4FsetFire
- 方块是否会着火breakBlocks
- 是否破坏方块- 返回:
- 如果爆炸被取消则返回false,否则返回true
-
createExplosion
在指定坐标生成指定威力的爆炸.原文: Creates explosion at given coordinates with given power
- 参数:
loc
- 爆炸位置power
- 爆炸的威力,一个TNT当量为4F- 返回:
- 如果爆炸被取消则返回false,否则返回true
-
createExplosion
在指定的坐标生成指定威力的爆炸并设置方块是否会着火.原文: Creates explosion at given coordinates with given power and optionally setting blocks on fire.
- 参数:
loc
- 爆炸位置power
- 爆炸的威力,一个TNT当量为4FsetFire
- 方块是否会着火- 返回:
- 如果爆炸被取消则返回false,否则返回true
-
getEnvironment
World.Environment getEnvironment()获取世界的环境
类型.原文: Gets the
World.Environment
type of this world- 返回:
- 这个世界的环境类型
-
getSeed
long getSeed()获取世界的种子.原文: Gets the Seed for this world.
- 返回:
- 这个世界的种子
-
getPVP
boolean getPVP()获取世界当前的PVP设置.原文: Gets the current PVP setting for this world.
- 返回:
- 如果允许PVP则返回true
-
setPVP
void setPVP(boolean pvp) 设置世界的PVP设置.原文: Sets the PVP setting for this world.
- 参数:
pvp
- 是否允许PVP,允许为true,不允许为false.
-
getGenerator
ChunkGenerator getGenerator()获取世界的区块生成器.原文: Gets the chunk generator for this world
- 返回:
- 这个世界相关的
区块生成器
-
save
void save()保存世界到磁盘.原文:Saves world to disk
-
getPopulators
List<BlockPopulator> getPopulators()获取一个这个世界使用的所有方块填充器
的列表.原文: Gets a list of all applied
BlockPopulator
s for this World- 返回:
- 这个世界使用的所有方块填充器的列表
-
spawn
-
spawn
<T extends Entity> T spawn(Location location, Class<T> clazz, Consumer<T> function) throws IllegalArgumentException Spawn an entity of a specific class at the givenLocation
, with the supplied function run before the entity is added to the world.
Note that when the function is run, the entity will not be actually in the world. Any operation involving such as teleporting the entity is undefined until after this function returns.- 类型参数:
T
- the class of theEntity
to spawn- 参数:
location
- theLocation
to spawn the entity atclazz
- the class of theEntity
to spawnfunction
- the function to be run before the entity is spawned.- 返回:
- an instance of the spawned
Entity
- 抛出:
IllegalArgumentException
- if either parameter is null or theEntity
requested cannot be spawned
-
spawnFallingBlock
FallingBlock spawnFallingBlock(Location location, MaterialData data) throws IllegalArgumentException Spawn aFallingBlock
entity at the givenLocation
of the specifiedMaterial
. The material dictates what is falling. When the FallingBlock hits the ground, it will place that block.The Material must be a block type, check with
material.isBlock()
. The Material may not be air.- 参数:
location
- TheLocation
to spawn the FallingBlockdata
- The block data- 返回:
- The spawned
FallingBlock
instance - 抛出:
IllegalArgumentException
- ifLocation
orMaterialData
are null orMaterial
of theMaterialData
is not a block
-
spawnFallingBlock
@Deprecated FallingBlock spawnFallingBlock(Location location, Material material, byte data) throws IllegalArgumentException 已过时。不安全的参数在指定的位置
根据给定的物品
生成一个正在下落的方块
实体。物品决定下落的东西。当下落方块碰到地时就会放置这个方块.物品必须是一个经过
Material.isBlock()
检验的方块类型,可能不是空气.原文: Spawn a
FallingBlock
entity at the givenLocation
of the specifiedMaterial
. The material dictates what is falling. When the FallingBlock hits the ground, it will place that block.The Material must be a block type, check with
material.isBlock()
. The Material may not be air. -
spawnFallingBlock
@Deprecated FallingBlock spawnFallingBlock(Location location, int blockId, byte blockData) throws IllegalArgumentException 已过时。不安全的参数在指定的位置
根据指定的方块ID(会被转换为物品
)生成一个正在下落的方块
实体.原文: Spawn a
FallingBlock
entity at the givenLocation
of the specified blockId (converted toMaterial
)- 参数:
location
- 生成下落方块的位置
blockId
- 物品相应的IDblockData
- 方块数据- 返回:
- 生成的
正在下落的方块
实例 - 抛出:
IllegalArgumentException
- 如果位置为空或方块无效则抛出错误- 另请参阅:
-
playEffect
向以指定位置为圆心的默认半径内的所有玩家施加(给予)一个效果.原文: Plays an effect to all players within a default radius around a given location.
-
playEffect
向在以指定位置为圆心的指定半径内的所有玩家施加(给予)一个效果。原文: Plays an effect to all players within a given radius around a location.
-
playEffect
向在以指定位置为圆心的默认半径内的所有玩家施加(给予)一个效果。原文: Plays an effect to all players within a default radius around a given location.
-
playEffect
向在以指定位置为圆心的指定半径内的所有玩家施加(给予)一个效果。原文: Plays an effect to all players within a given radius around a location.
-
getEmptyChunkSnapshot
ChunkSnapshot getEmptyChunkSnapshot(int x, int z, boolean includeBiome, boolean includeBiomeTempRain) 获取空区块的快照(相当于所有空气方块),可设置包含有效生物群系数据。用于表示一个未生成的区块,或者只用于获取生物群系数据而不加载区块。原文: Get empty chunk snapshot (equivalent to all air blocks), optionally including valid biome data. Used for representing an ungenerated chunk, or for fetching only biome data without loading a chunk.
- 参数:
x
- 区块x坐标z
- 区块z坐标includeBiome
- 如果为true,则快照会包含每个坐标的生物群系类型includeBiomeTempRain
- 如果为true,则快照会包含每个坐标的原始生物群系温度和降雨- 返回:
- 空快照
-
setSpawnFlags
void setSpawnFlags(boolean allowMonsters, boolean allowAnimals) 为这个世界设置出生标识。原文: Sets the spawn flags for this.
- 参数:
allowMonsters
- 如果为true,则允许怪物在这个世界生成allowAnimals
- 如果为true,则允许动物在这个世界生成
-
getAllowAnimals
boolean getAllowAnimals()获取动物能不能在这个世界生成。原文: Gets whether animals can spawn in this world.
- 返回:
- 动物能不能在这个世界生成
-
getAllowMonsters
boolean getAllowMonsters()获取怪物能不能在这个世界生成。原文: Gets whether monsters can spawn in this world.
- 返回:
- 怪物能不能在这个世界生成
-
getBiome
获取指定方块坐标的生物群系。原文: Gets the biome for the given block coordinates.
- 参数:
x
- 方块的x坐标z
- 方块的z坐标- 返回:
- 所查方块的生物群系
-
setBiome
设置指定方块坐标的生物群系原文: Sets the biome for the given block coordinates
- 参数:
x
- 方块的x坐标z
- 方块的z坐标bio
- 这个方块的新生物群系类型
-
getTemperature
double getTemperature(int x, int z) 获取指定方块坐标的温度。方块不存在时运行这个方法是安全的,它不会创建方块。
原文: Gets the temperature for the given block coordinates.
It is safe to run this method when the block does not exist, it will not create the block.
- 参数:
x
- 方块的x坐标z
- 方块的z坐标- 返回:
- 查询方块的温度
-
getHumidity
double getHumidity(int x, int z) 获取指定方块坐标的湿度。方块不存在时运行这个方法是安全的,它不会创建方块。
原文: Gets the humidity for the given block coordinates.
It is safe to run this method when the block does not exist, it will not create the block.
- 参数:
x
- 方块的x坐标z
- 方块的z坐标- 返回:
- 查询方块的湿度
-
getMaxHeight
int getMaxHeight()获取这个世界的最大高度。如果最大高度为100,则只有y=0到y=99才有方块。
原文: Gets the maximum height of this world.
If the max height is 100, there are only blocks from y=0 to y=99.
- 返回:
- 世界的最大高度
-
getSeaLevel
int getSeaLevel()获取世界的海平面。这个值总是
getMaxHeight()
的一半原文: Gets the sea level for this world.
This is often half of
getMaxHeight()
- 返回:
- 海平面高度
-
getKeepSpawnInMemory
boolean getKeepSpawnInMemory()获取世界的出生点是否会在内存中保存加载。原文: Gets whether the world's spawn area should be kept loaded into memory or not.
- 返回:
- 如果世界的出生地区会在内存中保存加载则返回true
-
setKeepSpawnInMemory
void setKeepSpawnInMemory(boolean keepLoaded) 设置世界的出生点是否会在内存中保存加载。原文: Sets whether the world's spawn area should be kept loaded into memory or not.
- 参数:
keepLoaded
- 如果为true则世界的出生地区会在内存中保存加载
-
isAutoSave
boolean isAutoSave()获取世界是否会自动保存。原文: Gets whether or not the world will automatically save
- 返回:
- 如果世界会自动保存则返回true,否则返回false
-
setAutoSave
void setAutoSave(boolean value) 设置世界是否会自动保存。原文: Sets whether or not the world will automatically save
- 参数:
value
- 如果为true则世界会自动保存,否则为false
-
setDifficulty
设置世界的游戏难度。原文: Sets the Difficulty of the world.
- 参数:
difficulty
- 设置的世界的新难度
-
getDifficulty
Difficulty getDifficulty()获取世界的游戏难度。原文: Gets the Difficulty of the world.
- 返回:
- 世界的难度
-
getWorldFolder
File getWorldFolder()获取这个世界保存在磁盘的哪个文件夹。原文: Gets the folder of this world on disk.
- 返回:
- 这个世界所在的文件夹
-
getWorldType
WorldType getWorldType()获取世界类型。原文: Gets the type of this world.
- 返回:
- 世界类型
-
canGenerateStructures
boolean canGenerateStructures()获取建筑物是否会被生成。原文: Gets whether or not structures are being generated.
- 返回:
- 如果建筑物会被生成则返回true
-
getTicksPerAnimalSpawns
long getTicksPerAnimalSpawns()获取世界生成动物的时间间隔(单位为tick)。这个数值决定每次尝试生成动物之间的时间间隔(单位为tick)。
用法示例:
- 数值为1意味着服务器每1tick都会尝试在这个世界生成动物。
- 数值为400意味着服务器每400tick会尝试在这个世界生成动物。
- 数值低于0则会被重置为Minecraft的默认值。
注意: 如果设置为0,则会禁止这个世界生成动物。我们一般使用
setSpawnFlags(boolean, boolean)
来代替。Minecraft的默认值:400。
原文: Gets the world's ticks per animal spawns value
This value determines how many ticks there are between attempts to spawn animals.
Example Usage:
- A value of 1 will mean the server will attempt to spawn animals in this world every tick.
- A value of 400 will mean the server will attempt to spawn animals in this world every 400th tick.
- A value below 0 will be reset back to Minecraft's default.
Note: If set to 0, animal spawning will be disabled for this world. We recommend using
setSpawnFlags(boolean, boolean)
to control this instead.Minecraft default: 400.
- 返回:
- 世界生成动物的时间间隔(单位为tick)
-
setTicksPerAnimalSpawns
void setTicksPerAnimalSpawns(int ticksPerAnimalSpawns) 设置世界生成动物的时间间隔(单位为tick)。这个数值决定每次尝试生成动物之间的时间间隔(单位为tick)。
用法示例:
- 数值为1意味着服务器每1tick都会尝试在这个世界生成动物。
- 数值为400意味着服务器每400tick会尝试在这个世界生成动物。
- 数值低于0则会被重置为Minecraft的默认值。
注意: 如果设置为0,则会禁止这个世界生成动物。我们一般使用
setSpawnFlags(boolean, boolean)
来代替。Minecraft的默认值:400。
原文: Sets the world's ticks per animal spawns value
This value determines how many ticks there are between attempts to spawn animals.
Example Usage:
- A value of 1 will mean the server will attempt to spawn animals in this world every tick.
- A value of 400 will mean the server will attempt to spawn animals in this world every 400th tick.
- A value below 0 will be reset back to Minecraft's default.
Note: If set to 0, animal spawning will be disabled for this world. We recommend using
setSpawnFlags(boolean, boolean)
to control this instead.Minecraft default: 400.
- 参数:
ticksPerAnimalSpawns
- 设置的世界生成动物的时间间隔(单位为tick)
-
getTicksPerMonsterSpawns
long getTicksPerMonsterSpawns()获取世界生成怪物的时间间隔(单位为tick)。这个数值决定每次尝试生成怪物之间的时间间隔(单位为tick)。
用法示例:
- 数值为1意味着服务器每1tick都会尝试在这个世界生成怪物。
- 数值为400意味着服务器每400tick会尝试在这个世界生成怪物。
- 数值低于0则会被重置为Minecraft的默认值。
注意: 如果设置为0,则会禁止这个世界生成怪物。我们一般使用
setSpawnFlags(boolean, boolean)
来代替。Minecraft的默认值:1。
原文: Gets the world's ticks per monster spawns value
This value determines how many ticks there are between attempts to spawn monsters.
Example Usage:
- A value of 1 will mean the server will attempt to spawn monsters in this world every tick.
- A value of 400 will mean the server will attempt to spawn monsters in this world every 400th tick.
- A value below 0 will be reset back to Minecraft's default.
Note: If set to 0, monsters spawning will be disabled for this world. We recommend using
setSpawnFlags(boolean, boolean)
to control this instead.Minecraft default: 1.
- 返回:
- 世界生成怪物的时间间隔(单位为tick)
-
setTicksPerMonsterSpawns
void setTicksPerMonsterSpawns(int ticksPerMonsterSpawns) 设置世界生成怪物的时间间隔(单位为tick)。这个数值决定每次尝试生成怪物之间的时间间隔(单位为tick)。
用法示例:
- 数值为1意味着服务器每1tick都会尝试在这个世界生成怪物。
- 数值为400意味着服务器每400tick会尝试在这个世界生成怪物。
- 数值低于0则会被重置为Minecraft的默认值。
注意: 如果设置为0,则会禁止这个世界生成怪物。我们一般使用
setSpawnFlags(boolean, boolean)
来代替。Minecraft的默认值:1。
原文: Sets the world's ticks per monster spawns value
This value determines how many ticks there are between attempts to spawn monsters.
Example Usage:
- A value of 1 will mean the server will attempt to spawn monsters in this world on every tick.
- A value of 400 will mean the server will attempt to spawn monsters in this world every 400th tick.
- A value below 0 will be reset back to Minecraft's default.
Note: If set to 0, monsters spawning will be disabled for this world. We recommend using
setSpawnFlags(boolean, boolean)
to control this instead.Minecraft default: 1.
- 参数:
ticksPerMonsterSpawns
- 设置的世界生成怪物的时间间隔(单位为tick)
-
getMonsterSpawnLimit
int getMonsterSpawnLimit()获取这个世界一个区块内的怪物生成数限制。原文: Gets limit for number of monsters that can spawn in a chunk in this world
- 返回:
- 怪物生成限制
-
setMonsterSpawnLimit
void setMonsterSpawnLimit(int limit) 设置这个世界一个区块内的怪物生成数限制。注意:如果设置为负数则这个世界会使用服务器普遍的生成限制来代替。
原文: Sets the limit for number of monsters that can spawn in a chunk in this world
Note: If set to a negative number the world will use the server-wide spawn limit instead.
- 参数:
limit
- 新的怪物限制
-
getAnimalSpawnLimit
int getAnimalSpawnLimit()获取这个世界一个区块内的动物生成数限制。原文: Gets the limit for number of animals that can spawn in a chunk in this world
- 返回:
- 动物生成限制
-
setAnimalSpawnLimit
void setAnimalSpawnLimit(int limit) 设置这个世界一个区块内的动物生成数限制。注意:如果设置为负数则这个世界会使用服务器普遍的生成限制来代替。
原文: Sets the limit for number of animals that can spawn in a chunk in this world
Note: If set to a negative number the world will use the server-wide spawn limit instead.
- 参数:
limit
- 新的动物限制
-
getWaterAnimalSpawnLimit
int getWaterAnimalSpawnLimit()获取这个世界一个区块内的水生动物生成数限制。原文: Gets the limit for number of water animals that can spawn in a chunk in this world
- 返回:
- 水生动物生成限制
-
setWaterAnimalSpawnLimit
void setWaterAnimalSpawnLimit(int limit) 设置这个世界一个区块内的水生动物生成数限制。注意:如果设置为负数则这个世界会使用服务器普遍的生成限制来代替。
原文: Sets the limit for number of water animals that can spawn in a chunk in this world
Note: If set to a negative number the world will use the server-wide spawn limit instead.
- 参数:
limit
- 新的水生动物限制
-
getAmbientSpawnLimit
int getAmbientSpawnLimit()获取这个世界一个区块内周围的怪物的生成数限制。原文: Gets the limit for number of ambient mobs that can spawn in a chunk in this world
- 返回:
- 周围的怪物的生成限制
-
setAmbientSpawnLimit
void setAmbientSpawnLimit(int limit) 设置这个世界一个区块内周围的怪物的生成数限制。注意:如果设置为负数则这个世界会使用服务器普遍的生成限制来代替。
原文: Sets the limit for number of ambient mobs that can spawn in a chunk in this world
Note: If set to a negative number the world will use the server-wide spawn limit instead.
- 参数:
limit
- 新的周围的怪物的限制
-
playSound
在世界中指定的位置播放一个声音。如果位置或声音为空则这个函数会失效。
原文: Play a Sound at the provided Location in the World
This function will fail silently if Location or Sound are null.
- 参数:
location
- 演奏声音的位置sound
- 要播放的声音volume
- 声音音量pitch
- 声音音调
-
playSound
Play a Sound at the provided Location in the World.This function will fail silently if Location or Sound are null. No sound will be heard by the players if their clients do not have the respective sound for the value passed.
- 参数:
location
- the location to play the soundsound
- the internal sound name to playvolume
- the volume of the soundpitch
- the pitch of the sound
-
playSound
Play a Sound at the provided Location in the World.This function will fail silently if Location or Sound are null.
- 参数:
location
- The location to play the soundsound
- The sound to playcategory
- the category of the soundvolume
- The volume of the soundpitch
- The pitch of the sound
-
playSound
Play a Sound at the provided Location in the World.This function will fail silently if Location or Sound are null. No sound will be heard by the players if their clients do not have the respective sound for the value passed.
- 参数:
location
- the location to play the soundsound
- the internal sound name to playcategory
- the category of the soundvolume
- the volume of the soundpitch
- the pitch of the sound
-
getGameRules
String[] getGameRules()获取当前的游戏规则。译注:如果你不知道这是什么,请查阅gamerule命令。
原文: Get existing rules
- 返回:
- 包含所有规则的数组
-
getGameRuleValue
获取指定游戏规则的当前状态。如果规则是空则会返回null
原文: Gets the current state of the specified rule
Will return null if rule passed is null
- 参数:
rule
- 要查找的规则- 返回:
- 规则的字符串数值
-
setGameRuleValue
将指定的游戏规则设置为指定数值。规则可能会尝试验证值,如果数值被设置则会返回true。
如果规则为空,则这个函数会返回false。
原文: Set the specified gamerule to specified value.
The rule may attempt to validate the value passed, will return true if value was set.
If rule is null, the function will return false.
- 参数:
rule
- 要设置的规则value
- 要设置的规则数值- 返回:
- 规则被设置则返回true
-
isGameRule
检查字符串是否是一个有效的游戏规则。原文: Checks if string is a valid game rule
- 参数:
rule
- 要检测的规则- 返回:
- 如果规则存在则返回true
-
getWorldBorder
WorldBorder getWorldBorder()获取这个世界的世界边界对象。原文: Gets the world border for this world.
- 返回:
- 这个世界的世界边界对象
-
spawnParticle
Spawns the particle (the number of times specified by count) at the target location.- 参数:
particle
- the particle to spawnlocation
- the location to spawn atcount
- the number of particles
-
spawnParticle
Spawns the particle (the number of times specified by count) at the target location.- 参数:
particle
- the particle to spawnx
- the position on the x axis to spawn aty
- the position on the y axis to spawn atz
- the position on the z axis to spawn atcount
- the number of particles
-
spawnParticle
Spawns the particle (the number of times specified by count) at the target location.- 参数:
particle
- the particle to spawnlocation
- the location to spawn atcount
- the number of particlesdata
- the data to use for the particle or null, the type of this depends onParticle.getDataType()
-
spawnParticle
Spawns the particle (the number of times specified by count) at the target location.- 参数:
particle
- the particle to spawnx
- the position on the x axis to spawn aty
- the position on the y axis to spawn atz
- the position on the z axis to spawn atcount
- the number of particlesdata
- the data to use for the particle or null, the type of this depends onParticle.getDataType()
-
spawnParticle
void 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. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- 参数:
particle
- the particle to spawnlocation
- the location to spawn atcount
- the number of particlesoffsetX
- the maximum random offset on the X axisoffsetY
- the maximum random offset on the Y axisoffsetZ
- the maximum random offset on the Z axis
-
spawnParticle
void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ) Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- 参数:
particle
- the particle to spawnx
- the position on the x axis to spawn aty
- the position on the y axis to spawn atz
- the position on the z axis to spawn atcount
- the number of particlesoffsetX
- the maximum random offset on the X axisoffsetY
- the maximum random offset on the Y axisoffsetZ
- the maximum random offset on the Z axis
-
spawnParticle
<T> void 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. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- 参数:
particle
- the particle to spawnlocation
- the location to spawn atcount
- the number of particlesoffsetX
- the maximum random offset on the X axisoffsetY
- the maximum random offset on the Y axisoffsetZ
- the maximum random offset on the Z axisdata
- the data to use for the particle or null, the type of this depends onParticle.getDataType()
-
spawnParticle
<T> void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data) Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- 参数:
particle
- the particle to spawnx
- the position on the x axis to spawn aty
- the position on the y axis to spawn atz
- the position on the z axis to spawn atcount
- the number of particlesoffsetX
- the maximum random offset on the X axisoffsetY
- the maximum random offset on the Y axisoffsetZ
- the maximum random offset on the Z axisdata
- the data to use for the particle or null, the type of this depends onParticle.getDataType()
-
spawnParticle
void 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. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- 参数:
particle
- the particle to spawnlocation
- the location to spawn atcount
- the number of particlesoffsetX
- the maximum random offset on the X axisoffsetY
- the maximum random offset on the Y axisoffsetZ
- the maximum random offset on the Z axisextra
- the extra data for this particle, depends on the particle used (normally speed)
-
spawnParticle
void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra) Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- 参数:
particle
- the particle to spawnx
- the position on the x axis to spawn aty
- the position on the y axis to spawn atz
- the position on the z axis to spawn atcount
- the number of particlesoffsetX
- the maximum random offset on the X axisoffsetY
- the maximum random offset on the Y axisoffsetZ
- the maximum random offset on the Z axisextra
- the extra data for this particle, depends on the particle used (normally speed)
-
spawnParticle
<T> void 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. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- 参数:
particle
- the particle to spawnlocation
- the location to spawn atcount
- the number of particlesoffsetX
- the maximum random offset on the X axisoffsetY
- the maximum random offset on the Y axisoffsetZ
- the maximum random offset on the Z axisextra
- the extra data for this particle, depends on the particle used (normally speed)data
- the data to use for the particle or null, the type of this depends onParticle.getDataType()
-
spawnParticle
<T> void spawnParticle(Particle particle, double x, double y, double z, 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. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- 参数:
particle
- the particle to spawnx
- the position on the x axis to spawn aty
- the position on the y axis to spawn atz
- the position on the z axis to spawn atcount
- the number of particlesoffsetX
- the maximum random offset on the X axisoffsetY
- the maximum random offset on the Y axisoffsetZ
- the maximum random offset on the Z axisextra
- the extra data for this particle, depends on the particle used (normally speed)data
- the data to use for the particle or null, the type of this depends onParticle.getDataType()
-