Interface World
- All Superinterfaces:
- Audience,- FeatureFlagSetHolder,- ForwardingAudience,- Keyed,- Keyed,- Metadatable,- PersistentDataHolder,- PersistentDataViewHolder,- PluginMessageRecipient,- Pointered,- RegionAccessor,- WorldInfo
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic interfaceDeprecated.Use either the Future or the Consumer based methodsstatic enumRepresents various map environment types that a world may bestatic classDeprecated, for removal: This API element is subject to removal in a future version.Nested classes/interfaces inherited from interface net.kyori.adventure.audience.ForwardingAudienceForwardingAudience.Single
- 
Method SummaryModifier and TypeMethodDescriptionbooleanaddPluginChunkTicket(int x, int z, @NotNull Plugin plugin) Adds a plugin ticket for the specified chunk, loading the chunk if it is not already loaded.Gets the audiences.booleanGets whether or not structures are being generated.voidClears all debug block highlights for all players on this world.default booleancreateExplosion(double x, double y, double z, float power) Creates explosion at given coordinates with given powerdefault booleancreateExplosion(double x, double y, double z, float power, boolean setFire) Creates explosion at given coordinates with given power and optionally setting blocks on fire.default booleancreateExplosion(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.booleancreateExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks, @Nullable Entity source) Creates explosion at given coordinates with given power and optionally setting blocks on fire or breaking blocks.default booleancreateExplosion(@NotNull Location loc, float power) Creates explosion at given coordinates with given powerdefault booleancreateExplosion(@NotNull Location loc, float power, boolean setFire) Creates explosion at given coordinates with given power and optionally setting blocks on fire.default booleancreateExplosion(@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.booleancreateExplosion(@NotNull Location loc, float power, boolean setFire, boolean breakBlocks, @Nullable Entity source) Creates explosion at given coordinates with given power and optionally setting blocks on fire or breaking blocks.default booleancreateExplosion(@NotNull Entity source, float power) Creates explosion at given entities location with given power and optionally setting blocks on fire, with the specified entity as the source.default booleancreateExplosion(@NotNull Entity source, float power, boolean setFire) Creates explosion at given entities location with given power and optionally setting blocks on fire, with the specified entity as the source.default booleancreateExplosion(@NotNull Entity source, float power, boolean setFire, boolean breakBlocks) Creates explosion at given entities location with given power and optionally setting blocks on fire, with the specified entity as the source.default booleancreateExplosion(@Nullable Entity source, @NotNull Location loc, float power) Creates explosion at given location with given power, with the specified entity as the source.default booleancreateExplosion(@Nullable Entity source, @NotNull Location loc, float power, boolean setFire) Creates explosion at given location with given power and optionally setting blocks on fire, with the specified entity as the source.default booleancreateExplosion(@Nullable Entity source, @NotNull Location loc, float power, boolean setFire, boolean breakBlocks) Creates explosion at given location with given power and optionally setting blocks on fire, with the specified entity as the source.booleancreateExplosion(@Nullable Entity source, @NotNull Location loc, float power, boolean setFire, boolean breakBlocks, boolean excludeSourceFromDamage) Creates explosion at given location with given power and optionally setting blocks on fire, with the specified entity as the source.Drops an item at the specifiedLocationdropItem(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer<? super Item> function) Drops an item at the specifiedLocationNote that functions will run before the entity is spawneddropItemNaturally(@NotNull Location location, @NotNull ItemStack item) Drops an item at the specifiedLocationwith a random offsetdropItemNaturally(@NotNull Location location, @NotNull ItemStack item, @Nullable Consumer<? super Item> function) Drops an item at the specifiedLocationwith a random offset Note that functions will run before the entity is spawnedfindLightningRod(@NotNull Location location) Finds the location of the nearest unobstructed Lightning Rod in a 128-block radius around the given location.findLightningTarget(@NotNull Location location) Finds a targetLocationfor lightning to strike.booleangenerateTree(@NotNull Location location, @NotNull TreeType type) Deprecated.in favor ofRegionAccessor.generateTree(Location, java.util.Random, TreeType)to specify its own random instance and this method is not accessible throughRegionAccessorbooleangenerateTree(@NotNull Location loc, @NotNull TreeType type, @NotNull BlockChangeDelegate delegate) Deprecated.this method does not handle block entities (bee nests)booleanGets whether animals can spawn in this world.booleanGets whether monsters can spawn in this world.default intDeprecated.Deprecated in favor ofgetSpawnLimit(SpawnCategory)default intDeprecated.Deprecated in favor ofgetSpawnLimit(SpawnCategory)getBiome(int x, int z) Deprecated.biomes are now 3-dimensionalGets the biome provider for this worldgetBlockAt(int x, int y, int z) Gets theBlockat the given coordinatesgetBlockAt(@NotNull Location location) getBlockAtKey(long key) Deprecated.only encodes y block ranges from -512 to 511 and represents an already changed implementation detailgetChunkAt(int x, int z) Gets theChunkat the given coordinatesgetChunkAt(int x, int z, boolean generate) Gets theChunkat the given coordinatesgetChunkAt(long chunkKey) Gets the chunk at the specified chunk key, which is the X and Z packed into a long.getChunkAt(long chunkKey, boolean generate) Gets the chunk at the specified chunk key, which is the X and Z packed into a long.getChunkAt(@NotNull Location location) getChunkAt(@NotNull Block block) default CompletableFuture<Chunk> getChunkAtAsync(int x, int z) Requests aChunkto be loaded at the given coordinates This method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time.default CompletableFuture<Chunk> getChunkAtAsync(int x, int z, boolean gen) Requests aChunkto be loaded at the given coordinates This method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time.default CompletableFuture<Chunk> getChunkAtAsync(int x, int z, boolean gen, boolean urgent) Requests aChunkto be loaded at the given coordinates.voidgetChunkAtAsync(int x, int z, boolean gen, boolean urgent, @NotNull Consumer<? super Chunk> cb) Requests aChunkto be loaded at the given coordinates This method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time.default voidgetChunkAtAsync(int x, int z, boolean gen, @NotNull Consumer<? super Chunk> cb) Requests aChunkto be loaded at the given coordinates This method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time.default voidgetChunkAtAsync(int x, int z, @NotNull Consumer<? super Chunk> cb) Requests aChunkto be loaded at the given coordinates This method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time.default voidgetChunkAtAsync(int x, int z, @NotNull World.ChunkLoadCallback cb) Deprecated.Use either the Future or the Consumer based methodsdefault CompletableFuture<Chunk> Requests aChunkto be loaded at the given coordinates This method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time.default CompletableFuture<Chunk> getChunkAtAsync(@NotNull Location loc, boolean gen) Requests aChunkto be loaded at the given coordinates This method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time.default voiddefault voiddefault voidDeprecated.Use either the Future or the Consumer based methodsdefault CompletableFuture<Chunk> getChunkAtAsync(@NotNull Block block) Requests aChunkto be loaded at the given coordinates This method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time.default CompletableFuture<Chunk> getChunkAtAsync(@NotNull Block block, boolean gen) Requests aChunkto be loaded at the given coordinates This method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time.default voiddefault voiddefault voidgetChunkAtAsync(@NotNull Block block, @NotNull World.ChunkLoadCallback cb) Deprecated.Use either the Future or the Consumer based methodsdefault CompletableFuture<Chunk> getChunkAtAsyncUrgently(int x, int z) Requests aChunkto be loaded at the given coordinatesdefault CompletableFuture<Chunk> Requests aChunkto be loaded at the given coordinatesdefault CompletableFuture<Chunk> getChunkAtAsyncUrgently(@NotNull Location loc, boolean gen) Requests aChunkto be loaded at the given coordinatesdefault CompletableFuture<Chunk> getChunkAtAsyncUrgently(@NotNull Block block) Requests aChunkto be loaded at the given coordinatesdefault CompletableFuture<Chunk> getChunkAtAsyncUrgently(@NotNull Block block, boolean gen) Requests aChunkto be loaded at the given coordinatesintvoidgetChunksAtAsync(int minX, int minZ, int maxX, int maxZ, boolean urgent, @NotNull Runnable cb) Requests all chunks with x between [minX, maxZ] and z between [minZ, maxZ] to be loaded.intGet the clear weather duration.doubleGets the coordinate scaling of this world.Gets the Difficulty of the world.getEmptyChunkSnapshot(int x, int z, boolean includeBiome, boolean includeBiomeTemp) Get empty chunk snapshot (equivalent to all air blocks), optionally including valid biome data.Get theDragonBattleassociated with this world.Get a list of all entities in this World<T extends Entity>
 @NotNull Collection<T> getEntitiesByClass(@NotNull Class<T> cls) Get a collection of all entities in this World matching the given class/interface<T extends Entity>
 @NotNull Collection<T> getEntitiesByClass(@NotNull Class<T>... classes) Deprecated.getEntitiesByClasses(@NotNull Class<?>... classes) Get a collection of all entities in this World matching any of the given classes/interfacesGets an entity in this world by its UUIDintGet allFeatureFlagenabled in this world.Returns all force loaded chunks in this world.longGets the full in-game time on this world<T> TgetGameRuleDefault(@NotNull GameRule<T> rule) Get the default value for a givenGameRule.Get an array containing the names of all theGameRules.getGameRuleValue(@Nullable String rule) Deprecated.usegetGameRuleValue(GameRule)instead<T> TgetGameRuleValue(@NotNull GameRule<T> rule) Get the current value for a givenGameRule.longGets the full in-game time on this world since the world generationGets the chunk generator for this worldgetHighestBlockAt(int x, int z) Gets the highest non-empty (impassable) block at the given coordinates.getHighestBlockAt(int x, int z, @NotNull HeightMap heightMap) Gets the highest block corresponding to theHeightMapat the given coordinates.getHighestBlockAt(@NotNull Location location) Gets the highest non-empty (impassable) block at the given coordinates.getHighestBlockAt(@NotNull Location location, @NotNull HeightMap heightMap) Gets the highest block corresponding to theHeightMapat the given coordinates.default doublegetHumidity(int x, int z) Deprecated.biomes are now 3-dimensionaldoublegetHumidity(int x, int y, int z) Gets the humidity for the given block coordinates.Gets the collection of materials that burn infinitely in this world.Gets all Chunks intersecting the given BoundingBox.default booleanDeprecated, for removal: This API element is subject to removal in a future version.No longer functional since 1.21.9, the vanilla server does not have the concept of spawn chunks anymore.Get a list of all living entities in this WorldGets an array of all loadedChunksfloatgetLocalDifficultyAt(@NotNull Location location) Gets the local difficulty (based on inhabited time) at a locationgetLocationAtKey(long key) Deprecated.intGets the maximum height to which chorus fruits and nether portals can bring players within this dimension.default intDeprecated.Deprecated in favor ofgetSpawnLimit(SpawnCategory)default @NotNull Collection<Entity> getNearbyEntities(@NotNull Location location, double x, double y, double z) Returns a list of entities within a bounding box centered around a Location.getNearbyEntities(@NotNull Location location, double x, double y, double z, @Nullable Predicate<? super Entity> filter) Returns a list of entities within a bounding box centered around a Location.default @NotNull Collection<Entity> getNearbyEntities(@NotNull BoundingBox boundingBox) Returns a list of entities within the given bounding box.getNearbyEntities(@NotNull BoundingBox boundingBox, @Nullable Predicate<? super Entity> filter) Returns a list of entities within the given bounding box.default <T extends Entity>
 @NotNull Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends T> clazz, @NotNull Location loc, double radius) Gets all nearby entities of the specified type, within the specified radius (bounding box)default <T extends Entity>
 @NotNull Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends T> clazz, @NotNull Location loc, double xzRadius, double yRadius) Gets all nearby entities of the specified type, within the specified radius, with x and x radius matching (bounding box)default <T extends Entity>
 @NotNull Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends T> clazz, @NotNull Location loc, double xRadius, double yRadius, double zRadius) Gets all nearby entities of the specified type, within the specified radius (bounding box)default <T extends Entity>
 @NotNull Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends T> clazz, @NotNull Location loc, double xRadius, double yRadius, double zRadius, @Nullable Predicate<? super T> predicate) Gets all nearby entities of the specified type, within the specified radius (bounding box)default <T extends Entity>
 @NotNull Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends T> clazz, @NotNull Location loc, double xzRadius, double yRadius, @Nullable Predicate<? super T> predicate) Gets all nearby entities of the specified type, within the specified radius, with x and x radius matching (bounding box)default <T extends Entity>
 @NotNull Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends T> clazz, @NotNull Location loc, double radius, @Nullable Predicate<? super T> predicate) Gets all nearby entities of the specified type, within the specified radius (bounding box)default @NotNull Collection<LivingEntity> getNearbyLivingEntities(@NotNull Location loc, double radius) Gets nearby LivingEntities within the specified radius (bounding box)default @NotNull Collection<LivingEntity> getNearbyLivingEntities(@NotNull Location loc, double xzRadius, double yRadius) Gets nearby LivingEntities within the specified radius (bounding box)default @NotNull Collection<LivingEntity> getNearbyLivingEntities(@NotNull Location loc, double xRadius, double yRadius, double zRadius) Gets nearby LivingEntities within the specified radius (bounding box)default @NotNull Collection<LivingEntity> getNearbyLivingEntities(@NotNull Location loc, double xRadius, double yRadius, double zRadius, @Nullable Predicate<? super LivingEntity> predicate) Gets nearby LivingEntities within the specified radius (bounding box)default @NotNull Collection<LivingEntity> getNearbyLivingEntities(@NotNull Location loc, double xzRadius, double yRadius, @Nullable Predicate<? super LivingEntity> predicate) Gets nearby LivingEntities within the specified radius (bounding box)default @NotNull Collection<LivingEntity> getNearbyLivingEntities(@NotNull Location loc, double radius, @Nullable Predicate<? super LivingEntity> predicate) Gets nearby LivingEntities within the specified radius (bounding box)default @NotNull Collection<Player> getNearbyPlayers(@NotNull Location loc, double radius) Gets nearby players within the specified radius (bounding box)default @NotNull Collection<Player> getNearbyPlayers(@NotNull Location loc, double xzRadius, double yRadius) Gets nearby players within the specified radius (bounding box)default @NotNull Collection<Player> getNearbyPlayers(@NotNull Location loc, double xRadius, double yRadius, double zRadius) Gets nearby players within the specified radius (bounding box)default @NotNull Collection<Player> getNearbyPlayers(@NotNull Location loc, double xRadius, double yRadius, double zRadius, @Nullable Predicate<? super Player> predicate) Gets nearby players within the specified radius (bounding box)default @NotNull Collection<Player> getNearbyPlayers(@NotNull Location loc, double xzRadius, double yRadius, @Nullable Predicate<? super Player> predicate) Gets nearby players within the specified radius (bounding box)default @NotNull Collection<Player> getNearbyPlayers(@NotNull Location loc, double radius, @Nullable Predicate<? super Player> predicate) Gets nearby players within the specified radius (bounding box)default intDeprecated.intGet a list of all players in this WorldgetPlayersSeeingChunk(int x, int z) Get a list of all players who are can view the specified chunk from their clientgetPlayersSeeingChunk(@NotNull Chunk chunk) Get a list of all players who are can view the specified chunk from their clientReturns a map of which plugins have tickets for what chunks.getPluginChunkTickets(int x, int z) Retrieves a collection specifying which plugins have tickets for the specified chunk.Gets a list of all appliedBlockPopulators for this WorldbooleangetPVP()Deprecated.useGameRule.PVPinsteadgetRaid(int id) Get a raid with the specific id fromRaid.getId()from this world.getRaids()Gets all raids that are going on over this world.intGets the sea level for this world.intGets the sending view distance for this world.intReturns the simulation distance used for this world.intgetSpawnLimit(@NotNull SpawnCategory spawnCategory) Gets the limit for number ofSpawnCategoryentities that can spawn in a chunk in this worldGets the default spawnLocationof this worldgetStructures(int x, int z) Gets all generated structures that intersect the chunk at the given coordinates.getStructures(int x, int z, @NotNull Structure structure) Gets all generated structures of a givenStructurethat intersect the chunk at the given coordinates.default doublegetTemperature(int x, int z) Deprecated.biomes are now 3-dimensionaldoublegetTemperature(int x, int y, int z) Gets the temperature for the given block coordinates.intGet the thundering duration.intdefault longDeprecated.Deprecated in favor ofgetTicksPerSpawns(SpawnCategory)default longDeprecated.Deprecated in favor ofgetTicksPerSpawns(SpawnCategory)default longDeprecated.Deprecated in favor ofgetTicksPerSpawns(SpawnCategory)longgetTicksPerSpawns(@NotNull SpawnCategory spawnCategory) Gets the world's ticks perSpawnCategorymob spawns valuedefault longDeprecated.Deprecated in favor ofgetTicksPerSpawns(SpawnCategory)default longDeprecated.Deprecated in favor ofgetTicksPerSpawns(SpawnCategory)default longDeprecated.Deprecated in favor ofgetTicksPerSpawns(SpawnCategory)intlonggetTime()Gets the relative in-game time of this world.intReturns the view distance used for this world.floatGets the damage applied to the entities when they are in the void in this world.doubleGets the offset applied toWorldInfo.getMinHeight()to determine the height at which void damage starts to apply.default intDeprecated.Deprecated in favor ofgetSpawnLimit(SpawnCategory)default intDeprecated.Deprecated in favor ofgetSpawnLimit(SpawnCategory)default intDeprecated.Deprecated in favor ofgetSpawnLimit(SpawnCategory)intGet the remaining time in ticks of the current conditions.Gets the world border for this world.Gets the folder of this world on disk.Gets the path of this world on disk.Deprecated.world type is only used to select the default word generation settings and is not stored in Vanilla worlds, making it impossible for this method to always return the correct value.booleanChecks if the bonus chest is enabled.booleanGets if this world has a ceiling.booleanhasRaids()Gets if players with the bad omen effect in this world will trigger a raid.booleanGets if this world has skylight access.booleanhasStorm()Returns whether the world has an ongoing storm.booleanhasStructureAt(@NotNull Position position, @NotNull Structure structure) Check if the naturally-generated structure exists at the position.booleanGets whether or not the world will automatically savebooleanGets if beds work in this world.booleanisChunkForceLoaded(int x, int z) Gets whether the chunk at the specified chunk coordinates is force loaded.booleanisChunkGenerated(int x, int z) Checks if theChunkat the specified coordinates is generateddefault booleanisChunkGenerated(long chunkKey) Checks if aChunkhas been generated at the specified chunk key, which is the X and Z packed into a long.booleanisChunkInUse(int x, int z) Deprecated.This method was added to facilitate chunk garbage collection.booleanisChunkLoaded(int x, int z) Checks if theChunkat the specified coordinates is loadedbooleanisChunkLoaded(@NotNull Chunk chunk) Checks if the specifiedChunkis loadedbooleanReturns whether the world has clear weather.booleanCheck if it is currently daytime in this worldbooleanChecks if this world has a fixed timebooleanisGameRule(@NotNull String rule) Checks if string is a valid game rulebooleanGets whether the world is hardcore or not.booleanGets if this world is natural.booleanGets if this world allow to piglins to survive without shaking and transforming to zombified piglins.default booleanisPositionLoaded(@NotNull Position position) Checks if this position is loaded.booleanGets if this world allows players to charge and use respawn anchors.booleanReturns whether there is thunder.booleanGets if various water/lava mechanics will be triggered in this world, eg:
 Water is evaporated Sponges dry Lava spreads faster and furtherbooleanChecks if void damage is enabled on this world.default voidloadChunk(int x, int z) Loads theChunkat the specified coordinates.booleanloadChunk(int x, int z, boolean generate) Loads theChunkat the specified coordinates.voidLoads the specifiedChunk.locateNearestBiome(@NotNull Location origin, int radius, int horizontalInterval, int verticalInterval, @NotNull Biome... biomes) Find the closest nearby location with a biome matching the providedBiome(s).default @Nullable BiomeSearchResultlocateNearestBiome(@NotNull Location origin, int radius, @NotNull Biome... biomes) Find the closest nearby location with a biome matching the providedBiome(s).locateNearestBiome(@NotNull Location origin, @NotNull Biome biome, int radius) Deprecated.locateNearestBiome(@NotNull Location origin, @NotNull Biome biome, int radius, int step) Deprecated.locateNearestRaid(@NotNull Location location, int radius) Finds the nearest raid close to the given location.locateNearestStructure(@NotNull Location origin, @NotNull Structure structure, int radius, boolean findUnexplored) Find the closest nearby structure of a givenStructure.locateNearestStructure(@NotNull Location origin, @NotNull StructureType structureType, int radius, boolean findUnexplored) Find the closest nearby structure of a givenStructureType.locateNearestStructure(@NotNull Location origin, StructureType structureType, int radius, boolean findUnexplored) default voidplayEffect(@NotNull Location location, @NotNull Effect effect, int data) Plays an effect to all players within a default radius around a given location.voidplayEffect(@NotNull Location location, @NotNull Effect effect, int data, int radius) Plays an effect to all players within a given radius around a location.default <T> voidplayEffect(@NotNull Location location, @NotNull Effect effect, T data) Plays an effect to all players within a default radius around a given location.<T> voidplayEffect(@NotNull Location location, @NotNull Effect effect, T data, int radius) Plays an effect to all players within a given radius around a location.default voidPlay a note at the provided Location in the World.default voidPlay a Sound at the provided Location in the World.voidplaySound(@NotNull Location location, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch) Play a Sound at the provided Location in the World.voidplaySound(@NotNull Location location, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch, long seed) Play a Sound at the provided Location in the World.default voidPlay a Sound at the provided Location in the World.voidplaySound(@NotNull Location location, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch) Play a Sound at the provided Location in the World.voidplaySound(@NotNull Location location, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch, long seed) Play a Sound at the provided Location in the World.default voidPlay a Sound at the location of the provided entity in the World.voidplaySound(@NotNull Entity entity, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch) Play a Sound at the location of the provided entity in the World.voidplaySound(@NotNull Entity entity, @NotNull String sound, @NotNull SoundCategory category, float volume, float pitch, long seed) Play a Sound at the location of the provided entity in the World.default voidPlay a Sound at the location of the provided entity in the World.voidplaySound(@NotNull Entity entity, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch) Play a Sound at the location of the provided entity in the World.voidplaySound(@NotNull Entity entity, @NotNull Sound sound, @NotNull SoundCategory category, float volume, float pitch, long seed) Play a Sound at the location of the provided entity in the World.rayTrace(@NotNull Position start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, @Nullable Predicate<? super Entity> filter, @Nullable Predicate<? super Block> canCollide) Performs a ray trace that checks for both block and entity collisions.rayTrace(@NotNull Consumer<PositionedRayTraceConfigurationBuilder> builderConsumer) Performs a ray trace that checks for collisions with the specified targets.default @Nullable RayTraceResultrayTrace(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, @Nullable Predicate<? super Entity> filter) Performs a ray trace that checks for both block and entity collisions.rayTraceBlocks(@NotNull Position start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, @Nullable Predicate<? super Block> canCollide) Performs a ray trace that checks for block collisions using the blocks' precise collision shapes.default @Nullable RayTraceResultrayTraceBlocks(@NotNull Location start, @NotNull Vector direction, double maxDistance) Performs a ray trace that checks for block collisions using the blocks' precise collision shapes.default @Nullable RayTraceResultrayTraceBlocks(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode) Performs a ray trace that checks for block collisions using the blocks' precise collision shapes.default @Nullable RayTraceResultrayTraceBlocks(@NotNull Location start, @NotNull Vector direction, double maxDistance, @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks) Performs a ray trace that checks for block collisions using the blocks' precise collision shapes.rayTraceEntities(@NotNull Position start, @NotNull Vector direction, double maxDistance, double raySize, @Nullable Predicate<? super Entity> filter) Performs a ray trace that checks for entity collisions.default @Nullable RayTraceResultrayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance) Performs a ray trace that checks for entity collisions.default @Nullable RayTraceResultrayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, double raySize) Performs a ray trace that checks for entity collisions.default @Nullable RayTraceResultrayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, double raySize, @Nullable Predicate<? super Entity> filter) Performs a ray trace that checks for entity collisions.default @Nullable RayTraceResultrayTraceEntities(@NotNull Location start, @NotNull Vector direction, double maxDistance, @Nullable Predicate<? super Entity> filter) Performs a ray trace that checks for entity collisions.booleanrefreshChunk(int x, int z) Resends theChunkto all clientsdefault booleanregenerateChunk(int x, int z) Deprecated, for removal: This API element is subject to removal in a future version.regenerating a single chunk is not likely to produce the same chunk as before as terrain decoration may be spread across chunks.booleanremovePluginChunkTicket(int x, int z, @NotNull Plugin plugin) Removes the specified plugin's ticket for the specified chunkvoidremovePluginChunkTickets(@NotNull Plugin plugin) Removes all plugin tickets for the specified plugindefault voidsave()Saves the world to diskvoidsave(boolean flush) Saves the world to diskvoidsendBlockHighlight(@NotNull Location location, int duration) Creates debug block highlight on specified block location and show it to all players on this world.voidsendBlockHighlight(@NotNull Location location, int duration, int argb) Creates debug block highlight on specified block location and show it to all players on this world.voidsendBlockHighlight(@NotNull Location location, int duration, @NotNull String text) Creates debug block highlight on specified block location and show it to all players on this world.voidsendBlockHighlight(@NotNull Location location, int duration, @NotNull String text, int argb) Creates debug block highlight on specified block location and show it to all players on this world.voidsendBlockHighlight(@NotNull Location location, int duration, @NotNull String text, Color color, int transparency) Creates debug block highlight on specified block location and show it to all players on this world.voidsendBlockHighlight(@NotNull Location location, int duration, Color color, int transparency) Creates debug block highlight on specified block location and show it to all players on this world.voidsendGameEvent(@Nullable Entity sourceEntity, @NotNull GameEvent gameEvent, @NotNull Vector position) Posts a specified game event at a locationdefault voidsetAmbientSpawnLimit(int limit) Deprecated.Deprecated in favor ofsetSpawnLimit(SpawnCategory, int)default voidsetAnimalSpawnLimit(int limit) Deprecated.Deprecated in favor ofgetSpawnLimit(SpawnCategory)voidsetAutoSave(boolean value) Sets whether or not the world will automatically savevoidDeprecated.biomes are now 3-dimensionalvoidsetChunkForceLoaded(int x, int z, boolean forced) Sets whether the chunk at the specified chunk coordinates is force loaded.voidsetClearWeatherDuration(int duration) Set the clear weather duration.voidsetDifficulty(@NotNull Difficulty difficulty) Sets the Difficulty of the world.voidsetFullTime(long time) Sets the in-game time on the server<T> booleansetGameRule(@NotNull GameRule<T> rule, T newValue) Set the givenGameRule's new value.booleansetGameRuleValue(@NotNull String rule, @NotNull String value) Deprecated.usesetGameRule(GameRule, Object)instead.voidsetHardcore(boolean hardcore) Sets whether the world is hardcore or not.default voidsetKeepSpawnInMemory(boolean keepLoaded) Deprecated, for removal: This API element is subject to removal in a future version.No longer functional since 1.21.9, the vanilla server does not have the concept of spawn chunks anymore.default voidsetMonsterSpawnLimit(int limit) Deprecated.Deprecated in favor ofsetSpawnLimit(SpawnCategory, int)default voidsetNoTickViewDistance(int viewDistance) Deprecated.voidsetPVP(boolean pvp) Deprecated.useGameRule.PVPinsteadvoidsetSendViewDistance(int viewDistance) Sets the sending view distance for this world.voidsetSimulationDistance(int simulationDistance) Sets the simulation distance for this world.voidsetSpawnFlags(boolean allowMonsters, boolean allowAnimals) Sets the spawn flags for this.voidsetSpawnLimit(@NotNull SpawnCategory spawnCategory, int limit) Sets the limit for number ofSpawnCategoryentities that can spawn in a chunk in this worlddefault booleansetSpawnLocation(int x, int y, int z) Sets the spawn location of the worldbooleansetSpawnLocation(int x, int y, int z, float yaw) Sets the spawn location of the worldbooleansetSpawnLocation(@NotNull Location location) Sets the spawn location of the world.voidsetStorm(boolean hasStorm) Set whether there is a storm.voidsetThunderDuration(int duration) Set the thundering duration.voidsetThundering(boolean thundering) Set whether it is thundering.default voidsetTicksPerAmbientSpawns(int ticksPerAmbientSpawns) Deprecated.Deprecated in favor ofsetTicksPerSpawns(SpawnCategory, int)default voidsetTicksPerAnimalSpawns(int ticksPerAnimalSpawns) Deprecated.Deprecated in favor ofsetTicksPerSpawns(SpawnCategory, int)default voidsetTicksPerMonsterSpawns(int ticksPerMonsterSpawns) Deprecated.Deprecated in favor ofsetTicksPerSpawns(SpawnCategory, int)voidsetTicksPerSpawns(@NotNull SpawnCategory spawnCategory, int ticksPerCategorySpawn) Sets the world's ticks perSpawnCategorymob spawns valuedefault voidsetTicksPerWaterAmbientSpawns(int ticksPerWaterAmbientSpawns) Deprecated.Deprecated in favor ofsetTicksPerSpawns(SpawnCategory, int)default voidsetTicksPerWaterSpawns(int ticksPerWaterSpawns) Deprecated.Deprecated in favor ofsetTicksPerSpawns(SpawnCategory, int)default voidsetTicksPerWaterUndergroundCreatureSpawns(int ticksPerWaterUndergroundCreatureSpawns) Deprecated.Deprecated in favor ofsetTicksPerSpawns(SpawnCategory, int)voidsetTime(long time) Sets the relative in-game time on the server.voidsetViewDistance(int viewDistance) Sets the view distance for this world.voidsetVoidDamageAmount(float voidDamageAmount) Sets the damage applied to the entities when they are in the void in this world.voidsetVoidDamageEnabled(boolean enabled) Sets whether void damage is enabled on this world.voidsetVoidDamageMinBuildHeightOffset(double minBuildHeightOffset) Sets the offset applied toWorldInfo.getMinHeight()to determine the height at which void damage starts to apply.default voidsetWaterAmbientSpawnLimit(int limit) Deprecated.Deprecated in favor ofsetSpawnLimit(SpawnCategory, int)default voidsetWaterAnimalSpawnLimit(int limit) Deprecated.Deprecated in favor ofsetSpawnLimit(SpawnCategory, int)default voidsetWaterUndergroundCreatureSpawnLimit(int limit) Deprecated.Deprecated in favor ofsetSpawnLimit(SpawnCategory, int)voidsetWeatherDuration(int duration) Set the remaining time in ticks of the current conditions.<T extends LivingEntity>
 Tspawn(@NotNull Location location, @NotNull Class<T> clazz, CreatureSpawnEvent.SpawnReason spawnReason, boolean randomizeData, @Nullable Consumer<? super T> function) Creates a new entity at the givenLocationwith the supplied function run before the entity is added to the world.spawnArrow(@NotNull Location location, @NotNull Vector direction, float speed, float spread) <T extends AbstractArrow>
 TspawnArrow(@NotNull Location location, @NotNull Vector direction, float speed, float spread, @NotNull Class<T> clazz) Creates an arrow entity of the given class at the givenLocationspawnFallingBlock(@NotNull Location location, @NotNull Material material, byte data) Deprecated, for removal: This API element is subject to removal in a future version.Magic value.spawnFallingBlock(@NotNull Location location, @NotNull BlockData data) Deprecated.UseRegionAccessor.spawn(Location, Class, Consumer)(or a variation thereof) in combination withFallingBlock.setBlockData(BlockData)spawnFallingBlock(@NotNull Location location, @NotNull MaterialData data) Deprecated, for removal: This API element is subject to removal in a future version.UseRegionAccessor.spawn(Location, Class, Consumer)(or a variation thereof) in combination withFallingBlock.setBlockData(BlockData)default voidspawnParticle(@NotNull Particle particle, double x, double y, double z, int count) Spawns the particle (the number of times specified by count) at the target location.default voidspawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ) Spawns the particle (the number of times specified by count) at the target location.default voidspawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra) Spawns the particle (the number of times specified by count) at the target location.default <T> voidspawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) Spawns the particle (the number of times specified by count) at the target location.default <T> voidspawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) Spawns the particle (the number of times specified by count) at the target location.default <T> voidspawnParticle(@NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data) Spawns the particle (the number of times specified by count) at the target location.default <T> voidspawnParticle(@NotNull Particle particle, double x, double y, double z, int count, T data) Spawns the particle (the number of times specified by count) at the target location.default <T> voidspawnParticle(@NotNull Particle particle, @Nullable List<Player> receivers, @NotNull Player source, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) Spawns the particle (the number of times specified by count) at the target location.<T> voidspawnParticle(@NotNull Particle particle, @Nullable List<Player> receivers, @Nullable Player source, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) Spawns the particle (the number of times specified by count) at the target location.default voidspawnParticle(@NotNull Particle particle, @NotNull Location location, int count) Spawns the particle (the number of times specified by count) at the target location.default voidspawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ) Spawns the particle (the number of times specified by count) at the target location.default voidspawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra) Spawns the particle (the number of times specified by count) at the target location.default <T> voidspawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) Spawns the particle (the number of times specified by count) at the target location.default <T> voidspawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) Spawns the particle (the number of times specified by count) at the target location.default <T> voidspawnParticle(@NotNull Particle particle, @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, T data) Spawns the particle (the number of times specified by count) at the target location.default <T> voidspawnParticle(@NotNull Particle particle, @NotNull Location location, int count, T data) Spawns the particle (the number of times specified by count) at the target location.spigot()Deprecated.Unsupported apiStrikes lightning at the givenLocationStrikes lightning at the givenLocationwithout doing damagedefault booleanunloadChunk(int x, int z) Safely unloads and saves theChunkat the specified coordinatesbooleanunloadChunk(int x, int z, boolean save) Safely unloads and optionally saves theChunkat the specified coordinates.default booleanunloadChunk(@NotNull Chunk chunk) Safely unloads and saves theChunkat the specified coordinatesbooleanunloadChunkRequest(int x, int z) Safely queues theChunkat the specified coordinates for unloading.Methods inherited from interface net.kyori.adventure.audience.AudiencedeleteMessage, openBook, removeResourcePacks, removeResourcePacks, removeResourcePacks, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendResourcePacks, sendResourcePacks, showTitle, stopSoundMethods inherited from interface io.papermc.paper.world.flag.FeatureFlagSetHolderisEnabledMethods inherited from interface net.kyori.adventure.audience.ForwardingAudienceclearResourcePacks, clearTitle, closeDialog, deleteMessage, filterAudience, forEachAudience, hideBossBar, openBook, playSound, playSound, playSound, pointers, removeResourcePacks, removeResourcePacks, resetTitle, sendActionBar, sendMessage, sendMessage, sendMessage, sendMessage, sendMessage, sendPlayerListFooter, sendPlayerListHeader, sendPlayerListHeaderAndFooter, sendResourcePacks, sendTitlePart, showBossBar, showDialog, stopSoundMethods inherited from interface org.bukkit.metadata.MetadatablegetMetadata, hasMetadata, removeMetadata, setMetadataMethods inherited from interface org.bukkit.persistence.PersistentDataHoldergetPersistentDataContainerMethods inherited from interface org.bukkit.plugin.messaging.PluginMessageRecipientgetListeningPluginChannels, sendPluginMessageMethods inherited from interface net.kyori.adventure.pointer.Pointeredget, getOrDefault, getOrDefaultFromMethods inherited from interface org.bukkit.RegionAccessoraddEntity, createEntity, generateTree, generateTree, generateTree, getBiome, getBiome, getBlockData, getBlockData, getBlockState, getBlockState, getComputedBiome, getFluidData, getFluidData, getFluidData, getHighestBlockYAt, getHighestBlockYAt, getHighestBlockYAt, getHighestBlockYAt, getKey, getMoonPhase, getType, getType, hasCollisionsIn, lineOfSightExists, setBiome, setBiome, setBlockData, setBlockData, setType, setType, spawn, spawn, spawn, spawn, spawn, spawn, spawnEntity, spawnEntity, spawnEntity, spawnEntityMethods inherited from interface org.bukkit.generator.WorldInfogetEnvironment, getMaxHeight, getMinHeight, getName, getSeed, getUID, vanillaBiomeProvider
