Skip to content

FurnaceInventory ​

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

Since1.8.4

Inventory wrapper for a furnace screen, exposing its input, fuel, result, and smelting state.

js
const inv = Player.openInventory();  
if (inv instanceof Inventories.Furnace) {
  Chat.log(`${inv.getSmeltedItem().getItemId()} -> ${inv.getOutput().getItemId()}, `
    + `${inv.getRemainingSmeltingTime()} ticks left`);  
}

Available in scripts as Inventories.Furnace.

Constructors ​

new FurnaceInventory ​

new FurnaceInventory(AbstractFurnaceScreen<?> inventory)#
Wraps a furnace screen without opening or creating it; use FPlayer.openInventory() to obtain the current inventory wrapper.

Parameters:

  • inventory: the furnace screen to wrap

Methods ​

canUseAsFuel ​

canUseAsFuel(ItemStackHelper stack): booleanSince1.8.4#

Parameters:

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

getCraftingHeight ​

getCraftingHeight(): intSince1.8.4#
Returns the fixed height of the furnace input grid.
Returns: 1

getCraftingSlotCount ​

getCraftingSlotCount(): intSince1.8.4#
Returns the number of input slots, excluding the fuel and result slots.
Returns: 1

getCraftingWidth ​

getCraftingWidth(): intSince1.8.4#
Returns the fixed width of the furnace input grid.
Returns: 1

getFuel ​

getFuel(): ItemStackHelperSince1.8.4#
Returns: the fuel item.

getFuelValues ​

getFuelValues(): Map<String, Integer>Since1.8.4#
Returns item registry IDs mapped to their burn times in ticks. On Minecraft 26.3 and later, uses the open furnace's integrated-server context when available; remote servers use local vanilla ordinary-furnace defaults, which do not reflect remote datapack providers. Items referencing providers unknown to the local defaults are omitted on remote servers.
Returns: the fuel-value map

getInput ​

getInput(int x, int y): ItemStackHelperSince1.8.4#
Returns the furnace's sole input item; the coordinates are ignored.

Parameters:

  • x: ignored
  • y: ignored
Returns: the item in the input slot
getInput(): ItemStackHelper[][]Since1.8.4#
Returns input cells in an array indexed by column, then row. Its dimensions are the reported width and height, so it is empty when either dimension is zero.
Returns: the grid as [column][row]

getOutput ​

getOutput(): ItemStackHelperSince1.8.4#
Returns the item currently in the furnace menu's result slot.
Returns: the item in the result slot

getRemainingFuelTime ​

getRemainingFuelTime(): intSince1.8.4#
Returns the furnace menu's remaining fuel time in ticks.
Returns: the remaining fuel time

getRemainingSmeltingTime ​

getRemainingSmeltingTime(): intSince1.8.4#
Returns the total smelting time minus the current progress, in ticks.
Returns: the calculated remaining time

getSmeltedItem ​

getSmeltedItem(): ItemStackHelperSince1.8.4#
Returns: the currently smelting item.

getSmeltingProgress ​

getSmeltingProgress(): intSince1.8.4#
Returns the furnace menu's current smelting progress in ticks.
Returns: the current progress

getTotalFuelTime ​

getTotalFuelTime(): intSince1.8.4#
Returns the furnace menu's total fuel time in ticks.
Returns: the total fuel time

getTotalSmeltingTime ​

getTotalSmeltingTime(): intSince1.8.4#
Returns the total smelting time reported by the furnace menu, in ticks.
Returns: the total smelting time

isBurning ​

isBurning(): booleanSince1.8.4#
Returns: true if the furnace menu is lit, false otherwise

isSmeltable ​

isSmeltable(ItemStackHelper stack): booleanSince1.8.4#

Parameters:

  • stack: the item to check
Returns: true if the item can be smelted, false otherwise.

toString ​

toString(): String#
Returns the fixed diagnostic label for this inventory wrapper.
Returns: "FurnaceInventory:{}"