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>
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>
Make a new class that implements DisplayCategory
.
Override getCategoryIdentifier
, and return the identifier created above.
Override getTitle
and return a Component
(Mojmap) / Text
(Yarn).
Override getIcon
and return a Renderer
.
You may return an EntryStack
here as that implements Renderer
.
By default, the bounds of the display is 150x99.
You may change this by overriding getDisplayWidth
and getDisplayHeight
.