world

The global instance of the WorldAPI and its subtypes
field signature:
world
Method Property Fluent Description Representation
Field Type a WorldAPI

WorldAPI.exists

Checks whether or not a world currently exists
This will almost always be true,
but might be false on some occasions such as while traveling between dimensions
overload 1:
world.exists()
Method Property Fluent Description Representation
Return Value a Boolean

WorldAPI.getTime

Gets the current game time of the world
If delta is passed in,
then it adds delta to the time
The default value of delta is zero
overload 1:
world.getTime()
Method Property Fluent Description Representation
Return Value a Number
overload 2:
world.getTime(delta)
Method Property Fluent Description Representation
delta accepts a Number
Return Value a Number

WorldAPI.getTimeOfDay

Gets the current day time of the world
If delta is passed in,
then it adds delta to the time
The default value of delta is zero
overload 1:
world.getTimeOfDay()
Method Property Fluent Description Representation
Return Value a Number
overload 2:
world.getTimeOfDay(delta)
Method Property Fluent Description Representation
delta accepts a Number
Return Value a Number

WorldAPI.getDay

Gets the current day
If delta is passed in, then it adds delta to the time
The default value of delta is zero
overload 1:
world.getDay()
Method Property Fluent Description Representation
Return Value a Number
overload 2:
world.getDay(delta)
Method Property Fluent Description Representation
delta accepts a Number
Return Value a Number

WorldAPI.getEntity

Returns an EntityAPI object from this UUID's entity, or nil if no entity was found
overload 1:
world.getEntity(UUID)
Method Property Fluent Description Representation
UUID accepts a String
Return Value either an EntityAPI or nil

WorldAPI.getStrongRedstonePower

