Skip to content

CartographyInventory ​

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

Since1.8.4

A handle for an open cartography table screen. The input slots are 0 and 1, and slot 2 is the result; getMap() groups the inputs as input and the result as output.

The second input accepts paper, maps, or glass panes. The menu supplies the result; this wrapper does not calculate it.

js
const inv = Player.openInventory();  
if (inv instanceof Inventories.Cartography) {
 Chat.log(`${inv.getMapItem().getItemId()} with ${inv.getMaterial().getItemId()}`);  
 if (!inv.getOutput().isEmpty()) {
   Chat.log(`table offers ${inv.getOutput().getCount()} item(s)`);  
 }
}

Available in scripts as Inventories.Cartography.

Constructors ​

new CartographyInventory ​

new CartographyInventory(CartographyTableScreen inventory)#
Wraps the supplied cartography screen and captures its menu and the current client player through Inventory's setup. This does not open or create a screen; scripts can obtain a wrapper for the current screen through FPlayer.openInventory().

Parameters:

  • inventory: the cartography screen to wrap

Methods ​

getMapItem ​

getMapItem(): ItemStackHelperSince1.8.4#
Returns the item in the first input slot. The menu accepts items carrying a map ID here.
Returns: the map item in the first slot

getMaterial ​

getMaterial(): ItemStackHelperSince1.8.4#
Returns the second input item. It may be paper, a map, or a glass pane; its effect depends on the item and the first input map's state.
Returns: the item in the second slot

getOutput ​

getOutput(): ItemStackHelperSince1.8.4#
Returns the result slot (slot 2) as currently exposed by the menu; this wrapper does not calculate a result.
Returns: the result the table is currently offering

toString ​

toString(): String#
Returns this wrapper's fixed diagnostic label.
Returns: CartographyInventory:{}