Preset

Presets consist of properties that define how a tooltip is shown.

Configuration

Presets are configured in the Tooltips/presets folder. To create presets, create a new file in the folder as <name>.yml. After that, you can start configuring presets in that file.

Configuration

All of these, except for theme are optional.

preset-id:
  priority: 0
  text:
  - 'Test Tooltip'
  - 'Price: 500{default/gem}'
  - '(Click to buy)'
  fade:
    fadein: 20
    stay: 20
    fadeout: 20
  theme: default/three-line
  display:
    color: white
    horizontal-shift: 0
  conditions:
  - gamemode{gm=creative} true
  show:
    reshow: false
    active: true
    cooldown: 0
  actions:
    right-click:
    - 'message Hello!'
  

Minimal Configuration

preset-id:
  theme: default-three-line

Properties

priority - Highest priority will appear first

Default priority for all presets is 0. Presets with a higher priority will be checked first, this is extremely useful in more complex configurations with multiple presets.

text - Lines of text that will be displayed

text:
- 'Regular text, nothing special' # PlaceholderAPI placeholder supported
- '||Centered text||' # Centered text
- '<red>Colored <gradient:red:blue>text' # MiniMessage format
- 'Sofa price: <green>$data(furniture.sofa.price)$' # Functions
- '<typewriter text="Hello there!">' # Animations

fade - Fade options, just like in titles

fade:
    fadein: 20 # 20 ticks = 1 second to fade in
    stay: 100 # 100 ticks to stay, only necessary with active: false
    fadeout: 40 # 40 ticks = 2 seconds to fade out

theme - The visual theme used for this preset

Set to the ID of a Theme. This is required, otherwise preset wouldn't know what to look like.

display

Options related to how the tooltip is displayed.

color - color of the background

You can specify the color the following ways:

Gradients generate a larger JSON message than regular color, so tooltips with gradients that have a large background may be laggier!

color: 'white'
color: '#fcba03'
color: 'red:green' # gradient from red to green
color: '#ffffff:#00ff19' # gradient from #ffffff to #00ff19
color: '#ffffff:#00ff19:#ffffff' # gradient from #ffffff to #00ff19 and to #ffffff again 

horizontal-shift - shift of the tooltip in pixels

conditions - a list of conditions

Conditions, which have to be fulfilled in often for this preset to be shown. More about conditions:

show - defines how this preset is shown

Presets can be made to be shown once or have a given cooldown. More about show properties:

actions - commands tied to actions

Think of this as events, once they happen - a list of commands is ran. More about actions:

Other Properties

File Priority

You can define a priority for the entire preset file like so:

priority: 10 # At the top of the file

my-preset:
    ...
my-other-preset:
    ...

This will add the given priority priorities of all presets. For example if my-presets priority is 0, it will be 10 with the file priority. This option is useful to make presets of one file more important than of another file.

Data

Data is scoped to a single preset file, and can be used by the $data(key) function in presets. This is useful to have predefined data, like furniture prices right in your preset files. You can define any sort of valid yaml data after "data".

data: # At the top of the file
    my-own-key: 1
    debug: true
    prices:
        chair: 100
        table: 50
    lines:
    - 'Hello!'
    - 'My name is %placeholder%'

Parenting

Presets support parenting since plugin version 1.5. Parenting allows you to copy all properties from a "parent" preset into another preset and modify only the required properties. Parents and children are defined like so:

parent:
  content:
    text:
    - '&cThe parent!'
  display:
    theme: default-one-line

child:
  parent: parent
  
child-modified:
  parent: parent
  content:
    text:
    - '&aThe second child!'

Other children can be parented as well.

Last updated