Bukkit  1.4.7-R1.0
 All Classes Namespaces Files Functions Variables Enumerator Pages
org.bukkit.World Interface Reference

Represents a world, which may contain entities, chunks and blocks. More...

+ Inheritance diagram for org.bukkit.World:
+ Collaboration diagram for org.bukkit.World:

Classes

enum  Environment
 Represents various map environment types that a world may be. More...
 

Public Member Functions

Block getBlockAt (int x, int y, int z)
 Gets the Block at the given coordinates.
 
Block getBlockAt (Location location)
 Gets the Block at the given Location.
 
int getBlockTypeIdAt (int x, int y, int z)
 Gets the block type ID at the given coordinates.
 
int getBlockTypeIdAt (Location location)
 Gets the block type ID at the given Location.
 
int getHighestBlockYAt (int x, int z)
 Gets the highest non-air coordinate at the given coordinates.
 
int getHighestBlockYAt (Location location)
 Gets the highest non-air coordinate at the given Location.
 
Block getHighestBlockAt (int x, int z)
 Gets the highest non-empty block at the given coordinates.
 
Block getHighestBlockAt (Location location)
 Gets the highest non-empty block at the given coordinates.
 
Chunk getChunkAt (int x, int z)
 Gets the Chunk at the given coordinates.
 
Chunk getChunkAt (Location location)
 Gets the Chunk at the given Location.
 
Chunk getChunkAt (Block block)
 Gets the Chunk that contains the given Block.
 
boolean isChunkLoaded (Chunk chunk)
 Checks if the specified Chunk is loaded.
 
Chunk[] getLoadedChunks ()
 Gets an array of all loaded Chunks.
 
void loadChunk (Chunk chunk)
 Loads the specified Chunk.
 
boolean isChunkLoaded (int x, int z)
 Checks if the Chunk at the specified coordinates is loaded.
 
boolean isChunkInUse (int x, int z)
 Checks if the Chunk at the specified coordinates is loaded and in use by one or more players.
 
void loadChunk (int x, int z)
 Loads the Chunk at the specified coordinates.
 
boolean loadChunk (int x, int z, boolean generate)
 Loads the Chunk at the specified coordinates.
 
boolean unloadChunk (Chunk chunk)
 Safely unloads and saves the Chunk at the specified coordinates.
 
boolean unloadChunk (int x, int z)
 Safely unloads and saves the Chunk at the specified coordinates.
 
boolean unloadChunk (int x, int z, boolean save)
 Safely unloads and optionally saves the Chunk at the specified coordinates.
 
boolean unloadChunk (int x, int z, boolean save, boolean safe)
 Unloads and optionally saves the Chunk at the specified coordinates.
 
boolean unloadChunkRequest (int x, int z)
 Safely queues the Chunk at the specified coordinates for unloading.
 
boolean unloadChunkRequest (int x, int z, boolean safe)
 Queues the Chunk at the specified coordinates for unloading.
 
boolean regenerateChunk (int x, int z)
 Regenerates the Chunk at the specified coordinates.
 
boolean refreshChunk (int x, int z)
 Resends the Chunk to all clients.
 
Item dropItem (Location location, ItemStack item)
 Drops an item at the specified Location.
 
Item dropItemNaturally (Location location, ItemStack item)
 Drops an item at the specified Location with a random offset.
 
Arrow spawnArrow (Location location, Vector velocity, float speed, float spread)
 Creates an Arrow entity at the given Location.
 
boolean generateTree (Location location, TreeType type)
 Creates a tree at the given Location.
 
boolean generateTree (Location loc, TreeType type, BlockChangeDelegate delegate)
 Creates a tree at the given Location.
 
Entity spawnEntity (Location loc, EntityType type)
 Creates a entity at the given Location.
 
LivingEntity spawnCreature (Location loc, EntityType type)
 Creates a creature at the given Location.
 
LivingEntity spawnCreature (Location loc, CreatureType type)
 Creates a creature at the given Location.
 
LightningStrike strikeLightning (Location loc)
 Strikes lightning at the given Location.
 
LightningStrike strikeLightningEffect (Location loc)
 Strikes lightning at the given Location without doing damage.
 
List< EntitygetEntities ()
 Get a list of all entities in this World.
 
List< LivingEntity > getLivingEntities ()
 Get a list of all living entities in this World.
 
public< T extends Entity >
Collection< T > 
getEntitiesByClass (Class< T >...classes)
 Get a collection of all entities in this World matching the given class/interface.
 
public< T extends Entity >
Collection< T > 
getEntitiesByClass (Class< T > cls)
 Get a collection of all entities in this World matching the given class/interface.
 
Collection< EntitygetEntitiesByClasses (Class<?>...classes)
 Get a collection of all entities in this World matching any of the given classes/interfaces.
 
List< PlayergetPlayers ()
 Get a list of all players in this World.
 
