Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.World Interface Reference
Inheritance diagram for org.bukkit.World:
org.bukkit.plugin.messaging.PluginMessageRecipient org.bukkit.metadata.Metadatable

Classes

enum  Environment
 

Public Member Functions

Block getBlockAt (int x, int y, int z)
 
Block getBlockAt (Location location)
 
int getBlockTypeIdAt (int x, int y, int z)
 
int getBlockTypeIdAt (Location location)
 
int getHighestBlockYAt (int x, int z)
 
int getHighestBlockYAt (Location location)
 
Block getHighestBlockAt (int x, int z)
 
Block getHighestBlockAt (Location location)
 
Chunk getChunkAt (int x, int z)
 
Chunk getChunkAt (Location location)
 
Chunk getChunkAt (Block block)
 
boolean isChunkLoaded (Chunk chunk)
 
Chunk[] getLoadedChunks ()
 
void loadChunk (Chunk chunk)
 
boolean isChunkLoaded (int x, int z)
 
boolean isChunkInUse (int x, int z)
 
void loadChunk (int x, int z)
 
boolean loadChunk (int x, int z, boolean generate)
 
boolean unloadChunk (Chunk chunk)
 
boolean unloadChunk (int x, int z)
 
boolean unloadChunk (int x, int z, boolean save)
 
boolean unloadChunk (int x, int z, boolean save, boolean safe)
 
boolean unloadChunkRequest (int x, int z)
 
boolean unloadChunkRequest (int x, int z, boolean safe)
 
boolean regenerateChunk (int x, int z)
 
boolean refreshChunk (int x, int z)
 
Item dropItem (Location location, ItemStack item)
 
Item dropItemNaturally (Location location, ItemStack item)
 
Arrow spawnArrow (Location location, Vector direction, float speed, float spread)
 
boolean generateTree (Location location, TreeType type)
 
boolean generateTree (Location loc, TreeType type, BlockChangeDelegate delegate)
 
Entity spawnEntity (Location loc, EntityType type)
 
LivingEntity spawnCreature (Location loc, EntityType type)
 
LivingEntity spawnCreature (Location loc, CreatureType type)
 
LightningStrike strikeLightning (Location loc)
 
LightningStrike strikeLightningEffect (Location loc)
 
List< EntitygetEntities ()
 
List< LivingEntitygetLivingEntities ()
 
public< T extends Entity > Collection< T > getEntitiesByClass (Class< T >...classes)
 
public< T extends Entity > Collection< T > getEntitiesByClass (Class< T > cls)
 
Collection< EntitygetEntitiesByClasses (Class<?>...classes)
 
List< PlayergetPlayers ()
 
String getName ()
 
UUID getUID ()
 
Location getSpawnLocation ()
 
boolean setSpawnLocation (int x, int y, int z)
 
long getTime ()
 
void setTime (long time)
 
long getFullTime ()
 
void setFullTime (long time)
 
boolean hasStorm ()
 
void setStorm (boolean hasStorm)
 
int getWeatherDuration ()
 
void setWeatherDuration (int duration)
 
boolean isThundering ()
 
void setThundering (boolean thundering)
 
int getThunderDuration ()
 
void setThunderDuration (int duration)
 
boolean createExplosion (double x, double y, double z, float power)
 
boolean createExplosion (double x, double y, double z, float power, boolean setFire)
 
boolean createExplosion (double x, double y, double z, float power, boolean setFire, boolean breakBlocks)
 
boolean createExplosion (Location loc, float power)
 
boolean createExplosion (Location loc, float power, boolean setFire)
 
Environment getEnvironment ()
 
long getSeed ()
 
boolean getPVP ()
 
void setPVP (boolean pvp)
 
ChunkGenerator getGenerator ()
 
void save ()
 
List< BlockPopulatorgetPopulators ()
 
public< T extends Entity > T spawn (Location location, Class< T > clazz) throws IllegalArgumentException
 
FallingBlock spawnFallingBlock (Location location, Material material, byte data) throws IllegalArgumentException
 
FallingBlock spawnFallingBlock (Location location, int blockId, byte blockData) throws IllegalArgumentException
 
void playEffect (Location location, Effect effect, int data)
 
void playEffect (Location location, Effect effect, int data, int radius)
 
public< T > void playEffect (Location location, Effect effect, T data)
 
public< T > void playEffect (Location location, Effect effect, T data, int radius)
 
ChunkSnapshot getEmptyChunkSnapshot (int x, int z, boolean includeBiome, boolean includeBiomeTempRain)
 
void setSpawnFlags (boolean allowMonsters, boolean allowAnimals)
 
boolean getAllowAnimals ()
 
boolean getAllowMonsters ()
 
Biome getBiome (int x, int z)
 
void setBiome (int x, int z, Biome bio)
 
double getTemperature (int x, int z)
 
double getHumidity (int x, int z)
 
int getMaxHeight ()
 
int getSeaLevel ()
 
boolean getKeepSpawnInMemory ()
 
void setKeepSpawnInMemory (boolean keepLoaded)
 
boolean isAutoSave ()
 
void setAutoSave (boolean value)
 
void setDifficulty (Difficulty difficulty)
 
Difficulty getDifficulty ()
 
File getWorldFolder ()
 
WorldType getWorldType ()
 
boolean canGenerateStructures ()
 
long getTicksPerAnimalSpawns ()
 
void setTicksPerAnimalSpawns (int ticksPerAnimalSpawns)
 
long getTicksPerMonsterSpawns ()
 
void setTicksPerMonsterSpawns (int ticksPerMonsterSpawns)
 
int getMonsterSpawnLimit ()
 
void setMonsterSpawnLimit (int limit)
 
int getAnimalSpawnLimit ()
 
void setAnimalSpawnLimit (int limit)
 
int getWaterAnimalSpawnLimit ()
 
void setWaterAnimalSpawnLimit (int limit)
 
int getAmbientSpawnLimit ()
 
void setAmbientSpawnLimit (int limit)
 
void playSound (Location location, Sound sound, float volume, float pitch)
 
String[] getGameRules ()
 
String getGameRuleValue (String rule)
 
boolean setGameRuleValue (String rule, String value)
 
boolean isGameRule (String rule)
 
- Public Member Functions inherited from org.bukkit.plugin.messaging.PluginMessageRecipient
void sendPluginMessage (Plugin source, String channel, byte[] message)
 
Set< String > getListeningPluginChannels ()
 

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
Deprecated:
Magic value
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
Deprecated:
Magic value
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
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
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().

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
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
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  location,
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
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
void org.bukkit.World.setThunderDuration ( int  duration)

Set the thundering duration.

Parameters
durationDuration in ticks
void org.bukkit.World.setThundering ( boolean  thundering)

Set whether it is thundering.

Parameters
thunderingWhether it is thundering
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(long)

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
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  direction,
float  speed,
float  spread 
)

Creates an Arrow entity at the given Location

Parameters
locationLocation to spawn the arrow
directionDirection 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
Deprecated:
Magic value
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
blockIdThe id of the intended material
blockDataThe block data
Returns
The spawned FallingBlock instance
Exceptions
IllegalArgumentExceptionif location is null, or blockId is invalid
See also
spawnFallingBlock(org.bukkit.Location, org.bukkit.Material, byte)
Deprecated:
Magic value
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 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 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 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 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: