By default this library only offers methods to use strings with legacy formatting for inventory titles and element descriptions. This is due to at this point not one unified API existing for how components should be used in the API and the library aims to support both Spigot and Paper by default.
However it is possible to use text components and RGB colors on supported platforms by using the InventoryCreator, the item name and lore setters to convert strings to components. (There is also an InventoryGui constructor which takes all three of these at once)
This is an example constructor for the InventoryGui which uses MineDown to parse the string to the Adventure Components included in Paper.
An implementation of a method to create a GUI could look like this:
InventoryGui createMineDownGui(JavaPlugin plugin, InventoryHolder holder, String title, String[] guiSetup) { InventoryGui.InventoryCreator mineDownInventoryCreator = new InventoryGui.InventoryCreator( (gui, viewer, type) -> Bukkit.createInventory(new InventoryGui.Holder(gui), type, MineDown.parse(gui.replaceVars(viewer, gui.getTitle()))), (gui, viewer, size) -> Bukkit.createInventory(new InventoryGui.Holder(gui), size, MineDown.parse(gui.replaceVars(viewer, gui.getTitle())))); BiConsumer<ItemMeta, String> mineDownNameSetter = (itemMeta, name) -> { if (name != null) { itemMeta.displayName(MineDown.parse(name)); } }; BiConsumer<ItemMeta, List<String>> mineDownLoreSetter = (itemMeta, lore) -> { if (lore != null) { List<Component> loreComponents = new ArrayList<>(); for (String line : lore) { loreComponents.add(MineDown.parse(line)); } itemMeta.lore(loreComponents); } }; return new InventoryGui(plugin, mineDownInventoryCreator, mineDownNameSetter, mineDownLoreSetter, holder, title, guiSetup); }
(This snippet is (c) 2025 Max Lee aka Phoenix616
and freely usable under the terms of the GPLv3)
If you prefer using MiniMessage then an example method to create a GUI could look like this:
InventoryGui createMiniMessageGui(JavaPlugin plugin, InventoryHolder holder, String title, String[] guiSetup) { InventoryGui.InventoryCreator miniMessageInventoryCreator = new InventoryGui.InventoryCreator( (gui, viewer, type) -> Bukkit.createInventory(new InventoryGui.Holder(gui), type, MiniMessage.miniMessage().deserialize(gui.replaceVars(viewer, gui.getTitle()))), (gui, viewer, size) -> Bukkit.createInventory(new InventoryGui.Holder(gui), size, MiniMessage.miniMessage().deserialize(gui.replaceVars(viewer, gui.getTitle())))); BiConsumer<ItemMeta, String> miniMessageNameSetter = (itemMeta, name) -> { if (name != null) { itemMeta.displayName((MiniMessage.miniMessage().deserialize(name)); } }; BiConsumer<ItemMeta, List<String>> miniMessageLoreSetter = (itemMeta, lore) -> { if (lore != null) { List<Component> loreComponents = new ArrayList<>(); for (String line : lore) { loreComponents.add(MiniMessage.miniMessage().deserialize(line)); } itemMeta.lore(loreComponents); } }; return new InventoryGui(plugin, miniMessageInventoryCreator, miniMessageNameSetter, miniMessageLoreSetter, holder, title, guiSetup); }
(This snippet is (c) 2025 Max Lee aka Phoenix616
and freely usable under the terms of the GPLv3)