String getName ()
 Gets the unique name of this world.
 
UUID getUID ()
 Gets the Unique ID of this world.
 
Location getSpawnLocation ()
 Gets the default spawn Location of this world.
 
boolean setSpawnLocation (int x, int y, int z)
 Sets the spawn location of the world.
 
long getTime ()
 Gets the relative in-game time of this world.
 
void setTime (long time)
 Sets the relative in-game time on the server.
 
long getFullTime ()
 Gets the full in-game time on this world.
 
void setFullTime (long time)
 Sets the in-game time on the server.
 
boolean hasStorm ()
 Returns whether the world has an ongoing storm.
 
void setStorm (boolean hasStorm)
 Set whether there is a storm.
 
int getWeatherDuration ()
 Get the remaining time in ticks of the current conditions.
 
void setWeatherDuration (int duration)
 Set the remaining time in ticks of the current conditions.
 
boolean isThundering ()
 Returns whether there is thunder.
 
void setThundering (boolean thundering)
 Set whether it is thundering.
 
int getThunderDuration ()
 Get the thundering duration.
 
void setThunderDuration (int duration)
 Set the thundering duration.
 
boolean createExplosion (double x, double y, double z, float power)
 Creates explosion at given coordinates with given power.
 
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.
 
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.
 
boolean createExplosion (Location loc, float power)
 Creates explosion at given coordinates with given power.
 
boolean createExplosion (Location loc, float power, boolean setFire)
 Creates explosion at given coordinates with given power and optionally setting blocks on fire.
 
Environment getEnvironment ()
 Gets the Environment type of this world.
 
long getSeed ()
 Gets the Seed for this world.
 
boolean getPVP ()
 Gets the current PVP setting for this world.
 
void setPVP (boolean pvp)
 Sets the PVP setting for this world.
 
ChunkGenerator getGenerator ()
 Gets the chunk generator for this world.
 
void save ()
 Saves world to disk.
 
List< BlockPopulatorgetPopulators ()
 Gets a list of all applied BlockPopulators for this World.
 
public< T extends Entity > T spawn (Location location, Class< T > clazz) throws IllegalArgumentException
 Spawn an entity of a specific class at the given Location.
 
FallingBlock spawnFallingBlock (Location location, Material material, byte data) throws IllegalArgumentException
 Spawn a FallingBlock entity at the given Location of the specified Material.
 
FallingBlock spawnFallingBlock (Location location, int blockId, byte blockData) throws IllegalArgumentException
 Spawn a FallingBlock entity at the given Location of the specified blockId (converted to Material)
 
void playEffect (Location location, Effect effect, int data)
 Plays an effect to all players within a default radius around a given location.
 
void playEffect (Location location, Effect effect, int data, int radius)
 Plays an effect to all players within a given radius around a location.
 
public< T > void playEffect (Location location, Effect effect, T data)
 Plays an effect to all players within a default radius around a given location.
 
public< T > void playEffect (Location location, Effect effect, T data, int radius)
 Plays an effect to all players within a given radius around a location.
 
ChunkSnapshot getEmptyChunkSnapshot (int x, int z, boolean includeBiome, boolean includeBiomeTempRain)
 Get empty chunk snapshot (equivalent to all air blocks), optionally including valid biome data.
 
void setSpawnFlags (boolean allowMonsters, boolean allowAnimals)
 Sets the spawn flags for this.
 
boolean getAllowAnimals ()
 Gets whether animals can spawn in this world.
 
boolean getAllowMonsters ()
 Gets whether monsters can spawn in this world.
 
Biome getBiome (int x, int z)
 Gets the biome for the given block coordinates.
 
void setBiome (int x, int z, Biome bio)
 Sets the biome for the given block coordinates.
 
double getTemperature (int x, int z)
 Gets the temperature for the given block coordinates.
 
double getHumidity (int x, int z)
 Gets the humidity for the given block coordinates.
 
int getMaxHeight ()
 Gets the maximum height of this world.
 
int getSeaLevel ()
 Gets the sea level for this world.
 
boolean getKeepSpawnInMemory ()
 Gets whether the world's spawn area should be kept loaded into memory or not.
 
void setKeepSpawnInMemory (boolean keepLoaded)
 Sets whether the world's spawn area should be kept loaded into memory or not.
 
boolean isAutoSave ()
 Gets whether or not the world will automatically save.
 
void setAutoSave (boolean value)
 Sets whether or not the world will automatically save.
 
void setDifficulty (Difficulty difficulty)
 Sets the Difficulty of the world.
 
Difficulty getDifficulty ()
 Gets the Difficulty of the world.
 
File getWorldFolder ()
 Gets the folder of this world on disk.
 
WorldType getWorldType ()
 Gets the type of this world.
 
boolean canGenerateStructures ()
 Gets whether or not structures are being generated.
 
