程序包 org.bukkit

接口 World

所有超级接口:
Keyed, Metadatable, PersistentDataHolder, PluginMessageRecipient, RegionAccessor, WorldInfo

代表一个世界,包含了实体,区块,方块
  • 方法详细资料

    • getBlockAt

      @NotNull @NotNull Block getBlockAt(int x, int y, int z)
      获取坐标所指的方块.

      原文:Gets the Block at the given coordinates

      参数:
      x - 方块的X坐标
      y - 方块的Y坐标
      z - 方块的Z坐标
      返回:
      在指定坐标的方块
    • getBlockAt

      获取指定位置的方块.

      原文:Gets the Block at the given Location

      参数:
      location - 要获取的方块的位置
      返回:
      在指定位置的方块
    • getHighestBlockAt

      @NotNull @NotNull Block getHighestBlockAt(int x, int z)
      获取指定坐标最高处不是空气且不可逾越的方块.

      原文:Gets the highest non-empty (impassable) block at the given coordinates.

      参数:
      x - 方块X坐标
      z - 方块Z坐标
      返回:
      最高处不是空气的方块.
    • getHighestBlockAt

      @NotNull @NotNull Block getHighestBlockAt(@NotNull @NotNull Location location)
      获取指定位置最高处不是空气且不可逾越的方块.

      原文:Gets the highest non-empty (impassable) block at the given coordinates.

      参数:
      location - 需要获取最高的方块的位置
      返回:
      最高的不是空气的方块
    • getHighestBlockAt

      @NotNull @NotNull Block getHighestBlockAt(int x, int z, @NotNull @NotNull HeightMap heightMap)
      获取给定坐标处对应于指定高度映射的最高方块.

      原文:Gets the highest block corresponding to the HeightMap at the given coordinates.

      参数:
      x - 方块的X坐标
      z - 方块的Z坐标
      heightMap - 用于确定最高点的高度映射
      返回:
      对应于指定高度映射的最高方块
    • getHighestBlockAt

      @NotNull @NotNull Block getHighestBlockAt(@NotNull @NotNull Location location, @NotNull @NotNull HeightMap heightMap)
      获取给定位置处对应于指定高度映射的最高方块.

      原文:Gets the highest block corresponding to the HeightMap at the given coordinates.

      参数:
      location - 获取最高方块的坐标位置
      heightMap - 用于确定最高点的高度映射
      返回:
      对应于指定高度映射的最高方块
    • getChunkAt

      @NotNull @NotNull Chunk getChunkAt(int x, int z)
      获取给定坐标所在的区块.

      原文:Gets the Chunk at the given coordinates

      参数:
      x - X坐标
      z - Z坐标
      返回:
      给定坐标所在的区块
    • getChunkAt

      @NotNull @NotNull Chunk getChunkAt(int x, int z, boolean generate)
      获取给定坐标所在的区块.

      原文:Gets the Chunk at the given coordinates

      参数:
      x - 区块的X坐标
      z - 区块的Z坐标
      generate - 如果区块未完全生成, 是否应该被完整生成
      返回:
      给定坐标所在的区块
    • getChunkAt

      获取给定位置所在的区块.

      原文: Gets the Chunk at the given Location

      参数:
      location - 方块的位置
      返回:
      给定位置的区块
    • getChunkAt

      获取这个方块所处的区块.

      原文: Gets the Chunk that contains the given Block

      参数:
      block - 需要检测的方块
      返回:
      方块所处的区块
    • isChunkLoaded

      boolean isChunkLoaded(@NotNull @NotNull Chunk chunk)
      检查指定区块是否已经被加载.

      原文: Checks if the specified Chunk is loaded

      参数:
      chunk - 需要检查的区块
      返回:
      如果区块已经被加载则返回true,否则返回false
    • getLoadedChunks

      @NotNull @NotNull Chunk[] getLoadedChunks()
      获取一个所有被加载的区块的数组.

      原文: Gets an array of all loaded Chunks

      返回:
      包含所有被加载区块的数组Chunk[]
    • loadChunk

      void loadChunk(@NotNull @NotNull Chunk chunk)
      加载指定的区块.

      本方法将使指定的区块保持加载状态直到卸载方法被手动调用. 建议开发者使用 getChunkAt 方法, 其方法只会临时加载请求的区块, 而不是本方法.

      原文: Loads the specified Chunk.

      This method will keep the specified chunk loaded until one of the unload methods is manually called. Callers are advised to instead use getChunkAt which will only temporarily load the requested chunk.

      参数:
      chunk - 待加载的区块
    • isChunkLoaded

      boolean isChunkLoaded(int x, int z)
      检查在指定坐标的区块是否被加载.

      原文: Checks if the Chunk at the specified coordinates is loaded

      参数:
      x - 区块的x坐标
      z - 区块的z坐标
      返回:
      如果区块已经被加载则返回true,否则返回false
    • isChunkGenerated

      boolean isChunkGenerated(int x, int z)
      检查指定坐标处的区块是否已生成.

      原文:Checks if the Chunk at the specified coordinates is generated

      参数:
      x - 区块x坐标
      z - 区块z坐标
      返回:
      区块已生成则返回true, 反之为false
    • isChunkInUse

      @Deprecated(since="1.14") boolean isChunkInUse(int x, int z)
      已过时。
      本方法曾被添加用于促进区块的垃圾回收. 由于当前 Minecraft 的区块被严格管理, 并且除非那些区块正被使用, 否则不会加载超过1tick时长 (意思是mc现在对区块管理更好了, 不用的区块会被及时卸载并回收)
      检查指定坐标的区块是否被加载且被一个或更多的玩家使用.

      原文: 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)
      加载指定坐标的区块.

      本方法将使指定的区块保持加载状态直到卸载方法被手动调用. 建议开发者使用 getChunkAt 方法, 其方法只会临时加载请求的区块, 而不是本方法.

      如果区块不存在则会被生成。

      这个方法类似于当generate值为true时的loadChunk(int, int, boolean).

      原文: Loads the Chunk at the specified coordinates.

      This method will keep the specified chunk loaded until one of the unload methods is manually called. Callers are advised to instead use getChunkAt which will only temporarily load the requested chunk.

      If 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)
      加载指定坐标的区块.

      本方法将使指定的区块保持加载状态直到卸载方法被手动调用. 建议开发者使用 getChunkAt 方法, 其方法只会临时加载请求的区块, 而不是本方法.

      原文: Loads the Chunk at the specified coordinates.

      This method will keep the specified chunk loaded until one of the unload methods is manually called. Callers are advised to instead use getChunkAt which will only temporarily load the requested chunk.

      参数:
      x - 区块的x坐标
      z - 区块的z坐标
      generate - 如果区块不存在是否生成
      返回:
      如果区块被成功加载则返回true,否则返回false
    • unloadChunk

      boolean unloadChunk(@NotNull @NotNull Chunk chunk)
      安全的卸载并保存指定坐标的区块.

      这个方法类似于当safe值为true时的unloadChunk(int, int, boolean).

      原文: Safely unloads and saves the Chunk at the specified coordinates

      This method is analogous to unloadChunk(int, int, boolean) where save is true.

      参数:
      chunk - 卸载的区块
      返回:
      如果区块被成功卸载则返回true,否则返回false
    • unloadChunk

      boolean unloadChunk(int x, int z)
      安全的卸载并保存指定坐标的区块.

      这个方法类似于当safe值为true时的unloadChunk(int, int, boolean).

      原文: Safely unloads and saves the Chunk at the specified coordinates

      This method is analogous to unloadChunk(int, int, boolean) where save is true.

      参数:
      x - 区块的x坐标
      z - 区块的z坐标
      返回:
      如果区块被成功卸载则返回true,否则返回false
    • unloadChunk

      boolean unloadChunk(int x, int z, boolean save)
      安全的卸载并选择是否保存指定坐标的区块.

      原文: Safely unloads and optionally saves the Chunk at the specified coordinates

      参数:
      x - 区块的x坐标
      z - 区块的z坐标
      save - 是否保存区块
      返回:
      如果区块被成功卸载则返回true,否则返回false
    • unloadChunkRequest

      boolean unloadChunkRequest(int x, int z)
      安全地将卸载指定坐标的区块请求列入队列.

      原文: Safely queues the Chunk at the specified coordinates for unloading

      参数:
      x - 区块的x坐标
      z - 区块的z坐标
      返回:
      如果尝试列入队列成功则返回true,否则返回false
    • regenerateChunk

      @Deprecated(since="1.13") boolean regenerateChunk(int x, int z)
      已过时。
      无法保证重新生成单个区块会产生与之前相同的区块, 因为地形装饰可分布在区块上. 应避免使用本方法, 由于已知本方法易产生bug
      重新生成指定坐标的区块.

      原文: Regenerates the Chunk at the specified coordinates

      参数:
      x - 区块的x坐标
      z - 区块的z坐标
      返回:
      区块是否真的被重新生成
    • refreshChunk

      @Deprecated(since="1.8") boolean refreshChunk(int x, int z)
      已过时。
      这个方法不能保证在所有的客户端接口都正常地工作。
      将区块重新发送给所有的客户端.

      原文: Resends the Chunk to all clients

      参数:
      x - 区块的x坐标
      z - 区块的z坐标
      返回:
      区块是否真的被刷新
    • getPlayersSeeingChunk

      @NotNull @NotNull Collection<Player> getPlayersSeeingChunk(@NotNull @NotNull Chunk chunk)
      获取可以从客户端查看指定区块的所有玩家列表.

      如果没有玩家正在查看该区块, 或者该区块已卸载, 则此列表为空.

      原文:Get a list of all players who are can view the specified chunk from their client

      This list will be empty if no players are viewing the chunk, or the chunk is unloaded.

      参数:
      chunk - 要检查的区块
      返回:
      可以看到该区块的玩家集合
    • getPlayersSeeingChunk

      @NotNull @NotNull Collection<Player> getPlayersSeeingChunk(int x, int z)
      获取可以从客户端查看指定区块的所有玩家列表.

      如果没有玩家正在查看该区块, 或者该区块已卸载, 则此列表为空.

      原文:Get a list of all players who are can view the specified chunk from their client

      This list will be empty if no players are viewing the chunk, or the chunk is unloaded.

      参数:
      x - 区块的X坐标
      z - 区块的Z坐标
      返回:
      可以看到该区块的玩家集合
    • isChunkForceLoaded

      boolean isChunkForceLoaded(int x, int z)
      获取指定坐标处的区块是否被强制加载.

      被强制加载的区块不会因缺少玩家活动而被卸载.

      原文:Gets whether the chunk at the specified chunk coordinates is force loaded.

      A force loaded chunk will not be unloaded due to lack of player activity.

      参数:
      x - 区块的X坐标
      z - 区块的Z坐标
      返回:
      强制加载状态
    • setChunkForceLoaded

      void setChunkForceLoaded(int x, int z, boolean forced)
      设置指定坐标处的区块是否被强制加载.

      被强制加载的区块不会因缺少玩家活动而被卸载.

      原文:Sets whether the chunk at the specified chunk coordinates is force loaded.

      A force loaded chunk will not be unloaded due to lack of player activity.

      参数:
      x - 区块的X坐标
      z - 区块的Z坐标
      forced - 强制加载状态
    • getForceLoadedChunks

      @NotNull @NotNull Collection<Chunk> getForceLoadedChunks()
      返回这个世界中所有被强制加载的区块.

      被强制加载的区块不会因缺少玩家活动而被卸载.

      原文:Returns all force loaded chunks in this world.

      A force loaded chunk will not be unloaded due to lack of player activity.

      返回:
      不可修改的强制加载区块集合
    • addPluginChunkTicket

      boolean addPluginChunkTicket(int x, int z, @NotNull @NotNull Plugin plugin)
      为指定区块添加一个插件票证, 如果该区块尚未加载则会加载它.

      插件票证会阻止区块被卸载, 直到该票证被显式移除. 每个插件实例对每个区块只能持有一张票证, 但每个区块可以拥有多张来自不同插件的票证.

      原文:Adds a plugin ticket for the specified chunk, loading the chunk if it is not already loaded.

      A plugin ticket will prevent a chunk from unloading until it is explicitly removed. A plugin instance may only have one ticket per chunk, but each chunk can have multiple plugin tickets.

      参数:
      x - 区块的X坐标
      z - 区块的Z坐标
      plugin - 拥有该票证的插件
      返回:
      true 如果成功添加了插件票证, false 如果该插件已持有该区块的票证
      抛出:
      IllegalStateException - 如果指定的插件未启用
      另请参阅:
    • removePluginChunkTicket

      boolean removePluginChunkTicket(int x, int z, @NotNull @NotNull Plugin plugin)
      移除指定插件对指定区块的票证.

      插件票证会阻止区块被卸载, 直到该票证被显式移除. 每个插件实例对每个区块只能持有一张票证, 但每个区块可以拥有多张来自不同插件的票证.

      原文:Removes the specified plugin's ticket for the specified chunk

      A plugin ticket will prevent a chunk from unloading until it is explicitly removed. A plugin instance may only have one ticket per chunk, but each chunk can have multiple plugin tickets.

      参数:
      x - 区块的X坐标
      z - 区块的Z坐标
      plugin - 拥有该票证的插件
      返回:
      true 如果成功移除了插件票证, false 如果该区块没有来自该插件的票证
      另请参阅:
    • removePluginChunkTickets

      void removePluginChunkTickets(@NotNull @NotNull Plugin plugin)
      移除指定插件的所有票证.

      插件票证会阻止区块被卸载, 直到该票证被显式移除. 每个插件实例对每个区块只能持有一张票证, 但每个区块可以拥有多张来自不同插件的票证.

      原文:Removes all plugin tickets for the specified plugin

      A plugin ticket will prevent a chunk from unloading until it is explicitly removed. A plugin instance may only have one ticket per chunk, but each chunk can have multiple plugin tickets.

      参数:
      plugin - 指定的插件
      另请参阅:
    • getPluginChunkTickets

      @NotNull @NotNull Collection<Plugin> getPluginChunkTickets(int x, int z)
      获取一个集合, 指定哪些插件对指定区块持有票证. 当对该区块添加或移除插件票证时, 该集合不会被更新.

      插件票证会阻止区块被卸载, 直到该票证被显式移除. 每个插件实例对每个区块只能持有一张票证, 但每个区块可以拥有多张来自不同插件的票证.

      原文:Retrieves a collection specifying which plugins have tickets for the specified chunk. This collection is not updated when plugin tickets are added or removed to the chunk.

      A plugin ticket will prevent a chunk from unloading until it is explicitly removed. A plugin instance may only have one ticket per chunk, but each chunk can have multiple plugin tickets.

      参数:
      x - 区块的X坐标
      z - 区块的Z坐标
      返回:
      不可修改的集合, 包含对该区块持有票证的插件
      另请参阅:
    • getPluginChunkTickets

      @NotNull @NotNull Map<Plugin,Collection<Chunk>> getPluginChunkTickets()
      返回一个映射, 包含哪些插件对哪些区块持有票证. 返回的映射在添加或移除插件票证时不会被更新. 如果某个插件没有持有任何票证, 则不会出现在映射中.

      插件票证会阻止区块被卸载, 直到该票证被显式移除. 每个插件实例对每个区块只能持有一张票证, 但每个区块可以拥有多张来自不同插件的票证.

      原文:Returns a map of which plugins have tickets for what chunks. The returned map is not updated when plugin tickets are added or removed to chunks. If a plugin has no tickets, it will be absent from the map.

      A plugin ticket will prevent a chunk from unloading until it is explicitly removed. A plugin instance may only have one ticket per chunk, but each chunk can have multiple plugin tickets.

      返回:
      不可修改的映射, 包含哪些插件对哪些区块持有票证
      另请参阅:
    • getIntersectingChunks

      获取与给定边界框相交的所有区块.

      原文:Gets all Chunks intersecting the given BoundingBox.

      参数:
      box - 要检查的边界框
      返回:
      与给定边界框相交的区块集合
    • dropItem

      在指定的位置丢出一个物品.

      原文: Drops an item at the specified Location

      参数:
      location - 丢出物品的位置
      item - 丢出的物品堆
      返回:
      这个方法会创建一个ItemDrop(物品掉落)实体作为结果
    • dropItem

      在指定的位置丢出一个物品.

      注意, 函数将在实体生成之前运行.

      原文:Drops an item at the specified Location Note that functions will run before the entity is spawned

      参数:
      location - 丢出物品的位置
      item - 丢出的物品堆
      function - 在实体生成之前运行的函数
      返回:
      这个方法会创建一个ItemDrop(物品掉落)实体作为结果
    • dropItemNaturally

      在指定的位置丢出一个随机偏移的物品.

      原文:Drops an item at the specified Location with a random offset

      参数:
      location - 丢出物品的位置
      item - 丢出的物品堆
      返回:
      这个方法会创建一个ItemDrop(物品掉落)实体作为结果
    • dropItemNaturally

      @NotNull @NotNull Item dropItemNaturally(@NotNull @NotNull Location location, @NotNull @NotNull ItemStack item, @Nullable @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

      参数:
      location - 丢出物品的位置
      item - 丢出的物品堆
      function - 在实体生成之前运行的函数
      返回:
      这个方法会创建一个ItemDrop(物品掉落)实体作为结果
    • spawnArrow

      @NotNull @NotNull Arrow spawnArrow(@NotNull @NotNull Location location, @NotNull @NotNull Vector direction, float speed, float spread)
      在指定的位置创建一个箭的实体.

      原文: Creates an Arrow entity at the given Location

      参数:
      location - 生成箭的位置
      direction - 箭射向的方向
      speed - 箭的射速,建议为0.6
      spread - 箭存在的时间(箭在多久后会消失)
      返回:
      这个方法会生成一个Arrow(箭)实体作为结果
    • spawnArrow

      @NotNull <T extends AbstractArrow> T spawnArrow(@NotNull @NotNull Location location, @NotNull @NotNull Vector direction, float speed, float spread, @NotNull @NotNull Class<T> clazz)
      在给定的位置生成指定类型的箭矢实体.

      原文:Creates an arrow entity of the given class at the given Location

      类型参数:
      T - 要生成的箭矢类型
      参数:
      location - 生成箭矢的位置
      direction - 箭矢射击的方向
      speed - 箭矢的速度, 建议值为0.6
      spread - 箭矢的散射度, 建议值为12
      clazz - 箭矢的实体类 SpectralArrow,Arrow,TippedArrow
      返回:
      作为此方法结果生成的箭矢实体
    • generateTree

      boolean generateTree(@NotNull @NotNull Location location, @NotNull @NotNull TreeType type)
      在指定的位置创建一颗树.

      原文: Creates a tree at the given Location

      参数:
      location - 生成树的位置
      type - 创建的树的类型
      返回:
      如果树被成功生成则返回true,否则返回false
    • generateTree

      @Deprecated(since="1.17.1") boolean generateTree(@NotNull @NotNull Location loc, @NotNull @NotNull TreeType type, @NotNull @NotNull BlockChangeDelegate delegate)
      已过时。
      此方法不处理方块实体(蜂巢)
      在指定的位置创建一颗树.

      原文: Creates a tree at the given Location

      参数:
      loc - 生成树的位置
      type - 创建的树的类型
      delegate - 这个方法会返回一个用于调用每个方块的改变的类作为结果
      返回:
      如果树被成功生成则返回true,否则返回false
      另请参阅:
    • strikeLightning

      在指定的位置劈下闪电.

      原文: Strikes lightning at the given Location

      参数:
      loc - 劈下闪电的位置
      返回:
      lightning(闪电)实体
    • strikeLightningEffect

      在指定的位置劈下不会造成伤害的闪电.

      原文: Strikes lightning at the given Location without doing damage

      参数:
      loc - 劈下闪电的位置
      返回:
      lightning(闪电)实体
    • getEntities

      @NotNull @NotNull List<Entity> getEntities()
      获取一个这个世界所有实体的列表.

      原文: Get a list of all entities in this World

      指定者:
      getEntities 在接口中 RegionAccessor
      返回:
      一个当前处在这个世界的所有实体的列表
    • getLivingEntities

      @NotNull @NotNull List<LivingEntity> getLivingEntities()
      获取一个这个世界所有生物实体的列表.

      原文: Get a list of all living entities in this World

      指定者:
      getLivingEntities 在接口中 RegionAccessor
      返回:
      一个当前处在这个世界的所有生物实体的列表
    • getEntitiesByClass

      @Deprecated(since="1.1") @NotNull <T extends Entity> @NotNull Collection<T> getEntitiesByClass(@NotNull @NotNull Class<T>... classes)
      已过时。
      获取一个在这个世界的所有与指定的类/接口相匹配的实体的集合.

      原文: Get a collection of all entities in this World matching the given class/interface

      类型参数:
      T - 一个实体子类
      参数:
      classes - 用于匹配的表示实体类型的类
      返回:
      一个当前处在这个世界的所有与指定的类/接口相匹配的实体的列表
    • getEntitiesByClass

      @NotNull <T extends Entity> @NotNull Collection<T> getEntitiesByClass(@NotNull @NotNull Class<T> cls)
      获取一个在这个世界的所有与指定的类/接口相匹配的实体的集合.

      原文: Get a collection of all entities in this World matching the given class/interface

      指定者:
      getEntitiesByClass 在接口中 RegionAccessor
      类型参数:
      T - 一个实体子类
      参数:
      cls - 用于匹配的表示实体类型的类
      返回:
      一个当前处在这个世界的所有与指定的类/接口相匹配的实体的列表
    • getEntitiesByClasses

      @NotNull @NotNull Collection<Entity> getEntitiesByClasses(@NotNull @NotNull Class<?>... classes)
      获取一个在这个世界的所有与任一指定的类/接口相匹配的实体的集合.

      原文: Get a collection of all entities in this World matching any of the given classes/interfaces

      指定者:
      getEntitiesByClasses 在接口中 RegionAccessor
      参数:
      classes - 用于匹配的表示实体类型的类
      返回:
      一个当前处在这个世界的所有与一个或更多指定的类/接口相匹配的实体的列表
    • getPlayers

      @NotNull @NotNull List<Player> getPlayers()
      获取一个这个世界的所有玩家的列表.

      原文: Get a list of all players in this World

      返回:
      一个当前处在这个世界的所有玩家的列表
    • getNearbyEntities

      @NotNull @NotNull Collection<Entity> getNearbyEntities(@NotNull @NotNull Location location, double x, double y, double z)
      返回一个以这个位置为中心的包围着的所有实体的列表(译注:这个可能不太好理解,就是在这个位置,按指定的搜索范围,搜索这个范围里的所有实体).

      这可能不会考虑当前尚未加载的区块中的实体. 一些实现可能会对搜索的范围的大小施加限制.

      原文: Returns a list of entities within a bounding box centered around a Location.

      This may not consider entities in currently unloaded chunks. Some implementations may impose artificial restrictions on the size of the search bounding box.

      参数:
      location - 搜索范围的中心
      x - 搜索范围的x半轴长度
      y - 搜索范围的y半轴长度
      z - 搜索范围的z半轴长度
      返回:
      在位置附近的实体的集合,一般不为空
    • getNearbyEntities

      @NotNull @NotNull Collection<Entity> getNearbyEntities(@NotNull @NotNull Location location, double x, double y, double z, @Nullable @Nullable Predicate<? super Entity> filter)
      返回一个以这个位置为中心的包围着的所有实体的列表.

      这可能不会考虑当前尚未加载的区块中的实体. 一些实现可能会对搜索的范围的大小施加限制.

      原文:Returns a list of entities within a bounding box centered around a Location.

      This may not consider entities in currently unloaded chunks. Some implementations may impose artificial restrictions on the size of the search bounding box.

      参数:
      location - 搜索范围的中心
      x - 搜索范围的x半轴长度
      y - 搜索范围的y半轴长度
      z - 搜索范围的z半轴长度
      filter - 只考虑满足此过滤器的实体, 或者 null 考虑所有实体
      返回:
      在位置附近的实体的集合, 一般不为空
    • getNearbyEntities

      @NotNull @NotNull Collection<Entity> getNearbyEntities(@NotNull @NotNull BoundingBox boundingBox)
      返回给定边界框内的所有实体列表.

      这可能不会考虑当前尚未加载的区块中的实体. 一些实现可能会对搜索的范围的大小施加限制.

      原文:Returns a list of entities within the given bounding box.

      This may not consider entities in currently unloaded chunks. Some implementations may impose artificial restrictions on the size of the search bounding box.

      参数:
      boundingBox - 边界框
      返回:
      边界框内的实体集合, 总是非null的集合
    • getNearbyEntities

      @NotNull @NotNull Collection<Entity> getNearbyEntities(@NotNull @NotNull BoundingBox boundingBox, @Nullable @Nullable Predicate<? super Entity> filter)
      返回给定边界框内的所有实体列表.

      这可能不会考虑当前尚未加载的区块中的实体. 一些实现可能会对搜索的范围的大小施加限制.

      原文:Returns a list of entities within the given bounding box.

      This may not consider entities in currently unloaded chunks. Some implementations may impose artificial restrictions on the size of the search bounding box.

      参数:
      boundingBox - 边界框
      filter - 只考虑满足此过滤器的实体, 或者 null 考虑所有实体
      返回:
      边界框内的实体集合, 总是非null的集合
    • rayTraceEntities

      @Nullable @Nullable RayTraceResult rayTraceEntities(@NotNull @NotNull Location start, @NotNull @NotNull Vector direction, double maxDistance)
      执行检查实体碰撞的射线跟踪.

      这可能不考虑当前已经卸载的区块中的实体. 一些实现可能会对最大距离施加人为限制.

      原文: Performs a ray trace that checks for entity collisions.

      This may not consider entities in currently unloaded chunks. Some implementations may impose artificial restrictions on the maximum distance.

      Note: Due to display entities having a zero size hitbox, this method will not detect them. To detect display entities use rayTraceEntities(Location, Vector, double, double) with a positive raySize

      参数:
      start - 起始位置
      direction - 射线方向
      maxDistance - 最大距离
      返回:
      最近的射线跟踪命中结果, 如果没有命中, 则为null
      另请参阅:
    • rayTraceEntities

      @Nullable @Nullable RayTraceResult rayTraceEntities(@NotNull @NotNull Location start, @NotNull @NotNull Vector direction, double maxDistance, double raySize)
      执行检查实体碰撞的射线跟踪.

      这可能不考虑当前已经卸载的区块中的实体. 一些实现可能会对最大距离施加人为限制.

      原文: Performs a ray trace that checks for entity collisions.

      This may not consider entities in currently unloaded chunks. Some implementations may impose artificial restrictions on the maximum distance.

      参数:
      start - 起始位置
      direction - 射线方向
      maxDistance - 最大距离
      raySize - 在进行碰撞检查之前, 实体边界框将按此值均匀地放大(或缩小)
      返回:
      最近的射线跟踪命中结果, 如果没有命中, 则为null
      另请参阅:
    • rayTraceEntities

      @Nullable @Nullable RayTraceResult rayTraceEntities(@NotNull @NotNull Location start, @NotNull @NotNull Vector direction, double maxDistance, @Nullable @Nullable Predicate<? super Entity> filter)
      执行检查实体碰撞的射线跟踪.

      这可能不考虑当前已经卸载的区块中的实体. 一些实现可能会对最大距离施加人为限制.

      原文: Performs a ray trace that checks for entity collisions.

      This may not consider entities in currently unloaded chunks. Some implementations may impose artificial restrictions on the maximum distance.

      Note: Due to display entities having a zero size hitbox, this method will not detect them. To detect display entities use rayTraceEntities(Location, Vector, double, double, Predicate) with a positive raySize

      参数:
      start - 起始位置
      direction - 射线方向
      maxDistance - 最大距离
      filter - 只考虑满足此过滤器的实体, 或者 null 考虑所有实体
      返回:
      最近的射线跟踪命中结果, 如果没有命中, 则为null
      另请参阅:
    • rayTraceEntities

      @Nullable @Nullable RayTraceResult rayTraceEntities(@NotNull @NotNull Location start, @NotNull @NotNull Vector direction, double maxDistance, double raySize, @Nullable @Nullable Predicate<? super Entity> filter)
      执行检查实体碰撞的射线跟踪.

      这可能不考虑当前已经卸载的区块中的实体. 一些实现可能会对最大距离施加人为限制.

      原文: Performs a ray trace that checks for entity collisions.

      This may not consider entities in currently unloaded chunks. Some implementations may impose artificial restrictions on the maximum distance.

      参数:
      start - 起始位置
      direction - 射线方向
      maxDistance - 最大距离
      raySize - 在进行碰撞检查之前, 实体边界框将按此值均匀地放大(或缩小)
      filter - 只考虑满足此过滤器的实体, 或者 null 考虑所有实体
      返回:
      最近的射线跟踪命中结果, 如果没有命中, 则为null
    • rayTraceBlocks

      @Nullable @Nullable RayTraceResult rayTraceBlocks(@NotNull @NotNull Location start, @NotNull @NotNull Vector direction, double maxDistance)
      执行射线跟踪, 使用方块的精确碰撞形状来检查方块碰撞.

      这将考虑与可穿过的方块的碰撞, 但忽略流体.

      这可能会导致区块加载! 一些实现可能会对最大距离施加人为限制.

      原文: Performs a ray trace that checks for block collisions using the blocks' precise collision shapes.

      This takes collisions with passable blocks into account, but ignores fluids.

      This may cause loading of chunks! Some implementations may impose artificial restrictions on the maximum distance.

      参数:
      start - 起始位置
      direction - 射线方向
      maxDistance - 最大距离
      返回:
      最近的射线跟踪命中结果, 如果没有命中, 则为null
      另请参阅:
    • rayTraceBlocks

      @Nullable @Nullable RayTraceResult rayTraceBlocks(@NotNull @NotNull Location start, @NotNull @NotNull Vector direction, double maxDistance, @NotNull @NotNull FluidCollisionMode fluidCollisionMode)
      执行射线跟踪, 使用方块的精确碰撞形状来检查方块碰撞.

      这将考虑与可穿过的方块的碰撞.

      这可能会导致区块加载! 一些实现可能会对最大距离施加人为限制.

      原文: Performs a ray trace that checks for block collisions using the blocks' precise collision shapes.

      This takes collisions with passable blocks into account.

      This may cause loading of chunks! Some implementations may impose artificial restrictions on the maximum distance.

      参数:
      start - 起始位置
      direction - 射线方向
      maxDistance - 最大距离
      fluidCollisionMode - 流体碰撞模式
      返回:
      最近的射线跟踪命中结果, 如果没有命中, 则为null
      另请参阅:
    • rayTraceBlocks

      @Nullable @Nullable RayTraceResult rayTraceBlocks(@NotNull @NotNull Location start, @NotNull @NotNull Vector direction, double maxDistance, @NotNull @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks)
      执行射线跟踪, 使用方块的精确碰撞形状来检查方块碰撞.

      如果忽略与可穿过的方块的碰撞, 则无论流体碰撞模式如何, 也会忽略流体碰撞.

      只有当射线从传送门方块内部开始时, 其才被认为是可穿过的. 除此之外, 即使忽略了与可穿过方块的碰撞, 也将考虑与传送门方块的碰撞.

      这可能会导致区块加载! 一些实现可能会对最大距离施加人为限制.

      原文: Performs a ray trace that checks for block collisions using the blocks' precise collision shapes.

      If collisions with passable blocks are ignored, fluid collisions are ignored as well regardless of the fluid collision mode.

      Portal blocks are only considered passable if the ray starts within them. Apart from that collisions with portal blocks will be considered even if collisions with passable blocks are otherwise ignored.

      This may cause loading of chunks! Some implementations may impose artificial restrictions on the maximum distance.

      参数:
      start - 起始位置
      direction - 射线方向
      maxDistance - 最大距离
      fluidCollisionMode - 流体碰撞模式
      ignorePassableBlocks - 是否忽略可穿过但可碰撞的方块(例如高草丛、告示牌、液体等)
      返回:
      最近的射线跟踪命中结果, 如果没有命中, 则为null
    • rayTrace

      @Nullable @Nullable RayTraceResult rayTrace(@NotNull @NotNull Location start, @NotNull @NotNull Vector direction, double maxDistance, @NotNull @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, @Nullable @Nullable Predicate<? super Entity> filter)
      执行射线跟踪, 检查方块碰撞和实体碰撞.

      方块碰撞使用方块的精确碰撞形状. raySize 参数仅用于实体的碰撞检查.

      如果忽略与可穿过方块的碰撞, 则无论流体碰撞模式如何, 也会忽略流体碰撞.

      只有当射线从传送门方块内部开始时, 其才被认为是可穿过的. 除此之外, 即使忽略了与可穿过方块的碰撞, 也将考虑与传送门方块的碰撞.

      这可能会导致区块加载! 一些实现可能会对最大距离施加人为限制.

      原文: Performs a ray trace that checks for both block and entity collisions.

      Block collisions use the blocks' precise collision shapes. The raySize parameter is only taken into account for entity collision checks.

      If collisions with passable blocks are ignored, fluid collisions are ignored as well regardless of the fluid collision mode.

      Portal blocks are only considered passable if the ray starts within them. Apart from that collisions with portal blocks will be considered even if collisions with passable blocks are otherwise ignored.

      This may cause loading of chunks! Some implementations may impose artificial restrictions on the maximum distance.

      参数:
      start - 起始位置
      direction - 射线方向
      maxDistance - 最大距离
      fluidCollisionMode - 流体碰撞模式
      ignorePassableBlocks - 是否忽略可穿过但可碰撞的方块(例如高草丛、告示牌、液体等)
      raySize - 在进行碰撞检查之前, 实体边界框将按此值均匀地放大(或缩小)
      filter - 只考虑满足此过滤器的实体, 或者 null 考虑所有实体
      返回:
      最近的方块或实体的射线跟踪命中结果, 如果没有命中, 则为null
    • getSpawnLocation

      @NotNull @NotNull Location getSpawnLocation()
      获取这个世界的默认出生点位置.

      原文: Gets the default spawn Location of this world

      返回:
      这个世界的出生点位置
    • setSpawnLocation

      boolean setSpawnLocation(@NotNull @NotNull Location location)
      设置这个世界的出生点位置.
      提供的位置所处世界必须与这个世界相同.

      原文: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, float angle)
      设置这个世界的出生点位置.

      原文:Sets the spawn location of the world

      参数:
      x - X 坐标
      y - Y 坐标
      z - Z 坐标
      angle - 角度
      返回:
      若成功设置返回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 - 设置的世界的新绝对时间
      另请参阅:
    • getGameTime

      long getGameTime()
      获取这个世界自世界生成以来的完整游戏时间.

      原文:Gets the full in-game time on this world since the world generation

      返回:
      自世界生成以来的当前绝对时间
      另请参阅:
    • hasStorm

      boolean hasStorm()
      返回世界现在是否有雷暴.

      原文: Returns whether the world has an ongoing storm.

      返回:
      是否有雷暴
    • setStorm

      void setStorm(boolean hasStorm)
      设置是否有风暴. 会为新的天气设置一段持续时间. 本方法会隐式调用 setClearWeatherDuration(int), 指定 0 tick 来重置世界的晴朗天气.

      原文: Set whether there is a storm. A duration will be set for the new current conditions. This will implicitly call setClearWeatherDuration(int) with 0 ticks to reset the world's clear weather.

      参数:
      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)
      设置这个世界是否在打雷. 本方法会隐式调用 setClearWeatherDuration(int), 指定 0 tick 来重置世界的晴朗天气.

      原文: Set whether it is thundering. This will implicitly call setClearWeatherDuration(int) with 0 ticks to reset the world's clear weather.

      参数:
      thundering - 是否打雷
    • getThunderDuration

      int getThunderDuration()
      获取这个世界打雷的持续时间.

      原文: Get the thundering duration.

      返回:
      持续时间,单位为tick
    • setThunderDuration

      void setThunderDuration(int duration)
      设置这个世界打雷持续时间。

      原文: Set the thundering duration.

      参数:
      duration - 持续时间,单位为tick
    • isClearWeather

      boolean isClearWeather()
      返回世界是否为晴天. 雷雨退散, 便是晴天.

      原文:Returns whether the world has clear weather. This will be true such that isThundering() and hasStorm() are both false.

      返回:
      是否为晴天
    • setClearWeatherDuration

      void setClearWeatherDuration(int duration)
      设置晴朗天气的持续时间 (单位为 tick). 晴朗天气的持续时间决定着是否允许世界下雨或打雷. 如果持续时间为 > 0, 那么在持续时间过后, 世界也不会自然地下雨/雪. 本方法等效于 /weather clear 持续时间.

      原文:Set the clear weather duration. The clear weather ticks determine whether or not the world will be allowed to rain or storm. If clear weather ticks are > 0, the world will not naturally do either until the duration has elapsed. This method is equivalent to calling /weather clear with a set amount of ticks.

      参数:
      duration - 持续时间, 单位为 tick
    • getClearWeatherDuration

      int getClearWeatherDuration()
      获取晴朗天气的持续时间.

      原文:Get the clear weather 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当量为4F
      setFire - 方块是否会着火
      返回:
      如果爆炸被取消则返回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当量为4F
      setFire - 方块是否会着火
      breakBlocks - 是否破坏方块
      返回:
      如果爆炸被取消则返回false,否则返回true
    • createExplosion

      boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks, @Nullable @Nullable Entity source)
      在指定的坐标生成指定威力的爆炸并设置方块是否会着火或被破坏.

      注意, 如果提供了非null的source实体且breakBlocks为true, 当爆炸所在世界中的GameRule.MOB_GRIEFING为false时, breakBlocks的值将被忽略. 换言之, 如果不允许爆炸, mob griefing游戏规则将优先于breakBlocks.

      原文:Creates explosion at given coordinates with given power and optionally setting blocks on fire or breaking blocks.

      Note that if a non-null source Entity is provided and breakBlocks is true, the value of breakBlocks will be ignored if GameRule.MOB_GRIEFING is false in the world in which the explosion occurs. In other words, the mob griefing gamerule will take priority over breakBlocks if explosions are not allowed.

      参数:
      x - X坐标
      y - Y坐标
      z - Z坐标
      power - 爆炸的威力, 其中4F相当于TNT
      setFire - 是否设置方块着火
      breakBlocks - 是否允许方块被破坏
      source - 用于追踪伤害来源的实体
      返回:
      如果爆炸被取消则返回false, 否则返回true
    • createExplosion

      boolean createExplosion(@NotNull @NotNull Location loc, float power)
      在指定坐标生成指定威力的爆炸.

      原文: Creates explosion at given coordinates with given power

      参数:
      loc - 爆炸位置
      power - 爆炸的威力,一个TNT当量为4F
      返回:
      如果爆炸被取消则返回false,否则返回true
    • createExplosion

      boolean createExplosion(@NotNull @NotNull Location loc, float power, boolean setFire)
      在指定的坐标生成指定威力的爆炸并设置方块是否会着火.

      原文: Creates explosion at given coordinates with given power and optionally setting blocks on fire.

      参数:
      loc - 爆炸位置
      power - 爆炸的威力,一个TNT当量为4F
      setFire - 方块是否会着火
      返回:
      如果爆炸被取消则返回false,否则返回true
    • createExplosion

      boolean createExplosion(@NotNull @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.

      参数:
      loc - 爆炸位置
      power - 爆炸的威力, 其中4F相当于TNT
      setFire - 是否设置方块着火
      breakBlocks - 是否允许方块被破坏
      返回:
      如果爆炸被取消则返回false, 否则返回true
    • createExplosion

      boolean createExplosion(@NotNull @NotNull Location loc, float power, boolean setFire, boolean breakBlocks, @Nullable @Nullable Entity source)
      在指定位置生成指定威力的爆炸并设置方块是否会着火或被破坏.

      注意, 如果提供了非null的source实体且breakBlocks为true, 当爆炸所在世界中的GameRule.MOB_GRIEFING为false时, breakBlocks的值将被忽略. 换言之, 如果不允许爆炸, mob griefing游戏规则将优先于breakBlocks.

      原文:Creates explosion at given coordinates with given power and optionally setting blocks on fire or breaking blocks.

      Note that if a non-null source Entity is provided and breakBlocks is true, the value of breakBlocks will be ignored if GameRule.MOB_GRIEFING is false in the world in which the explosion occurs. In other words, the mob griefing gamerule will take priority over breakBlocks if explosions are not allowed.

      参数:
      loc - 爆炸位置
      power - 爆炸的威力, 其中4F相当于TNT
      setFire - 是否设置方块着火
      breakBlocks - 是否允许方块被破坏
      source - 用于追踪伤害来源的实体
      返回:
      如果爆炸被取消则返回false, 否则返回true
    • 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

      获取世界的区块生成器.

      原文: Gets the chunk generator for this world

      返回:
      这个世界相关的区块生成器
    • getBiomeProvider

      @Nullable @Nullable BiomeProvider getBiomeProvider()
      获取这个世界使用的生物群系提供器.

      原文:Gets the biome provider for this world

      返回:
      与这个世界关联的生物群系提供器
    • save

      void save()
      保存世界到磁盘.

      原文:Saves world to disk

    • getPopulators

      获取一个这个世界使用的所有方块填充器的列表.

      原文: Gets a list of all applied BlockPopulators for this World

      返回:
      这个世界使用的所有方块填充器的列表
    • spawn

      @NotNull <T extends LivingEntity> T spawn(@NotNull @NotNull Location location, @NotNull @NotNull Class<T> clazz, @NotNull CreatureSpawnEvent.SpawnReason spawnReason, boolean randomizeData, @Nullable @Nullable Consumer<? super T> function) throws IllegalArgumentException
      在给定的位置创建一个新实体, 并在实体被添加到世界之前运行提供的函数.
      注意, 当函数运行时, 实体实际上还未进入世界. 在此函数返回之前, 任何涉及该实体的操作(如传送实体)都是未定义的. 但是, 传入的函数在潜在实体的生成随机化之后运行, 因此已经允许访问生物的值, 无论这些值是否被随机化, 例如属性或实体装备.

      原文:Creates a new entity at the given Location 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. The passed function however is run after the potential entity's spawn randomization and hence already allows access to the values of the mob, whether or not those were randomized, such as attributes or the entity equipment.

      类型参数:
      T - 正在创建的实体的泛型类型.
      参数:
      location - 实体将被生成的位置.
      clazz - 要生成的生物实体的类.
      spawnReason - 在CreatureSpawnEvent调用期间提供的原因.
      randomizeData - 实体的数据是否应该在生成前被随机化. 默认情况下, 实体在生成前会对其装备、年龄、属性等进行随机化. 这种随机化的示例包括羊的颜色、生物装备上的随机附魔, 甚至僵尸变成骑鸡僵尸. 如果设置为false, 实体在生成前不会被随机化, 意味着所有数据将保持默认状态, 不会对实体进行进一步修改. 值得注意的是, 只有继承Mob接口的实体才提供生成随机化逻辑. 因此此参数对任何其他类型的实体无用.
      function - 在实体生成之前运行的函数.
      返回:
      生成的实体实例.
      抛出:
      IllegalArgumentException - 如果world或clazz参数为null.
    • spawnFallingBlock

      在给定的位置生成一个掉落中的方块实体, 使用指定的MaterialData. MaterialData决定下落的内容. 当下落方块碰到地面时, 它将放置该方块.

      Material必须是方块类型, 可通过data.getItemType().isBlock()检查. Material不能是空气.

      原文:Spawn a FallingBlock entity at the given Location of the specified MaterialData. The MaterialData dictates what is falling. When the FallingBlock hits the ground, it will place that block.

      The Material must be a block type, check with data.getItemType().isBlock(). The Material may not be air.

      参数:
      location - 生成掉落中的方块的位置
      data - 方块数据
      返回:
      生成的掉落中的方块实例
      抛出:
      IllegalArgumentException - 如果Location或MaterialData为null, 或MaterialData的Material不是方块
    • spawnFallingBlock

      在指定的位置根据给定的BlockData生成一个掉落中的方块实体。 BlockData决定下落的东西。当下落方块碰到地时就会放置这个方块.

      原文: Spawn a FallingBlock entity at the given Location of the specified BlockData. The BlockData dictates what is falling. When the FallingBlock hits the ground, it will place that block.

      参数:
      location - 生成下落方块的位置
      data - FallingBlock的方块数据
      返回:
      生成的正在下落的方块实例
      抛出:
      IllegalArgumentException - 如果 Location 或 BlockData 为null
    • spawnFallingBlock

      @Deprecated(since="1.7.5") @NotNull @NotNull FallingBlock spawnFallingBlock(@NotNull @NotNull Location location, @NotNull @NotNull Material material, byte data) throws IllegalArgumentException
      已过时。
      不安全的参数
      在指定的位置根据指定的方块物品生成一个掉落中的方块实体. 物品决定下落的东西。当下落方块碰到地时就会放置这个方块.

      物品必须是一个经过Material.isBlock()检验的方块类型,可能不是空气.

      原文: Spawn a FallingBlock entity at the given Location of the specified Material. 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 - 生成下落方块的位置
      material - 方块 Material 类型
      data - 方块数据
      返回:
      生成的正在下落的方块实例
      抛出:
      IllegalArgumentException - 如果 Location 或 Material 为null 或 Material 不是方块
    • playEffect

      void playEffect(@NotNull @NotNull Location location, @NotNull @NotNull Effect effect, int data)
      向以指定位置为圆心的默认半径内的所有玩家施加(给予)一个效果.

      原文: Plays an effect to all players within a default radius around a given location.

      参数:
      location - 在这个位置周围给玩家施加效果
      effect - 效果
      data - 一些效果需要的数据
    • playEffect

      void playEffect(@NotNull @NotNull Location location, @NotNull @NotNull Effect effect, int data, int radius)
      向在以指定位置为圆心的指定半径内的所有玩家施加(给予)一个效果。

      原文: Plays an effect to all players within a given radius around a location.

      参数:
      location - 在这个位置周围给玩家施加效果
      effect - 效果
      data - 一些效果需要的数据
      radius - 半径
    • playEffect

      <T> void playEffect(@NotNull @NotNull Location location, @NotNull @NotNull Effect effect, @Nullable T data)
      向在以指定位置为圆心的默认半径内的所有玩家施加(给予)一个效果。

      原文: Plays an effect to all players within a default radius around a given location.

      类型参数:
      T - 与效果类型相关的数据
      参数:
      location - 在这个位置周围给玩家施加效果
      effect - 效果
      data - 一些效果需要的数据
    • playEffect

      <T> void playEffect(@NotNull @NotNull Location location, @NotNull @NotNull Effect effect, @Nullable T data, int radius)
      向在以指定位置为圆心的指定半径内的所有玩家施加(给予)一个效果。

      原文: Plays an effect to all players within a given radius around a location.

      类型参数:
      T - 与效果类型相关的数据
      参数:
      location - 在这个位置周围给玩家施加效果
      effect - 效果
      data - 一些效果需要的数据
      radius - 半径
    • getEmptyChunkSnapshot

      @NotNull @NotNull ChunkSnapshot getEmptyChunkSnapshot(int x, int z, boolean includeBiome, boolean includeBiomeTemp)
      获取空区块的快照(相当于所有空气方块),可设置包含有效生物群系数据。用于表示一个未生成的区块,或者只用于获取生物群系数据而不加载区块。

      原文: 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,则快照会包含每个坐标的生物群系类型
      includeBiomeTemp - 如果为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

      @NotNull @Deprecated(since="1.15") @NotNull Biome getBiome(int x, int z)
      已过时。
      1.15更新后生物群系已三维化
      获取指定方块坐标的生物群系。

      原文: Gets the biome for the given block coordinates.

      参数:
      x - 方块的x坐标
      z - 方块的z坐标
      返回:
      所查方块的生物群系
    • setBiome

      @Deprecated(since="1.15") void setBiome(int x, int z, @NotNull @NotNull Biome bio)
      已过时。
      1.15更新后生物群系已三维化
      设置指定方块坐标的生物群系.

      原文:Sets the biome for the given block coordinates

      参数:
      x - 方块的x坐标
      z - 方块的z坐标
      bio - 这个方块的新生物群系类型
    • getTemperature

      @Deprecated(since="1.15") double getTemperature(int x, int z)
      已过时。
      1.15更新后生物群系已三维化
      获取指定方块坐标的温度。

      方块不存在时运行这个方法是安全的,它不会创建方块.

      本方法将返回原始温度值, 不以方块高度所带来的影响而判断.

      原文: 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.

      This method will return the raw temperature without adjusting for block height effects.

      参数:
      x - 方块的x坐标
      z - 方块的z坐标
      返回:
      查询方块的温度
    • getTemperature

      double getTemperature(int x, int y, 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.

      This method will return the raw temperature without adjusting for block height effects.

      参数:
      x - 方块的X坐标
      y - 方块的Y坐标
      z - 方块的Z坐标
      返回:
      查询方块的温度
    • getHumidity

      @Deprecated(since="1.15") double getHumidity(int x, int z)
      已过时。
      1.15更新后生物群系已三维化
      获取指定方块坐标的湿度。

      方块不存在时运行这个方法是安全的,它不会创建方块。

      原文: 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坐标
      返回:
      查询方块的湿度
    • getHumidity

      double getHumidity(int x, int y, 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坐标
      y - 方块的Y坐标
      z - 方块的Z坐标
      返回:
      查询方块的湿度
    • getLogicalHeight

      int getLogicalHeight()
      获取紫颂果和下界传送门可以将玩家传送到此维度的最大高度.

      这不包括已在限制之上建造的传送门, 因为它们仍然可以正常连接. 不会大于WorldInfo.getMaxHeight().

      原文:Gets the maximum height to which chorus fruits and nether portals can bring players within this dimension. This excludes portals that were already built above the limit as they still connect normally. May not be greater than WorldInfo.getMaxHeight().

      返回:
      紫颂果和下界传送门的最大逻辑高度
    • isNatural

      boolean isNatural()
      获取这个世界是否为自然世界.

      当为false时, 指南针会随机旋转, 使用床设置重生点或睡觉将被禁用. 当为true时, 下界传送门可以生成僵尸猪灵.

      原文:Gets if this world is natural. When false, compasses spin randomly, and using a bed to set the respawn point or sleep, is disabled. When true, nether portals can spawn zombified piglins.

      返回:
      如果世界是自然世界则返回true
    • isBedWorks

      boolean isBedWorks()
      获取床在这个世界是否有效.

      无效的床在尝试睡觉时会爆炸. isNatural()定义了床是否可用于设置重生点.

      原文:Gets if beds work in this world. A non-working bed will blow up when trying to sleep. isNatural() defines if a bed can be used to set spawn point.

      返回:
      如果床在此世界有效则返回true
    • hasSkyLight

      boolean hasSkyLight()
      获取这个世界是否有天空光照.

      原文:Gets if this world has skylight access.

      返回:
      如果这个世界有天空光照则返回true
    • hasCeiling

      boolean hasCeiling()
      获取这个世界是否有天花板.

      原文:Gets if this world has a ceiling.

      返回:
      如果这个世界有基岩天花板则返回true
    • isPiglinSafe

      boolean isPiglinSafe()
      获取这个世界是否允许猪灵在不颤抖和不变身为僵尸猪灵的情况下存活.

      原文:Gets if this world allow to piglins to survive without shaking and transforming to zombified piglins.

      返回:
      如果猪灵不会变身为僵尸猪灵则返回true
    • isRespawnAnchorWorks

      boolean isRespawnAnchorWorks()
      获取这个世界是否允许玩家充能和使用重生锚.

      原文:Gets if this world allows players to charge and use respawn anchors.

      返回:
      如果玩家可以充能和使用重生锚则返回true
    • hasRaids

      boolean hasRaids()
      获取在此世界中带有不祥之兆效果的玩家是否将触发袭击.

      原文:Gets if players with the bad omen effect in this world will trigger a raid.

      返回:
      如果袭击将被触发则返回true
    • isUltraWarm

      boolean isUltraWarm()
      获取此世界是否会触发各种水/岩浆机制, 例如:
      • 水被蒸发
      • 海绵变干
      • 岩浆扩散更快更远

      原文:Gets if various water/lava mechanics will be triggered in this world, eg:

      • Water is evaporated
      • Sponges dry
      • Lava spreads faster and further
      返回:
      如果这个世界有上述机制则返回true
    • getSeaLevel

      int getSeaLevel()
      获取世界的海平面。

      这个值总是WorldInfo.getMaxHeight()的一半

      原文: Gets the sea level for this world.

      This is often half of WorldInfo.getMaxHeight()

      返回:
      海平面高度
    • getKeepSpawnInMemory

      @Deprecated(since="1.20.5") boolean getKeepSpawnInMemory()
      已过时。
      "出生点区块"的概念已被移除, 使用 isChunkForceLoaded(int, int) 以更好地控制
      获取世界的出生点是否会在内存中保存加载。

      原文: Gets whether the world's spawn area should be kept loaded into memory or not.

      返回:
      如果世界的出生地区会在内存中保存加载则返回true
    • setKeepSpawnInMemory

      @Deprecated(since="1.20.5") void setKeepSpawnInMemory(boolean keepLoaded)
      已过时。
      使用 GameRule#SPAWN_CHUNK_RADIUS 以更好地控制
      设置世界的出生点是否会在内存中保存加载。

      原文: 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

      void setDifficulty(@NotNull @NotNull Difficulty difficulty)
      设置世界的游戏难度。

      原文: Sets the Difficulty of the world.

      参数:
      difficulty - 设置的世界的新难度
    • getDifficulty

      @NotNull @NotNull Difficulty getDifficulty()
      获取世界的游戏难度。

      原文: Gets the Difficulty of the world.

      返回:
      世界的难度
    • getViewDistance

      int getViewDistance()
      获取这个世界使用的视距.

      原文:Returns the view distance used for this world.

      返回:
      这个世界使用的视距
    • getSimulationDistance

      int getSimulationDistance()
      获取这个世界使用的模拟距离.

      原文:Returns the simulation distance used for this world.

      返回:
      这个世界使用的模拟距离
    • getWorldFolder

      @NotNull @NotNull File getWorldFolder()
      获取这个世界保存在磁盘的哪个文件夹。

      原文: Gets the folder of this world on disk.

      返回:
      这个世界所在的文件夹
    • getWorldType

      @Nullable @Deprecated(since="1.16.1") @Nullable WorldType getWorldType()
      已过时。
      世界类型仅用于选择默认的世界生成设置, 且不会存储在原版世界中, 因此此方法无法始终返回正确的值.
      获取世界类型。

      原文: Gets the type of this world.

      返回:
      世界类型
    • canGenerateStructures

      boolean canGenerateStructures()
      获取建筑物是否会被生成。

      原文: Gets whether or not structures are being generated.

      返回:
      如果建筑物会被生成则返回true
    • isHardcore

      boolean isHardcore()
      获取这个世界是否为极限模式.

      在极限模式世界中, 难度被锁定为困难.

      原文:Gets whether the world is hardcore or not. In a hardcore world the difficulty is locked to hard.

      返回:
      极限模式状态
    • setHardcore

      void setHardcore(boolean hardcore)
      设置这个世界是否为极限模式.

      在极限模式世界中, 难度被锁定为困难.

      原文:Sets whether the world is hardcore or not. In a hardcore world the difficulty is locked to hard.

      参数:
      hardcore - 世界是否为极限模式
    • getTicksPerAnimalSpawns

      @Deprecated(since="1.18.1") 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

      @Deprecated(since="1.18.1") 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

      @Deprecated(since="1.18.1") 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

      @Deprecated(since="1.18.1") 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)
    • getTicksPerWaterSpawns

      @Deprecated(since="1.18.1") long getTicksPerWaterSpawns()
      已过时。
      获取世界生成水生生物的时间间隔(单位为tick).

      这个数值决定每次尝试生成水生生物之间的时间间隔(单位为tick).

      用法示例:

      • 数值为1意味着服务器每1tick都会尝试在这个世界生成水生生物.
      • 数值为400意味着服务器每400tick会尝试在这个世界生成水生生物.
      • 数值低于0则会被重置为Minecraft的默认值.

      注意: 如果设置为0, 则会禁止这个世界生成水生生物.

      Minecraft的默认值:1.

      原文:Gets the world's ticks per water mob spawns value

      This value determines how many ticks there are between attempts to spawn water mobs.

      Example Usage:

      • A value of 1 will mean the server will attempt to spawn water mobs in this world every tick.
      • A value of 400 will mean the server will attempt to spawn water mobs in this world every 400th tick.
      • A value below 0 will be reset back to Minecraft's default.

      Note: If set to 0, water mobs spawning will be disabled for this world.

      Minecraft default: 1.

      返回:
      世界生成水生生物的时间间隔(单位为tick)
    • setTicksPerWaterSpawns

      @Deprecated(since="1.18.1") void setTicksPerWaterSpawns(int ticksPerWaterSpawns)
      已过时。
      设置世界生成水生生物的时间间隔(单位为tick).

      这个数值决定每次尝试生成水生生物之间的时间间隔(单位为tick).

      用法示例:

      • 数值为1意味着服务器每1tick都会尝试在这个世界生成水生生物.
      • 数值为400意味着服务器每400tick会尝试在这个世界生成水生生物.
      • 数值低于0则会被重置为Minecraft的默认值.

      注意: 如果设置为0, 则会禁止这个世界生成水生生物.

      Minecraft的默认值:1.

      原文:Sets the world's ticks per water mob spawns value

      This value determines how many ticks there are between attempts to spawn water mobs.

      Example Usage:

      • A value of 1 will mean the server will attempt to spawn water mobs in this world on every tick.
      • A value of 400 will mean the server will attempt to spawn water mobs in this world every 400th tick.
      • A value below 0 will be reset back to Minecraft's default.

      Note: If set to 0, water mobs spawning will be disabled for this world.

      Minecraft default: 1.

      参数:
      ticksPerWaterSpawns - 要设置的世界生成水生生物的时间间隔(单位为tick)
    • getTicksPerWaterAmbientSpawns

      @Deprecated(since="1.18.1") long getTicksPerWaterAmbientSpawns()
      已过时。
      获取默认的水生环境生物生成时间间隔(单位为tick).

      用法示例:

      • 数值为1意味着服务器每1tick都会尝试生成水生环境生物.
      • 数值为400意味着服务器每400tick会尝试生成水生环境生物.
      • 数值低于0则会被重置为Minecraft的默认值.

      注意: 如果设置为0, 则水生环境生物的生成将被禁用.

      Minecraft的默认值:1.

      原文:Gets the default ticks per water ambient mob spawns value.

      Example Usage:

      • A value of 1 will mean the server will attempt to spawn water ambient mobs every tick.
      • A value of 400 will mean the server will attempt to spawn water ambient mobs every 400th tick.
      • A value below 0 will be reset back to Minecraft's default.

      Note: If set to 0, ambient mobs spawning will be disabled.

      Minecraft default: 1.

      返回:
      默认的水生环境生物生成时间间隔(单位为tick)
    • setTicksPerWaterAmbientSpawns

      @Deprecated(since="1.18.1") void setTicksPerWaterAmbientSpawns(int ticksPerAmbientSpawns)
      已过时。
      设置世界生成水生环境生物的时间间隔(单位为tick).

      这个数值决定每次尝试生成水生环境生物之间的时间间隔(单位为tick).

      用法示例:

      • 数值为1意味着服务器每1tick都会尝试在这个世界生成水生环境生物.
      • 数值为400意味着服务器每400tick会尝试在这个世界生成水生环境生物.
      • 数值低于0则会被重置为Minecraft的默认值.

      注意: 如果设置为0, 则会禁止这个世界生成水生环境生物.

      Minecraft的默认值:1.

      原文:Sets the world's ticks per water ambient mob spawns value

      This value determines how many ticks there are between attempts to spawn water ambient mobs.

      Example Usage:

      • A value of 1 will mean the server will attempt to spawn water ambient mobs in this world on every tick.
      • A value of 400 will mean the server will attempt to spawn water ambient mobs in this world every 400th tick.
      • A value below 0 will be reset back to Minecraft's default.

      Note: If set to 0, water ambient mobs spawning will be disabled for this world.

      Minecraft default: 1.

      参数:
      ticksPerAmbientSpawns - 要设置的世界生成水生环境生物的时间间隔(单位为tick)
    • getTicksPerWaterUndergroundCreatureSpawns

      @Deprecated(since="1.18.1") long getTicksPerWaterUndergroundCreatureSpawns()
      已过时。
      获取默认的水生地下生物生成时间间隔(单位为tick).

      用法示例:

      • 数值为1意味着服务器每1tick都会尝试生成水生地下生物.
      • 数值为400意味着服务器每400tick会尝试生成水生地下生物.
      • 数值低于0则会被重置为Minecraft的默认值.

      注意: 如果设置为0, 则水生地下生物的生成将被禁用.

      Minecraft的默认值:1.

      原文:Gets the default ticks per water underground creature spawns value.

      Example Usage:

      • A value of 1 will mean the server will attempt to spawn water underground creature every tick.
      • A value of 400 will mean the server will attempt to spawn water underground creature every 400th tick.
      • A value below 0 will be reset back to Minecraft's default.

      Note: If set to 0, water underground creature spawning will be disabled.

      Minecraft default: 1.

      返回:
      默认的水生地下生物生成时间间隔(单位为tick)
    • setTicksPerWaterUndergroundCreatureSpawns

      @Deprecated(since="1.18.1") void setTicksPerWaterUndergroundCreatureSpawns(int ticksPerWaterUndergroundCreatureSpawns)
      已过时。
      设置世界生成水生地下生物的时间间隔(单位为tick).

      这个数值决定每次尝试生成水生地下生物之间的时间间隔(单位为tick).

      用法示例:

      • 数值为1意味着服务器每1tick都会尝试在这个世界生成水生地下生物.
      • 数值为400意味着服务器每400tick会尝试在这个世界生成水生地下生物.
      • 数值低于0则会被重置为Minecraft的默认值.

      注意: 如果设置为0, 则会禁止这个世界生成水生地下生物.

      Minecraft的默认值:1.

      原文:Sets the world's ticks per water underground creature spawns value

      This value determines how many ticks there are between attempts to spawn water underground creature.

      Example Usage:

      • A value of 1 will mean the server will attempt to spawn water underground creature in this world on every tick.
      • A value of 400 will mean the server will attempt to spawn water underground creature in this world every 400th tick.
      • A value below 0 will be reset back to Minecraft's default.

      Note: If set to 0, water underground creature spawning will be disabled for this world.

      Minecraft default: 1.

      参数:
      ticksPerWaterUndergroundCreatureSpawns - 要设置的世界生成水生地下生物的时间间隔(单位为tick)
    • getTicksPerAmbientSpawns

      @Deprecated(since="1.18.1") long getTicksPerAmbientSpawns()
      已过时。
      获取世界生成环境生物的时间间隔(单位为tick).

      这个数值决定每次尝试生成环境生物之间的时间间隔(单位为tick).

      用法示例:

      • 数值为1意味着服务器每1tick都会尝试在这个世界生成环境生物.
      • 数值为400意味着服务器每400tick会尝试在这个世界生成环境生物.
      • 数值低于0则会被重置为Minecraft的默认值.

      注意: 如果设置为0, 则会禁止这个世界生成环境生物.

      Minecraft的默认值:1.

      原文:Gets the world's ticks per ambient mob spawns value

      This value determines how many ticks there are between attempts to spawn ambient mobs.

      Example Usage:

      • A value of 1 will mean the server will attempt to spawn ambient mobs in this world every tick.
      • A value of 400 will mean the server will attempt to spawn ambient mobs in this world every 400th tick.
      • A value below 0 will be reset back to Minecraft's default.

      Note: If set to 0, ambient mobs spawning will be disabled for this world.

      Minecraft default: 1.

      返回:
      默认的环境生物生成时间间隔(单位为tick)
    • setTicksPerAmbientSpawns

      @Deprecated(since="1.18.1") void setTicksPerAmbientSpawns(int ticksPerAmbientSpawns)
      已过时。
      设置世界生成环境生物的时间间隔(单位为tick).

      这个数值决定每次尝试生成环境生物之间的时间间隔(单位为tick).

      用法示例:

      • 数值为1意味着服务器每1tick都会尝试在这个世界生成环境生物.
      • 数值为400意味着服务器每400tick会尝试在这个世界生成环境生物.
      • 数值低于0则会被重置为Minecraft的默认值.

      注意: 如果设置为0, 则会禁止这个世界生成环境生物.

      Minecraft的默认值:1.

      原文:Sets the world's ticks per ambient mob spawns value

      This value determines how many ticks there are between attempts to spawn ambient mobs.

      Example Usage:

      • A value of 1 will mean the server will attempt to spawn ambient mobs in this world on every tick.
      • A value of 400 will mean the server will attempt to spawn ambient mobs in this world every 400th tick.
      • A value below 0 will be reset back to Minecraft's default.

      Note: If set to 0, ambient mobs spawning will be disabled for this world.

      Minecraft default: 1.

      参数:
      ticksPerAmbientSpawns - 要设置的世界生成环境生物的时间间隔(单位为tick)
    • getTicksPerSpawns

      long getTicksPerSpawns(@NotNull @NotNull SpawnCategory spawnCategory)
      获取世界生成指定生成类别生物的时间间隔(单位为tick).

      这个数值决定每次尝试生成指定生成类别生物之间的时间间隔(单位为tick).

      用法示例:

      • 数值为1意味着服务器每1tick都会尝试在这个世界生成指定生成类别的生物.
      • 数值为400意味着服务器每400tick会尝试在这个世界生成指定生成类别的生物.
      • 数值低于0则会被重置为Minecraft的默认值.

      注意: 如果设置为0, 则会禁止这个世界生成指定生成类别的生物.

      Minecraft的默认值:1.

      原文:Gets the world's ticks per SpawnCategory mob spawns value

      This value determines how many ticks there are between attempts to spawn SpawnCategory mobs.

      Example Usage:

      • A value of 1 will mean the server will attempt to spawn SpawnCategory mobs in this world every tick.
      • A value of 400 will mean the server will attempt to spawn SpawnCategory mobs in this world every 400th tick.
      • A value below 0 will be reset back to Minecraft's default.

      Note: If set to 0, SpawnCategory mobs spawning will be disabled for this world.

      Minecraft default: 1.

      参数:
      spawnCategory - 生成类别
      返回:
      世界生成指定生成类别生物的时间间隔(单位为tick)
    • setTicksPerSpawns

      void setTicksPerSpawns(@NotNull @NotNull SpawnCategory spawnCategory, int ticksPerCategorySpawn)
      设置世界生成指定生成类别生物的时间间隔(单位为tick).

      这个数值决定每次尝试生成指定生成类别生物之间的时间间隔(单位为tick).

      用法示例:

      • 数值为1意味着服务器每1tick都会尝试在这个世界生成指定生成类别的生物.
      • 数值为400意味着服务器每400tick会尝试在这个世界生成指定生成类别的生物.
      • 数值低于0则会被重置为Minecraft的默认值.

      注意: 如果设置为0, 则会禁止这个世界生成指定生成类别的生物.

      Minecraft的默认值:1.

      原文:Sets the world's ticks per SpawnCategory mob spawns value

      This value determines how many ticks there are between attempts to spawn SpawnCategory mobs.

      Example Usage:

      • A value of 1 will mean the server will attempt to spawn SpawnCategory mobs in this world on every tick.
      • A value of 400 will mean the server will attempt to spawn SpawnCategory mobs in this world every 400th tick.
      • A value below 0 will be reset back to Minecraft's default.

      Note: If set to 0, SpawnCategory mobs spawning will be disabled for this world.

      Minecraft default: 1.

      参数:
      spawnCategory - 生成类别
      ticksPerCategorySpawn - 要设置的世界生成指定生成类别生物的时间间隔(单位为tick)
    • getMonsterSpawnLimit

      @Deprecated(since="1.18.1") int getMonsterSpawnLimit()
      已过时。
      获取这个世界一个区块内的怪物生成数限制。

      原文: Gets limit for number of monsters that can spawn in a chunk in this world

      返回:
      怪物生成限制
    • setMonsterSpawnLimit

      @Deprecated(since="1.18.1") 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

      @Deprecated(since="1.18.1") int getAnimalSpawnLimit()
      已过时。
      获取这个世界一个区块内的动物生成数限制。

      原文: Gets the limit for number of animals that can spawn in a chunk in this world

      返回:
      动物生成限制
    • setAnimalSpawnLimit

      @Deprecated(since="1.18.1") 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

      @Deprecated(since="1.18.1") int getWaterAnimalSpawnLimit()
      已过时。
      获取这个世界一个区块内的水生动物生成数限制。

      原文: Gets the limit for number of water animals that can spawn in a chunk in this world

      返回:
      水生动物生成限制
    • setWaterAnimalSpawnLimit

      @Deprecated(since="1.18.1") 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 - 新的水生动物限制
    • getWaterUndergroundCreatureSpawnLimit

      @Deprecated(since="1.18.1") int getWaterUndergroundCreatureSpawnLimit()
      已过时。
      获取这个世界一个区块内的水生地下生物生成数限制.

      原文:Gets the limit for number of water underground creature that can spawn in a chunk in this world

      返回:
      水生地下生物生成限制
    • setWaterUndergroundCreatureSpawnLimit

      @Deprecated(since="1.18.1") void setWaterUndergroundCreatureSpawnLimit(int limit)
      已过时。
      设置这个世界一个区块内的水生地下生物生成数限制.

      注意:如果设置为负数则这个世界会使用服务器普遍的生成限制来代替.

      原文:Sets the limit for number of water underground creature 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 - 新的生物限制
    • getWaterAmbientSpawnLimit

      @Deprecated(since="1.18.1") int getWaterAmbientSpawnLimit()
      已过时。
      获取这个世界一个区块内的水生环境生物生成数限制.

      原文:Gets user-specified limit for number of water ambient mobs that can spawn in a chunk.

      返回:
      水生环境生物生成限制
    • setWaterAmbientSpawnLimit

      @Deprecated(since="1.18.1") void setWaterAmbientSpawnLimit(int limit)
      已过时。
      设置这个世界一个区块内的水生环境生物生成数限制.

      注意:如果设置为负数则这个世界会使用服务器普遍的生成限制来代替.

      原文:Sets the limit for number of water 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 - 新的生物限制
    • getAmbientSpawnLimit

      @Deprecated(since="1.18.1") int getAmbientSpawnLimit()
      已过时。
      获取这个世界一个区块内周围的怪物的生成数限制。

      原文: Gets the limit for number of ambient mobs that can spawn in a chunk in this world

      返回:
      周围的怪物的生成限制
    • setAmbientSpawnLimit

      @Deprecated(since="1.18.1") 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 - 新的周围的怪物的限制
    • getSpawnLimit

      int getSpawnLimit(@NotNull @NotNull SpawnCategory spawnCategory)
      获取这个世界一个区块内指定生成类别实体的生成数限制.

      原文:Gets the limit for number of SpawnCategory entities that can spawn in a chunk in this world

      参数:
      spawnCategory - 实体生成类别
      返回:
      指定类别的生成限制
    • setSpawnLimit

      void setSpawnLimit(@NotNull @NotNull SpawnCategory spawnCategory, int limit)
      设置这个世界一个区块内指定生成类别实体的生成数限制.

      注意:如果设置为负数则这个世界会使用服务器普遍的生成限制来代替.

      原文:Sets the limit for number of SpawnCategory entities 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.

      参数:
      spawnCategory - 实体生成类别
      limit - 新的生物限制
    • playNote

      void playNote(@NotNull @NotNull Location loc, @NotNull @NotNull Instrument instrument, @NotNull @NotNull Note note)
      在世界中指定的位置播放一个音符.
      这个方法可以与蛋糕一起使用.

      当使用Instrument.CUSTOM_HEAD调用时, 此方法会静默失败.

      原文:Play a note at the provided Location in the World.
      This will work with cake.

      This method will fail silently when called with Instrument.CUSTOM_HEAD.

      参数:
      loc - 播放音符的位置
      instrument - 乐器
      note - 音符
    • playSound

      void playSound(@NotNull @NotNull Location location, @NotNull @NotNull Sound sound, float volume, float pitch)
      在世界中指定的位置播放一个声音。

      如果位置或声音为空则这个函数会失效。

      原文: 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

      void playSound(@NotNull @NotNull Location location, @NotNull @NotNull String sound, float volume, float pitch)
      在世界中指定的位置播放一个声音.

      如果位置或声音为空则这个函数会失效. 如果客户端没有对应传入值的声音, 玩家将不会听到任何声音.

      原文: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 - 播放声音的位置
      sound - 要播放的内部声音名称
      volume - 声音音量
      pitch - 声音音调
    • playSound

      void playSound(@NotNull @NotNull Location location, @NotNull @NotNull Sound sound, @NotNull @NotNull SoundCategory category, float volume, float pitch)
      在世界中指定的位置播放一个声音.

      如果位置或声音为空则这个函数会失效.

      原文:Play a Sound at the provided Location in the World.

      This function will fail silently if Location or Sound are null.

      参数:
      location - 播放声音的位置
      sound - 要播放的声音
      category - 声音类别
      volume - 声音音量
      pitch - 声音音调
    • playSound

      void playSound(@NotNull @NotNull Location location, @NotNull @NotNull String sound, @NotNull @NotNull SoundCategory category, float volume, float pitch)
      在世界中指定的位置播放一个声音.

      如果位置或声音为空则这个函数会失效. 如果客户端没有对应传入值的声音, 玩家将不会听到任何声音.

      原文: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 - 播放声音的位置
      sound - 要播放的内部声音名称
      category - 声音类别
      volume - 声音音量
      pitch - 声音音调
    • playSound

      void playSound(@NotNull @NotNull Location location, @NotNull @NotNull Sound sound, @NotNull @NotNull SoundCategory category, float volume, float pitch, long seed)
      在世界中指定的位置播放一个声音. 对于有多个变体的声音, 传递相同的种子将始终播放相同的变体.

      如果位置或声音为空则这个函数会失效.

      原文:Play a Sound at the provided Location in the World. For sounds with multiple variations passing the same seed will always play the same variation.

      This function will fail silently if Location or Sound are null.

      参数:
      location - 播放声音的位置
      sound - 要播放的声音
      category - 声音类别
      volume - 声音音量
      pitch - 声音音调
      seed - 声音种子
    • playSound

      void playSound(@NotNull @NotNull Location location, @NotNull @NotNull String sound, @NotNull @NotNull SoundCategory category, float volume, float pitch, long seed)
      在世界中指定的位置播放一个声音. 对于有多个变体的声音, 传递相同的种子将始终播放相同的变体.

      如果位置或声音为空则这个函数会失效. 如果客户端没有对应传入值的声音, 玩家将不会听到任何声音.

      原文:Play a Sound at the provided Location in the World. For sounds with multiple variations passing the same seed will always play the same variation.

      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 - 播放声音的位置
      sound - 要播放的内部声音名称
      category - 声音类别
      volume - 声音音量
      pitch - 声音音调
      seed - 声音种子
    • playSound

      void playSound(@NotNull @NotNull Entity entity, @NotNull @NotNull Sound sound, float volume, float pitch)
      在世界中指定实体的位置播放一个声音.

      如果实体或声音为空则这个函数会失效.

      原文:Play a Sound at the location of the provided entity in the World.

      This function will fail silently if Entity or Sound are null.

      参数:
      entity - 播放声音的实体
      sound - 要播放的声音
      volume - 声音音量
      pitch - 声音音调
    • playSound

      void playSound(@NotNull @NotNull Entity entity, @NotNull @NotNull String sound, float volume, float pitch)
      在世界中指定实体的位置播放一个声音.

      如果实体或声音为空则这个函数会失效.

      原文:Play a Sound at the location of the provided entity in the World.

      This function will fail silently if Entity or Sound are null.

      参数:
      entity - 播放声音的实体
      sound - 要播放的声音
      volume - 声音音量
      pitch - 声音音调
    • playSound

      void playSound(@NotNull @NotNull Entity entity, @NotNull @NotNull Sound sound, @NotNull @NotNull SoundCategory category, float volume, float pitch)
      在世界中指定实体的位置播放一个声音.

      如果实体或声音为空则这个函数会失效.

      原文:Play a Sound at the location of the provided entity in the World.

      This function will fail silently if Entity or Sound are null.

      参数:
      entity - 播放声音的实体
      sound - 要播放的声音
      category - 声音类别
      volume - 声音音量
      pitch - 声音音调
    • playSound

      void playSound(@NotNull @NotNull Entity entity, @NotNull @NotNull String sound, @NotNull @NotNull SoundCategory category, float volume, float pitch)
      在世界中指定实体的位置播放一个声音.

      如果实体或声音为空则这个函数会失效.

      原文:Play a Sound at the location of the provided entity in the World.

      This function will fail silently if Entity or Sound are null.

      参数:
      entity - 播放声音的实体
      sound - 要播放的声音
      category - 声音类别
      volume - 声音音量
      pitch - 声音音调
    • playSound

      void playSound(@NotNull @NotNull Entity entity, @NotNull @NotNull Sound sound, @NotNull @NotNull SoundCategory category, float volume, float pitch, long seed)
      在世界中指定实体的位置播放一个声音. 对于有多个变体的声音, 传递相同的种子将始终播放相同的变体.

      如果实体或声音为空则这个函数会失效.

      原文:Play a Sound at the location of the provided entity in the World. For sounds with multiple variations passing the same seed will always play the same variation.

      This function will fail silently if Entity or Sound are null.

      参数:
      entity - 播放声音的实体
      sound - 要播放的声音
      category - 声音类别
      volume - 声音音量
      pitch - 声音音调
      seed - 声音种子
    • playSound

      void playSound(@NotNull @NotNull Entity entity, @NotNull @NotNull String sound, @NotNull @NotNull SoundCategory category, float volume, float pitch, long seed)
      在世界中指定实体的位置播放一个声音. 对于有多个变体的声音, 传递相同的种子将始终播放相同的变体.

      如果实体或声音为空则这个函数会失效.

      原文:Play a Sound at the location of the provided entity in the World. For sounds with multiple variations passing the same seed will always play the same variation.

      This function will fail silently if Entity or Sound are null.

      参数:
      entity - 播放声音的实体
      sound - 要播放的声音
      category - 声音类别
      volume - 声音音量
      pitch - 声音音调
      seed - 声音种子
    • getGameRules

      @NotNull @Deprecated(since="1.21.11") @NotNull String[] getGameRules()
      已过时。
      获取包含所有游戏规则的数组.

      原文:Get an array containing the names of all the GameRules.

      返回:
      游戏规则名列表.
    • isGameRule

      @Deprecated(since="1.21.11") boolean isGameRule(@NotNull @NotNull String rule)
      已过时。
      请使用 Registry.get(NamespacedKey) instead.
      检查字符串是否是一个有效的游戏规则.

      原文: Checks if string is a valid game rule

      参数:
      rule - 要检测的规则
      返回:
      如果规则存在则返回true
    • getGameRuleValue

      @Nullable <T> T getGameRuleValue(@NotNull @NotNull GameRule<T> rule)
      获取给定的游戏规则的数据值.

      原文:Get the current value for a given GameRule.

      类型参数:
      T - 游戏规则数据类型
      参数:
      rule - 游戏规则
      返回:
      游戏规则值
    • getGameRuleDefault

      @Nullable <T> T getGameRuleDefault(@NotNull @NotNull GameRule<T> rule)
      获取给定游戏规则的默认值. 不保证该值与当前值匹配.

      原文:Get the default value for a given GameRule. This value is not guaranteed to match the current value.

      类型参数:
      T - 游戏规则数据类型
      参数:
      rule - 游戏规则
      返回:
      游戏规则默认值
    • setGameRule

      <T> boolean setGameRule(@NotNull @NotNull GameRule<T> rule, @NotNull T newValue)
      设置给定游戏规则的数据值.

      原文:Set the given GameRule's new value.

      类型参数:
      T - 对应游戏规则的数据类型
      参数:
      rule - 要更新的游戏规则
      newValue - 值
      返回:
      若设置成功返回true
    • getWorldBorder

      @NotNull @NotNull WorldBorder getWorldBorder()
      获取这个世界的世界边界对象。

      原文: Gets the world border for this world.

      返回:
      这个世界的世界边界对象
    • spawnParticle

      void spawnParticle(@NotNull @NotNull Particle particle, @NotNull @NotNull Location location, int count)
      在目标位置生成粒子(由count指定数量).

      原文:Spawns the particle (the number of times specified by count) at the target location.

      参数:
      particle - 要生成的粒子
      location - 生成粒子的位置
      count - 粒子数量
    • spawnParticle

      void spawnParticle(@NotNull @NotNull Particle particle, double x, double y, double z, int count)
      在目标位置生成粒子(由count指定数量).

      原文:Spawns the particle (the number of times specified by count) at the target location.

      参数:
      particle - 要生成的粒子
      x - 生成粒子的X轴位置
      y - 生成粒子的Y轴位置
      z - 生成粒子的Z轴位置
      count - 粒子数量
    • spawnParticle

      <T> void spawnParticle(@NotNull @NotNull Particle particle, @NotNull @NotNull Location location, int count, @Nullable T data)
      在目标位置生成粒子(由count指定数量).

      原文:Spawns the particle (the number of times specified by count) at the target location.

      类型参数:
      T - 粒子数据类型(参见Particle.getDataType())
      参数:
      particle - 要生成的粒子
      location - 生成粒子的位置
      count - 粒子数量
      data - 用于粒子的数据或null, 其类型取决于Particle.getDataType()
    • spawnParticle

      <T> void spawnParticle(@NotNull @NotNull Particle particle, double x, double y, double z, int count, @Nullable T data)
      在目标位置生成粒子(由count指定数量).

      原文:Spawns the particle (the number of times specified by count) at the target location.

      类型参数:
      T - 粒子数据类型(参见Particle.getDataType())
      参数:
      particle - 要生成的粒子
      x - 生成粒子的X轴位置
      y - 生成粒子的Y轴位置
      z - 生成粒子的Z轴位置
      count - 粒子数量
      data - 用于粒子的数据或null, 其类型取决于Particle.getDataType()
    • spawnParticle

      void spawnParticle(@NotNull @NotNull Particle particle, @NotNull @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ)
      在目标位置生成粒子(由count指定数量). 每个粒子的位置将根据偏移参数在每个轴上进行正向和负向的随机偏移.

      原文: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 - 要生成的粒子
      location - 生成粒子的位置
      count - 粒子数量
      offsetX - X轴上的最大随机偏移量
      offsetY - Y轴上的最大随机偏移量
      offsetZ - Z轴上的最大随机偏移量
    • spawnParticle

      void spawnParticle(@NotNull @NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ)
      在目标位置生成粒子(由count指定数量). 每个粒子的位置将根据偏移参数在每个轴上进行正向和负向的随机偏移.

      原文: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 - 要生成的粒子
      x - 生成粒子的X轴位置
      y - 生成粒子的Y轴位置
      z - 生成粒子的Z轴位置
      count - 粒子数量
      offsetX - X轴上的最大随机偏移量
      offsetY - Y轴上的最大随机偏移量
      offsetZ - Z轴上的最大随机偏移量
    • spawnParticle

      <T> void spawnParticle(@NotNull @NotNull Particle particle, @NotNull @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data)
      在目标位置生成粒子(由count指定数量). 每个粒子的位置将根据偏移参数在每个轴上进行正向和负向的随机偏移.

      原文: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.

      类型参数:
      T - 粒子数据类型(参见Particle.getDataType())
      参数:
      particle - 要生成的粒子
      location - 生成粒子的位置
      count - 粒子数量
      offsetX - X轴上的最大随机偏移量
      offsetY - Y轴上的最大随机偏移量
      offsetZ - Z轴上的最大随机偏移量
      data - 用于粒子的数据或null, 其类型取决于Particle.getDataType()
    • spawnParticle

      <T> void spawnParticle(@NotNull @NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data)
      在目标位置生成粒子(由count指定数量). 每个粒子的位置将根据偏移参数在每个轴上进行正向和负向的随机偏移.

      原文: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.

      类型参数:
      T - 粒子数据类型(参见Particle.getDataType())
      参数:
      particle - 要生成的粒子
      x - 生成粒子的X轴位置
      y - 生成粒子的Y轴位置
      z - 生成粒子的Z轴位置
      count - 粒子数量
      offsetX - X轴上的最大随机偏移量
      offsetY - Y轴上的最大随机偏移量
      offsetZ - Z轴上的最大随机偏移量
      data - 用于粒子的数据或null, 其类型取决于Particle.getDataType()
    • spawnParticle

      void spawnParticle(@NotNull @NotNull Particle particle, @NotNull @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra)
      在目标位置生成粒子(由count指定数量). 每个粒子的位置将根据偏移参数在每个轴上进行正向和负向的随机偏移.

      原文: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 - 要生成的粒子
      location - 生成粒子的位置
      count - 粒子数量
      offsetX - X轴上的最大随机偏移量
      offsetY - Y轴上的最大随机偏移量
      offsetZ - Z轴上的最大随机偏移量
      extra - 此粒子的额外数据, 取决于使用的粒子(通常是速度)
    • spawnParticle

      void spawnParticle(@NotNull @NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra)
      在目标位置生成粒子(由count指定数量). 每个粒子的位置将根据偏移参数在每个轴上进行正向和负向的随机偏移.

      原文: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 - 要生成的粒子
      x - 生成粒子的X轴位置
      y - 生成粒子的Y轴位置
      z - 生成粒子的Z轴位置
      count - 粒子数量
      offsetX - X轴上的最大随机偏移量
      offsetY - Y轴上的最大随机偏移量
      offsetZ - Z轴上的最大随机偏移量
      extra - 此粒子的额外数据, 取决于使用的粒子(通常是速度)
    • spawnParticle

      <T> void spawnParticle(@NotNull @NotNull Particle particle, @NotNull @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data)
      在目标位置生成粒子(由count指定数量). 每个粒子的位置将根据偏移参数在每个轴上进行正向和负向的随机偏移.

      原文: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.

      类型参数:
      T - 粒子数据类型(参见Particle.getDataType())
      参数:
      particle - 要生成的粒子
      location - 生成粒子的位置
      count - 粒子数量
      offsetX - X轴上的最大随机偏移量
      offsetY - Y轴上的最大随机偏移量
      offsetZ - Z轴上的最大随机偏移量
      extra - 此粒子的额外数据, 取决于使用的粒子(通常是速度)
      data - 用于粒子的数据或null, 其类型取决于Particle.getDataType()
    • spawnParticle

      <T> void spawnParticle(@NotNull @NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data)
      在目标位置生成粒子(由count指定数量). 每个粒子的位置将根据偏移参数在每个轴上进行正向和负向的随机偏移.

      原文: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.

      类型参数:
      T - 粒子数据类型(参见Particle.getDataType())
      参数:
      particle - 要生成的粒子
      x - 生成粒子的X轴位置
      y - 生成粒子的Y轴位置
      z - 生成粒子的Z轴位置
      count - 粒子数量
      offsetX - X轴上的最大随机偏移量
      offsetY - Y轴上的最大随机偏移量
      offsetZ - Z轴上的最大随机偏移量
      extra - 此粒子的额外数据, 取决于使用的粒子(通常是速度)
      data - 用于粒子的数据或null, 其类型取决于Particle.getDataType()
    • spawnParticle

      <T> void spawnParticle(@NotNull @NotNull Particle particle, @NotNull @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data, boolean force)
      在目标位置生成粒子(由count指定数量). 每个粒子的位置将根据偏移参数在每个轴上进行正向和负向的随机偏移.

      原文: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.

      类型参数:
      T - 粒子数据类型(参见Particle.getDataType())
      参数:
      particle - 要生成的粒子
      location - 生成粒子的位置
      count - 粒子数量
      offsetX - X轴上的最大随机偏移量
      offsetY - Y轴上的最大随机偏移量
      offsetZ - Z轴上的最大随机偏移量
      extra - 此粒子的额外数据, 取决于使用的粒子(通常是速度)
      data - 用于粒子的数据或null, 其类型取决于Particle.getDataType()
      force - 是否将粒子发送给扩展范围内的玩家并强制其客户端渲染, 无论设置如何
    • spawnParticle

      <T> void spawnParticle(@NotNull @NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data, boolean force)
      在目标位置生成粒子(由count指定数量). 每个粒子的位置将根据偏移参数在每个轴上进行正向和负向的随机偏移.

      原文: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.

      类型参数:
      T - 粒子数据类型(参见Particle.getDataType())
      参数:
      particle - 要生成的粒子
      x - 生成粒子的X轴位置
      y - 生成粒子的Y轴位置
      z - 生成粒子的Z轴位置
      count - 粒子数量
      offsetX - X轴上的最大随机偏移量
      offsetY - Y轴上的最大随机偏移量
      offsetZ - Z轴上的最大随机偏移量
      extra - 此粒子的额外数据, 取决于使用的粒子(通常是速度)
      data - 用于粒子的数据或null, 其类型取决于Particle.getDataType()
      force - 是否将粒子发送给扩展范围内的玩家并强制其客户端渲染, 无论设置如何
    • locateNearestStructure

      @Nullable @Deprecated(since="1.19") @Nullable Location locateNearestStructure(@NotNull @NotNull Location origin, @NotNull StructureType structureType, int radius, boolean findUnexplored)
      查找最近的指定结构类型的结构. 查找未探索的结构可能会阻塞, 如果世界正在查看尚未生成的区块. 这可能导致世界在定位未探索的结构时暂时冻结.

      radius不是严格的方形半径. 每种结构可能改变每次迭代检查的区块数量. 不要假设只会检查半径*半径的区块区域. 例如, StructureType.WOODLAND_MANSION可能会检查距离20000个方块(或更多)远的地方, 无论使用的半径是多少.

      此方法不会加载或生成区块. 如果你只查找未探索的结构, 这也可能导致服务器挂起的情况. 这是因为它会不断向外寻找以找到该结构.

      原文:Find the closest nearby structure of a given StructureType. Finding unexplored structures can, and will, block if the world is looking in chunks that gave not generated yet. This can lead to the world temporarily freezing while locating an unexplored structure.

      The radius is not a rigid square radius. Each structure may alter how many chunks to check for each iteration. Do not assume that only a radius x radius chunk area will be checked. For example, StructureType.WOODLAND_MANSION can potentially check up to 20,000 blocks away (or more) regardless of the radius used.

      This will not load or generate chunks. This can also lead to instances where the server can hang if you are only looking for unexplored structures. This is because it will keep looking further and further out in order to find the structure.

      参数:
      origin - 开始查找结构的位置
      structureType - 要查找的结构类型
      radius - 搜索半径(以区块为单位)
      findUnexplored - 是否只查找未探索的结构
      返回:
      最近的位置, 如果不存在指定类型的结构则返回null
      另请参阅:
    • locateNearestStructure

      @Nullable @Nullable StructureSearchResult locateNearestStructure(@NotNull @NotNull Location origin, @NotNull @NotNull StructureType structureType, int radius, boolean findUnexplored)
      查找最近的指定结构类型的结构. 查找未探索的结构可能会阻塞, 如果世界正在查看尚未生成的区块. 这可能导致世界在定位未探索的结构时暂时冻结.

      radius不是严格的方形半径. 每种结构可能改变每次迭代检查的区块数量. 不要假设只会检查半径*半径的区块区域. 例如, StructureType.WOODLAND_MANSION可能会检查距离20000个方块(或更多)远的地方, 无论使用的半径是多少.

      此方法不会加载或生成区块. 如果你只查找未探索的结构, 这也可能导致服务器挂起的情况. 这是因为它会不断向外寻找以找到该结构.

      搜索StructureType和Structure的区别在于, StructureType可以引用多个结构, 而搜索Structure只会搜索给定的Structure.

      原文:Find the closest nearby structure of a given StructureType. Finding unexplored structures can, and will, block if the world is looking in chunks that gave not generated yet. This can lead to the world temporarily freezing while locating an unexplored structure.

      The radius is not a rigid square radius. Each structure may alter how many chunks to check for each iteration. Do not assume that only a radius x radius chunk area will be checked. For example, StructureType.WOODLAND_MANSION can potentially check up to 20,000 blocks away (or more) regardless of the radius used.

      This will not load or generate chunks. This can also lead to instances where the server can hang if you are only looking for unexplored structures. This is because it will keep looking further and further out in order to find the structure.

      The difference between searching for a StructureType and a Structure is, that a StructureType can refer to multiple Structures while searching for a Structure while only search for the given Structure.

      参数:
      origin - 开始查找结构的位置
      structureType - 要查找的结构类型
      radius - 搜索半径(以区块为单位)
      findUnexplored - 是否只查找未探索的结构
      返回:
      最近的位置和结构, 如果不存在指定类型的结构则返回null
      另请参阅:
    • locateNearestStructure

      @Nullable @Nullable StructureSearchResult locateNearestStructure(@NotNull @NotNull Location origin, @NotNull @NotNull Structure structure, int radius, boolean findUnexplored)
      查找最近的指定结构的结构. 查找未探索的结构可能会阻塞, 如果世界正在查看尚未生成的区块. 这可能导致世界在定位未探索的结构时暂时冻结.

      radius不是严格的方形半径. 每种结构可能改变每次迭代检查的区块数量. 不要假设只会检查半径*半径的区块区域. 例如, Structure.MANSION可能会检查距离20000个方块(或更多)远的地方, 无论使用的半径是多少.

      此方法不会加载或生成区块. 如果你只查找未探索的结构, 这也可能导致服务器挂起的情况. 这是因为它会不断向外寻找以找到该结构.

      搜索StructureType和Structure的区别在于, StructureType可以引用多个结构, 而搜索Structure只会搜索给定的Structure.

      原文:Find the closest nearby structure of a given Structure. Finding unexplored structures can, and will, block if the world is looking in chunks that gave not generated yet. This can lead to the world temporarily freezing while locating an unexplored structure.

      The radius is not a rigid square radius. Each structure may alter how many chunks to check for each iteration. Do not assume that only a radius x radius chunk area will be checked. For example, Structure.MANSION can potentially check up to 20,000 blocks away (or more) regardless of the radius used.

      This will not load or generate chunks. This can also lead to instances where the server can hang if you are only looking for unexplored structures. This is because it will keep looking further and further out in order to find the structure.

      The difference between searching for a StructureType and a Structure is, that a StructureType can refer to multiple Structures while searching for a Structure while only search for the given Structure.

      参数:
      origin - 开始查找结构的位置
      structure - 要查找的结构
      radius - 搜索半径(以区块为单位)
      findUnexplored - 是否只查找未探索的结构
      返回:
      最近的位置和结构, 如果未找到结构则返回null
      另请参阅:
    • spigot

    • locateNearestBiome

      @Nullable @Nullable BiomeSearchResult locateNearestBiome(@NotNull @NotNull Location origin, int radius, @NotNull @NotNull Biome... biomes)
      查找最近的与提供的生物群系匹配的位置. 查找生物群系可能会阻塞, 如果世界正在查看尚未生成的区块. 这可能导致世界在定位生物群系时暂时冻结.

      注意:此方法不会反映世界生成后所做的更改, 此方法只能看到世界生成时的生物群系. 此方法不会加载或生成区块.

      如果提供了多个生物群系, BiomeSearchResult.getBiome()将指示定位到的是哪一个.

      此方法将使用32的水平间隔和64的垂直间隔, 等同于/locate命令.

      原文:Find the closest nearby location with a biome matching the provided Biome(s). Finding biomes can, and will, block if the world is looking in chunks that have not generated yet. This can lead to the world temporarily freezing while locating a biome.

      Note: This will not reflect changes made to the world after generation, this method only sees the biome at the time of world generation. This will not load or generate chunks.

      If multiple biomes are provided BiomeSearchResult.getBiome() will indicate which one was located.

      This method will use a horizontal interval of 32 and a vertical interval of 64, equal to the /locate command.

      参数:
      origin - 开始查找生物群系的位置
      radius - 搜索半径(以方块为单位)
      biomes - 要搜索的生物群系
      返回:
      包含最近的位置和生物群系的BiomeSearchResult, 如果未找到生物群系则返回null
      另请参阅:
    • locateNearestBiome

      @Nullable @Nullable BiomeSearchResult locateNearestBiome(@NotNull @NotNull Location origin, int radius, int horizontalInterval, int verticalInterval, @NotNull @NotNull Biome... biomes)
      查找最近的与提供的生物群系匹配的位置. 查找生物群系可能会阻塞, 如果世界正在查看尚未生成的区块. 这可能导致世界在定位生物群系时暂时冻结.

      注意:此方法不会反映世界生成后所做的更改, 此方法只能看到世界生成时的生物群系. 此方法不会加载或生成区块.

      如果提供了多个生物群系, BiomeSearchResult.getBiome()将指示定位到的是哪一个. 较高的horizontalInterval和verticalInterval值将导致更快的搜索, 但可能会遗漏较小的生物群系.

      原文:Find the closest nearby location with a biome matching the provided Biome(s). Finding biomes can, and will, block if the world is looking in chunks that have not generated yet. This can lead to the world temporarily freezing while locating a biome.

      Note: This will not reflect changes made to the world after generation, this method only sees the biome at the time of world generation. This will not load or generate chunks.

      If multiple biomes are provided BiomeSearchResult.getBiome() will indicate which one was located. Higher values for horizontalInterval and verticalInterval will result in faster searches, but may lead to small biomes being missed.

      参数:
      origin - 开始查找生物群系的位置
      radius - 搜索半径(以方块为单位)
      horizontalInterval - 每次检查之间的水平距离
      verticalInterval - 每次检查之间的垂直距离
      biomes - 要搜索的生物群系
      返回:
      包含最近的位置和生物群系的BiomeSearchResult, 如果未找到生物群系则返回null
      另请参阅:
    • locateNearestRaid

      @Nullable @Nullable Raid locateNearestRaid(@NotNull @NotNull Location location, int radius)
      寻找与给定位置相距最近的袭击.

      原文:Finds the nearest raid close to the given location.

      参数:
      location - 源位置
      radius - 搜索半径
      返回:
      最近的袭击, 如果没有找到袭击事件返回null.
    • getRaids

      @NotNull @NotNull List<Raid> getRaids()
      获取本世界正在进行的所有袭击.

      原文:Gets all raids that are going on over this world.

      返回:
      本世界所有活跃的袭击
    • getEnderDragonBattle

      @Nullable @Nullable DragonBattle getEnderDragonBattle()
      获取与此世界关联的末影龙战斗.

      如果此世界的环境不是World.Environment.THE_END, 将返回null.

      如果是末地世界, 无论世界中是否存在末影龙或是否已激活战斗序列, 都将返回一个末影龙战斗实例. 末影龙战斗实例用作状态持有者.

      原文:Get the DragonBattle associated with this world. If this world's environment is not World.Environment.THE_END, null will be returned.

      If an end world, a dragon battle instance will be returned regardless of whether or not a dragon is present in the world or a fight sequence has been activated. The dragon battle instance acts as a state holder.

      返回:
      末影龙战斗实例
    • getFeatureFlags

      @NotNull @NotNull Set<FeatureFlag> getFeatureFlags()
      获取此世界启用的所有功能标志.

      原文:Get all FeatureFlag enabled in this world.

      返回:
      所有启用的功能标志
    • getStructures

      @NotNull @NotNull Collection<GeneratedStructure> getStructures(int x, int z)
      获取与给定坐标区块相交的所有已生成结构.
      如果不存在结构, 则返回空集合.

      原文:Gets all generated structures that intersect the chunk at the given coordinates.
      If no structures are present an empty collection will be returned.

      参数:
      x - 区块的X坐标
      z - 区块的Z坐标
      返回:
      给定坐标区块中已放置的结构集合
    • getStructures

      @NotNull @NotNull Collection<GeneratedStructure> getStructures(int x, int z, @NotNull @NotNull Structure structure)
      获取与给定坐标区块相交的所有指定结构的已生成结构.
      如果不存在结构, 则返回空集合.

      原文:Gets all generated structures of a given Structure that intersect the chunk at the given coordinates.
      If no structures are present an empty collection will be returned.

      参数:
      x - 区块的X坐标
      z - 区块的Z坐标
      structure - 要查找的结构
      返回:
      给定坐标区块中已放置的结构集合