- Notifications
You must be signed in to change notification settings - Fork 35
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.
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.

@OverridepublicvoidonOpen(OpenContextopen) {
open.modifyConfig().title(String.format(
"Hi, %s", open.getPlayer().getName()
));
}Options that define how the inventory container itself is created.
Sets the initial title of the inventory.
@OverridepublicvoidonInit(ViewConfigBuilderconfig) {
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.
@OverridepublicvoidonInit(ViewConfigBuilderconfig) {
config.title(Component.text("Write something")
.color(NamedTextColor.BLUE));
}Sets the inventory size.
You may specify:
- Number of lines →
size(4) - Absolute number of slots →
size(45)
@OverridepublicvoidonInit(ViewConfigBuilderconfig) {
config.size(4); // 4 lines (36 slots)config.size(45); // explicit number of slots
}Automatically sets the inventory to the largest size allowed by its type.
@OverridepublicvoidonInit(ViewConfigBuilderconfig) {
config.maxSize();
}Defines the underlying container type (e.g. ANVIL, HOPPER, DISPENSER…).

@OverridepublicvoidonInit(ViewConfigBuilderconfig) {
config.type(ViewType.SHULKER_BOX);
}Defines the structural layout of the inventory.
Each character in the array represents a slot, and each string corresponds to a row in the layout.
See Layouts for more details.
Controls how players are allowed to interact with the inventory.
Shortcut to cancel all interactions.
Cancels all click interactions. Prevents items from being moved.

@OverridepublicvoidonInit(ViewConfigBuilderconfig) {
config.cancelOnClick();
}Cancels dragging items across slots.

@OverridepublicvoidonInit(ViewConfigBuilderconfig) {
config.cancelOnDrag();
}Cancels item drops while the inventory is open. To cancel pickups see cancelOnPickup.
@OverridepublicvoidonInit(ViewConfigBuilderconfig) {
config.cancelOnDrop();
}Cancels item pickup while the inventory is open. To cancel drops see cancelOnDrop.
@OverridepublicvoidonInit(ViewConfigBuilderconfig) {
config.cancelOnPickup();
}Adds a delay before any interaction becomes valid. Actions performed before the delay ends are cancelled.

@OverridepublicvoidonInit(ViewConfigBuilderconfig) {
config.interactionDelay(Duration.ofSeconds(3));
}In the example video, the player clicks multiple times, but all interactions are delayed by 3 seconds.
Schedules periodic updates for the inventory.
Triggers onUpdate(Context) automatically.
@OverridepublicvoidonInit(ViewConfigBuilderconfig) {
config.scheduleUpdate(20L); // every 1 secondconfig.scheduleUpdate(Duration.ofSeconds(5)); // every 5 seconds
}See Scheduled Updates for more details.
Same as above, but driven by a Timer State instead of a fixed tick count — the interval can be changed and the timer paused/resumed at runtime.
privatefinalTimerStatetimerState = timerState(20L);
@OverridepublicvoidonInit(ViewConfigBuilderconfig) {
config.scheduleUpdate(timerState);
}Note: experimental (
@ApiStatus.Experimental).
Adds configuration modifiers — internal advanced options.
Controls whether initial data is passed when navigating between inventory.
false (default): data from View A does not transfer to View Btrue: data from A is carried over to B
@OverridepublicvoidonInit(ViewConfigBuilderconfig) {
config.transitiveInitialData(true);
}See Navigating Between Views for more details.
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.