long getTicksPerAnimalSpawns ()
 Gets the world's ticks per animal spawns value.
 
void setTicksPerAnimalSpawns (int ticksPerAnimalSpawns)
 Sets the world's ticks per animal spawns value.
 
long getTicksPerMonsterSpawns ()
 Gets the world's ticks per monster spawns value.
 
void setTicksPerMonsterSpawns (int ticksPerMonsterSpawns)
 Sets the world's ticks per monster spawns value.
 
int getMonsterSpawnLimit ()
 Gets limit for number of monsters that can spawn in a chunk in this world.
 
void setMonsterSpawnLimit (int limit)
 Sets the limit for number of monsters that can spawn in a chunk in this world.
 
int getAnimalSpawnLimit ()
 Gets the limit for number of animals that can spawn in a chunk in this world.
 
void setAnimalSpawnLimit (int limit)
 Sets the limit for number of animals that can spawn in a chunk in this world.
 
int getWaterAnimalSpawnLimit ()
 Gets the limit for number of water animals that can spawn in a chunk in this world.
 
void setWaterAnimalSpawnLimit (int limit)
 Sets the limit for number of water animals that can spawn in a chunk in this world.
 
int getAmbientSpawnLimit ()
 Gets the limit for number of ambient mobs that can spawn in a chunk in this world.
 
void setAmbientSpawnLimit (int limit)
 Sets the limit for number of ambient mobs that can spawn in a chunk in this world.
 
void playSound (Location loc, Sound sound, float volume, float pitch)
 Play a Sound at the provided Location in the World.
 
String[] getGameRules ()
 Get existing rules.
 
String getGameRuleValue (String rule)
 Gets the current state of the specified rule.
 
boolean setGameRuleValue (String rule, String value)
 Set the specified gamerule to specified value.
 
boolean isGameRule (String rule)
 Checks if string is a valid game rule.
 
- Public Member Functions inherited from org.bukkit.plugin.messaging.PluginMessageRecipient
void sendPluginMessage (Plugin source, String channel, byte[] message)
 Sends this recipient a Plugin Message on the specified outgoing channel.
 
Set< String > getListeningPluginChannels ()
 Gets a set containing all the Plugin Channels that this client is listening on.
 

Detailed Description

Represents a world, which may contain entities, chunks and blocks.

Definition at line 23 of file World.java.

Member Function Documentation

boolean org.bukkit.World.canGenerateStructures ( )

Gets whether or not structures are being generated.

Returns
True if structures are being generated.
boolean org.bukkit.World.createExplosion ( double  x,
double  y,
double  z,
float  power 
)

Creates explosion at given coordinates with given power.

Parameters
xX coordinate
yY coordinate
zZ coordinate
powerThe power of explosion, where 4F is TNT
Returns
false if explosion was canceled, otherwise true
boolean org.bukkit.World.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
xX coordinate
yY coordinate
zZ coordinate
powerThe power of explosion, where 4F is TNT
setFireWhether or not to set blocks on fire
Returns
false if explosion was canceled, otherwise true
boolean org.bukkit.World.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
xX coordinate
yY coordinate
zZ coordinate
powerThe power of explosion, where 4F is TNT
setFireWhether or not to set blocks on fire
breakBlocksWhether or not to have blocks be destroyed
Returns
false if explosion was canceled, otherwise true
boolean org.bukkit.World.createExplosion ( Location  loc,
float  power 
)

Creates explosion at given coordinates with given power.

Parameters
locLocation to blow up
powerThe power of explosion, where 4F is TNT
Returns
false if explosion was canceled, otherwise true
boolean org.bukkit.World.createExplosion ( Location  loc,
float  power,
boolean  setFire 
)

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

Parameters
locLocation to blow up
powerThe power of explosion, where 4F is TNT
setFireWhether or not to set blocks on fire
Returns
false if explosion was canceled, otherwise true
Item org.bukkit.World.dropItem ( Location  location,
ItemStack  item 
)

Drops an item at the specified Location.

Parameters
locationLocation to drop the item
itemItemStack to drop
Returns
ItemDrop entity created as a result of this method
Item org.bukkit.World.dropItemNaturally ( Location  location,
ItemStack  item 
)

Drops an item at the specified Location with a random offset.

Parameters
locationLocation to drop the item
itemItemStack to drop
Returns
ItemDrop entity created as a result of this method

Referenced by org.bukkit.inventory.InventoryView.setItem().

boolean org.bukkit.World.generateTree ( Location  location,
TreeType  type 
)

Creates a tree at the given Location.

Parameters
locationLocation to spawn the tree
typeType of the tree to create
Returns
true if the tree was created successfully, otherwise false
boolean org.bukkit.World.generateTree ( Location  loc,
TreeType  type,
BlockChangeDelegate  delegate 
)

Creates a tree at the given Location.

