API reference Obsidian.API.Client.Screens
IScreenMenu interface
The client's side of a menu the server opened, as a ModMenuScreen sees it: what the server sends with it (its slots' stacks, its data slots' values and the extra data it was opened with), and its buttons.
public interface IScreenMenu
In Obsidian.API.Client.
Remarks
It's the server's menu as last sent: the values change as the server sends them, between the screen's ticks.
Properties
Carried
ItemStack Carried { get; }An isolated copy of the stack the player carries on the cursor, like vanilla's getCarried; null when they carry nothing. For a screen whose clicks outside slots do something with it, like putting it into a machine's storage.
SlotCount
int SlotCount { get; }How many slots the menu type has. The player's inventory follows them in the menu: its 27 main slots row by row from IScreenMenu.SlotCount, then its 9 hotbar slots.
Title
string Title { get; }The title the server opened the menu with.
Type
string Type { get; }The menu type's identifier, like examplemod:grinder.
Methods
ClickButton(int)
void ClickButton(int button);Sends a click on one of the screen's buttons to the server, like vanilla's clickMenuButton: the server's MenuContainer.ClickButton gets the number, which means whatever the menu says. Does nothing once the menu closed.
GetData(int)
int GetData(int index);The value of one of the menu's data slots, like a furnace's progress (the server's MenuContainer.GetData); 0 until the server sends it.
GetItem(int)
ItemStack GetItem(int slot);An isolated copy of the stack in a menu slot, the player's inventory included, retaining its count and components; null for an empty or unknown slot. Changing the copy doesn't change the menu.
ReadOpenData()
INetStreamReader ReadOpenData();Reads the extra data the menu was opened with, which the mod's server side wrote in MenuContainer.WriteOpenData, from its start: a new reader each call. Empty when the server sent none.