Skip to content

API reference / @jsprismarine/prismarine / world/brewing

world/brewing ​

Interfaces ​

BrewingTick ​

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

One brewing stand update.

Properties ​

bottles ​

readonly bottles: BrewingBottles

Defined in: packages/prismarine/src/world/brewing.ts:274

Which bottle slots hold something, which the block's states show.

brewed ​

readonly brewed: boolean

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

Whether a brew finished, which plays the stand's brewing sound.

changedSlots ​

readonly changedSlots: readonly number[]

Defined in: packages/prismarine/src/world/brewing.ts:272

The slots whose stacks changed, in slot order; empty for none.

drops ​

readonly drops: readonly ItemDrop[]

Defined in: packages/prismarine/src/world/brewing.ts:278

What the stand drops beside itself: a remainder its slot had no room for.

tags ​

readonly tags: NBTTagCompound

Defined in: packages/prismarine/src/world/brewing.ts:270

The complete block entity after its timers and inventory advance.

Type Aliases ​

BrewingBottles ​

BrewingBottles = Readonly<Record<typeof BOTTLE_STATES[number], boolean>>

Defined in: packages/prismarine/src/world/brewing.ts:78

Which bottle slots hold something, as the block shows them.

Variables ​

BREWING_BOTTLE_SLOTS ​

const BREWING_BOTTLE_SLOTS: 3 = 3

Defined in: packages/prismarine/src/world/brewing.ts:30

How many bottle slots the stand has, which are its slots 0 to 2 in Java's and Bedrock's numbering.


BREWING_DATA_BREW_TIME ​

const BREWING_DATA_BREW_TIME: 0 = 0

Defined in: packages/prismarine/src/world/brewing.ts:50

The ContainerSetDataPacket properties a brewing stand's screen draws from: the brew's ticks left, which is the arrow and the bubbles, then the brews the fuel has left and what the last fuel item gave, which is the fuel bar. The ids are the Bedrock brewing stand screen's own.


BREWING_DATA_FUEL_AMOUNT ​

const BREWING_DATA_FUEL_AMOUNT: 1 = 1

Defined in: packages/prismarine/src/world/brewing.ts:53

The property holding how many brews the burned fuel has left.


BREWING_DATA_FUEL_TOTAL ​

const BREWING_DATA_FUEL_TOTAL: 2 = 2

Defined in: packages/prismarine/src/world/brewing.ts:56

The property holding how many brews the last fuel item gave, which the fuel bar is a fraction of.


BREWING_FUEL_SLOT ​

const BREWING_FUEL_SLOT: 4 = 4

Defined in: packages/prismarine/src/world/brewing.ts:36

The stand's fuel slot, which takes blaze powder.


BREWING_INGREDIENT_SLOT ​

const BREWING_INGREDIENT_SLOT: 3 = 3

Defined in: packages/prismarine/src/world/brewing.ts:33

The stand's ingredient slot, above the bottles.


BREW_TICKS ​

const BREW_TICKS: 400 = 400

Defined in: packages/prismarine/src/world/brewing.ts:43

How many ticks one brew takes at a speed multiplier of 1, which every vanilla fuel has.

Java See ​

BrewingStandBlockEntity.serverTick

Functions ​

bottlesDiffer() ​

bottlesDiffer(states, bottles): boolean

Defined in: packages/prismarine/src/world/brewing.ts:140

Whether a block's states show other bottles than a stand holds.

Parameters ​

states ​

Readonly<Record<string, string | number | boolean>>

The block's states.

bottles ​

BrewingBottles

What the stand holds.

Returns ​

boolean


brewingBottlesOf() ​

brewingBottlesOf(stand): BrewingBottles

Defined in: packages/prismarine/src/world/brewing.ts:119

Which bottle slots of a loaded stand hold something, read from its items without rebuilding its record.

Parameters ​

stand ​

BrewingStand

The brewing stand.

Returns ​

BrewingBottles


brewingScreenData() ​

brewingScreenData(source): ReadonlyMap<number, number>

Defined in: packages/prismarine/src/world/brewing.ts:85

What a brewing stand's screen has to be told after a tick, by property id.

Parameters ​

source ​

NBTTagCompound | BrewingStand

The current brewing stand or its serialized block entity.

Returns ​

ReadonlyMap<number, number>


isBrewingFuelItem() ​

isBrewingFuelItem(content, identifier): boolean

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

Whether a stack can power a brewing stand, which is what its fuel slot takes.

Parameters ​

content ​

ServerContent

The server's content, whose item types are read.

identifier ​

string

The item's Bedrock identifier.

Returns ​

boolean

Java See ​

BrewingStandMenu$FuelSlot.mayPlaceItem


isBrewingReagent() ​

isBrewingReagent(content, item): boolean

Defined in: packages/prismarine/src/world/brewing.ts:206

Whether a stack can go in a brewing stand's ingredient slot: whether it is the reagent of a brewing recipe, by its item, which is Java's BREWING_REAGENTS property set.

Parameters ​

content ​

ServerContent

The server's content, whose brewing recipes are read.

item ​

The item, by its Bedrock identifier and data.

identifier ​

string

meta ​

number

Returns ​

boolean

Java See ​

BrewingStandMenu$IngredientsSlot.mayPlace


isBrewingStand() ​

isBrewingStand(identifier): boolean

Defined in: packages/prismarine/src/world/brewing.ts:27

Whether a block is a brewing stand.

Parameters ​

identifier ​

string

The block's identifier.

Returns ​

boolean


isPotionInput() ​

isPotionInput(content, item): boolean

Defined in: packages/prismarine/src/world/brewing.ts:229

Whether a stack can go in a brewing stand's bottle slot: whether it is the input of a brewing recipe, by its item, which is Java's BREWING_INPUTS property set, or is in #minecraft:brewing_potion_inputs.

Parameters ​

content ​

ServerContent

The server's content, whose brewing recipes and item tags are read.

item ​

The item, by its Bedrock identifier and data.

identifier ​

string

meta ​

number

Returns ​

boolean

Java Source ​

PotionIngredient.isPotionInput


tickBrewingStand() ​

tickBrewingStand(content, stand): BrewingTick | undefined

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

Advances one brewing stand by a game tick.

The fuel slot burns an item as soon as the stand has no fuel left, whether or not anything brews. A brew starts when the ingredient brews at least one bottle and there is fuel to spend, stops when the ingredient leaves or no bottle brews any more, and on its last tick turns every bottle the ingredient brews and uses one of the ingredient up. As in Java, the last tick brews before the ingredient is checked: an ingredient swapped in on that tick brews what it brews, and one swapped in a tick earlier stops the brew.

Only the slots a tick changes are written back: every other stack keeps its compound as it was, tags the item model does not read included.

Java leaves an item's crafting remainder in the fuel slot or the ingredient slot. The fuel's is none, since no source names one, and the ingredient's is what the recipe book's remainder lookup gives (RecipeMatch.remainder).

Parameters ​

content ​

ServerContent

The item types and recipes this world is running.

stand ​

BlockEntity

The brewing stand's block entity.

Returns ​

BrewingTick | undefined

The update, or undefined when nothing in the stand can change.

Java Source ​

BrewingStandBlockEntity.serverTick

Java Source ​

BrewingStandBlockEntity.isBrewable

Java Source ​

BrewingStandBlockEntity.doBrew