- 
Method Details- 
isVoidDamageEnabledboolean isVoidDamageEnabled()Checks if void damage is enabled on this world.- Returns:
- true if enabled
 
- 
setVoidDamageEnabledvoid setVoidDamageEnabled(boolean enabled) Sets whether void damage is enabled on this world.- Parameters:
- enabled- true to enable void damage
 
- 
getVoidDamageAmountfloat getVoidDamageAmount()Gets the damage applied to the entities when they are in the void in this world. CheckisVoidDamageEnabled()to see if void damage is enabled.- Returns:
- amount of damage to apply
- See Also:
 
- 
setVoidDamageAmountvoid setVoidDamageAmount(float voidDamageAmount) Sets the damage applied to the entities when they are in the void in this world. CheckisVoidDamageEnabled()to see if void damage is enabled.- Parameters:
- voidDamageAmount- amount of damage to apply
 
- 
getVoidDamageMinBuildHeightOffsetdouble getVoidDamageMinBuildHeightOffset()Gets the offset applied toWorldInfo.getMinHeight()to determine the height at which void damage starts to apply.- Returns:
- offset from min build height
- See Also:
 
- 
setVoidDamageMinBuildHeightOffsetvoid setVoidDamageMinBuildHeightOffset(double minBuildHeightOffset) Sets the offset applied toWorldInfo.getMinHeight()to determine the height at which void damage starts to apply.- Parameters:
- minBuildHeightOffset- offset from min build height
 
