Skip to content

API reference Obsidian.API.Client.Screens

ModMenuScreen class

A mod's screen for one of its menu types, like a NeoForge mod's AbstractContainerScreen: a ModScreen with the menu's title and the player's inventory, whose SlotGrids show the menu's slots, and whose ModMenuScreen.Menu gives the menu's data and sends its buttons. Register it with IClientRegistry.RegisterMenuScreen; the client makes one each time the server opens the menu.

public abstract class ModMenuScreen : ModScreen

In Obsidian.API.Client.

Remarks

The player clicks, drags and shift-clicks the slots like any container's, presses a hotbar key to swap with the slot under the mouse, and closes the screen, and the menu, with Escape or the inventory key.

Constructors

ModMenuScreen(IScreenMenu)

protected ModMenuScreen(IScreenMenu menu);

A mod's screen for one of its menu types, like a NeoForge mod's AbstractContainerScreen: a ModScreen with the menu's title and the player's inventory, whose SlotGrids show the menu's slots, and whose ModMenuScreen.Menu gives the menu's data and sends its buttons. Register it with IClientRegistry.RegisterMenuScreen; the client makes one each time the server opens the menu.

Parameters

menu
The menu the screen shows.

Remarks

The player clicks, drags and shift-clicks the slots like any container's, presses a hotbar key to swap with the slot under the mouse, and closes the screen, and the menu, with Escape or the inventory key.

Properties

Inventory

public GuiPosition? Inventory { get; set; }

Where the first slot of the player's inventory goes: its three rows of nine, then the hotbar 58 pixels below the first row, like vanilla's menus and MenuScreenProperties.Inventory; null to place the player's slots with SlotGrids, or not show them.

InventoryLabel

public GuiPosition? InventoryLabel { get; set; }

Where the "Inventory" label goes; if null, 12 pixels above the player's inventory, or nowhere without it.

public IScreenMenu Menu { get; }

The menu the screen shows.

Title

public GuiPosition Title { get; set; }

Where the menu's title goes.

On this page