Skip to content

API reference / @jsprismarine/prismarine / world/hopperWorld / HopperPass

Class: HopperPass ​

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

One hopper's tick of a live world.

Implements ​

Constructors ​

Constructor ​

new HopperPass(options): HopperPass

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

Parameters ​

options ​

HopperPassOptions

Returns ​

HopperPass

Properties ​

gameTime ​

readonly gameTime: number

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

The game tick now.

Java See ​

LevelAccessor.getGameTime

Implementation of ​

HopperWorld.gameTime

Methods ​

blocksPickup() ​

blocksPickup(at): boolean

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

Whether the block keeps dropped stacks from the hopper under it: Java's full collision cube, unless the block is in #minecraft:does_not_block_hoppers.

Parameters ​

at ​

ContentPosition

Returns ​

boolean

Implementation of ​

HopperWorld.blocksPickup


commit() ​

commit(): readonly ChangedContainer[]

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

Writes every container the tick changed to its block entities.

Returns ​

readonly ChangedContainer[]


containerAt() ​

containerAt(at): StagedContainer | undefined

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

The container in a block, read once a pass: both halves of a double chest, in Java's order, are one container whichever half is asked for.

Parameters ​

at ​

ContentPosition

Returns ​

StagedContainer | undefined

Implementation of ​

HopperWorld.containerAt


hopperAt() ​

hopperAt(at): HopperBlock | undefined

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

The hopper a block is, or undefined when it is none.

Parameters ​

at ​

ContentPosition

The hopper's block.

Returns ​

HopperBlock | undefined


itemsAbove() ​

itemsAbove(hopper): readonly HopperItemEntity[]

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

The dropped stacks in the hopper's suck box, in ascending runtime id order.

Parameters ​

hopper ​

ContentPosition

Returns ​

readonly HopperItemEntity[]

Implementation of ​

HopperWorld.itemsAbove


maxStackOf() ​

maxStackOf(item): number

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

The most of one item a stack holds, from the content's item types.

Parameters ​

item ​

ItemDrop

Returns ​

number

Implementation of ​

HopperWorld.maxStackOf


takeItem() ​

takeItem(id, count): ItemDrop | undefined

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

Takes up to count items from a dropped stack.

Parameters ​

id ​

number

count ​

number

Returns ​

ItemDrop | undefined

Implementation of ​

HopperWorld.takeItem