Skip to content

API reference Obsidian.API.Inventory

CreativeTabProperties class

A plugin's creative tab, given when registering it (see IPluginRegistry.RegisterCreativeTab): its title, its icon, where it goes among the tabs and the items it shows.

public sealed class CreativeTabProperties

In Obsidian.API.

Constructors

public CreativeTabProperties();

Properties

After

public string After { get; init; }

The tab this one follows, like NeoForge's withTabsBefore: one of vanilla's, like minecraft:spawn_eggs, or another plugin's. Null, or a tab that isn't registered (yet), puts it after vanilla's tabs and the tabs registered before it.

DisplayItems

public Func<IEnumerable<Item>> DisplayItems { get; init; }

Gives more items for the tab to show, after CreativeTabProperties.Items, like NeoForge's DisplayItemsGenerator: for contents that change, called each time the client builds the tabs (as the creative inventory opens). It runs on the client only, inside a call into the plugin; if it throws, the error is logged and the tab shows CreativeTabProperties.Items.

Icon

public required Item Icon { get; init; }

The item drawn on the tab.

Items

public IReadOnlyList<Item> Items { get; init; }

The items the tab shows, in order, before those CreativeTabProperties.DisplayItems gives.

Title

public required ChatMessage Title { get; init; }

The tab's title, shown above its items and as its tooltip: a translation key (new ChatMessage { Translate = "itemGroup.ruby" }, translated with the mod's language files) or plain text (ChatMessage.Simple).

On this page