- 
getEntityCountint getEntityCount()- Returns:
- The amount of entities in this world
 
- 
getTileEntityCountint getTileEntityCount()- Returns:
- The amount of block entities in this world
 
- 
getTickableTileEntityCountint getTickableTileEntityCount()- Returns:
- The amount of tickable block entities in this world
 
- 
getChunkCountint getChunkCount()- Returns:
- The amount of chunks in this world
 
- 
getPlayerCountint getPlayerCount()- Returns:
- The amount of players in this world
 
- 
hasStructureAtCheck if the naturally-generated structure exists at the position.Note that if the position is not loaded, this may cause chunk loads/generation to check if a structure is at that position. Use isPositionLoaded(io.papermc.paper.math.Position)to check if a position is loaded- Parameters:
- position- the position to check at
- structure- the structure to check for
- Returns:
- true if that structure exists at the position
 
- 
isPositionLoadedChecks if this position is loaded.- Parameters:
- position- position to check
- Returns:
- true if loaded
 
- 
getBlockAtGets theBlockat the given coordinates- Parameters:
- x- X-coordinate of the block
- y- Y-coordinate of the block
- z- Z-coordinate of the block
- Returns:
- Block at the given coordinates
 
- 
getBlockAt- Parameters:
- location- Location of the block
- Returns:
- Block at the given location
 
- 
getBlockAtKeyDeprecated.only encodes y block ranges from -512 to 511 and represents an already changed implementation detailGets theBlockat the given block key- Parameters:
- key- The block key. See- Block.getBlockKey()
- Returns:
- Block at the key
- See Also:
 
- 
getLocationAtKeyDeprecated.Gets theLocationat the given block key- Parameters:
- key- The block key. See- Location.toBlockKey()
- Returns:
- Location at the key
- See Also:
 
- 
getHighestBlockAtGets the highest non-empty (impassable) block at the given coordinates.- Parameters:
- x- X-coordinate of the block
- z- Z-coordinate of the block
- Returns:
- Highest non-empty block
 
- 
getHighestBlockAtGets the highest non-empty (impassable) block at the given coordinates.- Parameters:
- location- Coordinates to get the highest block
- Returns:
- Highest non-empty block
 
- 
getHighestBlockAt@NotNull default @NotNull Block getHighestBlockAt(int x, int z, @NotNull @NotNull HeightMap heightMap) Gets the highest block corresponding to theHeightMapat the given coordinates.- Parameters:
- x- X-coordinate of the block
- z- Z-coordinate of the block
- heightMap- the heightMap that is used to determine the highest point
- Returns:
- Highest block corresponding to the HeightMap
 
- 
getHighestBlockAt@NotNull default @NotNull Block getHighestBlockAt(@NotNull @NotNull Location location, @NotNull @NotNull HeightMap heightMap) Gets the highest block corresponding to theHeightMapat the given coordinates.- Parameters:
- location- Coordinates to get the highest block
- heightMap- the heightMap that is used to determine the highest point
- Returns:
- Highest block corresponding to the HeightMap
 
- 
getChunkAtGets theChunkat the given coordinates- Parameters:
- x- X-coordinate of the chunk
- z- Z-coordinate of the chunk
- Returns:
- Chunk at the given coordinates
 
- 
getChunkAtGets theChunkat the given coordinates- Parameters:
- x- X-coordinate of the chunk
- z- Z-coordinate of the chunk
- generate- Whether the chunk should be fully generated or not
- Returns:
- Chunk at the given coordinates
 
- 
getChunkAt- Parameters:
- location- Location of the chunk
- Returns:
- Chunk at the given location
 
- 
getChunkAt- Parameters:
- block- Block to get the containing chunk from
- Returns:
- The chunk that contains the given block
 
- 
getChunkAtGets the chunk at the specified chunk key, which is the X and Z packed into a long.See Chunk.getChunkKey()for easy access to the key, or you may calculate it as: long chunkKey = (long) chunkX & 0xffffffffL | ((long) chunkZ & 0xffffffffL) >> 32;- Parameters:
- chunkKey- The Chunk Key to look up the chunk by
- Returns:
- The chunk at the specified key
 
- 
getChunkAtGets the chunk at the specified chunk key, which is the X and Z packed into a long.See Chunk.getChunkKey()for easy access to the key, or you may calculate it as: long chunkKey = (long) chunkX & 0xffffffffL | ((long) chunkZ & 0xffffffffL) >> 32;- Parameters:
- chunkKey- The Chunk Key to look up the chunk by
- generate- Whether the chunk should be fully generated or not
- Returns:
- The chunk at the specified key
 
- 
isChunkGenerateddefault boolean isChunkGenerated(long chunkKey) Checks if aChunkhas been generated at the specified chunk key, which is the X and Z packed into a long.- Parameters:
- chunkKey- The Chunk Key to look up the chunk by
- Returns:
- true if the chunk has been generated, otherwise false
 
- 
isChunkLoadedChecks if the specifiedChunkis loaded- Parameters:
- chunk- The chunk to check
- Returns:
- true if the chunk is loaded, otherwise false
 
- 
getLoadedChunksGets an array of all loadedChunks- Returns:
- Chunk[] containing all loaded chunks
 
- 
loadChunkLoads the specifiedChunk.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. - Parameters:
- chunk- The chunk to load
 
- 
isChunkLoadedboolean isChunkLoaded(int x, int z) Checks if theChunkat the specified coordinates is loaded- Parameters:
- x- X-coordinate of the chunk
- z- Z-coordinate of the chunk
- Returns:
- true if the chunk is loaded, otherwise false
 
- 
isChunkGeneratedboolean isChunkGenerated(int x, int z) Checks if theChunkat the specified coordinates is generated- Parameters:
- x- X-coordinate of the chunk
- z- Z-coordinate of the chunk
- Returns:
- true if the chunk is generated, otherwise false
 
- 
isChunkInUseDeprecated.This method was added to facilitate chunk garbage collection. As of the current Minecraft version chunks are now strictly managed and will not be loaded for more than 1 tick unless they are in use.Checks if theChunkat the specified coordinates is loaded and in use by one or more players- Parameters:
- x- X-coordinate of the chunk
- z- Z-coordinate of the chunk
- Returns:
- true if the chunk is loaded and in use by one or more players, otherwise false
 
- 
loadChunkdefault void loadChunk(int x, int z) Loads theChunkat 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.- Parameters:
- x- X-coordinate of the chunk
- z- Z-coordinate of the chunk
 
- 
loadChunkboolean loadChunk(int x, int z, boolean generate) Loads theChunkat 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. - Parameters:
- x- X-coordinate of the chunk
- z- Z-coordinate of the chunk
- generate- Whether or not to generate a chunk if it doesn't already exist
- Returns:
- true if the chunk has loaded successfully, otherwise false
 
- 
unloadChunkSafely unloads and saves theChunkat the specified coordinatesThis method is analogous to unloadChunk(int, int, boolean)where save is true.- Parameters:
- chunk- the chunk to unload
- Returns:
- true if the chunk has unloaded successfully, otherwise false
 
- 
unloadChunkdefault boolean unloadChunk(int x, int z) Safely unloads and saves theChunkat the specified coordinatesThis method is analogous to unloadChunk(int, int, boolean)where save is true.- Parameters:
- x- X-coordinate of the chunk
- z- Z-coordinate of the chunk
- Returns:
- true if the chunk has unloaded successfully, otherwise false
 
- 
unloadChunkboolean unloadChunk(int x, int z, boolean save) Safely unloads and optionally saves theChunkat the specified coordinates.- Parameters:
- x- X-coordinate of the chunk
- z- Z-coordinate of the chunk
- save- Whether or not to save the chunk
- Returns:
- true if the chunk has unloaded successfully, otherwise false
 
- 
unloadChunkRequestboolean unloadChunkRequest(int x, int z) Safely queues theChunkat the specified coordinates for unloading.- Parameters:
- x- X-coordinate of the chunk
- z- Z-coordinate of the chunk
- Returns:
- true is the queue attempt was successful, otherwise false
 
- 
regenerateChunkDeprecated, for removal: This API element is subject to removal in a future version.regenerating a single chunk is not likely to produce the same chunk as before as terrain decoration may be spread across chunks. It may or may not change blocks in the adjacent chunks as well.Regenerates theChunkat the specified coordinates- Parameters:
- x- X-coordinate of the chunk
- z- Z-coordinate of the chunk
- Returns:
- Whether the chunk was actually regenerated
- Throws:
- UnsupportedOperationException- not implemented
 
- 
refreshChunkboolean refreshChunk(int x, int z) Resends theChunkto all clients- Parameters:
- x- X-coordinate of the chunk
- z- Z-coordinate of the chunk
- Returns:
- Whether the chunk was actually refreshed
 
- 
getPlayersSeeingChunkGet a list of all players who are can view the specified chunk from their clientThis list will be empty if no players are viewing the chunk, or the chunk is unloaded. - Parameters:
- chunk- the chunk to check
- Returns:
- collection of players who can see the chunk
 
- 
getPlayersSeeingChunkGet a list of all players who are can view the specified chunk from their clientThis list will be empty if no players are viewing the chunk, or the chunk is unloaded. - Parameters:
- x- X-coordinate of the chunk
- z- Z-coordinate of the chunk
- Returns:
- collection of players who can see the chunk
 
- 
isChunkForceLoadedboolean 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. - Parameters:
- x- X-coordinate of the chunk
- z- Z-coordinate of the chunk
- Returns:
- force load status
 
- 
setChunkForceLoadedvoid 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. - Parameters:
- x- X-coordinate of the chunk
- z- Z-coordinate of the chunk
- forced- force load status
 
- 
getForceLoadedChunksReturns all force loaded chunks in this world.A force loaded chunk will not be unloaded due to lack of player activity. - Returns:
- unmodifiable collection of force loaded chunks
 
- 
addPluginChunkTicketAdds 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. - Parameters:
- x- X-coordinate of the chunk
- z- Z-coordinate of the chunk
- plugin- Plugin which owns the ticket
- Returns:
- trueif a plugin ticket was added,- falseif the ticket already exists for the plugin
- Throws:
- IllegalStateException- If the specified plugin is not enabled
- See Also:
 
- 
removePluginChunkTicketRemoves the specified plugin's ticket for the specified chunkA 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. - Parameters:
- x- X-coordinate of the chunk
- z- Z-coordinate of the chunk
- plugin- Plugin which owns the ticket
- Returns:
- trueif the plugin ticket was removed,- falseif there is no plugin ticket for the chunk
- See Also:
 
- 
removePluginChunkTicketsRemoves all plugin tickets for the specified pluginA 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. - Parameters:
- plugin- Specified plugin
- See Also:
 
- 
getPluginChunkTicketsRetrieves 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. - Parameters:
- x- X-coordinate of the chunk
- z- Z-coordinate of the chunk
- Returns:
- unmodifiable collection containing which plugins have tickets for the chunk
- See Also:
 
- 
getPluginChunkTicketsReturns 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. - Returns:
- unmodifiable map containing which plugins have tickets for what chunks
- See Also:
 
- 
getIntersectingChunksGets all Chunks intersecting the given BoundingBox.- Parameters:
- box- BoundingBox to check
- Returns:
- A collection of Chunks intersecting the given BoundingBox
 
- 
dropItem@NotNull default @NotNull Item dropItem(@NotNull @NotNull Location location, @NotNull @NotNull ItemStack item) Drops an item at the specifiedLocation- Parameters:
- location- Location to drop the item
- item- ItemStack to drop
- Returns:
- ItemDrop entity created as a result of this method
 
- 
dropItem@NotNull @NotNull Item dropItem(@NotNull @NotNull Location location, @NotNull @NotNull ItemStack item, @Nullable @Nullable Consumer<? super Item> function) Drops an item at the specifiedLocationNote that functions will run before the entity is spawned- Parameters:
- location- Location to drop the item
- item- ItemStack to drop
- function- the function to be run before the entity is spawned.
- Returns:
- ItemDrop entity created as a result of this method
 
- 
dropItemNaturally@NotNull default @NotNull Item dropItemNaturally(@NotNull @NotNull Location location, @NotNull @NotNull ItemStack item) Drops an item at the specifiedLocationwith a random offset- Parameters:
- location- Location to drop the item
- item- ItemStack to drop
- Returns:
- ItemDrop entity created as a result of this method
 
- 
dropItemNaturally@NotNull @NotNull Item dropItemNaturally(@NotNull @NotNull Location location, @NotNull @NotNull ItemStack item, @Nullable @Nullable Consumer<? super Item> function) Drops an item at the specifiedLocationwith a random offset Note that functions will run before the entity is spawned- Parameters:
- location- Location to drop the item
- item- ItemStack to drop
- function- the function to be run before the entity is spawned.
- Returns:
- ItemDrop entity created as a result of this method
 
- 
spawnArrow@NotNull default @NotNull Arrow spawnArrow(@NotNull @NotNull Location location, @NotNull @NotNull Vector direction, float speed, float spread) - Parameters:
- location- Location to spawn the arrow
- direction- Direction to shoot the arrow in
- speed- Speed of the arrow. A recommend speed is 0.6
- spread- Spread of the arrow. A recommend spread is 12
- Returns:
- Arrow entity spawned as a result of this method
 
