API reference / @jsprismarine/prismarine / world/beacon
world/beacon
Interfaces
BeaconBlocks
Defined in: packages/prismarine/src/world/beacon.ts:81
What a beacon's beam reads of the blocks above it.
Properties
maxY
readonlymaxY:number
Defined in: packages/prismarine/src/world/beacon.ts:85
The dimension's highest block y.
Methods
stopsBeam()
stopsBeam(
x,y,z):boolean
Defined in: packages/prismarine/src/world/beacon.ts:83
Whether the block at a position stops the beam. False when it is not loaded.
Parameters
x
number
y
number
z
number
Returns
boolean
BeaconEffects
Defined in: packages/prismarine/src/world/beacon.ts:68
The effects a beacon has chosen, by namespaced id, or null for none.
Properties
primary
readonlyprimary:string|null
Defined in: packages/prismarine/src/world/beacon.ts:69
secondary
readonlysecondary:string|null
Defined in: packages/prismarine/src/world/beacon.ts:70
BeaconPlayer
Defined in: packages/prismarine/src/world/beacon.ts:342
A player a beacon's pulse may reach.
Properties
feet
readonlyfeet:BlockXYZ
Defined in: packages/prismarine/src/world/beacon.ts:344
Where its feet are.
Methods
addStatusEffect()
addStatusEffect(
effect):unknown
Defined in: packages/prismarine/src/world/beacon.ts:346
Gives it one effect.
Parameters
effect
Returns
unknown
BeaconPower
Defined in: packages/prismarine/src/world/beacon.ts:169
One effect a beacon gives, and its amplifier.
Properties
amplifier
readonlyamplifier:number
Defined in: packages/prismarine/src/world/beacon.ts:171
effect
readonlyeffect:string
Defined in: packages/prismarine/src/world/beacon.ts:170
BeaconPowers
Defined in: packages/prismarine/src/world/beacon.ts:175
What a beacon gives on each application: how far it reaches, for how long, and which effects.
Properties
durationTicks
readonlydurationTicks:number
Defined in: packages/prismarine/src/world/beacon.ts:177
effects
readonlyeffects: readonlyBeaconPower[]
Defined in: packages/prismarine/src/world/beacon.ts:178
range
readonlyrange:number
Defined in: packages/prismarine/src/world/beacon.ts:176
BeaconPulse
Defined in: packages/prismarine/src/world/beacon.ts:350
What one pulse of a beacon did.
Properties
active
readonlyactive:boolean
Defined in: packages/prismarine/src/world/beacon.ts:354
Whether the beacon is active: on a pyramid, with its beam reaching the sky.
screen
readonlyscreen:ReadonlyMap<number,number>
Defined in: packages/prismarine/src/world/beacon.ts:352
What the beacon's screen shows now.
BeaconWorld
Defined in: packages/prismarine/src/world/beacon.ts:297
The little of a world a beacon reads and writes.
Extends
BlockEntityWorld
Methods
blockEntityChanged()
blockEntityChanged(
position,tags,before):void
Defined in: packages/prismarine/src/blockentity/blockEntityWrite.ts:60
Reports that the block entity at a position is now these tags.
Called only for a write that changed something, and only once the chunk holds it.
Parameters
position
The block the block entity sits in.
tags
Its complete data, as the chunk would serialize it.
before
NBTTagCompound | null
What stood there before the write, for the change log, or null when nothing did.
Returns
void
Inherited from
BlockEntityWorld.blockEntityChanged
getDimension()
getDimension():
DimensionBounds
Defined in: packages/prismarine/src/world/beacon.ts:300
Returns
DimensionBounds
getLoadedChunk()
getLoadedChunk(
x,z):BlockEntityChunk|null
Defined in: packages/prismarine/src/blockentity/blockEntityWrite.ts:49
The chunk holding a column, or null when it is not in memory.
Parameters
x
number
z
number
Returns
BlockEntityChunk | null
Inherited from
BlockEntityWorld.getLoadedChunk
loadedBlock()
loadedBlock(
x,y,z):BeaconBlock|undefined
Defined in: packages/prismarine/src/world/beacon.ts:299
The block at a position, or undefined when its chunk is not loaded.
Parameters
x
number
y
number
z
number
Returns
BeaconBlock | undefined
playNamedSound()
playNamedSound(
x,y,z,sound):void
Defined in: packages/prismarine/src/world/beacon.ts:301
Parameters
x
number
y
number
z
number
sound
string
Returns
void
Variables
BEACON
constBEACON:"minecraft:beacon"='minecraft:beacon'
Defined in: packages/prismarine/src/world/beacon.ts:25
The beacon block.
BEACON_BLOCK_ENTITY
constBEACON_BLOCK_ENTITY:string|undefined
Defined in: packages/prismarine/src/world/beacon.ts:28
The id a beacon's block entity is filed under.
BEACON_DATA_LEVELS
constBEACON_DATA_LEVELS:0=0
Defined in: packages/prismarine/src/world/beacon.ts:44
The beacon menu's data slot for the pyramid's levels.
BEACON_DATA_PRIMARY
constBEACON_DATA_PRIMARY:1=1
Defined in: packages/prismarine/src/world/beacon.ts:46
The beacon menu's data slot for the primary effect.
BEACON_DATA_SECONDARY
constBEACON_DATA_SECONDARY:2=2
Defined in: packages/prismarine/src/world/beacon.ts:48
The beacon menu's data slot for the secondary effect.
BEACON_INTERVAL
constBEACON_INTERVAL:80=80
Defined in: packages/prismarine/src/world/beacon.ts:34
A beacon applies its effects on every game tick that is a multiple of this.
BEACON_PAYMENT_ITEMS
constBEACON_PAYMENT_ITEMS:"minecraft:beacon_payment_items"='minecraft:beacon_payment_items'
Defined in: packages/prismarine/src/world/beacon.ts:31
The items a beacon takes as payment for a choice of effects.
Functions
beaconBeamClear()
beaconBeamClear(
blocks,at):boolean
Defined in: packages/prismarine/src/world/beacon.ts:161
Whether a beacon's beam reaches the sky: no block above it stops light, bedrock aside. A tinted block such as stained glass lets it through, as it does every block that does not stop light.
Parameters
blocks
at
BlockXYZ
Returns
boolean
Java See
BeaconBlockEntity.tick
beaconBlocksIn()
beaconBlocksIn(
world):BeaconBlocks
Defined in: packages/prismarine/src/world/beacon.ts:305
The blocks above a beacon in a world.
Parameters
world
Returns
beaconBlocksOf()
beaconBlocksOf(
blockAt,maxY):BeaconBlocks
Defined in: packages/prismarine/src/world/beacon.ts:99
The blocks above a beacon, as a world's loaded blocks give them.
Parameters
blockAt
(x, y, z) => BeaconBlock | undefined
The loaded block at a position, or undefined when its chunk is not loaded.
maxY
number
The dimension's highest block y.
Returns
beaconChoiceRefusal()
beaconChoiceRefusal(
payment,choice,levels):string|undefined
Defined in: packages/prismarine/src/world/beacon.ts:283
Why a beacon refuses a choice of effects paid for with a stack, or undefined when it takes it: the payment slot holds a payment item and the pyramid offers the choice.
Parameters
payment
BeaconPayment | null
What the payment slot holds.
choice
The effects chosen.
levels
number
The pyramid's levels.
Returns
string | undefined
Java See
BeaconMenu.updateEffects
Java See
BeaconMenu$PaymentSlot.mayPlace
beaconEffectId()
beaconEffectId(
effect):number
Defined in: packages/prismarine/src/world/beacon.ts:237
A beacon's chosen effect as a Bedrock effect id, the way the block entity keeps it and the menu's data slots carry it: 0 for none.
Parameters
effect
string | null
Returns
number
beaconEffectOfId()
beaconEffectOfId(
id):string|null|undefined
Defined in: packages/prismarine/src/world/beacon.ts:244
The effect a Bedrock effect id names, for a choice off the wire.
Parameters
id
number
Returns
string | null | undefined
Null for 0, or undefined for an id no effect has.
beaconEffectsOf()
beaconEffectsOf(
tags):BeaconEffects
Defined in: packages/prismarine/src/world/beacon.ts:228
The effects a beacon's block entity keeps. An effect no layer offers reads as none, as vanilla filters one it loads.
Parameters
tags
NBTTagCompound | undefined
The block entity, or undefined for a beacon that has none yet.
Returns
Java See
BeaconBlockEntity.filterEffect
beaconLevelsIn()
beaconLevelsIn(
blocks,world,at):number
Defined in: packages/prismarine/src/world/beacon.ts:127
How many full layers of base blocks stand under the beacon at a position, up to four.
Parameters
blocks
PyramidWorld
The content's block world.
world
NamedWorld
The world the beacon stands in.
at
BlockXYZ
The beacon.
Returns
number
beaconPowers()
beaconPowers(
levels,__namedParameters):BeaconPowers|undefined
Defined in: packages/prismarine/src/world/beacon.ts:187
What a beacon with this pyramid and choice gives, or undefined when it has no primary effect. The primary is amplified on a full pyramid whose secondary is the primary again; any other secondary is given beside it on a full pyramid.
Parameters
levels
number
__namedParameters
Returns
BeaconPowers | undefined
Java Source
BeaconBlockEntity.applyEffects
beaconReaches()
beaconReaches(
at,range,height,feet):boolean
Defined in: packages/prismarine/src/world/beacon.ts:208
Whether a player standing at a position is in a beacon's reach: the beacon's block grown by the range on every side, then up by the dimension's height.
Parameters
at
BlockXYZ
The beacon.
range
number
Its range.
height
number
The dimension's height in blocks.
feet
BlockXYZ
Where the player's feet are.
Returns
boolean
Java See
BeaconBlockEntity.applyEffects
beaconScreenData()
beaconScreenData(
levels,__namedParameters):ReadonlyMap<number,number>
Defined in: packages/prismarine/src/world/beacon.ts:261
The beacon menu's data slots: the pyramid's levels, then each effect as a Bedrock effect id or 0.
Parameters
levels
number
__namedParameters
Returns
ReadonlyMap<number, number>
Java See
BeaconBlockEntity$1.get
beaconScreenDataAt()
beaconScreenDataAt(
world,levels,at):ReadonlyMap<number,number>
Defined in: packages/prismarine/src/world/beacon.ts:321
What the screen of the beacon at a position shows: the pyramid's levels and its effects.
Parameters
world
BlockEntityWorld
The world it stands in.
levels
number
The pyramid's levels.
at
BlockXYZ
The beacon.
Returns
ReadonlyMap<number, number>
beaconTagsAt()
beaconTagsAt(
world,at):NBTTagCompound|undefined
Defined in: packages/prismarine/src/world/beacon.ts:309
The block entity of the beacon at a position, or undefined when it has none or is not loaded.
Parameters
world
BlockEntityWorld
at
BlockXYZ
Returns
NBTTagCompound | undefined
pulseBeacon()
pulseBeacon(
blocks,levels,at,tags,height,players):BeaconPulse
Defined in: packages/prismarine/src/world/beacon.ts:370
One beacon's pulse, which comes every BEACON_INTERVAL ticks: an active beacon gives its effects to each player in its reach, as ambient effects that show their particles and their icon.
Parameters
blocks
The blocks above it.
levels
number
Its pyramid's levels.
at
BlockXYZ
The beacon.
tags
NBTTagCompound | undefined
Its block entity.
height
number
The dimension's height in blocks.
players
readonly BeaconPlayer[]
The players in its world.
Returns
Java See
BeaconBlockEntity.tick
Java See
BeaconBlockEntity.applyEffects
storeBeaconEffects()
storeBeaconEffects(
world,at,choice):void
Defined in: packages/prismarine/src/world/beacon.ts:335
Keeps a paid-for choice of effects on the beacon at a position, which tells the players who see the block, and plays the beacon's sound for it while its beam reaches the sky.
Parameters
world
The world it stands in.
at
BlockXYZ
The beacon.
choice
The effects chosen.
Returns
void
Java See
BeaconBlockEntity$1.set
validBeaconEffects()
validBeaconEffects(
__namedParameters,levels):boolean
Defined in: packages/prismarine/src/world/beacon.ts:147
Whether a pyramid of levels layers offers this choice: each effect from a layer the pyramid has, a primary from below the top layer, and a secondary only on a full pyramid, where it is regeneration or the primary again.
Parameters
__namedParameters
levels
number
Returns
boolean
Java Source
BeaconBlockEntity.validateEffects
withBeaconEffects()
withBeaconEffects(
tags,__namedParameters):NBTTagCompound
Defined in: packages/prismarine/src/world/beacon.ts:251
Writes a choice of effects into a beacon's block entity.
Parameters
tags
__namedParameters
Returns
The same compound.