Search the docs

Find a guide, global, type or member

GlobalEmber

effects

World effects: dropped items, time, weather, lightning, explosions.

Functions

effects.dropItem(item: string, x: number, y: number, z: number, count: number?, vx: number?, vy: number?, vz: number?) -> Entity#

Drops count (default 1, at most a stack) of an item at a point, optionally thrown with velocity vx/vy/vz in blocks per second. Counts toward the 256-entity limit.

effects.time() -> number#

time of day in ticks

effects.setTime(ticks: number, frozen: boolean?)#

Sets the time of day in ticks; frozen (default false) stops it advancing.

effects.setWeather(weather: Weather)#

Sets the weather.

effects.lightning(x: number, y: number, z: number, damage: boolean?)#

Strikes lightning. With damage (default false), players within 3 blocks take 5 damage and catch fire.

effects.explosion(x: number, y: number, z: number, power: number, breakBlocks: boolean?)#

Explodes with power 0..16, hurting and knocking back players within power * 2 blocks. breakBlocks (default false) clears a sphere of radius power, sparing unbreakable blocks.