Skip to content

Commit d0fb22c

Browse files
authored
Merge pull request #56 from ez-plugins/feature/configurable-countdown-sound
feat: add configurable countdown start/end sounds
2 parents a001143 + 2770704 commit d0fb22c

29 files changed

Lines changed: 588 additions & 6 deletions

.github/workflows/ci.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,18 @@ jobs:
9393
uses: actions/setup-java@v5
9494
with:
9595
distribution: temurin
96-
java-version: ${{ matrix.java }}
96+
java-version: '21'
9797
cache: maven
9898

9999
- name: Build plugin JAR
100100
run: mvn -B -ntp -DskipTests package
101101

102+
- name: Switch to runtime JDK ${{ matrix.java }}
103+
uses: actions/setup-java@v5
104+
with:
105+
distribution: temurin
106+
java-version: ${{ matrix.java }}
107+
102108
- name: Resolve latest ${{ matrix.platform }} build for MC ${{ matrix.mc-prefix }}.x
103109
id: server
104110
run: |
@@ -214,7 +220,7 @@ jobs:
214220
uses: actions/setup-java@v5
215221
with:
216222
distribution: temurin
217-
java-version: ${{ matrix.java }}
223+
java-version: '21'
218224
cache: maven
219225

220226
- name: Configure Git for BuildTools
@@ -225,6 +231,12 @@ jobs:
225231
- name: Build plugin JAR
226232
run: mvn -B -ntp -DskipTests package
227233

234+
- name: Switch to runtime JDK ${{ matrix.java }}
235+
uses: actions/setup-java@v5
236+
with:
237+
distribution: temurin
238+
java-version: ${{ matrix.java }}
239+
228240
- name: Restore cached Spigot JAR (MC ${{ matrix.mc-prefix }}, Java ${{ matrix.java }})
229241
id: spigot-cache
230242
uses: actions/cache@v5

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
### Added
1313

1414
- **Placeholder formatted output regression tests** - added unit coverage in `EzCountdownPlaceholderExpansionUnitTest` to verify `%ezcountdown_<name>_formatted%` honors `display.time-format.hide-leading-zeros` for both enabled and disabled configurations.
15+
- **Optional countdown start/end sounds** - countdowns can now define `sounds.start` and `sounds.end` with Bukkit `Sound` enum names in `countdowns.yml`.
16+
- **GUI sound editors** - the in-game editor now includes dedicated actions to configure and validate start/end sounds, including `none` to disable either sound.
17+
18+
### Changed
19+
20+
- **Runtime start/end flow** - when a configured start/end sound is valid, EzCountdown now plays it to online players at countdown start/end alongside existing message, teleport, firework, and command actions.
1521

1622
## [2.0.1] - 2026-05-22
1723

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ EzCountdown provides configurable countdown timers for events, launches, and mai
66
## Features
77
- Fixed date, duration, recurring, and manual countdown modes.
88
- Display options: action bar, boss bar (1.9+), chat, title, and scoreboard.
9+
- Optional start/end sounds per countdown (`sounds.start`, `sounds.end`) using Bukkit `Sound` names.
910
- PlaceholderAPI support for `%ezcountdown_<name>_days%`, `_hours`, `_minutes`, `_seconds`, and `_formatted`.
1011
- Customizable messages (messages.yml), permissions, and update intervals.
1112
- Run console commands when countdowns finish.
13+
- GUI editor support for start/end messages, display modes, end commands, and start/end sounds.
1214
- **Developer API**: send ephemeral one-shot notifications from your plugin without touching YAML (see [API overview](docs/api/README.md)).
1315

1416
## Commands

docs/api/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ Countdown countdown = CountdownBuilder.builder("launch")
8989
.formatMessage("countdown.format")
9090
.startMessage("Server Launching")
9191
.endMessage("Server Launched")
92+
.startSound("ENTITY_PLAYER_LEVELUP")
93+
.endSound("BLOCK_NOTE_BLOCK_PLING")
9294
.zoneId(ZoneId.systemDefault())
9395
.duration(Duration.ofMinutes(10))
9496
.build();

docs/api/model/Countdown.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Important accessors and behavior:
2626
- `String getFormatMessage()` - format string used for display messages.
2727
- `String getStartMessage()` - message broadcasted on start (if configured).
2828
- `String getEndMessage()` - message broadcasted on end (if configured).
29+
- `String getStartSound()` / `void setStartSound(String)` - optional Bukkit `Sound` enum name for start.
30+
- `String getEndSound()` / `void setEndSound(String)` - optional Bukkit `Sound` enum name for end.
2931
- `List<String> getEndCommands()` - commands executed when countdown ends.
3032
- `ZoneId getZoneId()` - timezone used when resolving fixed/recurring dates.
3133

