Categories
Categories are defined in json files placed in the /data/<mod_id>/modonomicons/<book_id>/categories/
folder.
Attributes
name (DescriptionId, mandatory)
The category name. Will not parse markdown.
description (DescriptionId or Component JSON, optional)
The category description. Can be styled using markdown. Will be displayed on the first page when opening the category if it is in index mode.
display_mode (String, optional)
Default value: node
. The display mode of the category. Can be node
or index
.
Index mode ("patchouli-style") will display all entries in a list.
Node mode ("thaumonomicon-style") will display a "tree/quest/progress" view of the entries.
The category can be in "index" mode, despite the book being in "node" mode if you have contents that are better suited for a list.
In this case the styling attributes, such as the background (see below) are still applied, but only to provide a consistent look for the book rendered behind the category view.
icon (ResourceLocation, mandatory)
Either an item/block ResourceLocation that should be used as icon. E.g.: minecraft:nether_star
or minecraft:chest
.
Or the ResourceLocation to a texture. The texture must be 16x16 pixels. E.g.: modonomicon:textures/gui/some_random_icon.png
.
To use a texture make sure the ResourceLocation includes the file endinge .png
as seen in the example above.
sort_number (Integer, optional)
Defaults to -1
.
Category "Bookmark"-Buttos on the left side of the Book will be sorted by this number.
Similarly, in index mode, the categories will be sorted in the list by this number.
When using datagen and no sort nubmer is provided, the BookProvider will automatically assign a sort number based on the order the categories are added when using .add()
.
condition (Condition, optional)
Categories, like Entries, can be hidden until an Unlock Condition is fulfilled. Conditions are JSON objects.
See Unlock Conditions for details.
background (ResourceLocation, optional)
Defaults to modonomicon:textures/gui/dark_slate_seamless.png
.
The ResourceLocation for the Background texture to use for this category. The texture must be 512px by 512px.
background_parallax_layers (JSON Array of JSON Objects, optional)
If any parallax layers are supplied, the background
property will be ignored.
Parallax layers allow a multi-layered background with a parallax effect. That means, the textures supplied here likely will feature transparent elements, however the first layer should be fully opaque to avoid visual artifacts.
Sample Value:
"background_parallax_layers": [
{
"background": "modonomicon:textures/gui/parallax/flow/base.png",
"speed": 0.7
},
{
"background": "modonomicon:textures/gui/parallax/flow/1.png",
"speed": 1.0
},
{
"background": "modonomicon:textures/gui/parallax/flow/2.png",
"speed": 1.4,
"vanish_zoom": 0.9
}
],
background_height (Integer, optional)
Default value: 512
The height of the background texture. Applies both to the background
property as well as the background_parallax_layers
property.
background_width (Integer, optional)
Default value: 512
The width of the background texture. Applies both to the background
property as well as the background_parallax_layers
property.
max_scroll_x (Integer, optional)
Default value: 512
The maximum horizontal scroll distance in this category.
max_scroll_Y (Integer, optional)
Default value: 512
The maximum vertical scroll distance in this category.
background_texture_zoom_multiplier (Float, optional)
Default value: 1.0
Allows to modify how "zoomed in" the background texture is rendered.
A lower value means the texture is zoomed OUT more -> it is sharper / less blurry.
This is especially useful for textures larger than 512x512px, as they might end up looking blurry otherwise.
Make sure to use seamless textures as the texture may be repeated (especially horizontally) to fill the screen.
entry_textures (ResourceLocation, optional)
Defaults to modonomicon:textures/gui/entry_textures.png
.
The ResourceLocation for the Entry textures to use for this category. The texture must be 512px by 512px.
Entry textures govern how the Entry background behind the Icon as well as the arrows connecting entries look.
If you want to use a custom texture, make sure to copy the default file from /assets/modonomicon/textures/gui/entry_textures.png
and modify it in order to preserve the UV coordinates of all parts.
show_category_button (Boolean, optional)
Defaults to true
.
If false, the book overview screen will not show a button/bookmark for this category.
This is intended to be used with an entry that links to this category to effectively create "sub-categories". See also Entries for the category_to_open
attribute.
entry_to_open (ResourceLocation, optional)
The entry to directly open when this category is opened. If not set, no entry will be opened.
open_entry_to_open_only_once (Boolean, optional)
Defaults to true
.
If true, the entry_to_open will only be opened the first time the category is opened. If false, the entry_to_open will be opened every time the category is opened.
Usage Examples
/data/<mod_id>/modonomicons/<book_id>/categories/features.json
:
{
"background": "modonomicon:textures/gui/dark_slate_seamless.png",
"entry_textures": "modonomicon:textures/gui/entry_textures.png",
"icon": "minecraft:nether_star",
"name": "book.modonomicon.demo.features.name",
"sort_number": -1
}
/lang/*.json
:
{
"book.modonomicon.demo.features.name": "Features Category",
}