- 
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 givenLocation- Type Parameters:
- T- type of arrow to spawn
- Parameters:
- location- Location to spawn the arrow
- direction- Direction to shoot the arrow in
- speed- Speed of the arrow. A recommend speed is 0.6
- spread- Spread of the arrow. A recommend spread is 12
- clazz- the Entity class for the arrow- SpectralArrow,- Arrow,- TippedArrow
- Returns:
- Arrow entity spawned as a result of this method
 
- 
generateTree@Deprecated(since="1.21.6") boolean generateTree(@NotNull @NotNull Location location, @NotNull @NotNull TreeType type) Deprecated.in favor ofRegionAccessor.generateTree(Location, java.util.Random, TreeType)to specify its own random instance and this method is not accessible throughRegionAccessorCreates a tree at the givenLocation- Parameters:
- location- Location to spawn the tree
- type- Type of the tree to create
- Returns:
- true if the tree was created successfully, otherwise false
 
- 
generateTree@Deprecated(since="1.17.1") boolean generateTree(@NotNull @NotNull Location loc, @NotNull @NotNull TreeType type, @NotNull @NotNull BlockChangeDelegate delegate) Deprecated.this method does not handle block entities (bee nests)Creates a tree at the givenLocation- Parameters:
- loc- Location to spawn the tree
- type- Type of the tree to create
- delegate- A class to call for each block changed as a result of this method
- Returns:
- true if the tree was created successfully, otherwise false
- See Also:
 
- 
strikeLightningStrikes lightning at the givenLocation- Parameters:
- loc- The location to strike lightning
- Returns:
- The lightning entity.
 
- 
strikeLightningEffectStrikes lightning at the givenLocationwithout doing damage- Parameters:
- loc- The location to strike lightning
- Returns:
- The lightning entity.
 
- 
findLightningRodFinds the location of the nearest unobstructed Lightning Rod in a 128-block radius around the given location. Returnsnullif no Lightning Rod is found.Note: To activate a Lightning Rod, the position one block above it must be struck by lightning. 
- 
findLightningTargetFinds a targetLocationfor lightning to strike.It selects from (in the following order): - the block above the nearest Lightning Rod, found using findLightningRod(Location)
- a random LivingEntitythat can see the sky in a 6x6 cuboid around input X/Z coordinates. Y ranges from the highest motion-blocking block at the input X/Z - 3 to the height limit + 3
 Returns nullif no target is found.- Parameters:
- location-- Locationto search for target around
- Returns:
- lightning target or null
 
- the block above the nearest Lightning Rod, found using 
- 
getEntitiesGet a list of all entities in this World- Specified by:
- getEntitiesin interface- RegionAccessor
- Returns:
- A List of all Entities currently residing in this world
 
- 
getLivingEntitiesGet a list of all living entities in this World- Specified by:
- getLivingEntitiesin interface- RegionAccessor
- Returns:
- A List of all LivingEntities currently residing in this world
 
- 
getEntitiesByClass@Deprecated(since="1.1") @NotNull <T extends Entity> @NotNull Collection<T> getEntitiesByClass(@NotNull @NotNull Class<T>... classes) Deprecated.Get a collection of all entities in this World matching the given class/interface- Type Parameters:
- T- an entity subclass
- Parameters:
- classes- The classes representing the types of entity to match
- Returns:
- A List of all Entities currently residing in this world that match the given class/interface
 
- 
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- Specified by:
- getEntitiesByClassin interface- RegionAccessor
- Type Parameters:
- T- an entity subclass
- Parameters:
- cls- The class representing the type of entity to match
- Returns:
- A List of all Entities currently residing in this world that match the given class/interface
 
- 
getEntitiesByClassesGet a collection of all entities in this World matching any of the given classes/interfaces- Specified by:
- getEntitiesByClassesin interface- RegionAccessor
- Parameters:
- classes- The classes representing the types of entity to match
- Returns:
- A List of all Entities currently residing in this world that match one or more of the given classes/interfaces
 
- 
getNearbyLivingEntities@NotNull default @NotNull Collection<LivingEntity> getNearbyLivingEntities(@NotNull @NotNull Location loc, double radius) Gets nearby LivingEntities within the specified radius (bounding box)- Parameters:
- loc- Center location
- radius- Radius
- Returns:
- the collection of entities near location. This will always be a non-null collection.
 
- 
getNearbyLivingEntities@NotNull default @NotNull Collection<LivingEntity> getNearbyLivingEntities(@NotNull @NotNull Location loc, double xzRadius, double yRadius) Gets nearby LivingEntities within the specified radius (bounding box)- Parameters:
- loc- Center location
- xzRadius- X/Z Radius
- yRadius- Y Radius
- Returns:
- the collection of entities near location. This will always be a non-null collection.
 
- 
getNearbyLivingEntities@NotNull default @NotNull Collection<LivingEntity> getNearbyLivingEntities(@NotNull @NotNull Location loc, double xRadius, double yRadius, double zRadius) Gets nearby LivingEntities within the specified radius (bounding box)- Parameters:
- loc- Center location
- xRadius- X Radius
- yRadius- Y Radius
- zRadius- Z radius
- Returns:
- the collection of entities near location. This will always be a non-null collection.
 
- 
getNearbyLivingEntities@NotNull default @NotNull Collection<LivingEntity> getNearbyLivingEntities(@NotNull @NotNull Location loc, double radius, @Nullable @Nullable Predicate<? super LivingEntity> predicate) Gets nearby LivingEntities within the specified radius (bounding box)- Parameters:
- loc- Center location
- radius- X Radius
- predicate- a predicate used to filter results
- Returns:
- the collection of living entities near location. This will always be a non-null collection
 
- 
getNearbyLivingEntities@NotNull default @NotNull Collection<LivingEntity> getNearbyLivingEntities(@NotNull @NotNull Location loc, double xzRadius, double yRadius, @Nullable @Nullable Predicate<? super LivingEntity> predicate) Gets nearby LivingEntities within the specified radius (bounding box)- Parameters:
- loc- Center location
- xzRadius- X/Z Radius
- yRadius- Y Radius
- predicate- a predicate used to filter results
- Returns:
- the collection of living entities near location. This will always be a non-null collection
 
- 
getNearbyLivingEntities@NotNull default @NotNull Collection<LivingEntity> getNearbyLivingEntities(@NotNull @NotNull Location loc, double xRadius, double yRadius, double zRadius, @Nullable @Nullable Predicate<? super LivingEntity> predicate) Gets nearby LivingEntities within the specified radius (bounding box)- Parameters:
- loc- Center location
- xRadius- X Radius
- yRadius- Y Radius
- zRadius- Z radius
- predicate- a predicate used to filter results
- Returns:
- the collection of living entities near location. This will always be a non-null collection.
 
- 
getNearbyPlayers@NotNull default @NotNull Collection<Player> getNearbyPlayers(@NotNull @NotNull Location loc, double radius) Gets nearby players within the specified radius (bounding box)- Parameters:
- loc- Center location
- radius- X/Y/Z Radius
- Returns:
- the collection of living entities near location. This will always be a non-null collection.
 
- 
getNearbyPlayers@NotNull default @NotNull Collection<Player> getNearbyPlayers(@NotNull @NotNull Location loc, double xzRadius, double yRadius) Gets nearby players within the specified radius (bounding box)- Parameters:
- loc- Center location
- xzRadius- X/Z Radius
- yRadius- Y Radius
- Returns:
- the collection of living entities near location. This will always be a non-null collection.
 
- 
getNearbyPlayers@NotNull default @NotNull Collection<Player> getNearbyPlayers(@NotNull @NotNull Location loc, double xRadius, double yRadius, double zRadius) Gets nearby players within the specified radius (bounding box)- Parameters:
- loc- Center location
- xRadius- X Radius
- yRadius- Y Radius
- zRadius- Z Radius
- Returns:
- the collection of players near location. This will always be a non-null collection.
 
- 
getNearbyPlayers@NotNull default @NotNull Collection<Player> getNearbyPlayers(@NotNull @NotNull Location loc, double radius, @Nullable @Nullable Predicate<? super Player> predicate) Gets nearby players within the specified radius (bounding box)- Parameters:
- loc- Center location
- radius- X/Y/Z Radius
- predicate- a predicate used to filter results
- Returns:
- the collection of players near location. This will always be a non-null collection.
 
- 
getNearbyPlayers@NotNull default @NotNull Collection<Player> getNearbyPlayers(@NotNull @NotNull Location loc, double xzRadius, double yRadius, @Nullable @Nullable Predicate<? super Player> predicate) Gets nearby players within the specified radius (bounding box)- Parameters:
- loc- Center location
- xzRadius- X/Z Radius
- yRadius- Y Radius
- predicate- a predicate used to filter results
- Returns:
- the collection of players near location. This will always be a non-null collection.
 
- 
getNearbyPlayers@NotNull default @NotNull Collection<Player> getNearbyPlayers(@NotNull @NotNull Location loc, double xRadius, double yRadius, double zRadius, @Nullable @Nullable Predicate<? super Player> predicate) Gets nearby players within the specified radius (bounding box)- Parameters:
- loc- Center location
- xRadius- X Radius
- yRadius- Y Radius
- zRadius- Z Radius
- predicate- a predicate used to filter results
- Returns:
- the collection of players near location. This will always be a non-null collection.
 
- 
getNearbyEntitiesByType@NotNull default <T extends Entity> @NotNull Collection<T> getNearbyEntitiesByType(@Nullable @Nullable Class<? extends T> clazz, @NotNull @NotNull Location loc, double radius) Gets all nearby entities of the specified type, within the specified radius (bounding box)- Type Parameters:
- T- the entity type
- Parameters:
- clazz- Type to filter by
- loc- Center location
- radius- X/Y/Z radius to search within
- Returns:
- the collection of entities near location. This will always be a non-null collection.
 
- 
getNearbyEntitiesByType@NotNull default <T extends Entity> @NotNull Collection<T> getNearbyEntitiesByType(@Nullable @Nullable Class<? extends T> clazz, @NotNull @NotNull Location loc, double xzRadius, double yRadius) Gets all nearby entities of the specified type, within the specified radius, with x and x radius matching (bounding box)- Type Parameters:
- T- the entity type
- Parameters:
- clazz- Type to filter by
- loc- Center location
- xzRadius- X/Z radius to search within
- yRadius- Y radius to search within
- Returns:
- the collection of entities near location. This will always be a non-null collection.
 
- 
getNearbyEntitiesByType@NotNull default <T extends Entity> @NotNull Collection<T> getNearbyEntitiesByType(@Nullable @Nullable Class<? extends T> clazz, @NotNull @NotNull Location loc, double xRadius, double yRadius, double zRadius) Gets all nearby entities of the specified type, within the specified radius (bounding box)- Type Parameters:
- T- the entity type
- Parameters:
- clazz- Type to filter by
- loc- Center location
- xRadius- X Radius
- yRadius- Y Radius
- zRadius- Z Radius
- Returns:
- the collection of entities near location. This will always be a non-null collection.
 
- 
getNearbyEntitiesByType@NotNull default <T extends Entity> @NotNull Collection<T> getNearbyEntitiesByType(@Nullable @Nullable Class<? extends T> clazz, @NotNull @NotNull Location loc, double radius, @Nullable @Nullable Predicate<? super T> predicate) Gets all nearby entities of the specified type, within the specified radius (bounding box)- Type Parameters:
- T- the entity type
- Parameters:
- clazz- Type to filter by
- loc- Center location
- radius- X/Y/Z radius to search within
- predicate- a predicate used to filter results
- Returns:
- the collection of entities near location. This will always be a non-null collection.
 
- 
getNearbyEntitiesByType@NotNull default <T extends Entity> @NotNull Collection<T> getNearbyEntitiesByType(@Nullable @Nullable Class<? extends T> clazz, @NotNull @NotNull Location loc, double xzRadius, double yRadius, @Nullable @Nullable Predicate<? super T> predicate) Gets all nearby entities of the specified type, within the specified radius, with x and x radius matching (bounding box)- Type Parameters:
- T- the entity type
- Parameters:
- clazz- Type to filter by
- loc- Center location
- xzRadius- X/Z radius to search within
- yRadius- Y radius to search within
- predicate- a predicate used to filter results
- Returns:
- the collection of entities near location. This will always be a non-null collection.
 
- 
getNearbyEntitiesByType@NotNull default <T extends Entity> @NotNull Collection<T> getNearbyEntitiesByType(@Nullable @Nullable Class<? extends T> clazz, @NotNull @NotNull Location loc, double xRadius, double yRadius, double zRadius, @Nullable @Nullable Predicate<? super T> predicate) Gets all nearby entities of the specified type, within the specified radius (bounding box)- Type Parameters:
- T- the entity type
- Parameters:
- clazz- Type to filter by
- loc- Center location
- xRadius- X Radius
- yRadius- Y Radius
- zRadius- Z Radius
- predicate- a predicate used to filter results
- Returns:
- the collection of entities near location. This will always be a non-null collection.
 
- 
getChunkAtAsync@Deprecated(since="1.13.1") default void getChunkAtAsync(int x, int z, @NotNull @NotNull World.ChunkLoadCallback cb) Deprecated.Use either the Future or the Consumer based methodsRequests aChunkto be loaded at the given coordinates This method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time. You should use this method if you need a chunk but do not need it immediately, and you wish to let the server control the speed of chunk loads, keeping performance in mind. TheWorld.ChunkLoadCallbackwill always be executed synchronously on the main Server Thread.- Parameters:
- x- Chunk x-coordinate
- z- Chunk z-coordinate
- cb- Callback to receive the chunk when it is loaded. will be executed synchronously
 
- 
getChunkAtAsync@Deprecated(since="1.13.1") default void getChunkAtAsync(@NotNull @NotNull Location loc, @NotNull @NotNull World.ChunkLoadCallback cb) Deprecated.Use either the Future or the Consumer based methodsRequests aChunkto be loaded at the givenLocationThis method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time. You should use this method if you need a chunk but do not need it immediately, and you wish to let the server control the speed of chunk loads, keeping performance in mind. TheWorld.ChunkLoadCallbackwill always be executed synchronously on the main Server Thread.- Parameters:
- loc- Location of the chunk
- cb- Callback to receive the chunk when it is loaded. will be executed synchronously
 
- 
getChunkAtAsync@Deprecated(since="1.13.1") default void getChunkAtAsync(@NotNull @NotNull Block block, @NotNull @NotNull World.ChunkLoadCallback cb) Deprecated.Use either the Future or the Consumer based methodsRequestsChunkto be loaded that contains the givenBlockThis method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time. You should use this method if you need a chunk but do not need it immediately, and you wish to let the server control the speed of chunk loads, keeping performance in mind. TheWorld.ChunkLoadCallbackwill always be executed synchronously on the main Server Thread.- Parameters:
- block- Block to get the containing chunk from
- cb- Callback to receive the chunk when it is loaded. will be executed synchronously
 
- 
getChunkAtAsyncRequests aChunkto be loaded at the given coordinates This method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time. You should use this method if you need a chunk but do not need it immediately, and you wish to let the server control the speed of chunk loads, keeping performance in mind. TheConsumerwill always be executed synchronously on the main Server Thread.- Parameters:
- x- Chunk x-coordinate
- z- Chunk z-coordinate
- cb- Callback to receive the chunk when it is loaded. will be executed synchronously
 
- 
getChunkAtAsyncdefault void getChunkAtAsync(int x, int z, boolean gen, @NotNull @NotNull Consumer<? super Chunk> cb) Requests aChunkto be loaded at the given coordinates This method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time. You should use this method if you need a chunk but do not need it immediately, and you wish to let the server control the speed of chunk loads, keeping performance in mind. TheConsumerwill always be executed synchronously on the main Server Thread.- Parameters:
- x- Chunk x-coordinate
- z- Chunk z-coordinate
- gen- Should we generate a chunk if it doesn't exist or not
- cb- Callback to receive the chunk when it is loaded. will be executed synchronously
 
- 
getChunkAtAsyncvoid getChunkAtAsync(int x, int z, boolean gen, boolean urgent, @NotNull @NotNull Consumer<? super Chunk> cb) Requests aChunkto be loaded at the given coordinates This method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time. You should use this method if you need a chunk but do not need it immediately, and you wish to let the server control the speed of chunk loads, keeping performance in mind. TheConsumerwill always be executed synchronously on the main Server Thread.- Parameters:
- x- Chunk x-coordinate
- z- Chunk z-coordinate
- gen- Should we generate a chunk if it doesn't exist or not
- urgent- If true, the chunk may be prioritised to be loaded above other chunks in queue
- cb- Callback to receive the chunk when it is loaded. will be executed synchronously
 
- 
getChunksAtAsyncvoid getChunksAtAsync(int minX, int minZ, int maxX, int maxZ, boolean urgent, @NotNull @NotNull Runnable cb) Requests all chunks with x between [minX, maxZ] and z between [minZ, maxZ] to be loaded. This method makes no guarantee on how fast the chunk will load, and will invoke the callback at possibly a later time. You should use this method if you need chunks loaded but do not need them immediately, and you wish to let the server control the speed of chunk loads, keeping performance in mind. TheRunnablewill always be executed synchronously on the main Server Thread, and when invoked all chunks requested will be loaded.- Parameters:
- minX- Minimum Chunk x-coordinate
- minZ- Minimum Chunk z-coordinate
- maxX- Maximum Chunk x-coordinate
- maxZ- Maximum Chunk z-coordinate
- urgent- If true, the chunks may be prioritised to be loaded above other chunks in queue
- cb- Callback to invoke when all chunks are loaded. Will be executed synchronously
- See Also:
 
