-
Notifications
You must be signed in to change notification settings - Fork 36
Configuration Guide
This guide covers all configuration options available.
Use these options inside onInit(...) to define how a view behaves, looks, and interacts with players.
Tip
Before continuing, it's important to understand that the configuration defined in onInit serves as the base configuration for the view.
If you need to adjust the configuration per player—for example, changing the title only for a specific player—you can use modifyConfig inside onOpen.
All configuration options available in onInit are also supported on a per-player basis within onOpen.
@Override
public void onOpen(OpenContext open) {
open.modifyConfig().title("Hi, " + open.getPlayer().getName());
}Options that define how the inventory container itself is created.
Sets the initial title of the inventory.
@Override
public void onInit(ViewConfigBuilder config) {
config.title("Write something");
}Sets the initial title using an Adventure Text Component.
Note
To use Adventure components as titles, make sure the inventory-framework-platform-paper module is on your classpath. See the Installation guide for details.
@Override
public void onInit(ViewConfigBuilder config) {
config.title(Component.text("Write something")
.color(NamedTextColor.BLUE));
}Sets the size of the inventory.
@Override
public void onInit(ViewConfigBuilder config) {
config.size(4); // rows
config.size(45); // full size
}Sets the size of the inventory to the maximum possible,
based on the inventory type.
@Override
public void onInit(ViewConfigBuilder config) {
config.maxSize();
}Welcome to the Inventory Framework documentation.
- Pagination — Display large collections of items across multiple pages.
- Layouts (a.k.a. Masks or Patterns) — Define visual patterns for item placement.
- Scheduled Updates
- Anvil Input — Capture text input from players using an anvil GUI.
- Dynamic Title Update — Update the inventory’s title in real time.
- IntelliJ Tooling Plugin — Live inventory preview and API inspections in the IDE.
You can find practical examples in the examples directory.