Every display has one category (tab in the display screen) handling it. Categories are identified by their category identifier, which we will get into below.

<aside> 💡 It is also important to read Displays at the same time!

</aside>

Setting up the CategoryIdentifier

First, declare a CategoryIdentifier somewhere statically, this id acts like a replacement for ResourceLocation (Mojmap) / Identifier (Yarn), but provides type-safe casting.

The generic type T is the display class of this category.

public static final CategoryIdentifier<MyDisplay> MY_DISPLAY = CategoryIdentifier.of("modid", "my_display");

<aside> 🛠 Optionally: Register Display Serializers.

</aside>

Setup the Category

Make a new class that implements DisplayCategory.

Setup the category identifier

Override getCategoryIdentifier, and return the identifier created above.

Setup the title

Override getTitle and return a Component (Mojmap) / Text (Yarn).

Setup the icon

Override getIcon and return a Renderer.

You may return an EntryStack here as that implements Renderer.

Setup the bounds of the display

By default, the bounds of the display is 150x99.

You may change this by overriding getDisplayWidth and getDisplayHeight.

Setup the display widgets