@@ -39,3 +41,5 @@ Runtime fields (mutable):
3941
Notes
4042

4143
- The constructor establishes the immutable configuration; runtime fields are updated by the plugin when starting/stopping the countdown.
44+
- `startSound` / `endSound` are optional mutable fields. Passing `null` or blank disables that phase sound.
45+
- YAML-backed countdowns map these fields to `sounds.start` and `sounds.end`.

docs/configuration.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,52 @@ Set per-countdown inside `countdowns.yml` under `display.bossbar`:
6363

6464
---
6565

66+
## Start/end sounds
67+
68+
Set optional per-countdown sounds in `countdowns.yml`:
69+
70+
| Key | Type | Default | Description |
71+
|---|---|---|---|
72+
| `sounds.start` | string | not set | Bukkit `Sound` enum name played when the countdown starts |
73+
| `sounds.end` | string | not set | Bukkit `Sound` enum name played when the countdown ends |
74+
75+
Notes:
76+
77+
- Sound names must match Bukkit `Sound` enum values (for example `ENTITY_PLAYER_LEVELUP`).
78+
- If a sound key is missing or blank, no sound is played for that phase.
79+
- If an invalid sound is configured, EzCountdown logs a warning and continues other start/end actions.
80+
- The GUI sound editor now prints the full list of sounds available on your running server version.
81+
82+
Common choices:
83+
84+
- `ENTITY_PLAYER_LEVELUP` - positive "start" cue.
85+
- `BLOCK_NOTE_BLOCK_PLING` - short neutral confirmation.
86+
- `ENTITY_EXPERIENCE_ORB_PICKUP` - subtle reward-like ping.
87+
- `UI_BUTTON_CLICK` - lightweight interface-style sound.
88+
- `BLOCK_BELL_USE` - event bell/chime.
89+
- `ENTITY_FIREWORK_ROCKET_BLAST` - celebratory end sound.
90+
- `BLOCK_RESPAWN_ANCHOR_CHARGE` - energetic build-up tone.
91+
- `ENTITY_ENDER_DRAGON_GROWL` - dramatic finale.
92+
93+
Full references:
94+
95+
- Spigot `Sound` enum: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Sound.html
96+
- Paper `Sound` enum: https://jd.papermc.io/paper/1.21/org/bukkit/Sound.html
97+
98+
Example:
99+
100+
```yaml
101+
countdowns:
102+
arena_event:
103+
type: DURATION
104+
duration: "15m"
105+
sounds:
106+
start: "ENTITY_PLAYER_LEVELUP"
107+
end: "BLOCK_NOTE_BLOCK_PLING"
108+
```
109+
110+
---
111+
66112
## Clock-aligned recurring options
67113
68114
Set these per-countdown in `countdowns.yml`:
@@ -118,6 +164,9 @@ countdowns:
118164
format: "New Year in {formatted}"
119165
start: "Countdown started!"
120166
end: "Happy New Year!"
167+
sounds:
168+
start: "ENTITY_PLAYER_LEVELUP"
169+
end: "BLOCK_NOTE_BLOCK_PLING"
121170
commands_on_end:
122171
- "broadcast &6Happy New Year!"
123172
teleport:

docs/feature/gui.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Opening the GUI
1717
- `Main` - see a list of configured countdowns, their running state, and quick start/stop/delete actions.
1818
- `Display Editor` - pick which `display.types` will show for a countdown and edit per-display settings. For the `BOSS_BAR` display the editor also exposes `color` and `style` options so you can match event themes or improve visibility; the GUI validates input and will show an error if an invalid option is selected.
1919
- `Messages` - edit `messages.format`, `messages.start`, and `messages.end` templates with live preview.
20+
- `Sounds` - edit `sounds.start` and `sounds.end` using Bukkit `Sound` enum names. The editor validates values, supports `none` to disable either sound, and prints the full list of available sounds from your current server version before input.
2021
- `Commands Editor` - add, remove, or reorder `commands.end` to run console commands when a countdown completes.
2122

2223
Behaviour & saving

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ A feature-rich countdown plugin for Paper/Spigot servers. Create countdowns for
2121
- **Discord webhooks** - post start/end notifications to a Discord channel.
2222
- **In-game GUI** - manage countdowns visually without editing YAML.
2323
- **Firework shows** - trigger configurable firework displays on start or end.
24+
- **Start/end sounds** - optionally play configurable Bukkit sounds when countdowns start or finish.
2425
- **Teleport actions** - move all online players to a named location when a countdown starts or ends.
2526
- **Console commands on end** - run any command when a countdown completes.
2627
- **Developer API** - create, start, stop, listen to countdown events, and send per-player notifications from other plugins.

