BrewingStandInventory
com.jsmacrosce.jsmacros.client.api.classes.inventory.BrewingStandInventory
Exposes a brewing stand's potion, ingredient, and fuel slots by name, with helpers to check recipes and preview brewing results without changing the stand.
On Minecraft 26.3 and later, recipe queries use the integrated server when available;
on remote servers they use local vanilla recipes and cannot account for remote datapacks.
js
const inv = Player.openInventory();
if (inv instanceof Inventories.BrewingStand) {
// what would the three bottles become?
for (const potion of inv.previewPotions()) {
Chat.log(potion.getName());
}
// and is it worth doing at all
if (inv.canBrewCurrentInput()) {
Chat.log(`brewing for another ${inv.getRemainingTicks()} ticks`);
}
}Available in scripts as Inventories.BrewingStand.
Constructors
new BrewingStandInventory
new BrewingStandInventory(BrewingStandScreen inventory)#Wraps the supplied brewing-stand screen and captures its menu and current client-player state. This constructor does not open or create a screen; scripts typically obtain the wrapper from FPlayer.openInventory().
Parameters:
inventory: the brewing-stand screen to wrap
Methods
canBrewCurrentInput
Returns:
true if the current ingredient is valid and at least one nonempty potion slot has a matching recipe; false otherwise. This does not check fuel or brewing progress.getBrewTime
Returns: elapsed brewing ticks, calculated from the menu's synchronized total on Minecraft 26.3 and later, or the standard duration on older versions, minus the remaining ticks
getFirstPotion
Returns: the item in potion slot 0.
getFuel
Returns: the item in slot 4, the fuel slot.
getFuelCount
Returns: the current fuel-use count.
getIngredient
Returns: the item in slot 3, the ingredient slot.
getMaxFuelUses
Returns: the maximum fuel-use count; on Minecraft 26.3 and later, the menu's synchronized total
getPotions
Returns: the items in potion slots 0, 1, and 2, in slot order.
getRemainingTicks
Returns: the menu's brewing-tick value, which counts down while brewing.
getSecondPotion
Returns: the item in potion slot 1.
getThirdPotion
Returns: the item in potion slot 2.
isBrewablePotion
Parameters:
potion: the potion to check
Returns:
true if the stack contains a potion type used as the result of a brewing recipe; false if it has no potion type or is not brewable.isValidIngredient
Parameters:
ingredient: the item to check
Returns:
true if the given item is a valid ingredient, false otherwise.isValidRecipe
Parameters:
potion: the potion to checkingredient: the ingredient to check
Returns:
true if the given potion and ingredient can be brewed together, false otherwise.previewPotion
Parameters:
potion: the potioningredient: the ingredient
Returns: the result of mixing the ingredient into the potion stack, or the original potion stack if no mix applies.
previewPotions
Returns the results of mixing the current ingredient with each of the three potion slots. Empty or incompatible slots are passed through unchanged by the brewing mix operation.
Returns: the three resulting item stacks, in potion-slot order.