mcutils:info_book
A simple UI guide book for add-ons.
Registering
Before you can use this component you need to register it.
js
import { system } from "@minecraft/server";
import { InfoBookComponent } from "@lpsmods/mc-utils";
system.beforeEvents.startup.subscribe((event) => {
event.blockComponentRegistry.registerCustomComponent(InfoBookComponent.typeId, new InfoBookComponent());
});
Component
Options
Name | Type | Default | Description |
---|---|---|---|
developer_mode | boolean | false | |
default | string | home | |
translation_pattern | string | guide.{NAMESPACE}:{KEY} | |
back_button | Back Button | ||
mcutils:search | Search |
Back Button
Name | Type | Description |
---|---|---|
label | ||
icon | ||
top_margin | number | |
bottom_margin | number | |
bottom_divider | boolean | |
top_divider | boolean |
Search
Name | Type | Description |
---|---|---|
include_buttons | boolean | |
include_titles | boolean | |
title | string | |
body | string | |
include_titles_label | string | |
include_buttons_label | string | |
result_title | string | |
result_body | string |
Examples
Guide Book
json
{
"format_version": "1.21.100",
"minecraft:item": {
"description": {
"identifier": "wiki:guide_book"
},
"components": {
"wiki:guide_book": {
"developer_mode": true,
"default": "home",
"translation_pattern": "guide.{NAMESPACE}:{KEY}",
"mcutils:search": {
"include_titles": true,
"include_buttons": true
},
"back_button": {
"icon": "textures/ui/arrowLeft.png"
}
}
}
}
}