- 
getChunkAtAsyncdefault void getChunkAtAsync(@NotNull @NotNull Location loc, @NotNull @NotNull Consumer<? super Chunk> cb) Requests aChunkto be loaded at the givenLocationThis method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time. You should use this method if you need a chunk but do not need it immediately, and you wish to let the server control the speed of chunk loads, keeping performance in mind. TheConsumerwill always be executed synchronously on the main Server Thread.- Parameters:
- loc- Location of the chunk
- cb- Callback to receive the chunk when it is loaded. will be executed synchronously
 
- 
getChunkAtAsyncdefault void getChunkAtAsync(@NotNull @NotNull Location loc, boolean gen, @NotNull @NotNull Consumer<? super Chunk> cb) Requests aChunkto be loaded at the givenLocationThis method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time. You should use this method if you need a chunk but do not need it immediately, and you wish to let the server control the speed of chunk loads, keeping performance in mind. TheConsumerwill always be executed synchronously on the main Server Thread.- Parameters:
- loc- Location of the chunk
- gen- Should the chunk generate if it doesn't exist
- cb- Callback to receive the chunk when it is loaded. will be executed synchronously
 
- 
getChunkAtAsyncdefault void getChunkAtAsync(@NotNull @NotNull Block block, @NotNull @NotNull Consumer<? super Chunk> cb) RequestsChunkto be loaded that contains the givenBlockThis method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time. You should use this method if you need a chunk but do not need it immediately, and you wish to let the server control the speed of chunk loads, keeping performance in mind. TheConsumerwill always be executed synchronously on the main Server Thread.- Parameters:
- block- Block to get the containing chunk from
- cb- Callback to receive the chunk when it is loaded. will be executed synchronously
 
- 
getChunkAtAsyncdefault void getChunkAtAsync(@NotNull @NotNull Block block, boolean gen, @NotNull @NotNull Consumer<? super Chunk> cb) RequestsChunkto be loaded that contains the givenBlockThis method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time. You should use this method if you need a chunk but do not need it immediately, and you wish to let the server control the speed of chunk loads, keeping performance in mind. TheConsumerwill always be executed synchronously on the main Server Thread.- Parameters:
- block- Block to get the containing chunk from
- gen- Should the chunk generate if it doesn't exist
- cb- Callback to receive the chunk when it is loaded. will be executed synchronously
 
- 
getChunkAtAsyncRequests aChunkto be loaded at the given coordinates This method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time. You should use this method if you need a chunk but do not need it immediately, and you wish to let the server control the speed of chunk loads, keeping performance in mind. The future will always be executed synchronously on the main Server Thread.- Parameters:
- loc- Location to load the corresponding chunk from
- Returns:
- Future that will resolve when the chunk is loaded
 
- 
getChunkAtAsync@NotNull default CompletableFuture<Chunk> getChunkAtAsync(@NotNull @NotNull Location loc, boolean gen) Requests aChunkto be loaded at the given coordinates This method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time. You should use this method if you need a chunk but do not need it immediately, and you wish to let the server control the speed of chunk loads, keeping performance in mind. The future will always be executed synchronously on the main Server Thread.- Parameters:
- loc- Location to load the corresponding chunk from
- gen- Should the chunk generate if it doesn't exist
- Returns:
- Future that will resolve when the chunk is loaded
 
- 
getChunkAtAsyncRequests aChunkto be loaded at the given coordinates This method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time. You should use this method if you need a chunk but do not need it immediately, and you wish to let the server control the speed of chunk loads, keeping performance in mind. The future will always be executed synchronously on the main Server Thread.- Parameters:
- block- Block to load the corresponding chunk from
- Returns:
- Future that will resolve when the chunk is loaded
 
- 
getChunkAtAsync@NotNull default CompletableFuture<Chunk> getChunkAtAsync(@NotNull @NotNull Block block, boolean gen) Requests aChunkto be loaded at the given coordinates This method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time. You should use this method if you need a chunk but do not need it immediately, and you wish to let the server control the speed of chunk loads, keeping performance in mind. The future will always be executed synchronously on the main Server Thread.- Parameters:
- block- Block to load the corresponding chunk from
- gen- Should the chunk generate if it doesn't exist
- Returns:
- Future that will resolve when the chunk is loaded
 
- 
getChunkAtAsyncRequests aChunkto be loaded at the given coordinates This method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time. You should use this method if you need a chunk but do not need it immediately, and you wish to let the server control the speed of chunk loads, keeping performance in mind. The future will always be executed synchronously on the main Server Thread.- Parameters:
- x- Chunk x-coordinate
- z- Chunk z-coordinate
- Returns:
- Future that will resolve when the chunk is loaded
 
- 
getChunkAtAsyncRequests aChunkto be loaded at the given coordinates This method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time. You should use this method if you need a chunk but do not need it immediately, and you wish to let the server control the speed of chunk loads, keeping performance in mind. The future will always be executed synchronously on the main Server Thread.- Parameters:
- x- Chunk x-coordinate
- z- Chunk z-coordinate
- gen- Should we generate a chunk if it doesn't exist or not
- Returns:
- Future that will resolve when the chunk is loaded
 
- 
getChunkAtAsyncUrgentlyRequests aChunkto be loaded at the given coordinatesThis method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time. You should use this method if you need a chunk but do not need it immediately, and you wish for it to be prioritised over other chunk loads in queue. The future will always be executed synchronously on the main Server Thread. - Parameters:
- loc- Location to load the corresponding chunk from
- Returns:
- Future that will resolve when the chunk is loaded
 
- 
getChunkAtAsyncUrgently@NotNull default CompletableFuture<Chunk> getChunkAtAsyncUrgently(@NotNull @NotNull Location loc, boolean gen) Requests aChunkto be loaded at the given coordinatesThis method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time. You should use this method if you need a chunk but do not need it immediately, and you wish for it to be prioritised over other chunk loads in queue. The future will always be executed synchronously on the main Server Thread. - Parameters:
- loc- Location to load the corresponding chunk from
- gen- Should the chunk generate if it doesn't exist
- Returns:
- Future that will resolve when the chunk is loaded
 
- 
getChunkAtAsyncUrgentlyRequests aChunkto be loaded at the given coordinatesThis method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time. You should use this method if you need a chunk but do not need it immediately, and you wish for it to be prioritised over other chunk loads in queue. The future will always be executed synchronously on the main Server Thread. - Parameters:
- block- Block to load the corresponding chunk from
- Returns:
- Future that will resolve when the chunk is loaded
 
- 
getChunkAtAsyncUrgently@NotNull default CompletableFuture<Chunk> getChunkAtAsyncUrgently(@NotNull @NotNull Block block, boolean gen) Requests aChunkto be loaded at the given coordinatesThis method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time. You should use this method if you need a chunk but do not need it immediately, and you wish for it to be prioritised over other chunk loads in queue. The future will always be executed synchronously on the main Server Thread. - Parameters:
- block- Block to load the corresponding chunk from
- gen- Should the chunk generate if it doesn't exist
- Returns:
- Future that will resolve when the chunk is loaded
 
- 
getChunkAtAsyncUrgentlyRequests aChunkto be loaded at the given coordinatesThis method makes no guarantee on how fast the chunk will load, and will complete the future at a later time. You should use this method if you need a chunk but do not need it immediately, and you wish for it to be prioritised over other chunk loads in queue. The future will always be executed synchronously on the main Server Thread. - Parameters:
- x- Chunk x-coordinate
- z- Chunk z-coordinate
- Returns:
- Future that will resolve when the chunk is loaded
 
- 
getChunkAtAsync@NotNull default CompletableFuture<Chunk> getChunkAtAsync(int x, int z, boolean gen, boolean urgent) Requests aChunkto be loaded at the given coordinates.This method makes no guarantee on how fast the chunk will load, and will return the chunk to the callback at a later time. You should use this method if you need a chunk but do not need it immediately, and you wish to let the server control the speed of chunk loads, keeping performance in mind. The future will always be executed synchronously on the main Server Thread. - Parameters:
- x- Chunk x-coordinate
- z- Chunk z-coordinate
- gen- Should the chunk generate if it doesn't exist
- urgent- If true, the chunk may be prioritised to be loaded above other chunks in queue
- Returns:
- Future that will resolve when the chunk is loaded
 
- 
getPlayersGet a list of all players in this World- Returns:
- A list of all Players currently residing in this world
 
- 
audiencesDescription copied from interface:net.kyori.adventure.audience.ForwardingAudienceGets the audiences.- Specified by:
- audiencesin interface- ForwardingAudience
- Returns:
- the audiences
 
- 
getNearbyEntities@NotNull default @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. - Parameters:
- location- The center of the bounding box
- x- 1/2 the size of the box along x axis
- y- 1/2 the size of the box along y axis
- z- 1/2 the size of the box along z axis
- Returns:
- the collection of entities near location. This will always be a non-null collection.
 
- 
getEntityGets an entity in this world by its UUID- Parameters:
- uuid- the UUID of the entity
- Returns:
- the entity with the given UUID, or null if it isn't found
 
- 
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. - Parameters:
- location- The center of the bounding box
- x- 1/2 the size of the box along x axis
- y- 1/2 the size of the box along y axis
- z- 1/2 the size of the box along z axis
- filter- only entities that fulfill this predicate are considered, or- nullto consider all entities
- Returns:
- the collection of entities near location. This will always be a non-null collection.
 
- 
getNearbyEntities@NotNull default @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. - Parameters:
- boundingBox- the bounding box
- Returns:
- the collection of entities within the bounding box, will always be a non-null collection
 
- 
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. - Parameters:
- boundingBox- the bounding box
- filter- only entities that fulfill this predicate are considered, or- nullto consider all entities
- Returns:
- the collection of entities within the bounding box, will always be a non-null collection
 
- 
rayTraceEntities@Nullable default @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- Parameters:
- start- the start position
- direction- the ray direction
- maxDistance- the maximum distance
- Returns:
- the closest ray trace hit result, or nullif there is no hit
- See Also:
 
- 
rayTraceEntities@Nullable default @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. - Parameters:
- start- the start position
- direction- the ray direction
- maxDistance- the maximum distance
- raySize- entity bounding boxes will be uniformly expanded (or shrunk) by this value before doing collision checks
- Returns:
- the closest ray trace hit result, or nullif there is no hit
- See Also:
 
- 
rayTraceEntities@Nullable default @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- Parameters:
- start- the start position
- direction- the ray direction
- maxDistance- the maximum distance
- filter- only entities that fulfill this predicate are considered, or- nullto consider all entities
- Returns:
- the closest ray trace hit result, or nullif there is no hit
- See Also:
 
- 
rayTraceEntities@Nullable default @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. - Parameters:
- start- the start position
- direction- the ray direction
- maxDistance- the maximum distance
- raySize- entity bounding boxes will be uniformly expanded (or shrunk) by this value before doing collision checks
- filter- only entities that fulfill this predicate are considered, or- nullto consider all entities
- Returns:
- the closest ray trace hit result, or nullif there is no hit
 
- 
rayTraceEntities@Nullable @Nullable RayTraceResult rayTraceEntities(@NotNull Position 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. - Parameters:
- start- the start position
- direction- the ray direction
- maxDistance- the maximum distance
- raySize- entity bounding boxes will be uniformly expanded (or shrunk) by this value before doing collision checks
- filter- only entities that fulfill this predicate are considered, or- nullto consider all entities
- Returns:
- the closest ray trace hit result, or nullif there is no hit
 
- 
rayTraceBlocks@Nullable default @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. - Parameters:
- start- the start location
- direction- the ray direction
- maxDistance- the maximum distance
- Returns:
- the ray trace hit result, or nullif there is no hit
- See Also:
 
- 
rayTraceBlocks@Nullable default @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. - Parameters:
- start- the start location
- direction- the ray direction
- maxDistance- the maximum distance
- fluidCollisionMode- the fluid collision mode
- Returns:
- the ray trace hit result, or nullif there is no hit
- See Also:
 
- 
rayTraceBlocks@Nullable default @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. - Parameters:
- start- the start location
- direction- the ray direction
- maxDistance- the maximum distance
- fluidCollisionMode- the fluid collision mode
- ignorePassableBlocks- whether to ignore passable but collidable blocks (ex. tall grass, signs, fluids, ..)
- Returns:
- the ray trace hit result, or nullif there is no hit
 
- 
rayTraceBlocks@Nullable @Nullable RayTraceResult rayTraceBlocks(@NotNull Position start, @NotNull @NotNull Vector direction, double maxDistance, @NotNull @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, @Nullable @Nullable Predicate<? super Block> canCollide) 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. - Parameters:
- start- the start position
- direction- the ray direction
- maxDistance- the maximum distance
- fluidCollisionMode- the fluid collision mode
- ignorePassableBlocks- whether to ignore passable but collidable blocks (ex. tall grass, signs, fluids, ..)
- canCollide- predicate for blocks the ray can potentially collide with, or- nullto consider all blocks
- Returns:
- the ray trace hit result, or nullif there is no hit
 
- 
rayTrace@Nullable default @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) Performs a ray trace that checks for both block and entity collisions.Block collisions use the blocks' precise collision shapes. The raySizeparameter 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. - Parameters:
- start- the start location
- direction- the ray direction
- maxDistance- the maximum distance
- fluidCollisionMode- the fluid collision mode
- ignorePassableBlocks- whether to ignore passable but collidable blocks (ex. tall grass, signs, fluids, ..)
- raySize- entity bounding boxes will be uniformly expanded (or shrunk) by this value before doing collision checks
- filter- only entities that fulfill this predicate are considered, or- nullto consider all entities
- Returns:
- the closest ray trace hit result with either a block or an
     entity, or nullif there is no hit
 
- 
rayTrace@Nullable @Nullable RayTraceResult rayTrace(@NotNull Position start, @NotNull @NotNull Vector direction, double maxDistance, @NotNull @NotNull FluidCollisionMode fluidCollisionMode, boolean ignorePassableBlocks, double raySize, @Nullable @Nullable Predicate<? super Entity> filter, @Nullable @Nullable Predicate<? super Block> canCollide) Performs a ray trace that checks for both block and entity collisions.Block collisions use the blocks' precise collision shapes. The raySizeparameter 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. - Parameters:
- start- the start position
- direction- the ray direction
- maxDistance- the maximum distance
- fluidCollisionMode- the fluid collision mode
- ignorePassableBlocks- whether to ignore passable but collidable blocks (ex. tall grass, signs, fluids, ..)
- raySize- entity bounding boxes will be uniformly expanded (or shrunk) by this value before doing collision checks
- filter- only entities that fulfill this predicate are considered, or- nullto consider all entities
- canCollide- predicate for blocks the ray can potentially collide with, or- nullto consider all blocks
- Returns:
- the closest ray trace hit result with either a block or an
     entity, or nullif there is no hit
 
- 
rayTrace@Nullable @Nullable RayTraceResult rayTrace(@NotNull @NotNull Consumer<PositionedRayTraceConfigurationBuilder> builderConsumer) Performs a ray trace that checks for collisions with the specified targets.This may cause loading of chunks! Some implementations may impose artificial restrictions on the maximum distance. - Parameters:
- builderConsumer- a consumer to configure the ray trace configuration. The received builder is not valid for use outside the consumer
- Returns:
- the closest ray trace hit result with either a block or an
     entity, or nullif there is no hit
 
- 
getSpawnLocationGets the default spawnLocationof this world- Returns:
- The spawn location of this world
- See Also:
 
- 
setSpawnLocationSets the spawn location of the world.
 The location provided must be equal to this world.- Parameters:
- location- The- Locationto set the spawn for this world at.
- Returns:
- True if it was successfully set.
- See Also:
 
- 
setSpawnLocationboolean setSpawnLocation(int x, int y, int z, float yaw) Sets the spawn location of the world- Parameters:
- x- X coordinate
- y- Y coordinate
- z- Z coordinate
- yaw- the yaw
- Returns:
- True if it was successfully set.
- See Also:
 
- 
setSpawnLocationdefault boolean setSpawnLocation(int x, int y, int z) Sets the spawn location of the world- Parameters:
- x- X coordinate
- y- Y coordinate
- z- Z coordinate
- Returns:
- True if it was successfully set.
- See Also:
 
- 
getTimelong getTime()Gets the relative in-game time of this world.The relative time is analogous to hours * 1000 - Returns:
- The current relative time
- See Also:
 
- 
setTimevoid setTime(long time) 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)- Parameters:
- time- The new relative time to set the in-game time to (in hours*1000)
- See Also:
 
- 
getFullTimelong getFullTime()Gets the full in-game time on this world- Returns:
- The current absolute time
- See Also:
 
- 
setFullTimevoid setFullTime(long time) Sets the in-game time on the serverNote that this sets the full time of the world, which may cause adverse effects such as breaking redstone clocks and any scheduled events - Parameters:
- time- The new absolute time to set this world to
- See Also:
 
