Skip to content

API reference / @jsprismarine/prismarine / entity/data/experienceOrbs / ExperienceOrbs

Class: ExperienceOrbs ​

Defined in: packages/prismarine/src/entity/data/experienceOrbs.ts:229

The experience orbs of one runtime, and the system that runs each of them once a tick.

Constructors ​

Constructor ​

new ExperienceOrbs(host): ExperienceOrbs

Defined in: packages/prismarine/src/entity/data/experienceOrbs.ts:233

Parameters ​

host ​

ExperienceOrbsHost

Returns ​

ExperienceOrbs

Methods ​

award() ​

award(at, points): DataEntity[]

Defined in: packages/prismarine/src/entity/data/experienceOrbs.ts:243

Drops a payout as orbs at a spot, Java's ExperienceOrb.award: the payout split into the largest orb sizes that fit, each added to an orb of the same value near the spot when the roll picks one and spawned as a new orb with a random toss otherwise.

Parameters ​

at ​

EntityPosition

points ​

number

Returns ​

DataEntity[]

The orbs spawned, without those an award joined.

Java Source ​

ExperienceOrb.award


spawn() ​

spawn(at, value): DataEntity | undefined

Defined in: packages/prismarine/src/entity/data/experienceOrbs.ts:259

Spawns one orb of a value at a spot with Java's random toss: up to 0.2 blocks a tick sideways each way and up to 0.4 up.

Parameters ​

at ​

EntityPosition

value ​

number

Returns ​

DataEntity | undefined


update() ​

update(orb): void

Defined in: packages/prismarine/src/entity/data/experienceOrbs.ts:279

One orb's tick, in Java's order: merges on the scan tick, the follow, a pickup by a player against it, and the age. The body's physics moves it after this.

Parameters ​

orb ​

DataEntity

Returns ​

void