docs/topics/bbcode-topic.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[CENTER][SIZE=6][B]EzCountdown[/B][/SIZE]
22
[SIZE=3]Run flash sales, timed events, and launches with stunning countdowns - ActionBar, BossBar, Titles & Placeholders![/SIZE]
3-
[SIZE=2]Spigot, Paper, or Bukkit 1.7-1.21.* • Action bar, boss bar, title, chat, scoreboard • PlaceholderAPI ready[/SIZE][/CENTER]
3+
[SIZE=2]Paper/Spigot 1.18+ • Java 17+ • Action bar, boss bar, title, chat, scoreboard • PlaceholderAPI ready[/SIZE][/CENTER]
44

55
Found an issue or have a question? Please contact me through [URL='https://discord.gg/yWP95XfmBS']the EzPlugins Discord server[/URL].
66

@@ -9,10 +9,12 @@ Found an issue or have a question? Please contact me through [URL='https://disco
99
[*][B]Perfect for flash sales & events[/B] - Instantly set up countdowns for shop discounts, launches, or any special event.
1010
[*][B]Multiple countdown types[/B] - Fixed dates, durations, recurring schedules, or manual timers. Great for launches, resets, or surprise sales.
1111
[*][B]Flexible displays[/B] - Show timers in action bar, boss bar, title, chat, or scoreboard. Make sure every player sees the excitement.
12+
[*][B]Start/end sounds[/B] - Configure optional [icode]sounds.start[/icode] and [icode]sounds.end[/icode] per countdown using Bukkit sound names.
1213
[*][B]Firework shows[/B] - Optional, configurable firework displays for celebration moments. ([COLOR=#ff0000]new[/COLOR])
1314
[*][B]Permission control[/B] - Limit visibility or management to specific ranks. Keep control in the hands of your staff or VIPs.
1415
[*][B]PlaceholderAPI support[/B] - Use %ezcountdown_<name>_formatted% and time-part placeholders in any plugin or message.
1516
[*][B]Config-driven[/B] - Tune update intervals, messaging, and defaults in YAML. No coding required, just edit and reload.
17+
[*][B]GUI sound editor[/B] - Set or disable countdown sounds directly in the editor with input validation.
1618
[*][B]Translation variables[/B] - Centralize message text in `messages.yml` and reference keys from `countdowns.yml` using `{translate:key.path}` so owners can reset countdowns without losing localized text.
1719
[/LIST]
1820

docs/topics/markdown-topic.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22

33
**EzCountdown** is the ultimate custom countdown timer plugin for Minecraft servers. Whether you’re launching a new map, running a flash sale, or celebrating a special event, EzCountdown lets you create, manage, and display any countdown you want, your way.
44

5-
**Compatible with Spigot, Paper, and Bukkit 1.7–1.21 · Java 8+ · Action bar, boss bar, title, chat & scoreboard displays · PlaceholderAPI ready**
5+
**Compatible with Paper/Spigot 1.18+ · Java 17+ · Action bar, boss bar, title, chat & scoreboard displays · PlaceholderAPI ready**
66

77
---
88

99
## Why EzCountdown?
1010

1111
- **Create any countdown** – Set up timers for launches, events, sales, or anything you can imagine. Fixed dates, durations, recurring, or manual, your choice.
1212
- **Flexible displays** – Show countdowns in the action bar, boss bar, title, chat, or scoreboard. Make your timers visible everywhere players look.
13+
- **Start/end sounds** – Configure optional `sounds.start` and `sounds.end` per countdown using Bukkit sound names.
1314
- **Easy configuration** – Define countdowns in YAML, customize messages, and reload instantly - no coding required.
14-
- **Easy configuration**Define countdowns in YAML, customize messages, and reload instantly - no coding required.
15+
- **GUI sound editor**Set or disable start/end sounds directly from the in-game editor with validation.
1516
- **Translation variables** – You can keep message text in `messages.yml` and reference it from `countdowns.yml` with the `{translate:key.path}` token. This lets you centralize translations and makes resetting `countdowns.yml` safe because messages are pulled from `messages.yml` at runtime.
1617
- **Permission control** – Limit who can see or manage each countdown.
1718
- **PlaceholderAPI support** – Use countdown placeholders in any plugin or message.

0 commit comments

Comments
 (0)