Wiki 9Minecraft Shulkerboxtooltip Wiki
Shulkerboxtooltip WikiDocumentation › Data Driven Previews

Data Driven Previews


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

Description

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:{}}]

Supported Properties

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).

should_display

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}}]

inventory_max_size

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}}]

active_slot_count

Type: integer
Description: The number of slots that are not disabled. Disabled slots will be grayed out.
Added in version: 5.4.0

Example

Red shulker box with 3 active slots:

give @p minecraft:white_shulker_box[minecraft:container=[{slot:1,item:{id:cobblestone,count:31}}],minecraft:custom_data={shulkerboxtooltip:{active_slot_count:3}}]

selected_slot

Type: integer
Description: Index of the current selected slot. The name of the selected item will show above the tooltip.
Added in version: 5.4.0

Example

Red shulker slot 1 (cobblestone stack) selected:

give @p minecraft:red_shulker_box[minecraft:container=[{slot:1,item:{id:cobblestone,count:31}}],minecraft:custom_data={shulkerboxtooltip:{selected_slot:1}}]

max_row_size

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}}]

compact_max_row_size

Type: integer
Description: The maximum number of slots per row in compact preview mode.
Added in version: 5.2.0

full_preview_available

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}}]

show_tooltip_hints

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}}]

tooltip_hint_lang_key

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"}}]

full_tooltip_hint_lang_key

Type: string
Description: The localization string to use for the "view full contents" hint.

lock_tooltip_hint_lang_key

Type: string
Description: The localization string to use for the "lock tooltip" hint.

window_color

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"}}}]

texture

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"}}]

can_insert_items

Type: boolean
Description: Controls whether the player is allowed to insert items into the container by clicking with a stack.

not yet implemented

can_extract_items

Type: boolean
Description: Controls whether the player is allowed to extract items from the container by clicking.

not yet implemented

Developer Notes

Overrides are controlled by the OverridingPreviewProvider class, which wraps the PreviewProvider instance of the item when it has the shulkerboxtooltip compound tag.