Events
NDailyRewards provides a range of events for you to use. This page will detail the events that NDailyRewards have.
Registered events that you can listen to:
AutoClaimEvent
- called when a player joins the server and the reward is automatically claimed.PlayerClaimRewardEvent
- called when a player claims a reward.PlayerReceiveReminderEvent
- called when a player receives a reminder about available rewards.
Examples
AutoClaimEvent
java
@EventHandler
public void playerAutoClaimEvent(AutoClaimEvent event) {
Player player = event.getPlayer();
int day = event.getDay();
player.sendMessage("You have claimed the reward for day " + day + " automatically!");
}
1
2
3
4
5
6
7
2
3
4
5
6
7
PlayerClaimRewardEvent
java
@EventHandler
public void playerClaimRewardEvent(PlayerClaimRewardEvent event) {
Player player = event.getPlayer();
int day = event.getDay();
player.sendMessage("You have claimed the reward for day " + day + "!");
}
1
2
3
4
5
6
7
2
3
4
5
6
7
PlayerReceiveReminderEvent
java
@EventHandler
public void playerRemindEvent(PlayerReceiveReminderEvent event) {
Player player = event.getPlayer();
int day = event.getDay();
player.sendMessage("You received a reminder for a new reward on day " + day);
}
1
2
3
4
5
6
7
2
3
4
5
6
7