- 
isDayTimeboolean isDayTime()Check if it is currently daytime in this world- Returns:
- True if it is daytime
 
- 
getGameTimelong getGameTime()Gets the full in-game time on this world since the world generation- Returns:
- The current absolute time since the world generation
- See Also:
 
- 
hasStormboolean hasStorm()Returns whether the world has an ongoing storm.- Returns:
- Whether there is an ongoing storm
 
- 
setStormvoid setStorm(boolean hasStorm) Set whether there is a storm. A duration will be set for the new current conditions. This will implicitly callsetClearWeatherDuration(int)with 0 ticks to reset the world's clear weather.- Parameters:
- hasStorm- Whether there is rain and snow
 
- 
getWeatherDurationint getWeatherDuration()Get the remaining time in ticks of the current conditions.- Returns:
- Time in ticks
 
- 
setWeatherDurationvoid setWeatherDuration(int duration) Set the remaining time in ticks of the current conditions.- Parameters:
- duration- Time in ticks
 
- 
isThunderingboolean isThundering()Returns whether there is thunder.- Returns:
- Whether there is thunder
 
- 
setThunderingvoid setThundering(boolean thundering) Set whether it is thundering. This will implicitly callsetClearWeatherDuration(int)with 0 ticks to reset the world's clear weather.- Parameters:
- thundering- Whether it is thundering
 
- 
getThunderDurationint getThunderDuration()Get the thundering duration.- Returns:
- Duration in ticks
 
- 
setThunderDurationvoid setThunderDuration(int duration) Set the thundering duration.- Parameters:
- duration- Duration in ticks
 
- 
isClearWeatherboolean isClearWeather()Returns whether the world has clear weather. This will be true such thatisThundering()andhasStorm()are both false.- Returns:
- true if clear weather
 
- 
setClearWeatherDurationvoid setClearWeatherDuration(int duration) 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 clearwith a set amount of ticks.- Parameters:
- duration- duration in ticks
 
- 
getClearWeatherDurationint getClearWeatherDuration()Get the clear weather duration.- Returns:
- duration in ticks
 
- 
createExplosiondefault boolean createExplosion(double x, double y, double z, float power) Creates explosion at given coordinates with given power- Parameters:
- x- X coordinate
- y- Y coordinate
- z- Z coordinate
- power- The power of explosion, where 4F is TNT
- Returns:
- false if explosion was canceled, otherwise true
 
- 
createExplosiondefault 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.- Parameters:
- x- X coordinate
- y- Y coordinate
- z- Z coordinate
- power- The power of explosion, where 4F is TNT
- setFire- Whether or not to set blocks on fire
- Returns:
- false if explosion was canceled, otherwise true
 
- 
createExplosiondefault 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.- Parameters:
- x- X coordinate
- y- Y coordinate
- z- Z coordinate
- power- The power of explosion, where 4F is TNT
- setFire- Whether or not to set blocks on fire
- breakBlocks- Whether or not to have blocks be destroyed
- Returns:
- false if explosion was canceled, otherwise true
 
- 
createExplosionboolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks, @Nullable @Nullable Entity source) Creates explosion at given coordinates with given power and optionally setting blocks on fire or breaking blocks.Note that if a non-null sourceEntity is provided andbreakBlocksistrue, the value ofbreakBlockswill be ignored ifGameRule.MOB_GRIEFINGisfalsein the world in which the explosion occurs. In other words, the mob griefing gamerule will take priority overbreakBlocksif explosions are not allowed.- Parameters:
- x- X coordinate
- y- Y coordinate
- z- Z coordinate
- power- The power of explosion, where 4F is TNT
- setFire- Whether or not to set blocks on fire
- breakBlocks- Whether or not to have blocks be destroyed
- source- the source entity, used for tracking damage
- Returns:
- false if explosion was canceled, otherwise true
 
- 
createExplosionCreates explosion at given coordinates with given power- Parameters:
- loc- Location to blow up
- power- The power of explosion, where 4F is TNT
- Returns:
- false if explosion was canceled, otherwise true
 
- 
createExplosionCreates explosion at given coordinates with given power and optionally setting blocks on fire.- Parameters:
- loc- Location to blow up
- power- The power of explosion, where 4F is TNT
- setFire- Whether or not to set blocks on fire
- Returns:
- false if explosion was canceled, otherwise true
 
- 
createExplosionboolean createExplosion(@Nullable @Nullable Entity source, @NotNull @NotNull Location loc, float power, boolean setFire, boolean breakBlocks, boolean excludeSourceFromDamage) Creates explosion at given location with given power and optionally setting blocks on fire, with the specified entity as the source.- Parameters:
- source- The source entity of the explosion
- loc- Location to blow up
- power- The power of explosion, where 4F is TNT
- setFire- Whether or not to set blocks on fire
- breakBlocks- Whether or not to have blocks be destroyed
- excludeSourceFromDamage- whether the explosion should exclude the passed source from taking damage like vanilla explosions do.
- Returns:
- false if explosion was canceled, otherwise true
 
- 
createExplosiondefault boolean createExplosion(@Nullable @Nullable Entity source, @NotNull @NotNull Location loc, float power, boolean setFire, boolean breakBlocks) Creates explosion at given location with given power and optionally setting blocks on fire, with the specified entity as the source.- Parameters:
- source- The source entity of the explosion
- loc- Location to blow up
- power- The power of explosion, where 4F is TNT
- setFire- Whether or not to set blocks on fire
- breakBlocks- Whether or not to have blocks be destroyed
- Returns:
- false if explosion was canceled, otherwise true
 
- 
createExplosiondefault boolean createExplosion(@Nullable @Nullable Entity source, @NotNull @NotNull Location loc, float power, boolean setFire) Creates explosion at given location with given power and optionally setting blocks on fire, with the specified entity as the source. Will destroy other blocks- Parameters:
- source- The source entity of the explosion
- loc- Location to blow up
- power- The power of explosion, where 4F is TNT
- setFire- Whether or not to set blocks on fire
- Returns:
- false if explosion was canceled, otherwise true
 
- 
createExplosiondefault boolean createExplosion(@Nullable @Nullable Entity source, @NotNull @NotNull Location loc, float power) Creates explosion at given location with given power, with the specified entity as the source. Will set blocks on fire and destroy blocks.- Parameters:
- source- The source entity of the explosion
- loc- Location to blow up
- power- The power of explosion, where 4F is TNT
- Returns:
- false if explosion was canceled, otherwise true
 
- 
createExplosiondefault boolean createExplosion(@NotNull @NotNull Entity source, float power, boolean setFire, boolean breakBlocks) Creates explosion at given entities location with given power and optionally setting blocks on fire, with the specified entity as the source.- Parameters:
- source- The source entity of the explosion
- power- The power of explosion, where 4F is TNT
- setFire- Whether or not to set blocks on fire
- breakBlocks- Whether or not to have blocks be destroyed
- Returns:
- false if explosion was canceled, otherwise true
 
- 
createExplosionCreates explosion at given entities location with given power and optionally setting blocks on fire, with the specified entity as the source. Will destroy blocks.- Parameters:
- source- The source entity of the explosion
- power- The power of explosion, where 4F is TNT
- setFire- Whether or not to set blocks on fire
- Returns:
- false if explosion was canceled, otherwise true
 
- 
createExplosionCreates explosion at given entities location with given power and optionally setting blocks on fire, with the specified entity as the source.- Parameters:
- source- The source entity of the explosion
- power- The power of explosion, where 4F is TNT
- Returns:
- false if explosion was canceled, otherwise true
 
- 
createExplosiondefault 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.- Parameters:
- loc- Location to blow up
- power- The power of explosion, where 4F is TNT
- setFire- Whether or not to set blocks on fire
- breakBlocks- Whether or not to have blocks be destroyed
- Returns:
- false if explosion was canceled, otherwise true
 
- 
createExplosionboolean createExplosion(@NotNull @NotNull Location loc, float power, boolean setFire, boolean breakBlocks, @Nullable @Nullable Entity source) Creates explosion at given coordinates with given power and optionally setting blocks on fire or breaking blocks.Note that if a non-null sourceEntity is provided andbreakBlocksistrue, the value ofbreakBlockswill be ignored ifGameRule.MOB_GRIEFINGisfalsein the world in which the explosion occurs. In other words, the mob griefing gamerule will take priority overbreakBlocksif explosions are not allowed.- Parameters:
- loc- Location to blow up
- power- The power of explosion, where 4F is TNT
- setFire- Whether or not to set blocks on fire
- breakBlocks- Whether or not to have blocks be destroyed
- source- the source entity, used for tracking damage
- Returns:
- false if explosion was canceled, otherwise true
 
- 
getPVPDeprecated.useGameRule.PVPinsteadGets the current PVP setting for this world.- Returns:
- True if PVP is enabled
 
- 
setPVPDeprecated.useGameRule.PVPinsteadSets the PVP setting for this world.- Parameters:
- pvp- True/False whether PVP should be Enabled.
 
- 
getGeneratorGets the chunk generator for this world- Returns:
- ChunkGenerator associated with this world
 
- 
getBiomeProviderGets the biome provider for this world- Returns:
- BiomeProvider associated with this world
 
- 
savedefault void save()Saves the world to disk
- 
savevoid save(boolean flush) Saves the world to disk- Parameters:
- flush- Whether to wait for the chunk writer to finish
 
- 
getPopulatorsGets a list of all appliedBlockPopulators for this World- Returns:
- List containing any or none BlockPopulators
 
- 
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 givenLocationwith 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.- Type Parameters:
- T- the generic type of the entity that is being created.
- Parameters:
- location- the location at which the entity will be spawned.
- clazz- the class of the- LivingEntitythat is to be spawned.
- spawnReason- the reason provided during the- CreatureSpawnEventcall.
- randomizeData- whether or not the entity's data should be randomised before spawning. By default entities are randomised before spawning in regards to their equipment, age, attributes, etc. An example of this randomization would be the color of a sheep, random enchantments on the equipment of mobs or even a zombie becoming a chicken jockey. If set to false, the entity will not be randomised before spawning, meaning all their data will remain in their default state and not further modifications to the entity will be made. Notably only entities that extend the- Mobinterface provide randomization logic for their spawn. This parameter is hence useless for any other type of entity.
- function- the function to be run before the entity is spawned.
- Returns:
- the spawned entity instance.
- Throws:
- IllegalArgumentException- if either the world or clazz parameter are null.
 
- 
spawnFallingBlock@NotNull @Deprecated(since="1.20.2", forRemoval=true) @NotNull FallingBlock spawnFallingBlock(@NotNull @NotNull Location location, @NotNull @NotNull MaterialData data) throws IllegalArgumentException Deprecated, for removal: This API element is subject to removal in a future version.UseRegionAccessor.spawn(Location, Class, Consumer)(or a variation thereof) in combination withFallingBlock.setBlockData(BlockData)Spawn aFallingBlockentity at the givenLocationof the specifiedMaterialData. 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.- Parameters:
- location- The- Locationto spawn the FallingBlock
- data- The block data
- Returns:
- The spawned FallingBlockinstance
- Throws:
- IllegalArgumentException- if- Locationor- MaterialDataare null or- Materialof the- MaterialDatais not a block
 
- 
spawnFallingBlock@NotNull @Obsolete(since="1.20.2") @NotNull FallingBlock spawnFallingBlock(@NotNull @NotNull Location location, @NotNull @NotNull BlockData data) throws IllegalArgumentException Deprecated.UseRegionAccessor.spawn(Location, Class, Consumer)(or a variation thereof) in combination withFallingBlock.setBlockData(BlockData)Spawn aFallingBlockentity at the givenLocationof the specifiedBlockData. The BlockData dictates what is falling. When the FallingBlock hits the ground, it will place that block.- Parameters:
- location- The- Locationto spawn the FallingBlock
- data- The- BlockDataof the FallingBlock to spawn
- Returns:
- The spawned FallingBlockinstance
- Throws:
- IllegalArgumentException- if- Locationor- BlockDataare null
 
- 
spawnFallingBlock@Deprecated(since="1.7.5", forRemoval=true) @NotNull @NotNull FallingBlock spawnFallingBlock(@NotNull @NotNull Location location, @NotNull @NotNull Material material, byte data) throws IllegalArgumentException Deprecated, for removal: This API element is subject to removal in a future version.Magic value. UseRegionAccessor.spawn(Location, Class, Consumer)(or a variation thereof) in combination withFallingBlock.setBlockData(BlockData)Spawn aFallingBlockentity at the givenLocationof the specifiedMaterial. The material dictates what is falling. When the FallingBlock hits the ground, it will place that block.The Material must be a block type, check with material.isBlock(). The Material may not be air.- Parameters:
- location- The- Locationto spawn the FallingBlock
- material- The block- Materialtype
- data- The block data
- Returns:
- The spawned FallingBlockinstance
- Throws:
- IllegalArgumentException- if- Locationor- Materialare null or- Materialis not a block
 
- 
playEffectdefault 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.
- 
playEffectvoid 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.
- 
playEffectdefault <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.
- 
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.
- 
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.- Parameters:
- x- - chunk x coordinate
- z- - chunk z coordinate
- includeBiome- - if true, snapshot includes per-coordinate biome type
- includeBiomeTemp- - if true, snapshot includes per-coordinate raw biome temperature
- Returns:
- The empty snapshot.
 
- 
setSpawnFlagsvoid setSpawnFlags(boolean allowMonsters, boolean allowAnimals) Sets the spawn flags for this.- Parameters:
- allowMonsters- - if true, monsters are allowed to spawn in this world.
- allowAnimals- - if true, animals are allowed to spawn in this world.
 
- 
getAllowAnimalsboolean getAllowAnimals()Gets whether animals can spawn in this world.- Returns:
- whether animals can spawn in this world.
 
- 
getAllowMonstersboolean getAllowMonsters()Gets whether monsters can spawn in this world.- Returns:
- whether monsters can spawn in this world.
 
- 
getBiomeDeprecated.biomes are now 3-dimensionalGets the biome for the given block coordinates.- Parameters:
- x- X coordinate of the block
- z- Z coordinate of the block
- Returns:
- Biome of the requested block
 
- 
setBiomeDeprecated.biomes are now 3-dimensionalSets the biome for the given block coordinates- Parameters:
- x- X coordinate of the block
- z- Z coordinate of the block
- bio- new Biome type for this block
 
- 
getTemperatureDeprecated.biomes are now 3-dimensionalGets 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. - Parameters:
- x- X coordinate of the block
- z- Z coordinate of the block
- Returns:
- Temperature of the requested block
 
- 
getTemperaturedouble 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. - Parameters:
- x- X coordinate of the block
- y- Y coordinate of the block
- z- Z coordinate of the block
- Returns:
- Temperature of the requested block
 
- 
getHumidityDeprecated.biomes are now 3-dimensionalGets 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. - Parameters:
- x- X coordinate of the block
- z- Z coordinate of the block
- Returns:
- Humidity of the requested block
 
- 
getHumiditydouble 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. - Parameters:
- x- X coordinate of the block
- y- Y coordinate of the block
- z- Z coordinate of the block
- Returns:
- Humidity of the requested block
 
- 
getLogicalHeightint getLogicalHeight()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 thanWorldInfo.getMaxHeight().- Returns:
- maximum logical height for chorus fruits and nether portals
 
- 
isNaturalboolean isNatural()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.- Returns:
- true if world is natural
 
- 
isBedWorksboolean isBedWorks()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.- Returns:
- true if beds work in this world
 
- 
hasSkyLightboolean hasSkyLight()Gets if this world has skylight access.- Returns:
- true if this world has skylight access
 
- 
hasCeilingboolean hasCeiling()Gets if this world has a ceiling.- Returns:
- true if this world has a bedrock ceiling
 
- 
isPiglinSafeboolean isPiglinSafe()Gets if this world allow to piglins to survive without shaking and transforming to zombified piglins.- Returns:
- true if piglins will not transform to zombified piglins
 
- 
isRespawnAnchorWorksboolean isRespawnAnchorWorks()Gets if this world allows players to charge and use respawn anchors.- Returns:
- true if players can charge and use respawn anchors
 
- 
hasRaidsboolean hasRaids()Gets if players with the bad omen effect in this world will trigger a raid.- Returns:
- true if raids will be triggered
 
- 
isUltraWarmboolean isUltraWarm()Gets if various water/lava mechanics will be triggered in this world, eg:
 - Water is evaporated
- Sponges dry
- Lava spreads faster and further
 - Returns:
- true if this world has the above mechanics
 
- 
getSeaLevelint getSeaLevel()Gets the sea level for this world.This is often half of WorldInfo.getMaxHeight()- Returns:
- Sea level
 
- 
getKeepSpawnInMemoryDeprecated, for removal: This API element is subject to removal in a future version.No longer functional since 1.21.9, the vanilla server does not have the concept of spawn chunks anymore.Gets whether the world's spawn area should be kept loaded into memory or not.- Returns:
- true if the world's spawn area will be kept loaded into memory.
 
- 
setKeepSpawnInMemoryDeprecated, for removal: This API element is subject to removal in a future version.No longer functional since 1.21.9, the vanilla server does not have the concept of spawn chunks anymore.Sets whether the world's spawn area should be kept loaded into memory or not.- Parameters:
- keepLoaded- if true then the world's spawn area will be kept loaded into memory.
 
- 
isAutoSaveboolean isAutoSave()Gets whether or not the world will automatically save- Returns:
- true if the world will automatically save, otherwise false
 
- 
setAutoSavevoid setAutoSave(boolean value) Sets whether or not the world will automatically save- Parameters:
- value- true if the world should automatically save, otherwise false
- API Note:
- This does not disable saving entirely, the world will still be saved on shutdown.
 The intended use of this method is to disable the periodical autosave by the game.
 
- 
setDifficultySets the Difficulty of the world.- Parameters:
- difficulty- the new difficulty you want to set the world to
 
- 
getDifficultyGets the Difficulty of the world.- Returns:
- The difficulty of the world.
 
- 
getViewDistanceint getViewDistance()Returns the view distance used for this world.- Returns:
- the view distance used for this world
 
- 
getSimulationDistanceint getSimulationDistance()Returns the simulation distance used for this world.- Returns:
- the simulation distance used for this world
 
- 
getWorldFolderGets the folder of this world on disk.- Returns:
- The folder of this world.
 
- 
getWorldPathGets the path of this world on disk.- Returns:
- The path of this world.
 
- 
getWorldTypeDeprecated.world type is only used to select the default word generation settings and is not stored in Vanilla worlds, making it impossible for this method to always return the correct value.Gets the type of this world.- Returns:
- Type of this world.
 
- 
canGenerateStructuresboolean canGenerateStructures()Gets whether or not structures are being generated.- Returns:
- True if structures are being generated.
 
- 
hasBonusChestboolean hasBonusChest()Checks if the bonus chest is enabled.- Returns:
- trueif the bonus chest is enabled,- falseotherwise
 
- 
isHardcoreboolean isHardcore()Gets whether the world is hardcore or not. In a hardcore world the difficulty is locked to hard.- Returns:
- hardcore status
 
- 
setHardcorevoid setHardcore(boolean hardcore) Sets whether the world is hardcore or not. In a hardcore world the difficulty is locked to hard.- Parameters:
- hardcore- Whether the world is hardcore
 
- 
getTicksPerAnimalSpawnsDeprecated.Deprecated in favor ofgetTicksPerSpawns(SpawnCategory)Gets the world's ticks per animal spawns valueThis 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. - Returns:
- The world's ticks per animal spawns value
 
- 
setTicksPerAnimalSpawnsDeprecated.Deprecated in favor ofsetTicksPerSpawns(SpawnCategory, int)Sets the world's ticks per animal spawns valueThis 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. - Parameters:
- ticksPerAnimalSpawns- the ticks per animal spawns value you want to set the world to
 
- 
getTicksPerMonsterSpawnsDeprecated.Deprecated in favor ofgetTicksPerSpawns(SpawnCategory)Gets the world's ticks per monster spawns valueThis 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. - Returns:
- The world's ticks per monster spawns value
 
- 
setTicksPerMonsterSpawnsDeprecated.Deprecated in favor ofsetTicksPerSpawns(SpawnCategory, int)Sets the world's ticks per monster spawns valueThis 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. - Parameters:
- ticksPerMonsterSpawns- the ticks per monster spawns value you want to set the world to
 
- 
getTicksPerWaterSpawnsDeprecated.Deprecated in favor ofgetTicksPerSpawns(SpawnCategory)Gets the world's ticks per water mob spawns valueThis 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. - Returns:
- The world's ticks per water mob spawns value
 
- 
setTicksPerWaterSpawnsDeprecated.Deprecated in favor ofsetTicksPerSpawns(SpawnCategory, int)Sets the world's ticks per water mob spawns valueThis 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. - Parameters:
- ticksPerWaterSpawns- the ticks per water mob spawns value you want to set the world to
 
- 
getTicksPerWaterAmbientSpawnsDeprecated.Deprecated in favor ofgetTicksPerSpawns(SpawnCategory)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. - Returns:
- the default ticks per water ambient mobs spawn value
 
- 
setTicksPerWaterAmbientSpawns@Deprecated(since="1.18.1") default void setTicksPerWaterAmbientSpawns(int ticksPerWaterAmbientSpawns) Deprecated.Deprecated in favor ofsetTicksPerSpawns(SpawnCategory, int)Sets the world's ticks per water ambient mob spawns valueThis 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. - Parameters:
- ticksPerWaterAmbientSpawns- the ticks per water ambient mob spawns value you want to set the world to
 
- 
getTicksPerWaterUndergroundCreatureSpawnsDeprecated.Deprecated in favor ofgetTicksPerSpawns(SpawnCategory)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. - Returns:
- the default ticks per water underground creature spawn value
 
- 
setTicksPerWaterUndergroundCreatureSpawns@Deprecated(since="1.18.1") default void setTicksPerWaterUndergroundCreatureSpawns(int ticksPerWaterUndergroundCreatureSpawns) Deprecated.Deprecated in favor ofsetTicksPerSpawns(SpawnCategory, int)Sets the world's ticks per water underground creature spawns valueThis 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. - Parameters:
- ticksPerWaterUndergroundCreatureSpawns- the ticks per water underground creature spawns value you want to set the world to
 
- 
getTicksPerAmbientSpawnsDeprecated.Deprecated in favor ofgetTicksPerSpawns(SpawnCategory)Gets the world's ticks per ambient mob spawns valueThis 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. - Returns:
- the default ticks per ambient mobs spawn value
 
- 
setTicksPerAmbientSpawnsDeprecated.Deprecated in favor ofsetTicksPerSpawns(SpawnCategory, int)Sets the world's ticks per ambient mob spawns valueThis 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. - Parameters:
- ticksPerAmbientSpawns- the ticks per ambient mob spawns value you want to set the world to
 
- 
getTicksPerSpawnsGets the world's ticks perSpawnCategorymob spawns valueThis value determines how many ticks there are between attempts to spawn SpawnCategorymobs.Example Usage: - A value of 1 will mean the server will attempt to spawn SpawnCategorymobs in this world every tick.
- A value of 400 will mean the server will attempt to spawn SpawnCategorymobs in this world every 400th tick.
- A value below 0 will be reset back to Minecraft's default.
 Note: If set to 0, SpawnCategorymobs spawning will be disabled for this world.Minecraft default: 1. - Parameters:
- spawnCategory- the category spawn
- Returns:
- The world's ticks per SpawnCategorymob spawns value
 
- A value of 1 will mean the server will attempt to spawn 
- 
setTicksPerSpawnsSets the world's ticks perSpawnCategorymob spawns valueThis value determines how many ticks there are between attempts to spawn SpawnCategorymobs.Example Usage: - A value of 1 will mean the server will attempt to spawn SpawnCategorymobs in this world on every tick.
- A value of 400 will mean the server will attempt to spawn SpawnCategorymobs in this world every 400th tick.
- A value below 0 will be reset back to Minecraft's default.
 Note: If set to 0, SpawnCategorymobs spawning will be disabled for this world.Minecraft default: 1. - Parameters:
- spawnCategory- the category spawn
- ticksPerCategorySpawn- the ticks per- SpawnCategorymob spawns value you want to set the world to
 
- A value of 1 will mean the server will attempt to spawn 
- 
getMonsterSpawnLimitDeprecated.Deprecated in favor ofgetSpawnLimit(SpawnCategory)Gets limit for number of monsters that can spawn in a chunk in this world- Returns:
- The monster spawn limit
 
- 
setMonsterSpawnLimitDeprecated.Deprecated in favor ofsetSpawnLimit(SpawnCategory, int)Sets the limit for number of monsters that can spawn in a chunk in this worldNote: If set to a negative number the world will use the server-wide spawn limit instead. - Parameters:
- limit- the new mob limit
 
- 
getAnimalSpawnLimitDeprecated.Deprecated in favor ofgetSpawnLimit(SpawnCategory)Gets the limit for number of animals that can spawn in a chunk in this world- Returns:
- The animal spawn limit
 
- 
setAnimalSpawnLimitDeprecated.Deprecated in favor ofgetSpawnLimit(SpawnCategory)Sets the limit for number of animals that can spawn in a chunk in this worldNote: If set to a negative number the world will use the server-wide spawn limit instead. - Parameters:
- limit- the new mob limit
 
- 
getWaterAnimalSpawnLimitDeprecated.Deprecated in favor ofgetSpawnLimit(SpawnCategory)Gets the limit for number of water animals that can spawn in a chunk in this world- Returns:
- The water animal spawn limit
 
- 
setWaterAnimalSpawnLimitDeprecated.Deprecated in favor ofsetSpawnLimit(SpawnCategory, int)Sets the limit for number of water animals that can spawn in a chunk in this worldNote: If set to a negative number the world will use the server-wide spawn limit instead. - Parameters:
- limit- the new mob limit
 
- 
getWaterUndergroundCreatureSpawnLimitDeprecated.Deprecated in favor ofgetSpawnLimit(SpawnCategory)Gets the limit for number of water underground creature that can spawn in a chunk in this world- Returns:
- The water underground creature spawn limit
 
- 
setWaterUndergroundCreatureSpawnLimitDeprecated.Deprecated in favor ofsetSpawnLimit(SpawnCategory, int)Sets the limit for number of water underground creature that can spawn in a chunk in this worldNote: If set to a negative number the world will use the server-wide spawn limit instead. - Parameters:
- limit- the new mob limit
 
- 
getWaterAmbientSpawnLimitDeprecated.Deprecated in favor ofgetSpawnLimit(SpawnCategory)Gets user-specified limit for number of water ambient mobs that can spawn in a chunk.- Returns:
- the water ambient spawn limit
 
- 
setWaterAmbientSpawnLimitDeprecated.Deprecated in favor ofsetSpawnLimit(SpawnCategory, int)Sets the limit for number of water ambient mobs that can spawn in a chunk in this worldNote: If set to a negative number the world will use the server-wide spawn limit instead. - Parameters:
- limit- the new mob limit
 
- 
getAmbientSpawnLimitDeprecated.Deprecated in favor ofgetSpawnLimit(SpawnCategory)Gets the limit for number of ambient mobs that can spawn in a chunk in this world- Returns:
- The ambient spawn limit
 
- 
setAmbientSpawnLimitDeprecated.Deprecated in favor ofsetSpawnLimit(SpawnCategory, int)Sets the limit for number of ambient mobs that can spawn in a chunk in this worldNote: If set to a negative number the world will use the server-wide spawn limit instead. - Parameters:
- limit- the new mob limit
 
- 
getSpawnLimitGets the limit for number ofSpawnCategoryentities that can spawn in a chunk in this world- Parameters:
- spawnCategory- the entity category
- Returns:
- The ambient spawn limit
 
- 
setSpawnLimitSets the limit for number ofSpawnCategoryentities that can spawn in a chunk in this worldNote: If set to a negative number the world will use the server-wide spawn limit instead. - Parameters:
- spawnCategory- the entity category
- limit- the new mob limit
 
- 
playNotedefault void playNote(@NotNull @NotNull Location loc, @NotNull @NotNull Instrument instrument, @NotNull @NotNull Note note) 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.- Parameters:
- loc- The location to play the note
- instrument- The instrument
- note- The note
 
- 
playSounddefault 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. - Parameters:
- location- The location to play the sound
- sound- The sound to play
- volume- The volume of the sound
- pitch- The pitch of the sound
 
- 
playSounddefault 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. - Parameters:
- location- The location to play the sound
- sound- The internal sound name to play
- volume- The volume of the sound
- pitch- The pitch of the sound
 
- 
playSoundvoid 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. - Parameters:
- location- The location to play the sound
- sound- The sound to play
- category- the category of the sound
- volume- The volume of the sound
- pitch- The pitch of the sound
 
- 
playSoundvoid 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. - Parameters:
- location- The location to play the sound
- sound- The internal sound name to play
- category- The category of the sound
- volume- The volume of the sound
- pitch- The pitch of the sound
 
- 
playSoundvoid 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. - Parameters:
- location- The location to play the sound
- sound- The sound to play
- category- the category of the sound
- volume- The volume of the sound
- pitch- The pitch of the sound
- seed- The seed for the sound
 
- 
playSoundvoid 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. - Parameters:
- location- The location to play the sound
- sound- The internal sound name to play
- category- the category of the sound
- volume- The volume of the sound
- pitch- The pitch of the sound
- seed- The seed for the sound
 
- 
playSounddefault 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. - Parameters:
- entity- The entity to play the sound
- sound- The sound to play
- volume- The volume of the sound
- pitch- The pitch of the sound
 
- 
playSounddefault 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. - Parameters:
- entity- The entity to play the sound
- sound- The sound to play
- volume- The volume of the sound
- pitch- The pitch of the sound
 
- 
playSoundvoid 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. - Parameters:
- entity- The entity to play the sound
- sound- The sound to play
- category- The category of the sound
- volume- The volume of the sound
- pitch- The pitch of the sound
 
- 
playSoundvoid 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. - Parameters:
- entity- The entity to play the sound
- sound- The sound to play
- category- The category of the sound
- volume- The volume of the sound
- pitch- The pitch of the sound
 
- 
playSoundvoid 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. - Parameters:
- entity- The entity to play the sound
- sound- The sound to play
- category- The category of the sound
- volume- The volume of the sound
- pitch- The pitch of the sound
- seed- The seed for the sound
 
- 
playSoundvoid 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. - Parameters:
- entity- The entity to play the sound
- sound- The sound to play
- category- The category of the sound
- volume- The volume of the sound
- pitch- The pitch of the sound
- seed- The seed for the sound
 
- 
getGameRulesGet an array containing the names of all theGameRules.- Returns:
- An array of GameRulenames.
 
- 
getGameRuleValue@Deprecated(since="1.13") @Contract("null -> null; !null -> !null") @Nullable @Nullable String getGameRuleValue(@Nullable @Nullable String rule) Deprecated.usegetGameRuleValue(GameRule)insteadGets the current state of the specified ruleWill return null if rule passed is null - Parameters:
- rule- Rule to look up value of
- Returns:
- String value of rule
 
- 
setGameRuleValue@Deprecated(since="1.13") boolean setGameRuleValue(@NotNull @NotNull String rule, @NotNull @NotNull String value) Deprecated.usesetGameRule(GameRule, Object)instead.Set the specified gamerule to specified value.The rule may attempt to validate the value passed, will return true if value was set. If rule is null, the function will return false. - Parameters:
- rule- Rule to set
- value- Value to set rule to
- Returns:
- True if rule was set
 
- 
isGameRuleChecks if string is a valid game rule- Parameters:
- rule- Rule to check
- Returns:
- True if rule exists
 
- 
getGameRuleValueGet the current value for a givenGameRule.- Type Parameters:
- T- the GameRule's type
- Parameters:
- rule- the GameRule to check
- Returns:
- the current value
 
- 
getGameRuleDefaultGet the default value for a givenGameRule. This value is not guaranteed to match the current value.- Type Parameters:
- T- the type of GameRule
- Parameters:
- rule- the rule to return a default value for
- Returns:
- the default value
 
- 
setGameRuleSet the givenGameRule's new value.- Type Parameters:
- T- the value type of the GameRule
- Parameters:
- rule- the GameRule to update
- newValue- the new value
- Returns:
- true if the value was successfully set
 
- 
getWorldBorderGets the world border for this world.- Returns:
- The world border for this world.
 
- 
spawnParticledefault void spawnParticle(@NotNull @NotNull Particle particle, @NotNull @NotNull Location location, int count) Spawns the particle (the number of times specified by count) at the target location.- Parameters:
- particle- the particle to spawn
- location- the location to spawn at
- count- the number of particles
 
- 
spawnParticledefault void spawnParticle(@NotNull @NotNull Particle particle, double x, double y, double z, int count) Spawns the particle (the number of times specified by count) at the target location.- Parameters:
- particle- the particle to spawn
- x- the position on the x axis to spawn at
- y- the position on the y axis to spawn at
- z- the position on the z axis to spawn at
- count- the number of particles
 
