Skip to content

BrewingStandInventory ​

com.jsmacrosce.jsmacros.client.api.classes.inventory.BrewingStandInventory

Since1.8.4

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 ​

canBrewCurrentInput(): booleanSince1.8.4#
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 ​

getBrewTime(): intSince1.8.4#
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 ​

getFirstPotion(): ItemStackHelperSince1.8.4#
Returns: the item in potion slot 0.

getFuel ​

getFuel(): ItemStackHelperSince1.8.4#
Returns: the item in slot 4, the fuel slot.

getFuelCount ​

getFuelCount(): intSince1.8.4#
Returns: the current fuel-use count.

getIngredient ​

getIngredient(): ItemStackHelperSince1.8.4#
Returns: the item in slot 3, the ingredient slot.

getMaxFuelUses ​

getMaxFuelUses(): intSince1.8.4#
Returns: the maximum fuel-use count; on Minecraft 26.3 and later, the menu's synchronized total

getPotions ​

getPotions(): List<ItemStackHelper>Since1.8.4#
Returns: the items in potion slots 0, 1, and 2, in slot order.

getRemainingTicks ​

getRemainingTicks(): intSince1.8.4#
Returns: the menu's brewing-tick value, which counts down while brewing.

getSecondPotion ​

getSecondPotion(): ItemStackHelperSince1.8.4#
Returns: the item in potion slot 1.

getThirdPotion ​

getThirdPotion(): ItemStackHelperSince1.8.4#
Returns: the item in potion slot 2.

isBrewablePotion ​

isBrewablePotion(ItemStackHelper potion): booleanSince1.8.4#

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 ​

isValidIngredient(ItemStackHelper ingredient): booleanSince1.8.4#

Parameters:

  • ingredient: the item to check
Returns: true if the given item is a valid ingredient, false otherwise.

isValidRecipe ​

isValidRecipe(ItemStackHelper potion, ItemStackHelper ingredient): booleanSince1.8.4#

Parameters:

  • potion: the potion to check
  • ingredient: the ingredient to check
Returns: true if the given potion and ingredient can be brewed together, false otherwise.

previewPotion ​

previewPotion(ItemStackHelper potion, ItemStackHelper ingredient): ItemStackHelperSince1.8.4#

Parameters:

  • potion: the potion
  • ingredient: the ingredient
Returns: the result of mixing the ingredient into the potion stack, or the original potion stack if no mix applies.

previewPotions ​

previewPotions(): List<ItemStackHelper>Since1.8.4#
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.

toString ​

toString(): String#
Returns the fixed diagnostic string "BrewingStandInventory:{}"; it does not include inventory contents.
Returns: the literal "BrewingStandInventory:{}"