Skip to content

definition_schemas

Trplnr edited this page Jun 12, 2026 · 11 revisions

Definition Schemas

This article describes the schemas for making a slideshow.

All schemas here will use TypeScript as the pseudocode language.


Identifier

A string that follows https://minecraft.wiki/w/Identifier#Legal_characters

Schema

// https://minecraft.wiki/w/Identifier#Legal_characters
type Identifier = string

Example

"namespace:path"
"my.project:path/to/thing"

Slideshow

A list of pages.

Schema

/** Identifier pointing to pages. */
type Slideshow = Identifier[];

Example

[
    "trplnr:summit_slideshow/intro",
    "trplnr:summit_slideshow/what_is_reef",
    "trplnr:summit_slideshow/outro",
    "trplnr:summit_slideshow/credits"
]

Page

A single page that contains elements and other metadata.

Schema

interface Page {
    /** 
     * List of commands to run when this page loads. 
     * Runs as and at the screen.
     * ⚠ This feature hasn't been released yet. 
     */
    commands?: string[];

    /** Transition to play when transitioning to this page. */
    transition?: Identifier;

    /** A list of element groups to display sequentially when reef:api/screen/next is ran. */
    sequence: Element[][];
}

Example

{
    "commands": ["playsound minecraft:entity.cat.ambient master @a ~ ~ ~ 2 1 2"],
    "transition": "trplnr:color_wipe",
    "sequence": [
        [{
            "type": "graphic",
            ...
        }],
        [
            {
                "type": "text",
                ...
            },
            {
                "type": "animated_element",
                ...
            }
        ]
    ]
}

Element

The main building block of pages.

Schema

/** Can either be a graphic element, a text element, or an animated graphic element based on the `type` field. */
type Element = GraphicElement | TextElement | AnimatedGraphicElement;

interface ElementBase {
    /** 
     * List of commands to run when this element spawns. 
     * Runs as and at the element.
     * ⚠ This feature hasn't been released yet. 
     */
    commands?: string[];

    /** Entity position of the element */
    pos?: Vector3;

    /** Decomposed transformation form (See https://minecraft.wiki/w/Display#Entity_data "Tags common to all display entities"). */
    translation?: Transformation.translation;
    scale?: Transformation.scale;
    left_rotation?: Transformation.left_rotation;
    right_rotation?: Transformation.right_rotation;

    /** 
     * Optional map of additional (non-default) data components (See https://minecraft.wiki/w/Data_component_format). 
     * ⚠ It is not advised to change the `minecraft:item_model` and the `minecraft:custom_model_data` component unless you know what you are doing!
     */
    components?: ItemStack.components; 
}

interface GraphicElement extends ElementBase {
    /** An element that displays a static or animated texture */
    type: "graphic";

    /** Identifier pointing to an items model definition (See https://minecraft.wiki/w/Items_model_definition). */
    model: Identifier;
}

interface TextElement extends ElementBase {
    /** An element that displays a text component */
    type: "text";

    /** See https://minecraft.wiki/w/Display#Text_Displays */
    text: TextComponent;
    background?: int;
    alignment?: "left" | "center" | "right";
    line_width?: int;
}

interface AnimatedGraphicElement extends ElementBase {
    /** An element that displays an animated texture and holds the last frame. */
    type: "animated_graphic";

    /** Identifier pointing to an items model definition (See https://minecraft.wiki/w/Items_model_definition). */
    model: Identifier;

    /** Frame count of the animated texture. */
    frames: int;
}

Examples

{
    "type": "graphic",
    "model": "trplnr:my_slideshow/background_image",
    "pos": [5, 5, 5],
    "scale": [2, 1, 2]
}
{
    "type": "text",
    "text": ["", {"text": "Welcome to my very cool presentation!"}, "\n", {"player": "Trplnr"}],
    "background": 65280,
    "alignment": "left",
    "line_width": 500,
    "pos": [10, 5, 10]
}
{
    "type": "animated_graphic",
    "model": "trplnr:my_slideshow/walking_moose",
    "frames": 35
}
{
    "type": "graphic",
    "model": "trplnr:my_evil_slideshow/haha_die_everyone_image",
    "commands": ["kill @a"],
}

ReefMini

A Reef Mini definition.

Schema

interface ReefMini {
    /** Transition to play when transitioning to this page. */
    transition?: Identifier;

    /** Identifier pointing to an items model definition with a custom model data range dispatch (See https://minecraft.wiki/w/Items_model_definition). */
    model: Identifier;

    page_count: int;
}

Example

{
    "transition": "trplnr:color_wipe",
    "model": "trplnr:my_mini_slideshow",
    "page_count": 10
}

Clone this wiki locally