Gets the direct redstone power level of the block at the given position
overload 1:
world.getStrongRedstonePower(pos)
Method Property Fluent Description Representation
pos accepts a Vector3
Return Value an Integer
overload 2:
world.getStrongRedstonePower(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value an Integer

WorldAPI.getDimension

Gets the dimension name of this world
overload 1:
world.getDimension()
Method Property Fluent Description Representation
Return Value a String

WorldAPI.getHeight

Returns the highest point at the given position according to the provided heightmap
Defaults to MOTION_BLOCKING if no heightmap is provided
overload 1:
world.getHeight(pos, heightmap)
Method Property Fluent Description Representation
pos accepts a Vector2
heightmap accepts a String
Return Value an Integer
overload 2:
world.getHeight(x, z, heightmap)
Method Property Fluent Description Representation
x accepts a Number
z accepts a Number
heightmap accepts a String
Return Value an Integer

WorldAPI.getBiome

Gets the Biome located at the given position
overload 1:
world.getBiome(pos)
Method Property Fluent Description Representation
pos accepts a Vector3
Return Value a Biome
overload 2:
world.getBiome(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a Biome

WorldAPI.newBlock

Parses and creates a new BlockState from the given string
A world position can be optionally given for the blockstate functions that rely on its position
overload 1:
world.newBlock(block)
Method Property Fluent Description Representation
block accepts a String
Return Value a BlockState
overload 2:
world.newBlock(block, pos)
Method Property Fluent Description Representation
block accepts a String
pos accepts a Vector3
Return Value a BlockState
overload 3:
world.newBlock(block, x, y, z)
Method Property Fluent Description Representation
block accepts a String
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a BlockState

WorldAPI.newItem

Parses and creates a new ItemStack from the given string
A count and damage can be given,
to be applied on this itemstack
overload 1:
world.newItem(item)
Method Property Fluent Description Representation
item accepts a String
Return Value an ItemStack
overload 2:
world.newItem(item, count)
Method Property Fluent Description Representation
item accepts a String
count accepts an Integer
Return Value an ItemStack
overload 3:
world.newItem(item, count, damage)
Method Property Fluent Description Representation
item accepts a String
count accepts an Integer
damage accepts an Integer
Return Value an ItemStack

WorldAPI.isChunkLoaded

figura.docs.world.is_chunk_loaded
overload 1:
world.isChunkLoaded(pos)
Method Property Fluent Description Representation
pos accepts a Vector3
Return Value a Boolean
overload 2:
world.isChunkLoaded(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a Boolean

WorldAPI.getSkyLightLevel

Gets the skylight level of the block at the given position
overload 1:
world.getSkyLightLevel(pos)
Method Property Fluent Description Representation
pos accepts a Vector3
Return Value an Integer
overload 2:
world.getSkyLightLevel(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value an Integer

WorldAPI.getRainGradient

Gets the current rain gradient in the world, interpolated from the previous tick to the current one
The default value of delta is 1,
which is the current tick
overload 1:
world.getRainGradient()
Method Property Fluent Description Representation
Return Value a Number
overload 2:
world.getRainGradient(delta)
Method Property Fluent Description Representation
delta accepts a Number
Return Value a Number

WorldAPI.getBlockLightLevel

Gets the block light level of the block at the given position
overload 1:
world.getBlockLightLevel(pos)
Method Property Fluent Description Representation
pos accepts a Vector3
Return Value an Integer
overload 2:
world.getBlockLightLevel(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value an Integer

WorldAPI.getPlayers

Returns a table containing instances of Player for all players in the world
The players are indexed by their names
overload 1:
world.getPlayers()
Method Property Fluent Description Representation
Return Value a table mapping a String to a PlayerAPI

WorldAPI.getLightLevel

Gets the overall light level of the block at the given position
overload 1:
world.getLightLevel(pos)
Method Property Fluent Description Representation
pos accepts a Vector3
Return Value an Integer
overload 2:
world.getLightLevel(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value an Integer

WorldAPI.getMoonPhase

Gets the current moon phase of the world, stored as an integer
overload 1:
world.getMoonPhase()
Method Property Fluent Description Representation
Return Value an Integer

WorldAPI.getDayTime

Gets the time of the current day between 0 and 24000
If delta is passed in,
then it adds delta to the time
The default value of delta is zero
overload 1:
world.getDayTime()
Method Property Fluent Description Representation
Return Value a Number
overload 2:
world.getDayTime(delta)
Method Property Fluent Description Representation
delta accepts a Number
Return Value a Number

WorldAPI.isThundering

Gets whether or not there is currently thunder/lightning happening in the world
overload 1:
world.isThundering()
Method Property Fluent Description Representation
Return Value a Boolean

WorldAPI.isOpenSky

Gets whether or not the sky is open at the given position
overload 1:
world.isOpenSky(pos)
Method Property Fluent Description Representation
pos accepts a Vector3
Return Value a Boolean
overload 2:
world.isOpenSky(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a Boolean

WorldAPI.getRedstonePower

Gets the redstone power level of the block at the given position
overload 1:
world.getRedstonePower(pos)
Method Property Fluent Description Representation
pos accepts a Vector3
Return Value an Integer
overload 2:
world.getRedstonePower(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value an Integer

WorldAPI.getBuildHeight

Returns the minimum and maximum build height of the world, as multiple results
overload 1:
world.getBuildHeight()
Method Property Fluent Description Representation
Return Value a Varargs

WorldAPI.getSpawnPoint

Returns a vector with the coordinates of the world spawn
overload 1:
world.getSpawnPoint()
Method Property Fluent Description Representation
Return Value a Vector3

WorldAPI.avatarVars

Returns a table containing variables stored from all loaded Avatars "avatar:store()" function
The table will be indexed by the avatar's owner UUID
overload 1:
world.avatarVars()
Method Property Fluent Description Representation
Return Value a table

WorldAPI.getBlocks

Gets a list of all BlockStates in the specified area
The maximum area size is 8 x 8 x 8
overload 1:
world.getBlocks(min, max)
Method Property Fluent Description Representation
min accepts a Vector3
max accepts a Vector3
Return Value a table
overload 2:
world.getBlocks(minX, minY, minZ, max)
Method Property Fluent Description Representation
minX accepts a Number
minY accepts a Number
minZ accepts a Number
max accepts a Vector3
Return Value a table
overload 3:
world.getBlocks(min, maxX, maxY, maxZ)
Method Property Fluent Description Representation
min accepts a Vector3
maxX accepts a Number
maxY accepts a Number
maxZ accepts a Number
Return Value a table
overload 4:
world.getBlocks(minX, minY, minZ, maxX, maxY, maxZ)
Method Property Fluent Description Representation
minX accepts a Number
minY accepts a Number
minZ accepts a Number
maxX accepts a Number
maxY accepts a Number
maxZ accepts a Number
Return Value a table

WorldAPI.getBlockState

Gets the BlockState of the block at the given position
If it is not loaded,
returns void_air
overload 1:
world.getBlockState(pos)
Method Property Fluent Description Representation
pos accepts a Vector3
Return Value a BlockState
overload 2:
world.getBlockState(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a BlockState
a a