Skip to content

Customizing Inventories

Adam edited this page Dec 9, 2024 · 3 revisions

Modern OpenInv has placeholders for increased inventory legibility. It also now has a resource pack designed to further-improve the experience. However, you may not like the defaults or may have conflicts with an existing resource pack. If that's the case, you will need to do some advanced configuration.

Using OpenInv with Existing Resource Packs

OpenInv uses the custom model data string openinv:custom on all of its items (9999 for versions prior to 1.21.4). If your resource pack does not use custom model data or does not use that particular data, you will just need to merge OpenInv's pack with yours. You will need to add OpenInv's models and textures to your pack, then modify the relevant Minecraft models to add the custom model data.

Customizing Placeholders

If you do need to modify placeholders for compatibility, they can be customized through a "secret" configuration section. This does not generate by default; it's easy to mess up the syntax and may require changes from version to version.

In Minecraft 1.21.4, these are the defaults:

placeholders:
  crafting-output: '{id:"minecraft:crafting_table",components:{"minecraft:custom_model_data":{"strings":["openinv:custom"]},"minecraft:item_name":''{"translate":"container.crafting"}''}}'
  cursor: '{id:"minecraft:white_banner",components:{"minecraft:custom_model_data":{"strings":["openinv:custom"]},"minecraft:banner_patterns":[{color:"gray",pattern:"minecraft:diagonal_up_right"},{color:"white",pattern:"minecraft:stripe_downright"},{color:"gray",pattern:"minecraft:border"}],"minecraft:hide_tooltip":{}}}'
  drop: '{id:"minecraft:dropper",components:{"minecraft:custom_model_data":{"strings":["openinv:custom"]},"minecraft:item_name":''{"translate":"key.drop"}''}}'
  empty-helmet: '{id:"minecraft:leather_helmet",components:{"minecraft:custom_model_data":{"strings":["openinv:custom"]},"minecraft:dyed_color":{rgb:13158600,show_in_tooltip:0b},"minecraft:hide_tooltip":{}}}'
  empty-chestplate: '{id:"minecraft:leather_chestplate",components:{"minecraft:custom_model_data":{"strings":["openinv:custom"]},"minecraft:dyed_color":{rgb:13158600,show_in_tooltip:0b},"minecraft:hide_tooltip":{}}}'
  empty-leggings: '{id:"minecraft:leather_leggings",components:{"minecraft:custom_model_data":{"strings":["openinv:custom"]},"minecraft:dyed_color":{rgb:13158600,show_in_tooltip:0b},"minecraft:hide_tooltip":{}}}'
  empty-boots: '{id:"minecraft:leather_boots",components:{"minecraft:custom_model_data":{"strings":["openinv:custom"]},"minecraft:dyed_color":{rgb:13158600,show_in_tooltip:0b},"minecraft:hide_tooltip":{}}}'
  empty-off-hand: '{id:"minecraft:shield",components:{"minecraft:custom_model_data":{"strings":["openinv:custom"]},"minecraft:banner_patterns":[{color:"black",pattern:"minecraft:half_vertical"},{color:"magenta",pattern:"minecraft:square_top_left"},{color:"magenta",pattern:"minecraft:square_bottom_left"},{color:"black",pattern:"minecraft:square_top_right"},{color:"black",pattern:"minecraft:square_bottom_right"}],"minecraft:base_color":"magenta","minecraft:hide_tooltip":{}}}'
  not-a-slot: '{id:"minecraft:white_stained_glass_pane",components:{"minecraft:custom_model_data":{"strings":["openinv:custom"]},"minecraft:hide_tooltip":{}}}'
  blocked:
    offline: '{id:"minecraft:barrier",components:{"minecraft:item_name":''{"translate":"options.narrator.notavailable","extra":[" - ",{"translate":"gui.socialInteractions.status_offline"}]}''}}'
    creative: '{id:"minecraft:barrier",components:{"minecraft:item_name":''{"translate":"options.narrator.notavailable","extra":[" - ",{"translate":"selectWorld.gameMode.creative"}]}''}}'
    spectator: '{id:"minecraft:barrier",components:{"minecraft:item_name":''{"translate":"options.narrator.notavailable","extra":[" - ",{"translate":"selectWorld.gameMode.spectator"}]}''}}'

Customizing Player Inventory Titles

There are also ways to use custom bitmap fonts to override inventory appearances. I'll admit, I don't really know how these operate beyond a surface level, but if you're an expert and want to use a textured font instead, OpenInv does offer a hidden-by-default prefix for your use. It uses the font openinv:font/inventory and white text, so your image should display correctly. Depending on whether the inventory is opened by the owner or another player, it will use translation key openinv.container.inventory.self or openinv.container.inventory.other.

After this comes an uncolored translation key openinv.container.inventory.prefix with an empty default and a parameter of the owner's name.

The secret prefix is followed by translation key container.inventory, then translation key openinv.container.inventory.suffix with a default of - %s and a parameter of the owner's name.

If that doesn't offer the customization you need, get in touch via an issue or change it yourself via Paper's title API/packets.

Customizing Ender Chests

Similarly to the player inventory, ender chests start with translation key openinv.container.enderchest.prefix with an empty default and a parameter of the owner's name.
This is followed by container.enderchest, then openinv.container.enderchest.suffix with a default of - %s and a parameter of the owner's name.