Parameters
locLocation to spawn the tree
typeType of the tree to create
delegateA class to call for each block changed as a result of this method
Returns
true if the tree was created successfully, otherwise false
boolean org.bukkit.World.getAllowAnimals ( )

Gets whether animals can spawn in this world.

Returns
whether animals can spawn in this world.
boolean org.bukkit.World.getAllowMonsters ( )

Gets whether monsters can spawn in this world.

Returns
whether monsters can spawn in this world.
int org.bukkit.World.getAmbientSpawnLimit ( )

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

Returns
The ambient spawn limit
int org.bukkit.World.getAnimalSpawnLimit ( )

Gets the limit for number of animals that can spawn in a chunk in this world.

Returns
The animal spawn limit
Biome org.bukkit.World.getBiome ( int  x,
int  z 
)

Gets the biome for the given block coordinates.

Parameters
xX coordinate of the block
zZ coordinate of the block
Returns
Biome of the requested block
Block org.bukkit.World.getBlockAt ( int  x,
int  y,
int  z 
)

Gets the Block at the given coordinates.

Parameters
xX-coordinate of the block
yY-coordinate of the block
zZ-coordinate of the block
Returns
Block at the given coordinates
See Also
getBlockTypeIdAt(int, int, int) Returns the current type ID of the block

Referenced by org.bukkit.util.BlockIterator.BlockIterator(), org.bukkit.generator.ChunkGenerator.canSpawn(), and org.bukkit.Location.getBlock().

Block org.bukkit.World.getBlockAt ( Location  location)

Gets the Block at the given Location.

Parameters
locationLocation of the block
Returns
Block at the given location
See Also
getBlockTypeIdAt(org.bukkit.Location) Returns the current type ID of the block
int org.bukkit.World.getBlockTypeIdAt ( int  x,
int  y,
int  z 
)

Gets the block type ID at the given coordinates.

Parameters
xX-coordinate of the block
yY-coordinate of the block
zZ-coordinate of the block
Returns
Type ID of the block at the given coordinates
See Also
getBlockAt(int, int, int) Returns a live Block object at the given location
int org.bukkit.World.getBlockTypeIdAt ( Location  location)

Gets the block type ID at the given Location.

Parameters
locationLocation of the block
Returns
Type ID of the block at the given location
See Also
getBlockAt(org.bukkit.Location) Returns a live Block object at the given location
Chunk org.bukkit.World.getChunkAt ( int  x,
int  z 
)

Gets the Chunk at the given coordinates.

Parameters
xX-coordinate of the chunk
zZ-coordinate of the chunk
Returns
Chunk at the given coordinates

Referenced by org.bukkit.Location.getChunk().

Chunk org.bukkit.World.getChunkAt ( Location  location)

Gets the Chunk at the given Location.

Parameters
locationLocation of the chunk
Returns
Chunk at the given location
Chunk org.bukkit.World.getChunkAt ( Block  block)

Gets the Chunk that contains the given Block.

Parameters
blockBlock to get the containing chunk from
Returns
The chunk that contains the given block
Difficulty org.bukkit.World.getDifficulty ( )

Gets the Difficulty of the world.

Returns
The difficulty of the world.
ChunkSnapshot org.bukkit.World.getEmptyChunkSnapshot ( int  x,
int  z,
boolean  includeBiome,
boolean  includeBiomeTempRain 
)

Get empty chunk snapshot (equivalent to all air blocks), optionally including valid biome data.

Used for representing an ungenerated chunk, or for fetching only biome data without loading a chunk.

Parameters
x- chunk x coordinate
z- chunk z coordinate
includeBiome- if true, snapshot includes per-coordinate biome type
includeBiomeTempRain- if true, snapshot includes per-coordinate raw biome temperature and rainfall
Returns
The empty snapshot.
List<Entity> org.bukkit.World.getEntities ( )

Get a list of all entities in this World.

Returns
A List of all Entities currently residing in this world
public<T extends Entity> Collection<T> org.bukkit.World.getEntitiesByClass ( Class< T >...  classes)

Get a collection of all entities in this World matching the given class/interface.

Parameters
classesThe 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
public<T extends Entity> Collection<T> org.bukkit.World.getEntitiesByClass ( Class< T >  cls)

Get a collection of all entities in this World matching the given class/interface.

Parameters
clsThe 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
Collection<Entity> org.bukkit.World.getEntitiesByClasses ( Class<?>...  classes)

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

Parameters
classesThe 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
Environment org.bukkit.World.getEnvironment ( )

Gets the Environment type of this world.

Returns
This worlds Environment type

Referenced by org.bukkit.generator.ChunkGenerator.canSpawn(), and org.bukkit.WorldCreator.copy().

long org.bukkit.World.getFullTime ( )

Gets the full in-game time on this world.

Returns
The current absolute time
See Also
getTime() Returns a relative time of this world
String [] org.bukkit.World.getGameRules ( )

Get existing rules.

