DaisyVotes — Developer API
DaisyVotes exposes a small, stable developer API for other plugins to react to top-voter wins.
TopVoterAwardEvent
Section titled “TopVoterAwardEvent”Fired when DaisyVotes pays out a Top Voter award for a completed period (daily, weekly, or monthly). Use it for custom announcements, trophies, broadcasts, or analytics.
Package: cat.daisy.daisyvotes.api.TopVoterAwardEvent
| Field | Type | Description |
|---|---|---|
playerUuid | String | The winner’s UUID. |
playerName | String | The winner’s name. |
votes | long | Their vote count for the period. |
rank | int | Placement — 1, 2, or 3. |
period | String | "daily", "weekly", or "monthly". |
Listening
Section titled “Listening”import cat.daisy.daisyvotes.api.TopVoterAwardEvent;import org.bukkit.Bukkit;import org.bukkit.event.EventHandler;import org.bukkit.event.Listener;
public class TopVoterListener implements Listener { @EventHandler public void onTopVoter(TopVoterAwardEvent event) { String name = event.getPlayerName(); int rank = event.getRank(); // 1, 2, or 3 String period = event.getPeriod(); // "daily" | "weekly" | "monthly"
Bukkit.getScheduler().runTask(myPlugin, () -> Bukkit.broadcastMessage("🏆 " + name + " placed #" + rank + " this " + period + "!")); }}import cat.daisy.daisyvotes.api.TopVoterAwardEventimport org.bukkit.Bukkitimport org.bukkit.event.EventHandlerimport org.bukkit.event.Listener
class TopVoterListener(private val plugin: Plugin) : Listener { @EventHandler fun onTopVoter(event: TopVoterAwardEvent) { val name = event.playerName val rank = event.rank // 1, 2, or 3 val period = event.period // "daily" | "weekly" | "monthly"
Bukkit.getScheduler().runTask(plugin, Runnable { Bukkit.broadcastMessage("🏆 $name placed #$rank this $period!") }) }}Depending on DaisyVotes
Section titled “Depending on DaisyVotes”Add DaisyVotes as a softdepend (or depend) in your plugin.yml so it loads first:
softdepend: [DaisyVotes]You don’t need DaisyVotes on your compile classpath to listen for the event by name, but if you import the event class directly, add the DaisyVotes JAR as a compileOnly/provided dependency in your build.