skapa-season-3/kubejs/server_scripts/calendar.js
Steve McMaster aa14e989ce
All checks were successful
continuous-integration/drone/push Build is passing
Prepare for season 3 reset. Update required! You MUST re-download
setup.exe
2024-07-17 05:42:11 +00:00

17 lines
849 B
JavaScript

BlockEvents.rightClicked('ags_day_counter:calendar', event => {
if (event.hand != 'off_hand') return;
let playTime = Math.round(event.player.stats.get(Stats.PLAY_TIME) / 24000.0)
let hordeDay = 15 - (playTime % 15);
let serverDays = parseInt(event.level.dayTime() / 24000.0);
event.player.tell(Component.of('Today is day ').append(Component.green(serverDays)).append('.'))
event.player.tell(Component.of('You have played ').append(Component.green(playTime)).append(' in-game days.'))
if (hordeDay == 15) {
hordeDay = 0;
event.player.tell(Component.of('The next horde wave is coming in ').append(Component.red(hordeDay)).append(' days.'))
}
else {
event.player.tell(Component.of('The next horde wave is coming in ').append(Component.yellow(hordeDay)).append(' days.'))
}
return
});