Returns
An array of rules
String org.bukkit.World.getGameRuleValue ( String  rule)

Gets the current state of the specified rule.

Will return null if rule passed is null

Parameters
ruleRule to look up value of
Returns
String value of rule

Referenced by org.bukkit.command.defaults.GameRuleCommand.execute().

ChunkGenerator org.bukkit.World.getGenerator ( )

Gets the chunk generator for this world.

Returns
ChunkGenerator associated with this world

Referenced by org.bukkit.WorldCreator.copy().

Block org.bukkit.World.getHighestBlockAt ( int  x,
int  z 
)

Gets the highest non-empty block at the given coordinates.

Parameters
xX-coordinate of the block
zZ-coordinate of the block
Returns
Highest non-empty block
Block org.bukkit.World.getHighestBlockAt ( Location  location)

Gets the highest non-empty block at the given coordinates.

Parameters
locationCoordinates to get the highest block
Returns
Highest non-empty block
int org.bukkit.World.getHighestBlockYAt ( int  x,
int  z 
)

Gets the highest non-air coordinate at the given coordinates.

Parameters
xX-coordinate of the blocks
zZ-coordinate of the blocks
Returns
Y-coordinate of the highest non-air block

Referenced by org.bukkit.generator.ChunkGenerator.canSpawn().

int org.bukkit.World.getHighestBlockYAt ( Location  location)

Gets the highest non-air coordinate at the given Location.

Parameters
locationLocation of the blocks
Returns
Y-coordinate of the highest non-air block
double org.bukkit.World.getHumidity ( int  x,
int  z 
)

Gets the humidity for the given block coordinates.

It is safe to run this method when the block does not exist, it will not create the block.

Parameters
xX coordinate of the block
zZ coordinate of the block
Returns
Humidity of the requested block
boolean org.bukkit.World.getKeepSpawnInMemory ( )

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.
List<LivingEntity> org.bukkit.World.getLivingEntities ( )

Get a list of all living entities in this World.

Returns
A List of all LivingEntities currently residing in this world
Chunk [] org.bukkit.World.getLoadedChunks ( )

Gets an array of all loaded Chunks.

Returns
Chunk[] containing all loaded chunks
int org.bukkit.World.getMaxHeight ( )

Gets the maximum height of this world.

If the max height is 100, there are only blocks from y=0 to y=99.

Returns
Maximum height of the world

Referenced by org.bukkit.command.defaults.SpawnpointCommand.execute().

int org.bukkit.World.getMonsterSpawnLimit ( )

Gets limit for number of monsters that can spawn in a chunk in this world.

Returns
The monster spawn limit
String org.bukkit.World.getName ( )

Gets the unique name of this world.

Returns
Name of this world

Referenced by org.bukkit.Location.distanceSquared(), and org.bukkit.command.defaults.ToggleDownfallCommand.execute().

List<Player> org.bukkit.World.getPlayers ( )

Get a list of all players in this World.

Returns
A list of all Players currently residing in this world
List<BlockPopulator> org.bukkit.World.getPopulators ( )

Gets a list of all applied BlockPopulators for this World.

Returns
List containing any or none BlockPopulators
boolean org.bukkit.World.getPVP ( )

Gets the current PVP setting for this world.

Returns
True if PVP is enabled
int org.bukkit.World.getSeaLevel ( )

Gets the sea level for this world.

This is often half of getMaxHeight()

Returns
Sea level
Location org.bukkit.World.getSpawnLocation ( )

Gets the default spawn Location of this world.

Returns
The spawn location of this world
double org.bukkit.World.getTemperature ( int  x,
int  z 
)

Gets the temperature for the given block coordinates.

It is safe to run this method when the block does not exist, it will not create the block.

Parameters
xX coordinate of the block
zZ coordinate of the block
Returns
Temperature of the requested block
int org.bukkit.World.getThunderDuration ( )

Get the thundering duration.

Returns
Duration in ticks
long org.bukkit.World.getTicksPerAnimalSpawns ( )

Gets the world's ticks per animal spawns value.

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

Example Usage:

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

Note: If set to 0, animal spawning will be disabled for this world. We recommend using setSpawnFlags(boolean, boolean) to control this instead.

Minecraft default: 400.

Returns
The world's ticks per animal spawns value
long org.bukkit.World.getTicksPerMonsterSpawns ( )

Gets the world's ticks per monster spawns value.

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

Example Usage:

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

Note: If set to 0, monsters spawning will be disabled for this world. We recommend using setSpawnFlags(boolean, boolean) to control this instead.

Minecraft default: 1.

Returns
The world's ticks per monster spawns value
long org.bukkit.World.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
getFullTime() Returns an absolute time of this world
UUID org.bukkit.World.getUID ( )

Gets the Unique ID of this world.

Returns
Unique ID of this world.
int org.bukkit.World.getWaterAnimalSpawnLimit ( )

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

