Animations
Titles, sounds, particles and more that play on queue, countdown, rounds and wins, and text animations for the scoreboard and tab.
File: plugins/MineDuels/animations.yml. Reload: /md reload. The full file reference is in animations.yml.
There are two kinds of animation:
- Trigger animations play a list of steps when something happens, for example a title and a sound when a match is found.
- Text animations are texts that change over time. You use them with
%animation:name%in the scoreboard, tab list and nametags.
Triggers
| Trigger | Plays when |
|---|---|
queue-join | A player joins a queue |
match-found | A queue match was found, while the players wait in the lobby |
countdown | Every second of the countdown. %seconds% is the number |
match-start | The fight begins |
round-win, round-lose | A round ended |
match-win, match-lose, match-draw | The match ended |
bed-destroyed | A bed was destroyed (bed kits) |
goal-scored | A goal was scored (bridge kits) |
kit-editor-save | A kit layout was saved |
A match trigger can be given for one match type by adding the type key: match-win-party-ffa plays only for free-for-all party games. The type keys are in Match types. A trigger that is not known is reported on reload and skipped. Preview one with /md animation <trigger> when dev-commands is on in config.yml.
A trigger
match-found:
enabled: true
steps:
- { at: 0, type: title, title: "<gradient:#ffc371:#ff5f6d>Match found</gradient>", subtitle: "<gray>vs <white>%opponent%", fade-in: 0, stay: 35, fade-out: 5 }
- { at: 0, type: sound, sound: entity.experience_orb.pickup, volume: 1, pitch: 0.8 }
- { at: 10, type: actionbar, text: "<yellow>Get ready", duration: 40 }enabled: false turns a trigger off. Each step has at, the tick it starts after the trigger (0 to 12000), and a type.
Step types
| Type | Keys |
|---|---|
title | title, subtitle, fade-in (10), stay (40), fade-out (10), all in ticks. One of title or subtitle is needed |
actionbar | text, duration in ticks (0 shows it once) |
sound | sound (a key such as entity.player.levelup), volume 0 to 10 (1), pitch 0.5 to 2 (1) |
particle | particle, shape (point, circle, spiral, column), count 1 to 200, radius 0 to 16, height 0 to 16 |
potion | effect, amplifier 0 to 255, duration in ticks. target is self |
firework | colors (a list of colour names), power 0 to 3 |
bossbar | text, color (pink, blue, red, green, yellow, purple, white), overlay (progress, notched_6, notched_10, notched_12, notched_20), duration, progress 0 to 1 |
message | text, sent to the player in chat |
Placeholders in texts depend on the trigger: %opponent%, %kit_display%, %kit%, %team%, %round%, %score%, %seconds%, %duration%, %elo_line%, %match_type% and %player%. See Placeholders.
Bad steps are reported on reload with their position and skipped. The other steps still play.
Animated titles and bars
A title, subtitle, actionbar or bossbar text can change over time in two ways.
Several frames, as a list:
- { at: 0, type: title, title: ["<green><bold>F", "<green><bold>FI", "<green><bold>FIG", "<green><bold>FIGH", "<green><bold>FIGHT"], frame-ticks: 2, stay: 25 }One text with an effect:
- { at: 0, type: title, title: "<gold><bold>VICTORY", effect: gradient-shift, frame-ticks: 2, loop: 0 }| Key | Meaning |
|---|---|
frame-ticks | Ticks per frame, 1 to 200 |
loop | Times the frames repeat, 0 to 100. 0 repeats until the step is over |
effect | none, typewriter, scroll, blink, gradient-shift |
subtitle-effect | The same for the subtitle of a title |
An effect animates a single text. Give the key one text, or drop the effect. Using a list of frames and an effect together is reported as an error.
Text animations
The animations section of the same file defines texts that rotate:
animations:
logo:
change-interval: 150
texts:
- "<gradient:#ff5f6d:#ffc371:-1><bold>DUELS</bold></gradient>"
- "<gradient:#ff5f6d:#ffc371:0><bold>DUELS</bold></gradient>"
- { text: "<gradient:#ffc371:#ff5f6d><bold>DUELS</bold></gradient>", ticks: 20 }| Key | Meaning |
|---|---|
change-interval | Milliseconds between frames (50 to 10000). The TAB plugin's name for it |
texts | The frames. A frame can be { text, ticks } to show that frame for its own time |
Use it as %animation:logo%:
# scoreboard.yml
lobby:
title: "%animation:logo%"tab.yml has its own animations section too. When both files use the same name, animations.yml wins. The scoreboard and tab refresh faster when an animation they show changes faster than update-ticks.
Examples
A countdown with a tick sound and the number as a title:
countdown:
enabled: true
steps:
- { at: 0, type: title, title: "<yellow>%seconds%", subtitle: "<gray>%kit_display%", fade-in: 0, stay: 22, fade-out: 0 }
- { at: 0, type: sound, sound: block.note_block.hat, volume: 1, pitch: 1.2 }A louder win for party free for all only:
match-win-party-ffa:
enabled: true
steps:
- { at: 0, type: title, title: "<gold><bold>LAST ONE STANDING", fade-in: 5, stay: 50, fade-out: 10 }
- { at: 0, type: firework, colors: [gold, yellow], power: 1 }Turn off every animation of one kind:
round-lose:
enabled: falseRelated: animations.yml reference, Scoreboard, Tab list.