Show

Conditions are all true, now how do we show our tooltip?

Introduction

Once all conditions are true, it's time to decide how we want our tooltip to be shown to the player. There are currently limited amount of options, but even with the ones available interesting behaviours can be achieved.

Show properties are defined inside a presets conditions like so:

preset-id:
    text:
        ...
    conditions:
        ...
    show:
        active: true
        cooldown: 10

Properties

Active

Has a value of either true of false, which determines whether the preset is active or not. Activity here means the time for which the tooltip is shown.

true

The tooltip will be shown as long as all of the conditions are true. This is useful for example when a tooltip has to constantly be shown when looking at a block.

Preset example config
1:
    text:
    - 'Active is'
    - '{+4}{+1}&atrue'
    theme: default/three-line
    conditions:
        conditions:
        - lookingatblock{type=bedrock} true
    show:
        # Is active
        active: true

Paired with fade options

Preset example config
1:
    text:
    - 'Active is'
    - '{+4}{+1}&atrue'
    theme: default/three-line
    # Fade options set here
    fade:
        fadein: 20
        fadeout: 20
    conditions:
        conditions:
        - lookingatblock{type=bedrock} true
    show:
        # Active
        active: true

false

The tooltip will be shown once using the provided fade options. If no fade options are provided, then the default stay time is 5 seconds (5 * 20 ticks = 100 ticks).

Preset example config
1:
    text:
    - 'Active is'
    - '{+4}&cfalse'
    theme: default/three-line
    fade:
        fadein: 20
        stay: 20
        fadeout: 20
    conditions:
        conditions:
        - lookingatblock{type=bedrock} true
    show:
        # Not active
        active: false

Cooldown

Cooldown is a simple property that is applied to a whole preset. Once a preset has been shown once, it will go on a cooldown before being able to be shown again. This could be used to, for example remind the player every 5 minutes that they have not voted or are located in a region.

The value of cooldown is an integer value of time in ticks. (1 second = 20 minecraft ticks)

Preset example config
1:
    text:
    - 'Active is'
    - '{+4}{+1}&atrue'
    theme: default/three-line
    fade:
        fadein: 20
        stay: 20
        fadeout: 20
    conditions:
        conditions:
        - lookingatblock{type=bedrock} true
    show:
        # Inactive, so only shows once
        active: false
        # Cooldown of 5 seconds
        cooldown: 100

Last updated