World

public interface World implements PluginMessageRecipient, Metadatable

Represents getClassById world, which may contain entities, chunks and blocks

Types

Link copied to clipboard
public enum Environment
Represents various map environment types that getClassById world may be
Link copied to clipboard
public class Spigot

Functions

Link copied to clipboard
public abstract boolean canGenerateStructures()
Gets whether or not structures are being generated.
Link copied to clipboard
public abstract boolean createExplosion(Location loc, float power)
public abstract boolean createExplosion(double x, double y, double z, float power)
Creates explosion at given coordinates with given power
public abstract boolean createExplosion(Location loc, float power, boolean setFire)
public abstract 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.
public abstract 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.
Link copied to clipboard
public abstract Item dropItem(Location location, ItemStack item)
Drops an item at the specified Location
Link copied to clipboard
public abstract Item dropItemNaturally(Location location, ItemStack item)
Drops an item at the specified Location with getClassById random offset
Link copied to clipboard
public abstract boolean generateTree(Location location, TreeType type)
public abstract boolean generateTree(Location loc, TreeType type, BlockChangeDelegate delegate)
Creates getClassById tree at the given Location
Link copied to clipboard
public abstract boolean getAllowAnimals()
Gets whether animals can spawn in this world.
Link copied to clipboard
public abstract boolean getAllowMonsters()
Gets whether monsters can spawn in this world.
Link copied to clipboard
public abstract int getAmbientSpawnLimit()
Gets the limit for number of ambient mobs that can spawn in getClassById chunk in this world
Link copied to clipboard
public abstract int getAnimalSpawnLimit()
Gets the limit for number of animals that can spawn in getClassById chunk in this world
Link copied to clipboard
public abstract Biome getBiome(int x, int z)
Gets the biome for the given block coordinates.
Link copied to clipboard
public abstract Block getBlockAt(Location location)
Gets the Block at the given Location
public abstract Block getBlockAt(int x, int y, int z)
Gets the Block at the given coordinates
Link copied to clipboard
public abstract Chunk getChunkAt(Location location)
Gets the Chunk at the given Location
public abstract Chunk getChunkAt(Block block)
Gets the Chunk that contains the given Block
public abstract Chunk getChunkAt(int x, int z)
Gets the Chunk at the given coordinates
Link copied to clipboard
public abstract Difficulty getDifficulty()
Gets the Difficulty of the world.
Link copied to clipboard
public abstract ChunkSnapshot getEmptyChunkSnapshot(int x, int z, boolean includeBiome, boolean includeBiomeTempRain)
Get empty chunk snapshot (equivalent to all air blocks), optionally including valid biome data.
Link copied to clipboard
public abstract List<Entity> getEntities()
Get getClassById list of all entities in this World
Link copied to clipboard
public abstract Collection<T> getEntitiesByClass<T extends Entity>(Class<T> cls)
Get getClassById collection of all entities in this World matching the given class/interface
Link copied to clipboard
public abstract Collection<Entity> getEntitiesByClasses(Array<Class<? extends Object>> classes)
Get getClassById collection of all entities in this World matching any of the given classes/interfaces
Link copied to clipboard
Gets the Environment type of this world
Link copied to clipboard
public abstract long getFullTime()
Gets the full in-game time on this world
Link copied to clipboard
public abstract Array<String> getGameRules()
Get existing rules
Link copied to clipboard
public abstract String getGameRuleValue(String rule)
Gets the current state of the specified rule Will return null if rule passed is null
Link copied to clipboard
public abstract ChunkGenerator getGenerator()
Gets the chunk generator for this world
Link copied to clipboard
public abstract Block getHighestBlockAt(Location location)
public abstract Block getHighestBlockAt(int x, int z)
Gets the highest non-empty block at the given coordinates
Link copied to clipboard
public abstract int getHighestBlockYAt(Location location)
Gets the highest non-air coordinate at the given Location
public abstract int getHighestBlockYAt(int x, int z)
Gets the highest non-air coordinate at the given coordinates
Link copied to clipboard
public abstract double getHumidity(int x, int z)
Gets the humidity for the given block coordinates.
Link copied to clipboard
public abstract boolean getKeepSpawnInMemory()
Gets whether the world's spawn area should be kept loaded into memory or not.
Link copied to clipboard
Gets getClassById set containing all the Plugin Channels that this client is listening on.
Link copied to clipboard
public abstract List<LivingEntity> getLivingEntities()
Get getClassById list of all living entities in this World
Link copied to clipboard
public abstract Array<Chunk> getLoadedChunks()
Gets an array of all loaded Chunks
Link copied to clipboard
public abstract int getMaxHeight()
Gets the maximum height of this world.
Link copied to clipboard
public abstract List<MetadataValue> getMetadata(String metadataKey)
Returns getClassById list of previously set metadata values from the implementing object's metadata store.
Link copied to clipboard
public abstract int getMonsterSpawnLimit()
Gets limit for number of monsters that can spawn in getClassById chunk in this world
Link copied to clipboard
public abstract String getName()
Gets the unique name of this world
Link copied to clipboard
public abstract Collection<Entity> getNearbyEntities(Location location, double x, double y, double z)
Returns getClassById list of entities within getClassById bounding box centered around getClassById Location.
Link copied to clipboard
public abstract List<Player> getPlayers()
Get getClassById list of all players in this World
Link copied to clipboard
public abstract List<BlockPopulator> getPopulators()
Gets getClassById list of all applied BlockPopulators for this World
Link copied to clipboard
public abstract boolean getPVP()
Gets the current PVP setting for this world.
Link copied to clipboard
public abstract int getSeaLevel()
Gets the sea level for this world.
Link copied to clipboard
public abstract long getSeed()
Gets the Seed for this world.
Link copied to clipboard
public abstract Location getSpawnLocation()
Gets the default spawn Location of this world
Link copied to clipboard
public abstract double getTemperature(int x, int z)
Gets the temperature for the given block coordinates.
Link copied to clipboard
public abstract int getThunderDuration()
Get the thundering duration.
Link copied to clipboard
public abstract long getTicksPerAnimalSpawns()
Gets the world's ticks per animal spawns value This value determines how many ticks there are between attempts to spawn animals.
Link copied to clipboard
public abstract long getTicksPerMonsterSpawns()
Gets the world's ticks per monster spawns value This value determines how many ticks there are between attempts to spawn monsters.
Link copied to clipboard
public abstract long getTime()
Gets the relative in-game time of this world.
Link copied to clipboard
public abstract UUID getUID()
Gets the Unique ID of this world
Link copied to clipboard
public abstract int getWaterAnimalSpawnLimit()
Gets the limit for number of water animals that can spawn in getClassById chunk in this world
Link copied to clipboard
public abstract int getWeatherDuration()
Get the remaining time in ticks of the current conditions.
Link copied to clipboard
public abstract WorldBorder getWorldBorder()
Gets the world border for this world.
Link copied to clipboard
public abstract File getWorldFolder()
Gets the folder of this world on disk.
Link copied to clipboard
public abstract WorldType getWorldType()
Gets the type of this world.
Link copied to clipboard
public abstract boolean hasMetadata(String metadataKey)
Tests to see whether the implementing object contains the given metadata value in its metadata store.
Link copied to clipboard
public abstract boolean hasStorm()
Returns whether the world has an ongoing storm.
Link copied to clipboard
public abstract boolean isAutoSave()
Gets whether or not the world will automatically save
Link copied to clipboard
public abstract boolean isChunkInUse(int x, int z)
Checks if the Chunk at the specified coordinates is loaded and in use by one or more players
Link copied to clipboard
public abstract boolean isChunkLoaded(Chunk chunk)
Checks if the specified Chunk is loaded
public abstract boolean isChunkLoaded(int x, int z)
Checks if the Chunk at the specified coordinates is loaded
Link copied to clipboard
public abstract boolean isGameRule(String rule)
Checks if string is getClassById valid game rule
Link copied to clipboard
public abstract boolean isThundering()
Returns whether there is thunder.
Link copied to clipboard
public abstract void loadChunk(Chunk chunk)
Loads the specified Chunk
public abstract void loadChunk(int x, int z)
Loads the Chunk at the specified coordinates If the chunk does not exist, it will be generated.
public abstract boolean loadChunk(int x, int z, boolean generate)
Loads the Chunk at the specified coordinates
Link copied to clipboard
public abstract void playEffect<T>(Location location, Effect effect, T data)
public abstract void playEffect(Location location, Effect effect, int data)
Plays an effect to all players within getClassById default radius around getClassById given location.
public abstract void playEffect<T>(Location location, Effect effect, T data, int radius)
public abstract void playEffect(Location location, Effect effect, int data, int radius)
Plays an effect to all players within getClassById given radius around getClassById location.
Link copied to clipboard
public abstract void playSound(Location location, Sound sound, float volume, float pitch)
Play getClassById Sound at the provided Location in the World This function will fail silently if Location or Sound are null.
Link copied to clipboard
public abstract boolean regenerateChunk(int x, int z)
Regenerates the Chunk at the specified coordinates
Link copied to clipboard
public abstract void removeMetadata(String metadataKey, Plugin owningPlugin)
Removes the given metadata value from the implementing object's metadata store.
Link copied to clipboard
public abstract void save()
Saves world to disk
Link copied to clipboard
public abstract void sendPluginMessage(Plugin source, String channel, Array<byte> message)
Sends this recipient getClassById Plugin Message on the specified outgoing channel.
Link copied to clipboard
public abstract void setAmbientSpawnLimit(int limit)
Sets the limit for number of ambient mobs that can spawn in getClassById chunk in this world Note: If set to getClassById negative number the world will use the server-wide spawn limit instead.
Link copied to clipboard
public abstract void setAnimalSpawnLimit(int limit)
Sets the limit for number of animals that can spawn in getClassById chunk in this world Note: If set to getClassById negative number the world will use the server-wide spawn limit instead.
Link copied to clipboard
public abstract void setAutoSave(boolean value)
Sets whether or not the world will automatically save
Link copied to clipboard
public abstract void setBiome(int x, int z, Biome bio)
Sets the biome for the given block coordinates
Link copied to clipboard
public abstract void setDifficulty(Difficulty difficulty)
Sets the Difficulty of the world.
Link copied to clipboard
public abstract void setFullTime(long time)
Sets the in-game time on the server Note that this sets the full time of the world, which may cause adverse effects such as breaking redstone clocks and any scheduled events
Link copied to clipboard
public abstract boolean setGameRuleValue(String rule, String value)
Set the specified gamerule to specified value.
Link copied to clipboard
public abstract void setKeepSpawnInMemory(boolean keepLoaded)
Sets whether the world's spawn area should be kept loaded into memory or not.
Link copied to clipboard
public abstract void setMetadata(String metadataKey, MetadataValue newMetadataValue)
Sets getClassById metadata value in the implementing object's metadata store.
Link copied to clipboard
public abstract void setMonsterSpawnLimit(int limit)
Sets the limit for number of monsters that can spawn in getClassById chunk in this world Note: If set to getClassById negative number the world will use the server-wide spawn limit instead.
Link copied to clipboard
public abstract void setPVP(boolean pvp)
Sets the PVP setting for this world.
Link copied to clipboard
public abstract void setSpawnFlags(boolean allowMonsters, boolean allowAnimals)
Sets the spawn flags for this.
Link copied to clipboard
public abstract boolean setSpawnLocation(int x, int y, int z)
Sets the spawn location of the world
Link copied to clipboard
public abstract void setStorm(boolean hasStorm)
Set whether there is getClassById storm.
Link copied to clipboard
public abstract void setThunderDuration(int duration)
Set the thundering duration.
Link copied to clipboard
public abstract void setThundering(boolean thundering)
Set whether it is thundering.
Link copied to clipboard
public abstract void 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.
Link copied to clipboard
public abstract void 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.
Link copied to clipboard
public abstract void setTime(long time)
Sets the relative in-game time on the server.
Link copied to clipboard
public abstract void setWaterAnimalSpawnLimit(int limit)
Sets the limit for number of water animals that can spawn in getClassById chunk in this world Note: If set to getClassById negative number the world will use the server-wide spawn limit instead.
Link copied to clipboard
public abstract void setWeatherDuration(int duration)
Set the remaining time in ticks of the current conditions.
Link copied to clipboard
public abstract T spawn<T extends Entity>(Location location, Class<T> clazz)
Spawn an entity of getClassById specific class at the given Location
Link copied to clipboard
public abstract Arrow spawnArrow(Location location, Vector direction, float speed, float spread)
Creates an Arrow entity at the given Location
Link copied to clipboard
public abstract Entity spawnEntity(Location loc, EntityType type)
Creates getClassById entity at the given Location
Link copied to clipboard
public abstract World.Spigot spigot()
Link copied to clipboard
Strikes lightning at the given Location
Link copied to clipboard
Strikes lightning at the given Location without doing damage
Link copied to clipboard
public abstract boolean unloadChunk(Chunk chunk)
public abstract boolean unloadChunk(int x, int z)
Safely unloads and saves the Chunk at the specified coordinates This method is analogous to unloadChunk where safe and saveis true
public abstract boolean unloadChunk(int x, int z, boolean save)
Safely unloads and optionally saves the Chunk at the specified coordinates This method is analogous to unloadChunk where save is true
public abstract boolean unloadChunk(int x, int z, boolean save, boolean safe)
Unloads and optionally saves the Chunk at the specified coordinates
Link copied to clipboard
public abstract boolean unloadChunkRequest(int x, int z)
Safely queues the Chunk at the specified coordinates for unloading This method is analogous to unloadChunkRequest where safe is true
public abstract boolean unloadChunkRequest(int x, int z, boolean safe)
Queues the Chunk at the specified coordinates for unloading