Returns
The water animal spawn limit
int org.bukkit.World.getWeatherDuration ( )

Get the remaining time in ticks of the current conditions.

Returns
Time in ticks
File org.bukkit.World.getWorldFolder ( )

Gets the folder of this world on disk.

Returns
The folder of this world.
WorldType org.bukkit.World.getWorldType ( )

Gets the type of this world.

Returns
Type of this world.
boolean org.bukkit.World.hasStorm ( )

Returns whether the world has an ongoing storm.

Returns
Whether there is an ongoing storm

Referenced by org.bukkit.command.defaults.ToggleDownfallCommand.execute().

boolean org.bukkit.World.isAutoSave ( )

Gets whether or not the world will automatically save.

Returns
true if the world will automatically save, otherwise false
boolean org.bukkit.World.isChunkInUse ( int  x,
int  z 
)

Checks if the Chunk at the specified coordinates is loaded and in use by one or more players.

Parameters
xX-coordinate of the chunk
zZ-coordinate of the chunk
Returns
true if the chunk is loaded and in use by one or more players, otherwise false
boolean org.bukkit.World.isChunkLoaded ( Chunk  chunk)

Checks if the specified Chunk is loaded.

Parameters
chunkThe chunk to check
Returns
true if the chunk is loaded, otherwise false
boolean org.bukkit.World.isChunkLoaded ( int  x,
int  z 
)

Checks if the Chunk at the specified coordinates is loaded.

Parameters
xX-coordinate of the chunk
zZ-coordinate of the chunk
Returns
true if the chunk is loaded, otherwise false
boolean org.bukkit.World.isGameRule ( String  rule)

Checks if string is a valid game rule.

Parameters
ruleRule to check
Returns
True if rule exists

Referenced by org.bukkit.command.defaults.GameRuleCommand.execute().

boolean org.bukkit.World.isThundering ( )

Returns whether there is thunder.

Returns
Whether there is thunder
void org.bukkit.World.loadChunk ( Chunk  chunk)

Loads the specified Chunk.

Parameters
chunkThe chunk to load
void org.bukkit.World.loadChunk ( int  x,
int  z 
)

Loads the Chunk at the specified coordinates.

If the chunk does not exist, it will be generated. This method is analogous to loadChunk(int, int, boolean) where generate is true.

Parameters
xX-coordinate of the chunk
zZ-coordinate of the chunk
boolean org.bukkit.World.loadChunk ( int  x,
int  z,
boolean  generate 
)

Loads the Chunk at the specified coordinates.

Parameters
xX-coordinate of the chunk
zZ-coordinate of the chunk
generateWhether or not to generate a chunk if it doesn't already exist
Returns
true if the chunk has loaded successfully, otherwise false
void org.bukkit.World.playEffect ( Location  location,
Effect  effect,
int  data 
)

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

Parameters
locationthe Location around which players must be to hear the sound
effectthe Effect
dataa data bit needed for some effects
void org.bukkit.World.playEffect ( Location  location,
Effect  effect,
int  data,
int  radius 
)

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

Parameters
locationthe Location around which players must be to hear the effect
effectthe Effect
dataa data bit needed for some effects
radiusthe radius around the location
public<T> void org.bukkit.World.playEffect ( Location  location,
Effect  effect,
data 
)

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

Parameters
locationthe Location around which players must be to hear the sound
effectthe Effect
dataa data bit needed for some effects
public<T> void org.bukkit.World.playEffect ( Location  location,
Effect  effect,
data,
int  radius 
)

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

Parameters
locationthe Location around which players must be to hear the effect
effectthe Effect
dataa data bit needed for some effects
radiusthe radius around the location
void org.bukkit.World.playSound ( Location  loc,
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
locationThe location to play the sound
soundThe sound to play
volumeThe volume of the sound
pitchThe pitch of the sound
boolean org.bukkit.World.refreshChunk ( int  x,
int  z 
)

Resends the Chunk to all clients.

Parameters
xX-coordinate of the chunk
zZ-coordinate of the chunk
Returns
Whether the chunk was actually refreshed
boolean org.bukkit.World.regenerateChunk ( int  x,
int  z 
)

Regenerates the Chunk at the specified coordinates.

Parameters
xX-coordinate of the chunk
zZ-coordinate of the chunk
Returns
Whether the chunk was actually regenerated
void org.bukkit.World.save ( )

Saves world to disk.

void org.bukkit.World.setAmbientSpawnLimit ( int  limit)

Sets the limit for number of ambient mobs that can spawn in a chunk in this world.

Note: If set to a negative number the world will use the server-wide spawn limit instead.

void org.bukkit.World.setAnimalSpawnLimit ( int  limit)

Sets the limit for number of animals that can spawn in a chunk in this world.

Note: If set to a negative number the world will use the server-wide spawn limit instead.

void org.bukkit.World.setAutoSave ( boolean  value)

Sets whether or not the world will automatically save.

Parameters
valuetrue if the world should automatically save, otherwise false
void org.bukkit.World.setBiome ( int  x,
int  z,
Biome  bio 
)

Sets the biome for the given block coordinates.

Parameters
xX coordinate of the block
zZ coordinate of the block
bionew Biome type for this block
void org.bukkit.World.setDifficulty ( Difficulty  difficulty)

Sets the Difficulty of the world.

Parameters
difficultythe new difficulty you want to set the world to
void org.bukkit.World.setFullTime ( long  time)

Sets the in-game time on the server.

Note that this sets the full time of the world, which may cause adverse effects such as breaking redstone clocks and any scheduled events

Parameters
timeThe new absolute time to set this world to
See Also
setTime(long) Sets the relative time of this world
boolean org.bukkit.World.setGameRuleValue ( String  rule,
String  value 
)

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
ruleRule to set
valueValue to set rule to
Returns
True if rule was set

Referenced by org.bukkit.command.defaults.GameRuleCommand.execute().

void org.bukkit.World.setKeepSpawnInMemory ( boolean  keepLoaded)

Sets whether the world's spawn area should be kept loaded into memory or not.

Parameters
keepLoadedif true then the world's spawn area will be kept loaded into memory.
void org.bukkit.World.setMonsterSpawnLimit ( int  limit)

Sets the limit for number of monsters that can spawn in a chunk in this world.

Note: If set to a negative number the world will use the server-wide spawn limit instead.

void org.bukkit.World.setPVP ( boolean  pvp)

Sets the PVP setting for this world.

Parameters
pvpTrue/False whether PVP should be Enabled.
void org.bukkit.World.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.
boolean org.bukkit.World.setSpawnLocation ( int  x,
int  y,
int  z 
)

Sets the spawn location of the world.

Parameters
xX coordinate
yY coordinate
zZ coordinate
Returns
True if it was successfully set.
void org.bukkit.World.setStorm ( boolean  hasStorm)

Set whether there is a storm.

A duration will be set for the new current conditions.

Parameters
hasStormWhether there is rain and snow

Referenced by org.bukkit.command.defaults.ToggleDownfallCommand.execute(), and org.bukkit.command.defaults.WeatherCommand.execute().

void org.bukkit.World.setThunderDuration ( int  duration)

Set the thundering duration.

Parameters
durationDuration in ticks

Referenced by org.bukkit.command.defaults.WeatherCommand.execute().

void org.bukkit.World.setThundering ( boolean  thundering)

Set whether it is thundering.

Parameters
thunderingWhether it is thundering

Referenced by org.bukkit.command.defaults.WeatherCommand.execute().

void org.bukkit.World.setTicksPerAnimalSpawns ( int  ticksPerAnimalSpawns)

Sets the world's ticks per animal spawns value.

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

Example Usage:

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

Note: If set to 0, animal spawning will be disabled for this world. We recommend using setSpawnFlags(boolean, boolean) to control this instead.

Minecraft default: 400.

Parameters
ticksPerAnimalSpawnsthe ticks per animal spawns value you want to set the world to
void org.bukkit.World.setTicksPerMonsterSpawns ( int  ticksPerMonsterSpawns)

Sets the world's ticks per monster spawns value.

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

Example Usage:

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

Note: If set to 0, monsters spawning will be disabled for this world. We recommend using setSpawnFlags(boolean, boolean) to control this instead.

Minecraft default: 1.

Parameters
ticksPerMonsterSpawnsthe ticks per monster spawns value you want to set the world to
void org.bukkit.World.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

Parameters
timeThe new relative time to set the in-game time to (in hours*1000)
See Also
setFullTime(long) Sets the absolute time of this world
void org.bukkit.World.setWaterAnimalSpawnLimit ( int  limit)

Sets the limit for number of water animals that can spawn in a chunk in this world.

Note: If set to a negative number the world will use the server-wide spawn limit instead.

void org.bukkit.World.setWeatherDuration ( int  duration)

Set the remaining time in ticks of the current conditions.

Parameters
durationTime in ticks

Referenced by org.bukkit.command.defaults.WeatherCommand.execute().

public<T extends Entity> T org.bukkit.World.spawn ( Location  location,
Class< T >  clazz 
) throws IllegalArgumentException

Spawn an entity of a specific class at the given Location.

Parameters
locationthe Location to spawn the entity at
clazzthe class of the Entity to spawn
<T>the class of the Entity to spawn
Returns
an instance of the spawned Entity
Exceptions
IllegalArgumentExceptionif either parameter is null or the Entity requested cannot be spawned
Arrow org.bukkit.World.spawnArrow ( Location  location,
Vector  velocity,
float  speed,
float  spread 
)

Creates an Arrow entity at the given Location.

Parameters
locationLocation to spawn the arrow
velocityVelocity to shoot the arrow in
speedSpeed of the arrow. A recommend speed is 0.6
spreadSpread of the arrow. A recommend spread is 12
Returns
Arrow entity spawned as a result of this method
LivingEntity org.bukkit.World.spawnCreature ( Location  loc,
EntityType  type 
)

Creates a creature at the given Location.

Parameters
locThe location to spawn the creature
typeThe creature to spawn
Returns
Resulting LivingEntity of this method, or null if it was unsuccessful
Deprecated:
Has issues spawning non LivingEntities. Use spawnEntity instead.
LivingEntity org.bukkit.World.spawnCreature ( Location  loc,
CreatureType  type 
)

Creates a creature at the given Location.

Parameters
locThe location to spawn the creature
typeThe creature to spawn
Returns
Resulting LivingEntity of this method, or null if it was unsuccessful
Entity org.bukkit.World.spawnEntity ( Location  loc,
EntityType  type 
)

Creates a entity at the given Location.

Parameters
locThe location to spawn the entity
typeThe entity to spawn
Returns
Resulting Entity of this method, or null if it was unsuccessful
FallingBlock org.bukkit.World.spawnFallingBlock ( Location  location,
Material  material,
byte  data 
) throws IllegalArgumentException

Spawn a FallingBlock entity at the given Location of the specified Material.

The material dictates what is falling. When the FallingBlock hits the ground, it will place that block.

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

Parameters
locationThe Location to spawn the FallingBlock
materialThe block Material type
dataThe block data
Returns
The spawned FallingBlock instance
Exceptions
IllegalArgumentExceptionif Location or Material are null or Material is not a block
FallingBlock org.bukkit.World.spawnFallingBlock ( Location  location,
int  blockId,
byte  blockData 
) throws IllegalArgumentException

Spawn a FallingBlock entity at the given Location of the specified blockId (converted to Material)

Parameters
locationThe Location to spawn the FallingBlock
blockIdsee {
See Also
spawnFallingBlock(org.bukkit.Location, org.bukkit.Material, byte)} material
Parameters
blockDataThe block data
Returns
The spawned FallingBlock instance
Exceptions
IllegalArgumentExceptionsee {
See Also
spawnFallingBlock(org.bukkit.Location, org.bukkit.Material, byte)}
LightningStrike org.bukkit.World.strikeLightning ( Location  loc)

Strikes lightning at the given Location.

Parameters
locThe location to strike lightning
Returns
The lightning entity.
LightningStrike org.bukkit.World.strikeLightningEffect ( Location  loc)

Strikes lightning at the given Location without doing damage.

Parameters
locThe location to strike lightning
Returns
The lightning entity.
boolean org.bukkit.World.unloadChunk ( Chunk  chunk)

Safely unloads and saves the Chunk at the specified coordinates.

This method is analogous to unloadChunk(int, int, boolean, boolean) where safe and saveis true

Parameters
chunkthe chunk to unload
Returns
true if the chunk has unloaded successfully, otherwise false
boolean org.bukkit.World.unloadChunk ( int  x,
int  z 
)

Safely unloads and saves the Chunk at the specified coordinates.

This method is analogous to unloadChunk(int, int, boolean, boolean) where safe and saveis true

Parameters
xX-coordinate of the chunk
zZ-coordinate of the chunk
Returns
true if the chunk has unloaded successfully, otherwise false
boolean org.bukkit.World.unloadChunk ( int  x,
int  z,
boolean  save 
)

Safely unloads and optionally saves the Chunk at the specified coordinates.

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

Parameters
xX-coordinate of the chunk
zZ-coordinate of the chunk
saveWhether or not to save the chunk
Returns
true if the chunk has unloaded successfully, otherwise false
boolean org.bukkit.World.unloadChunk ( int  x,
int  z,
boolean  save,
boolean  safe 
)

Unloads and optionally saves the Chunk at the specified coordinates.

Parameters
xX-coordinate of the chunk
zZ-coordinate of the chunk
saveControls whether the chunk is saved
safeControls whether to unload the chunk when players are nearby
Returns
true if the chunk has unloaded successfully, otherwise false
boolean org.bukkit.World.unloadChunkRequest ( int  x,
int  z 
)

Safely queues the Chunk at the specified coordinates for unloading.

This method is analogous to unloadChunkRequest(int, int, boolean) where safe is true

Parameters
xX-coordinate of the chunk
zZ-coordinate of the chunk
Returns
true is the queue attempt was successful, otherwise false
boolean org.bukkit.World.unloadChunkRequest ( int  x,
int  z,
boolean  safe 
)

Queues the Chunk at the specified coordinates for unloading.

Parameters
xX-coordinate of the chunk
zZ-coordinate of the chunk
safeControls whether to queue the chunk when players are nearby
Returns
Whether the chunk was actually queued

The documentation for this interface was generated from the following file: