Skip to content

API reference / @jsprismarine/prismarine / world/hopperWorld

world/hopperWorld ​

Classes ​

Interfaces ​

ChangedContainer ​

Defined in: packages/prismarine/src/world/hopperWorld.ts:240

A container a pass changed, for whoever has it open and the comparators reading it.

Properties ​

blocks ​

readonly blocks: readonly ContentPosition[]

Defined in: packages/prismarine/src/world/hopperWorld.ts:242

Each block whose slots changed.

screens ​

readonly screens: readonly object[]

Defined in: packages/prismarine/src/world/hopperWorld.ts:247

The block each screen of it can be open at, with the changed slots numbered as the screen numbers them: both halves of a double chest show all 54.


HopperPassOptions ​

Defined in: packages/prismarine/src/world/hopperWorld.ts:251

What a HopperPass reads of the world.

Properties ​

blocks ​

readonly blocks: WorldActions

Defined in: packages/prismarine/src/world/hopperWorld.ts:253

The blocks and block entities of the hopper's dimension.

content ​

readonly content: ServerContent

Defined in: packages/prismarine/src/world/hopperWorld.ts:254

gameTime ​

readonly gameTime: number

Defined in: packages/prismarine/src/world/hopperWorld.ts:255

Methods ​

clockAt() ​

clockAt(at): HopperClock

Defined in: packages/prismarine/src/world/hopperWorld.ts:257

The timers of the hopper at a position, created on first use.

Parameters ​
at ​

ContentPosition

Returns ​

HopperClock

itemsNear() ​

itemsNear(center, radius): readonly (HopperItemEntity & object)[]

Defined in: packages/prismarine/src/world/hopperWorld.ts:259

The dropped stacks within a distance across of a point, lying at the bottom of their boxes.

Parameters ​
center ​

ContentPosition

radius ​

number

Returns ​

readonly (HopperItemEntity & object)[]

takeItem() ​

takeItem(id, count): ItemDrop | undefined

Defined in: packages/prismarine/src/world/hopperWorld.ts:261

Takes up to count items from a dropped stack.

Parameters ​
id ​

number

count ​

number

Returns ​

ItemDrop | undefined