Skip to content

API reference Obsidian.API

MenuDefinition class

A menu type a plugin registered with IPluginRegistry.RegisterMenu, like a NeoForge mod's MenuType: a grid of MenuDefinition.Rows by MenuDefinition.Columns slots above the player's inventory. Open one with IPlayer.OpenInventoryAsync and a MenuContainer of the type.

public sealed class MenuDefinition

In Obsidian.API.

Remarks

The server owns the definition: it keeps its instance, identifier, id and shape until the server stops, even when the plugin reloads or unloads.

Properties

Columns

public int Columns { get; }

How many slots each row has, from 1 to 9.

Id

public int Id { get; }

The menu type's id in the menu registry. Vanilla's come first; plugins' follow, in the order they were first registered.

Identifier

public string Identifier { get; }

The menu type's identifier, like myplugin:pouch.

Rows

public int Rows { get; }

How many rows of slots the menu has, from 1 to 6.

SlotCount

public int SlotCount { get; }

How many slots the menu has, numbered row by row from 0; the player's inventory follows them, like in vanilla's menus.

Methods

public override string ToString();

On this page