Data Driven Previews - MisterPeModder/ShulkerBoxTooltip GitHub Wiki
Custom box with rows of size 5, orange window color, and no tooltip hints.
Note
This feature is available on version 4.2.0 and later for Minecraft 1.20.6 and later
Note
You may only override items which already previews such as shulker boxes, chest, and modded containers.
It does not work on arbitrary items
ShulkerBoxTooltip supports overriding some properties of preview-able items (see the list below) using custom NBT data on a stack-by-stack basis.
Overrides are located in the shulkerboxtooltip
compound tag or the minecraft:custom_data
item component, you may create them using a command of the following format:
give @s chest[minecraft:custom_data={shulkerboxtooltip:{}}]
Any of the following properties may be overridden. When omitted, falls back to the default behavior of the item (e.g. A shulker box will use window_color: {category: shulkerboxtooltip:shulker_boxes, id: shulker_box}
for its window color when missing).
Type: boolean
Description: Controls whether the preview window is allowed to display.
Example
Shulker box with no preview window:
give @p minecraft:shulker_box[minecraft:container=[{slot:2,item:{id:cobblestone,count:31}}],minecraft:custom_data={shulkerboxtooltip:{should_display:false}}]

Type: integer
Description: Limits the number of slots to display in the preview
Example
Barrel with only two slots:
give @p minecraft:barrel[minecraft:container=[{slot:1,item:{id:cobblestone,count:31}}],minecraft:custom_data={shulkerboxtooltip:{inventory_max_size:2}}]

Type: integer
Description: The maximum number of slots per row in full preview mode.
Example
Red shulker box with rows of 3 slots:
give @p minecraft:red_shulker_box[minecraft:container=[{slot:1,item:{id:cobblestone,count:31}}],minecraft:custom_data={shulkerboxtooltip:{max_row_size:3}}]

Type: integer
Description: The maximum number of slots per row in compact preview mode.
Added in version: 5.2.0
Type: boolean
Description: Controls whether the full preview window can be shown.
Example
Shulker box with full preview disabled:
give @p minecraft:shulker_box[minecraft:container=[{slot:2,item:{id:cobblestone,count:31}}],minecraft:custom_data={shulkerboxtooltip:{full_preview_available:false}}]

Type: boolean
Description: Whether to show hints like "Left Controls: lock tooltip" in the tooltip of the container.
Example
Shulker box without key hints:
give @p minecraft:shulker_box[minecraft:container=[{slot:2,item:{id:cobblestone,count:31}}],minecraft:custom_data={shulkerboxtooltip:{show_tooltip_hints:false}}]

Type: string
Description: The localization string to use for the "view contents" hint.
Examples
White shulker box with modified hint text:
give @p minecraft:shulker_box[minecraft:container=[{slot:2,item:{id:cobblestone,count:31}}],minecraft:custom_data={shulkerboxtooltip:{tooltip_hint_lang_key:"gui.proceed"}}]

Type: string
Description: The localization string to use for the "view full contents" hint.
Type: string
Description: The localization string to use for the "lock tooltip" hint.
Type: integer OR compound of format {category: "mod:category_id", id: "color_key_id"}
Description: Overrides the window color with a specific color code or a named color key. Color keys are listed in the "Colors" tab of the mod's configuration screen.
Examples
Chest using #ff5512
for its preview window color:
give @p minecraft:chest[minecraft:container=[{slot:2,item:{id:cobblestone,count:31}},{slot:15,item:{id:diamond_sword}}],minecraft:custom_data={shulkerboxtooltip:{window_color:16733458}}]

Chest using ender chest color:
give @p minecraft:chest[minecraft:container=[{slot:2,item:{id:cobblestone,count:31}},{slot:15,item:{id:diamond_sword}}],minecraft:custom_data={shulkerboxtooltip:{window_color:{category:"shulkerboxtooltip:default",id:"ender_chest"}}}]


Type: string / resource location (format: namespace:path/to/texture.png
)
Description: Use the specified texture for the preview window. Accepts any texture from vanilla, mods, and resource packs. Works best with textures similar to shulker_box_tooltip.png
Example
Dispenser using cobblestone as the preview texture:
give @p minecraft:dispenser[minecraft:container=[{slot:2,item:{id:cobblestone,count:31}}],minecraft:custom_data={shulkerboxtooltip:{texture:"minecraft:textures/block/cobblestone.png"}}]

Type: boolean
Description: Controls whether the player is allowed to insert items into the container by clicking with a stack.
not yet implemented
Type: boolean
Description: Controls whether the player is allowed to extract items from the container by clicking.
not yet implemented
Overrides are controlled by the OverridingPreviewProvider
class, which wraps the PreviewProvider
instance of the item when it has the shulkerboxtooltip
compound tag.