- 
spawnParticledefault <T> void spawnParticle(@NotNull @NotNull Particle particle, @NotNull @NotNull Location location, int count, @Nullable T data) Spawns the particle (the number of times specified by count) at the target location.- Type Parameters:
- T- type of particle data (see- Particle.getDataType()
- Parameters:
- particle- the particle to spawn
- location- the location to spawn at
- count- the number of particles
- data- the data to use for the particle or null, the type of this depends on- Particle.getDataType()
 
- 
spawnParticledefault <T> void spawnParticle(@NotNull @NotNull Particle particle, double x, double y, double z, int count, @Nullable T data) Spawns the particle (the number of times specified by count) at the target location.- Type Parameters:
- T- type of particle data (see- Particle.getDataType()
- Parameters:
- particle- the particle to spawn
- x- the position on the x axis to spawn at
- y- the position on the y axis to spawn at
- z- the position on the z axis to spawn at
- count- the number of particles
- data- the data to use for the particle or null, the type of this depends on- Particle.getDataType()
 
- 
spawnParticledefault void spawnParticle(@NotNull @NotNull Particle particle, @NotNull @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ) Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- Parameters:
- particle- the particle to spawn
- location- the location to spawn at
- count- the number of particles
- offsetX- the maximum random offset on the X axis
- offsetY- the maximum random offset on the Y axis
- offsetZ- the maximum random offset on the Z axis
 
- 
spawnParticledefault void spawnParticle(@NotNull @NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ) Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- Parameters:
- particle- the particle to spawn
- x- the position on the x axis to spawn at
- y- the position on the y axis to spawn at
- z- the position on the z axis to spawn at
- count- the number of particles
- offsetX- the maximum random offset on the X axis
- offsetY- the maximum random offset on the Y axis
- offsetZ- the maximum random offset on the Z axis
 
- 
spawnParticledefault <T> void spawnParticle(@NotNull @NotNull Particle particle, @NotNull @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data) Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- Type Parameters:
- T- type of particle data (see- Particle.getDataType()
- Parameters:
- particle- the particle to spawn
- location- the location to spawn at
- count- the number of particles
- offsetX- the maximum random offset on the X axis
- offsetY- the maximum random offset on the Y axis
- offsetZ- the maximum random offset on the Z axis
- data- the data to use for the particle or null, the type of this depends on- Particle.getDataType()
 
- 
spawnParticledefault <T> void spawnParticle(@NotNull @NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, @Nullable T data) Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- Type Parameters:
- T- type of particle data (see- Particle.getDataType()
- Parameters:
- particle- the particle to spawn
- x- the position on the x axis to spawn at
- y- the position on the y axis to spawn at
- z- the position on the z axis to spawn at
- count- the number of particles
- offsetX- the maximum random offset on the X axis
- offsetY- the maximum random offset on the Y axis
- offsetZ- the maximum random offset on the Z axis
- data- the data to use for the particle or null, the type of this depends on- Particle.getDataType()
 
- 
spawnParticledefault void spawnParticle(@NotNull @NotNull Particle particle, @NotNull @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra) Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- Parameters:
- particle- the particle to spawn
- location- the location to spawn at
- count- the number of particles
- offsetX- the maximum random offset on the X axis
- offsetY- the maximum random offset on the Y axis
- offsetZ- the maximum random offset on the Z axis
- extra- the extra data for this particle, depends on the particle used (normally speed)
 
- 
spawnParticledefault void spawnParticle(@NotNull @NotNull Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra) Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- Parameters:
- particle- the particle to spawn
- x- the position on the x axis to spawn at
- y- the position on the y axis to spawn at
- z- the position on the z axis to spawn at
- count- the number of particles
- offsetX- the maximum random offset on the X axis
- offsetY- the maximum random offset on the Y axis
- offsetZ- the maximum random offset on the Z axis
- extra- the extra data for this particle, depends on the particle used (normally speed)
 
- 
spawnParticledefault <T> void spawnParticle(@NotNull @NotNull Particle particle, @NotNull @NotNull Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data) Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- Type Parameters:
- T- type of particle data (see- Particle.getDataType()
- Parameters:
- particle- the particle to spawn
- location- the location to spawn at
- count- the number of particles
- offsetX- the maximum random offset on the X axis
- offsetY- the maximum random offset on the Y axis
- offsetZ- the maximum random offset on the Z axis
- extra- the extra data for this particle, depends on the particle used (normally speed)
- data- the data to use for the particle or null, the type of this depends on- Particle.getDataType()
 
- 
spawnParticledefault <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) 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.- Type Parameters:
- T- type of particle data (see- Particle.getDataType()
- Parameters:
- particle- the particle to spawn
- x- the position on the x axis to spawn at
- y- the position on the y axis to spawn at
- z- the position on the z axis to spawn at
- count- the number of particles
- offsetX- the maximum random offset on the X axis
- offsetY- the maximum random offset on the Y axis
- offsetZ- the maximum random offset on the Z axis
- extra- the extra data for this particle, depends on the particle used (normally speed)
- data- the data to use for the particle or null, the type of this depends on- Particle.getDataType()
 
- 
spawnParticledefault <T> void spawnParticle(@NotNull @NotNull Particle particle, @Nullable @Nullable List<Player> receivers, @NotNull @NotNull Player source, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data) Spawns the particle (the number of times specified by count) at the target location. The position of each particle will be randomized positively and negatively by the offset parameters on each axis.- Type Parameters:
- T- Type
- Parameters:
- particle- the particle to spawn
- receivers- List of players to receive the particles, or null for all in world
- source- Source of the particles to be used in visibility checks, or null if no player source
- x- the position on the x axis to spawn at
- y- the position on the y axis to spawn at
- z- the position on the z axis to spawn at
- count- the number of particles
- offsetX- the maximum random offset on the X axis
- offsetY- the maximum random offset on the Y axis
- offsetZ- the maximum random offset on the Z axis
- extra- the extra data for this particle, depends on the particle used (normally speed)
- data- the data to use for the particle or null, the type of this depends on- Particle.getDataType()
 
- 
spawnParticle<T> void spawnParticle(@NotNull @NotNull Particle particle, @Nullable @Nullable List<Player> receivers, @Nullable @Nullable Player source, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, @Nullable T data, boolean force) 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.- Type Parameters:
- T- Type
- Parameters:
- particle- the particle to spawn
- receivers- List of players to receive the particles, or null for all in world
- source- Source of the particles to be used in visibility checks, or null if no player source
- x- the position on the x axis to spawn at
- y- the position on the y axis to spawn at
- z- the position on the z axis to spawn at
- count- the number of particles
- offsetX- the maximum random offset on the X axis
- offsetY- the maximum random offset on the Y axis
- offsetZ- the maximum random offset on the Z axis
- extra- the extra data for this particle, depends on the particle used (normally speed)
- data- the data to use for the particle or null, the type of this depends on- Particle.getDataType()
- force- allows the particle to be seen further away from the player and shows to players using any vanilla client particle settings
 
- 
spawnParticledefault <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) 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.- Type Parameters:
- T- type of particle data (see- Particle.getDataType()
- Parameters:
- particle- the particle to spawn
- location- the location to spawn at
- count- the number of particles
- offsetX- the maximum random offset on the X axis
- offsetY- the maximum random offset on the Y axis
- offsetZ- the maximum random offset on the Z axis
- extra- the extra data for this particle, depends on the particle used (normally speed)
- data- the data to use for the particle or null, the type of this depends on- Particle.getDataType()
- force- whether to send the particle to players within an extended range and encourage their client to render it regardless of settings
 
- 
spawnParticledefault <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) 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.- Type Parameters:
- T- type of particle data (see- Particle.getDataType()
- Parameters:
- particle- the particle to spawn
- x- the position on the x axis to spawn at
- y- the position on the y axis to spawn at
- z- the position on the z axis to spawn at
- count- the number of particles
- offsetX- the maximum random offset on the X axis
- offsetY- the maximum random offset on the Y axis
- offsetZ- the maximum random offset on the Z axis
- extra- the extra data for this particle, depends on the particle used (normally speed)
- data- the data to use for the particle or null, the type of this depends on- Particle.getDataType()
- force- whether to send the particle to players within an extended range and encourage their client to render it regardless of settings
 
- 
locateNearestStructure@Nullable @Deprecated(since="1.19") @Nullable Location locateNearestStructure(@NotNull @NotNull Location origin, @NotNull StructureType structureType, int radius, boolean findUnexplored) Deprecated.Find the closest nearby structure of a givenStructureType. Finding unexplored structures 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 an unexplored structure.The radiusis 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_MANSIONcan 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. - Parameters:
- origin- where to start looking for a structure
- structureType- the type of structure to find
- radius- the radius, in chunks, around which to search
- findUnexplored- true to only find unexplored structures
- Returns:
- the closest Location, or null if no structure of the specified type exists.
- See Also:
 
- 
locateNearestStructure@Nullable @Nullable StructureSearchResult locateNearestStructure(@NotNull @NotNull Location origin, @NotNull @NotNull StructureType structureType, int radius, boolean findUnexplored) Find the closest nearby structure of a givenStructureType. Finding unexplored structures 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 an unexplored structure.The radiusis 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_MANSIONcan 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 StructureTypeand aStructureis, that aStructureTypecan refer to multipleStructureswhile searching for aStructurewhile only search for the givenStructure.- Parameters:
- origin- where to start looking for a structure
- structureType- the type of structure to find
- radius- the radius, in chunks, around which to search
- findUnexplored- true to only find unexplored structures
- Returns:
- the closest LocationandStructure, or null if no structure of the specified type exists.
- See Also:
 
- 
locateNearestStructure@Nullable @Nullable StructureSearchResult locateNearestStructure(@NotNull @NotNull Location origin, @NotNull @NotNull Structure structure, int radius, boolean findUnexplored) Find the closest nearby structure of a givenStructure. Finding unexplored structures 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 an unexplored structure.The radiusis 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.MANSIONcan 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 StructureTypeand aStructureis, that aStructureTypecan refer to multipleStructureswhile searching for aStructurewhile only search for the givenStructure.
- 
locateNearestBiome@Deprecated @Nullable default @Nullable Location locateNearestBiome(@NotNull @NotNull Location origin, @NotNull @NotNull Biome biome, int radius) Deprecated.Locates the nearest biome based on an origin, biome type, and radius to search. Step defaults to8.- Parameters:
- origin- Origin location
- biome- Biome to find
- radius- radius to search
- Returns:
- Location of biome or null if not found in specified radius
 
- 
locateNearestBiome@Deprecated @Nullable default @Nullable Location locateNearestBiome(@NotNull @NotNull Location origin, @NotNull @NotNull Biome biome, int radius, int step) Deprecated.Locates the nearest biome based on an origin, biome type, and radius to search and step- Parameters:
- origin- Origin location
- biome- Biome to find
- radius- radius to search
- step- Search step 1 would mean checking every block, 8 would be every 8th block
- Returns:
- Location of biome or null if not found in specified radius
 
- 
getCoordinateScaledouble getCoordinateScale()Gets the coordinate scaling of this world.- Returns:
- the coordinate scale
 
- 
isFixedTimeboolean isFixedTime()Checks if this world has a fixed time- Returns:
- whether this world has fixed time
 
- 
getInfiniburnGets the collection of materials that burn infinitely in this world.- Returns:
- the materials that will forever stay lit by fire
 
- 
sendGameEventvoid sendGameEvent(@Nullable @Nullable Entity sourceEntity, @NotNull @NotNull GameEvent gameEvent, @NotNull @NotNull Vector position) Posts a specified game event at a location- Parameters:
- sourceEntity- optional source entity
- gameEvent- the game event to post
- position- the position in the world where to post the event to listeners
 
- 
spigotDeprecated.Unsupported api
- 
locateNearestBiome@Nullable default @Nullable BiomeSearchResult locateNearestBiome(@NotNull @NotNull Location origin, int radius, @NotNull @NotNull Biome... biomes) Find the closest nearby location with a biome matching the providedBiome(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. 
- 
locateNearestBiome@Nullable @Nullable BiomeSearchResult locateNearestBiome(@NotNull @NotNull Location origin, int radius, int horizontalInterval, int verticalInterval, @NotNull @NotNull Biome... biomes) Find the closest nearby location with a biome matching the providedBiome(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 forhorizontalIntervalandverticalIntervalwill result in faster searches, but may lead to small biomes being missed.- Parameters:
- origin- where to start looking for a biome
- radius- the radius, in blocks, around which to search
- horizontalInterval- the horizontal distance between each check
- verticalInterval- the vertical distance between each check
- biomes- the biomes to search for
- Returns:
- a BiomeSearchResult containing the closest LocationandBiome, or null if no biome was found.
- See Also:
 
- 
locateNearestRaidFinds the nearest raid close to the given location.- Parameters:
- location- the origin location
- radius- the radius
- Returns:
- the closest Raid, or null if no raids were found
 
- 
getRaidGet a raid with the specific id fromRaid.getId()from this world.- Parameters:
- id- the id of the raid
- Returns:
- the raid or null if none with that id
 
- 
getRaidsGets all raids that are going on over this world.- Returns:
- the list of all active raids
 
- 
getEnderDragonBattleGet theDragonBattleassociated with this world. If this world's environment is notWorld.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. - Returns:
- the dragon battle instance
 
- 
getLocalDifficultyAtGets the local difficulty (based on inhabited time) at a location- Parameters:
- location- Location to check
- Returns:
- The local difficulty
 
- 
sendBlockHighlightCreates debug block highlight on specified block location and show it to all players on this world.Clients may be inconsistent in displaying it. - Parameters:
- location- Location to highlight
- duration- Duration for highlight to show in milliseconds
 
- 
sendBlockHighlightCreates debug block highlight on specified block location and show it to all players on this world.Clients may be inconsistent in displaying it. - Parameters:
- location- Location to highlight
- duration- Duration for highlight to show in milliseconds
- argb- Color of the highlight. ARGB int. Will be ignored on some versions of vanilla client
 
- 
sendBlockHighlightvoid sendBlockHighlight(@NotNull @NotNull Location location, int duration, @NotNull @NotNull String text) Creates debug block highlight on specified block location and show it to all players on this world.Clients may be inconsistent in displaying it. - Parameters:
- location- Location to highlight
- duration- Duration for highlight to show in milliseconds
- text- Text to show above the highlight
 
- 
sendBlockHighlightvoid sendBlockHighlight(@NotNull @NotNull Location location, int duration, @NotNull @NotNull String text, int argb) Creates debug block highlight on specified block location and show it to all players on this world.Clients may be inconsistent in displaying it. - Parameters:
- location- Location to highlight
- duration- Duration for highlight to show in milliseconds
- text- Text to show above the highlight
- argb- Color of the highlight. ARGB int. Will be ignored on some versions of vanilla client
 
- 
sendBlockHighlightvoid sendBlockHighlight(@NotNull @NotNull Location location, int duration, @NotNull Color color, int transparency) Creates debug block highlight on specified block location and show it to all players on this world.Clients may be inconsistent in displaying it. - Parameters:
- location- Location to highlight
- duration- Duration for highlight to show in milliseconds
- color- Color of the highlight. Will be ignored on some versions of vanilla client
- transparency- Transparency of the highlight
- Throws:
- IllegalArgumentException- If transparency is outside 0-255 range
 
- 
sendBlockHighlightvoid sendBlockHighlight(@NotNull @NotNull Location location, int duration, @NotNull @NotNull String text, @NotNull Color color, int transparency) Creates debug block highlight on specified block location and show it to all players on this world.Clients may be inconsistent in displaying it. - Parameters:
- location- Location to highlight
- duration- Duration for highlight to show in milliseconds
- text- Text to show above the highlight
- color- Color of the highlight. Will be ignored on some versions of vanilla client
- transparency- Transparency of the highlight
- Throws:
- IllegalArgumentException- If transparency is outside 0-255 range
 
- 
clearBlockHighlightsvoid clearBlockHighlights()Clears all debug block highlights for all players on this world.
- 
getFeatureFlagsGet allFeatureFlagenabled in this world.- Specified by:
- getFeatureFlagsin interface- FeatureFlagSetHolder
- Returns:
- all enabled FeatureFlag
 
- 
setViewDistancevoid setViewDistance(int viewDistance) Sets the view distance for this world.- Parameters:
- viewDistance- view distance in [2, 32]
 
- 
setSimulationDistancevoid setSimulationDistance(int simulationDistance) Sets the simulation distance for this world.- Parameters:
- simulationDistance- simulation distance in [2, 32]
 
- 
getNoTickViewDistanceDeprecated.Returns the no-tick view distance for this world.No-tick view distance is the view distance where chunks will load, however the chunks and their entities will not be set to tick. - Returns:
- The no-tick view distance for this world.
 
- 
setNoTickViewDistanceDeprecated.Sets the no-tick view distance for this world.No-tick view distance is the view distance where chunks will load, however the chunks and their entities will not be set to tick. - Parameters:
- viewDistance- view distance in [2, 32]
 
- 
getSendViewDistanceint getSendViewDistance()Gets the sending view distance for this world.Sending view distance is the view distance where chunks will load in for players in this world. - Returns:
- The sending view distance for this world.
 
- 
setSendViewDistancevoid setSendViewDistance(int viewDistance) Sets the sending view distance for this world.Sending view distance is the view distance where chunks will load in for players in this world. - Parameters:
- viewDistance- view distance in [2, 32] or -1
 
- 
getStructuresGets all generated structures that intersect the chunk at the given coordinates.
 If no structures are present an empty collection will be returned.- Parameters:
- x- X-coordinate of the chunk
- z- Z-coordinate of the chunk
- Returns:
- a collection of placed structures in the chunk at the given coordinates
 
- 
getStructures@NotNull @NotNull Collection<GeneratedStructure> getStructures(int x, int z, @NotNull @NotNull Structure structure) Gets all generated structures of a givenStructurethat intersect the chunk at the given coordinates.
 If no structures are present an empty collection will be returned.- Parameters:
- x- X-coordinate of the chunk
- z- Z-coordinate of the chunk
- structure- the structure to find
- Returns:
- a collection of placed structures in the chunk at the given coordinates
 
 
-