Inventories
Lets scripts identify inventory wrappers through the Inventories global,
instead of matching screen-name strings.
js
const inv = Player.openInventory();
if (inv instanceof Inventories.Villager) {
Chat.log(inv.getTrades());
}These names are available in JavaScript and Python without importing anything. They are read-only aliases of Java types, so instanceof works as usual.
| Script name | What it is |
|---|---|
Inventories.Anvil | Handle for an open anvil screen. |
Inventories.Beacon | Handle for an open beacon screen. |
Inventories.BrewingStand | 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. |
Inventories.Cartography | A handle for an open cartography table screen. |
Inventories.Container | Inventory handle for chest-like container screens. |
Inventories.Crafting | Provides access to the input grid and result of a crafting menu. |
Inventories.Creative | Handles the creative inventory screen and its item tabs. |
Inventories.Enchant | Handles an open enchanting table screen. |
Inventories.Furnace | Inventory wrapper for a furnace screen, exposing its input, fuel, result, and smelting state. |
Inventories.GrindStone | Handle for an open grindstone screen. |
Inventories.Horse | Handle for an open horse, mule, donkey, llama, or camel inventory screen. |
Inventories.Inventory | Wraps a container screen's menu; specialized subclasses represent recognized screen types. |
Inventories.Loom | Provides access to pattern selection in an open loom screen. |
Inventories.Player | The player's inventory screen, including its crafting result, input grid, equipment, and hotbar. |
Inventories.Recipe | Base API for recipe-book screens, exposing their input dimensions, cells, output, and recipe-book entries. |
Inventories.Smithing | Wraps an open smithing table screen. |
Inventories.StoneCutter | Handles an open stonecutter screen. |
Inventories.Villager | Handles an open villager trading screen. |