Compatibility
Minecraft: Java Edition
Platforms
Supported environments
Links
Tags
Creators
Details
A lightweight, vanilla-style day and clock counter for the HUD. Uses the overworld clock time, so it always matches the visible day/night cycle โ no drift, no guessing, no syncing issues in multiplayer.
The whole thing is built to blend into vanilla's own UI: the progress bar reuses Minecraft's XP bar sprites, the HUD icon shows the actual time of day (dawn, day, sunset, dusk, night), and the counter is placed exactly where a HUD element should live โ including automatically staying out of the way of a boss bar.
๐ Official website coming soon
We are preparing the official website for our mods, where you will be able to discover upcoming projects, report issues through the ticket system, and suggest ideas or new features. The link will be added to the mod descriptions as soon as the website is available.
The website will not host mod downloads directly: all mods will remain connected to Modrinth and will continue to be downloaded exclusively from this platform.

๐ What's new in 1.4.3
This release is about playing nicely with other mods' HUD elements, plus another batch of public API for developers:
- This mod's automatic boss-bar avoidance (the shrink-and-duck behavior for the "top center" HUD position) already reacts to any boss bar shown through vanilla's own boss bar system โ dragon, wither, a raid, or a server/datapack's own
/bossbarcommand โ which covers most OneBlock-style maps, since their "Level: X" progress bar is typically implemented exactly that way. If some other mod still overlaps this one (one that draws its own bar outside that shared channel), a new "Extra top clearance" setting (Settings โ HUD โ HUD Position) lets you nudge this mod's HUD clear of it with one click. - Hardcore run recap: on a hardcore world's final death, a dedicated "You survived N days" screen now appears in front of the usual death screen, with a short recap pulled straight from your World Journal (era names, first Nether/End, the Dragon, raids/trades/advancements) and a one-click shortcut into the full journal.
- Day display format: a new setting groups the day counter into weeks, months, or years ("Week 36 ยท Day 1", "Month 9 ยท Week 4 ยท Day 1", ...) instead of just the plain running count โ purely a different way to read the same number, with a toggle for whether the smallest unit resets each period or keeps counting up alongside the bigger label. The unit order follows what reads naturally per language instead of one fixed word order โ English largest-to-smallest ("Year 1 ยท Month 9 ยท Week 4 ยท Day 1"), Italian smallest-to-largest ("Giorno 1 ยท Settimana 4 ยท Mese 9 ยท Anno 1").
- Three new bits of public API for developers: generic named counters (
recordCustomCounter/getCustomCounterCount), aDAY_MILESTONE_REACHEDevent, andgetHudBlockBounds()so another mod can draw its own HUD content anchored to this one's block โ see For developers below.

โจ Features
- Current world day counter, with a brief pulse animation the moment the day advances (toggleable)
- Day display format: keep the plain running count, or group it into weeks, months, or years โ purely visual, nothing this mod tracks internally is affected
- Hardcore run recap: a dedicated "You survived N days" screen, with a short recap from your World Journal, in front of the usual death screen on a hardcore world's final death
- 24-hour or 12-hour clock format
- Day progress bar drawn with vanilla XP bar sprites, with an optional day/night color tint โ turns solid red instead while you're in the Nether, since there's no day/night cycle to track there
- Dawn/day/sunset/dusk/night HUD icon that follows the actual in-game time โ replaced with a Netherrack icon in the Nether
- Compass direction shown in the HUD label while holding a compass
- Contextual HUD: shows how long you've been on your current Nether visit โ in seconds for the first minute, then in minutes โ with the clock itself rendering as an animated glitch effect there, since a time-of-day reading is meaningless in the Nether; or your current survival streak in a Hardcore world โ only one shown at a time
- Vanilla-style toast reminder when it's getting late enough to sleep
- Small milestone sound on notable days (50, 100, 365...) โ turn it off, or pick which sound plays, from the settings screen
- 9 HUD position presets (top/middle/bottom ร left/center/right), with automatic shrink-and-shift when a boss bar (dragon, wither, raid, a server's own custom one, or most OneBlock-style level bars) would otherwise overlap it โ plus an "Extra top clearance" setting as a manual fallback for the rare mod that draws its own bar outside that shared channel
- Custom HUD bars from other mods can appear stacked below (or above) this counter, if you have a compatible mod installed โ toggleable in settings
- Quick Journal: a dedicated key opens a small popup to jot a note down without leaving gameplay or opening the full World Journal book
- Built-in Mod Menu settings screen, split into four tabs (HUD, Info & Alerts, World Journal, Keybinds) โ no config file editing needed, and this mod's two keys can be rebound right from the Keybinds tab
- Fully client-side โ safe to use on any server, vanilla or modded

๐ World Journal
Open the World Journal from the pause menu:
- Rename each dimension's era (Overworld/Nether/End) to whatever fits your playthrough
- Automatic milestones, logged for you: first Nether visit, first End visit, the Ender Dragon defeated, and world birthdays at 100/365/500/1000 days โ if you'd already reached one before installing the mod, it's estimated retroactively instead of being skipped
- Every death, not just the first โ the very first one is still called out specially
- Every raid you defend or lose
- Every villager trade, with exactly what you received
- Every advancement you complete
- A survival streak: how many days you've currently survived without dying, and your longest streak ever in that world
- Screenshot photos: press F2 (Minecraft's own screenshot key) in a world and the shot is automatically captured into the journal as a photo card, with the day, coordinates, and dimension recorded alongside it โ click a photo to give it a title and description, or take one on the spot with the "Screenshot" button in the pause menu. Photos are laid out as a small, gently tilted, scattered cluster per day, like a real scrapbook page, with a large preview on click.
- Daily weather: whether it rained or thundered is recorded and shown on days it actually happened
- Add your own notes, tied to the current in-game day, either from the book screen or with the
/journal addcommand (see Commands below) - Entries from other mods, occasionally with their own icon, if you have a compatible mod installed
- See what you've collected each day โ smart enough to not count items you already owned that you only dropped and picked back up, or that followed you through a game mode switch
- Automatic backups: a copy of your journal is kept every time you join a world (the last 5 are retained), so a corrupted file doesn't mean losing your whole journal
Journals are per-world (singleplayer) or per-server (multiplayer), saved locally on your own client โ every player keeps their own. Automatic entries (advancements, deaths, raids, trades, milestones) always show up translated into whatever language the game is currently set to, including entries logged in an earlier session under a different language โ nothing stays stuck in the language it was originally logged in. Notes you typed yourself, or entries logged by another mod through the public API, are kept exactly as written.
๐ง Fixed a serious storage bug from a past release โ read this if you're upgrading from an older version
On this Minecraft version, the way the game reports a singleplayer world's own save folder could resolve to the same path for every world instead of that world's actual one, so every singleplayer world ended up sharing a single journal file instead of getting its own โ a brand-new world could show entries that actually happened in a completely different world.
This is now fixed for good: each world's journal is tied to its own save folder through a small hidden marker file, independent of the folder's name. If you're upgrading from before that fix and had already been affected, opening the singleplayer world list once shows a recovery screen offering to either start every world clean or pick which world should keep the old shared file's entries.

๐ฎ Controls
- H โ open the Vanilla DayTime Counter settings screen
- J โ open the Quick Journal popup, to jot down a note without leaving gameplay
Both keys can be remapped at any time, either from this mod's own Keybinds settings tab or from Minecraft's own Controls menu โ both stay in sync.

โจ๏ธ Commands
Client-side /journal commands, for quick edits without opening the book screen:
/journal add <text>โ logs a manual entry on the current in-game day/journal removeday <day>โ shows how many entries exist for that day;/journal removeday <day> confirmdeletes all of them/journal clearโ shows a warning about what's about to happen;/journal clear confirmpermanently wipes the current world's entire journal
removeday and clear are destructive and can't be undone, which is why both require typing confirm as a separate step instead of running immediately.

๐ ๏ธ Settings
From the settings screen (now split into HUD, Info & Alerts, World Journal, and Keybinds tabs) you can toggle:
- 12-hour / 24-hour clock format
- HUD position (9 presets), plus an "Extra top clearance" fine-tune (Off / +20px / +40px / +60px) for the top presets
- Day counter visibility, and its change-pulse animation
- Day display format (Default / Weekly / Monthly / Annual), and whether the smallest shown unit resets each period or keeps counting up
- Clock visibility
- Progress bar visibility, and its day/night multicolor tint
- Compass direction display
- Contextual HUD (Nether visit timer / Hardcore survival streak)
- Custom HUD bars โ show or hide every progress bar added by other mods at once
- Era name display
- Sleep-time toast visibility
- Milestone sound, on/off and which sound plays
- World birthday toast
- Hardcore end screen (the "You survived N days" recap) on/off
- Screenshot photo capture into the journal
- Daily weather tracking
- Quick Journal key enabled/disabled
And, from the Keybinds tab, rebind this mod's own keys (with the same conflict warning vanilla shows for clashing keys) or jump straight into vanilla's full key-binding list.
๐ Config file locations โ for the technically curious
Settings are saved to Fabric's config folder as:
vanilladaytimecounter.json
World Journal data is saved per world/server under config/vanilladaytimecounter/worlds/, with each world's captured photos under config/vanilladaytimecounter/worlds/photos/, and its automatic backups under config/vanilladaytimecounter/backups/. No manual editing needed โ everything is managed from the in-game screens and the /journal command.

โ๏ธ Compatibility
Three separate jars are published, one per Minecraft version โ download the one matching your game:
- Minecraft
26.1โ Fabric Loader0.19.3+ - Minecraft
26.2โ Fabric Loader0.19.3+ - Minecraft
26.3 Pre-Release 1โ Fabric Loader0.19.3+โ ๐งช experimental, built against a pre-release (not the final stable 26.3), - Requires: Fabric API
- Environment: Client-side only

โ FAQ
Is it safe to use on a server I don't manage myself?
Yes โ the mod is fully client-side. It doesn't touch server logic, doesn't require the server to have it installed, and works on vanilla or modded servers alike.
Where is my World Journal data stored, and can I lose it?
Locally on your own client, per world (singleplayer) or per server (multiplayer) โ never uploaded anywhere. A backup copy is saved automatically every time you join (the last 5 are kept), so a corrupted save file doesn't mean losing your whole journal. Saves are also written more safely as of 1.4.2: a crash or power loss mid-save can no longer leave a corrupted journal file.
Will my counter/journal match what other players see in multiplayer?
The day/time counter always matches the shared overworld clock, so everyone sees the same day. The World Journal itself is per-player: each player logs their own deaths, trades, advancements, and photos, and keeps their own local copy.
Does turning off a feature (weather, photos, milestone sounds...) delete data already logged?
No โ settings only control what gets tracked or shown going forward. Past journal entries stay exactly as they are.
Can I recover journal entries from before I updated the mod?
Milestones you'd already reached before installing (world birthdays, first Nether/End visit, etc.) are estimated retroactively instead of being skipped. If you were affected by the old singleplayer save-path bug, the world list shows a one-time recovery screen the first time you open it after updating โ see World Journal above.
Can I hide progress bars added by other mods?
Yes โ the "Custom HUD bars" toggle in Settings hides every third-party bar at once, without needing to uninstall whichever mod added them. It doesn't affect anything else in that mod.
Does this mod already avoid overlapping OneBlock-style "Level" bars or other boss bars?
For any bar shown through vanilla's own boss bar system โ dragon, wither, a raid, or a server/datapack's own /bossbar command, which is how most OneBlock-style maps implement their own "Level: X" bar โ yes, automatically, no setup needed. For a mod that draws its own bar through some other channel entirely, use the new "Extra top clearance" setting in Settings โ HUD โ HUD Position to nudge this mod's HUD clear of it.
Does this mod affect server performance or require anything server-side?
No โ it's declared as client-side only ("environment": "client"), so it has zero footprint on the server.

๐งฉ For developers โ the API keeps growing
Vanilla DayTime Counter exposes a small public API (dev.notesow.vanilladaytimecounter.api.v1) so other Fabric mods can build on top of it instead of reinventing their own day counter. This mod's source isn't public, so everything a developer needs is written out below, in full โ there's no separate repo or docs site to link to.
New in 1.4.3: recordCustomCounter(Identifier)/recordCustomCounter(Identifier, int) and getCustomCounterCount(Identifier)/getCustomCounterCount(Identifier, long) โ generic named counters through this mod's journal, for anything the built-in death/raid/trade/advancement counters don't cover. Also new: the DAY_MILESTONE_REACHED event (fires on this mod's own open-ended day-milestone set โ 50, 365, every multiple of 100), and getHudBlockBounds()/HudBlockBounds, so another mod can find out where this mod's HUD block currently is and anchor its own HUD content to it (see "Locating the HUD block" below).
New in 1.4.2: HudBar / HudBarRegistry, letting another mod draw its own progress bar directly in this mod's HUD block (see "Drawing your own HUD bar" below). Also new: logCustomEvent(Identifier, String, Identifier icon) โ the same as logCustomEvent but with an item icon shown next to the entry โ and celebrateMilestone(Identifier, String, Identifier icon), which logs like that and also plays this mod's own configured milestone sound the first time that id is logged.
New in 1.4.1: read the player's current and longest survival streak, how long they've been on their current Nether visit, how many photos have been captured (and their day/coordinates/dimension/title/description), and each day's recorded weather. Also new: PHOTO_CAPTURED, WEATHER_CHANGED, and WORLD_BIRTHDAY events, plus the PhotoRecord/WeatherRecord DTOs.
New in 1.4.0: read how many times the player has died, defended or lost a raid (now with which ones were won vs. lost), traded with a villager (and what they got), or completed an advancement โ each either as a world/server total or scoped to a single in-game day. Also new: JOURNAL_DAY_REMOVED/JOURNAL_CLEARED events, so a mod tracking journal data gets notified instead of holding onto stale state after /journal removeday//journal clear.
๐ก What you can build with it
- A progression/RPG mod that draws its own mana/stamina bar right in this HUD, and rewards the player once they've collected enough of a given material, died too many times, survived a long enough streak, or completed a specific advancement.
- A horror mod that triggers a scripted event on a specific day, or the first time the player has been "out too long" after dark.
- A companion mod that logs its own milestones into the player's journal alongside this mod's automatic ones (first boss kill, first structure found, whatever fits your mod) โ with its own icon, and a little celebration sound for the big ones โ tracks its own progress with a named counter โ or reacts to a captured photo/weather change.
- A boss/quest mod that draws its own HUD bar anchored to (or clear of) this mod's own block via
getHudBlockBounds(), instead of hardcoding a screen position that might collide with it. - Anything that just wants a reliable "what day/time is it" without re-implementing overworld-clock math.
๐ Depending on this mod
There's no published Maven/Gradle repository or API-only artifact โ this mod is built with Gradle/Fabric Loom, but only as a local build, not published to a Maven repository. To depend on it: grab the built jar (e.g. from a release download), add it to your own project's compile-time classpath the same way you'd add any other Fabric mod jar as a local file dependency, and declare it in your own fabric.mod.json:
"depends": {
"vanilladaytimecounter": ">=1.4.3"
}
(>=1.3.7 is enough if you only need the material/journal/event methods, which shipped earlier; >=1.4.0 is enough for the death/raid/trade/advancement counters, getRaids(), and the journal-removal events; >=1.4.1 for the survival streak, Nether-visit timer, photo, and weather methods/events/DTOs; >=1.4.2 for HudBar/HudBarRegistry, the icon overload of logCustomEvent, and celebrateMilestone. recordCustomCounter/getCustomCounterCount, DAY_MILESTONE_REACHED, and getHudBlockBounds/HudBlockBounds were only ever released starting in 1.4.3.) No registration or init call is required on your side โ import classes from dev.notesow.vanilladaytimecounter.api.v1 and use them directly, as soon as both mods are loaded. Because this is a client-only mod ("environment": "client"), your integration code should also live in your client-side entrypoint/package.
๐ Drawing your own HUD bar โ HudBar / HudBarRegistry โ click to expand
Your bar is stacked automatically below this mod's own day/time HUD block โ or above it, on a bottom HUD position preset, so a tall stack never runs off-screen โ regardless of which of the 9 position presets the player has picked, and even if the player has turned off every one of this mod's own HUD elements.
public static HudBar.Builder HudBar.builder(Identifier id, DoubleSupplier progress, IntSupplier color)
.icon(Identifier icon) // optional 16x16 item icon left of the bar
.label(Supplier<String> label) // optional text right of the bar
.visible(BooleanSupplier visible) // optional; defaults to always true
.build()
HudBarRegistry.register(HudBar bar) // registering the same id again replaces it in place
HudBarRegistry.unregister(Identifier id)
Every supplier is read fresh once per HUD frame โ there's no update method to call yourself. A bar whose supplier throws an exception is skipped for that one frame only (with a single warning printed once, not a flood of them) instead of breaking the HUD or any other registered bar. The player can hide every third-party bar at once via this mod's own "Custom HUD bars" setting, without needing to uninstall your mod โ treat your bar as a nice-to-have overlay, not something the player strictly depends on seeing.
Registering your own mana bar:
HudBarRegistry.register(
HudBar.builder(
Identifier.fromNamespaceAndPath("rpgmod", "mana"),
RpgModClient::currentManaFraction, // DoubleSupplier, in [0.0, 1.0]
() -> 0xFF3355FF) // IntSupplier, ARGB blue
.icon(Identifier.withDefaultNamespace("lapis_lazuli"))
.label(() -> "Mana")
.build());
๐ Locating the HUD block โ HudBlockBounds โ click to expand
If what you want to draw can't be expressed as a simple stacked row via HudBar above (your own boss-style bar, a quest tracker, anything with its own shape), draw it yourself through your own mod's HUD render hook, and use getHudBlockBounds() to find out where this mod's own block currently is:
public static HudBlockBounds DayTimeApi.getHudBlockBounds()
public final int x, y, width, height; // GUI-scaled screen pixels; all 0 if !visible
public final boolean visible; // false = this mod's block is drawing nothing right now
Call it from inside your own per-frame render callback, not once at startup โ the block moves with the player's chosen position preset and can resize frame to frame. Always check visible before using the coordinates:
HudBlockBounds bounds = DayTimeApi.getHudBlockBounds();
int y = bounds.visible ? bounds.y + bounds.height + 6 : 8; // just below it, or a fallback
drawMyQuestBar(graphics, y);
๐ Quick start & more examples โ click to expand code samples
package com.example.horrormod;
import dev.notesow.vanilladaytimecounter.api.v1.DayTimeApi;
import dev.notesow.vanilladaytimecounter.api.v1.DayTimeEvents;
import net.fabricmc.api.ClientModInitializer;
import net.minecraft.resources.Identifier;
public final class HorrorModClient implements ClientModInitializer {
private static final Identifier SCREAM_DAY_13 =
Identifier.fromNamespaceAndPath("horrormod", "heard_scream_day13");
@Override
public void onInitializeClient() {
DayTimeEvents.DAY_CHANGED.register(day -> {
if (day == 13 && !DayTimeApi.hasLoggedEvent(SCREAM_DAY_13)) {
triggerScareEffect();
DayTimeApi.logCustomEvent(SCREAM_DAY_13, "You heard a scream in the dark");
}
});
}
private void triggerScareEffect() { /* ... */ }
}
Tracking your own named counter and rewarding a threshold:
Identifier wolvesFed = Identifier.fromNamespaceAndPath("rpgmod", "wolves_fed");
// Every time the player feeds a wolf:
DayTimeApi.recordCustomCounter(wolvesFed);
// Later, anywhere:
if (DayTimeApi.getCustomCounterCount(wolvesFed) >= 10) {
grantWolfWhispererTitle();
}
A boss mod celebrating a defeat the same way this mod celebrates its own day milestones โ sound and all:
Identifier bossDefeated = Identifier.fromNamespaceAndPath("bossmod", "swamp_hag_defeated");
DayTimeApi.celebrateMilestone(bossDefeated, "Defeated the Swamp Hag",
Identifier.withDefaultNamespace("golden_apple"));
A progression/RPG mod rewarding a long Hardcore survival streak, checked each day so the reward fires the moment the threshold is crossed instead of needing the player to reopen a menu:
DayTimeEvents.DAY_CHANGED.register(day -> {
if (DayTimeApi.getCurrentSurvivalStreak() >= 50) {
grantSurvivorPerk();
}
});
Reacting to this mod's own open-ended day-milestone set, instead of re-deriving which days count as milestones yourself:
DayTimeEvents.DAY_MILESTONE_REACHED.register(day -> {
spawnCelebrationFireworks();
});
A mod that reacts to the weather this mod already tracks, instead of polling the world's own weather state itself:
DayTimeEvents.WEATHER_CHANGED.register((day, weather) -> {
if (weather.thundered) {
spawnStormAmbiance();
}
});
A companion mod that mirrors every screenshot captured into the journal into its own gallery feature, picking up the title/description once the player has actually set them:
DayTimeEvents.PHOTO_CAPTURED.register((day, x, y, z, dimensionKey) -> {
queueForGallery(day, x, y, z, dimensionKey);
});
// Later, once the player has had a chance to edit it in the World Journal book:
for (PhotoRecord photo : DayTimeApi.getPhotos()) {
if (!photo.title.isEmpty()) {
updateGalleryEntry(photo);
}
}
A mod adding its own milestone into the same journal the player already reads, guarded with hasLoggedEvent so it only ever logs once, and namespaced under its own mod id rather than vanilladaytimecounter:
Identifier firstBossKill = Identifier.fromNamespaceAndPath("bossmod", "first_boss_kill");
if (!DayTimeApi.hasLoggedEvent(firstBossKill)) {
DayTimeApi.logCustomEvent(firstBossKill, "Defeated the Swamp Hag");
}
๐ Reading current state โ DayTimeApi โ full method reference table
Static-only facade: no instances, no init call needed, every method safe to call at any time.
DIMENSION_OVERWORLD, DIMENSION_NETHER, DIMENSION_END are the string constants accepted by getEraName; any other string just won't match a configured era.
| Method | Returns | When no world is loaded |
|---|---|---|
isWorldLoaded() |
whether a world/server is currently joined | false |
currentDay() |
current in-game day, 0-based, derived from the overworld clock |
0 |
currentTimeOfDay() |
ticks within the day, 0โ23999 (0 dawn, 6000 noon, 12000 dusk, 18000 midnight) |
0 |
getEraName(String dimensionKey) |
player-set era name for a dimension, or "" if unset |
"" |
listJournalEntries() |
all journal entries, sorted by day ascending, immutable snapshot | empty list |
hasLoggedEvent(Identifier eventId) |
whether that exact event id was already logged (including this mod's own automatic milestones) | false |
logCustomEvent(Identifier eventId, String text) |
logs a de-duplicated entry on the current day; text is plain text, not a translation key; no-op if the id was already logged |
no-op + stderr warning, never throws |
logCustomEvent(Identifier eventId, String text, Identifier icon) |
same, with an item icon shown next to the entry in the book | no-op + stderr warning, never throws |
celebrateMilestone(Identifier eventId, String text, Identifier icon) |
same as above, plus this mod's configured milestone sound the first time this exact id is logged | no-op + stderr warning, never throws |
getMaterialsCollectedOnDay(long day) |
item id โ net amount collected that day | empty map |
getMaterialLog() |
full day-ascending history: day โ (item id โ amount) | empty map |
getDeathCount() / getDeathCount(long day) |
times the player died, total or on one day | 0 |
getCurrentSurvivalStreak() |
in-game days survived without dying since the last death (or since day 0) | 0 |
getLongestSurvivalStreak() |
the longest such streak ever reached, including one still in progress | 0 |
getCurrentNetherVisitTicks() |
real-time ticks (20/s) since entering the Nether on the current, ongoing visit; resets every re-entry | 0 |
getRaidCount() / getRaidCount(long day) |
raids that ended (won or lost), total or on one day | 0 |
getRaids() / getRaids(long day) |
RaidRecord snapshot of which raids were won vs. lost, sorted by day ascending |
empty list |
getTradeCount() / getTradeCount(long day) |
villager trades completed (per occurrence, not per item), total or on one day | 0 |
getTrades() / getTrades(long day) |
TradeRecord snapshot of what was received, sorted by day ascending |
empty list |
getAdvancementCount() / getAdvancementCount(long day) |
advancements with a visible title completed (hidden/recipe-unlock ones never count), total or on one day | 0 |
getCompletedAdvancements() / getCompletedAdvancements(long day) |
AdvancementRecord snapshot of which ones, sorted by day ascending |
empty list |
getPhotoCount() / getPhotoCount(long day) |
photo screenshots captured into the journal, total or on one day | 0 |
getPhotos() / getPhotos(long day) |
PhotoRecord snapshot of each captured photo, sorted by day ascending |
empty list |
getWeather(long day) |
Optional<WeatherRecord> summary of that day's rain/thunder, empty if clear/untracked |
Optional.empty() |
recordCustomCounter(Identifier counterId) / recordCustomCounter(Identifier counterId, int amount) |
increments your own named counter (by 1, or by amount) on the current day |
no-op + stderr warning |
getCustomCounterCount(Identifier counterId) / getCustomCounterCount(Identifier counterId, long day) |
your counter's running total, total or on one day | 0 |
getHudBlockBounds() |
where this mod's own HUD block is currently drawn on screen | a HudBlockBounds with visible = false |
listJournalEntries(), getMaterialLog()/getMaterialsCollectedOnDay(), and getTrades()/getCompletedAdvancements()/getRaids()/getPhotos() all return immutable snapshots taken at call time, not live views โ call again, or use the events below, to observe changes over time. The counters (deaths, raids, trades, advancements, photos, and your own custom ones) each have a no-arg overload for the world/server total and a (long day) overload scoped to one in-game day.
A raid logged by a version of this mod older than 1.4.0 has no recorded outcome, so it still counts toward getRaidCount() but won't appear in getRaids(). Weather tracking can be turned off by the player in settings, in which case getWeather(long) always returns Optional.empty().
๐ Subscribing to events โ DayTimeEvents โ full event reference table
Each is a static ListenerList field; call .register(listener) once, typically from onInitializeClient. Listeners that throw a RuntimeException are caught and logged โ they don't crash the game or block other listeners.
| Event | Listener signature | Fires when |
|---|---|---|
DAY_CHANGED |
void onDayChanged(long day) |
the in-game day changes, and once immediately on join (even for day 0), so you get a baseline for free |
JOURNAL_EVENT_LOGGED |
void onJournalEventLogged(JournalEntry entry) |
any journal entry is logged โ this mod's own automatic milestones, the player's manual notes (from the book screen or /journal add), or another mod's (or your own) custom entries via logCustomEvent, after it's already persisted to disk |
MATERIAL_COLLECTED |
void onMaterialCollected(Identifier itemId, int amount, long day) |
the player's net item count for something increases compared to the previous client tick; only positive net gains are reported, and a same-tick pick-up-then-drop may not be observed (detection is based on periodic inventory snapshots) |
JOURNAL_DAY_REMOVED |
void onJournalDayRemoved(long day) |
/journal removeday <day> confirm wipes one day's entries, materials, and death/raid/trade/advancement records |
JOURNAL_CLEARED |
void onJournalCleared() |
/journal clear confirm wipes the entire journal |
PHOTO_CAPTURED |
void onPhotoCaptured(long day, double x, double y, double z, String dimensionKey) |
a new screenshot is captured into the journal, before the player has had a chance to set a title/description |
WEATHER_CHANGED |
void onWeatherChanged(long day, WeatherRecord weather) |
rain or thunder is newly observed on the current day (not fired again once already true, and not fired for clear weather) |
WORLD_BIRTHDAY |
void onWorldBirthday(long day, long milestoneDays) |
the world reaches one of the built-in 100/365/500/1000-day milestones |
DAY_MILESTONE_REACHED |
void onDayMilestoneReached(long day) |
this mod's own open-ended day-milestone set is reached (50, 365, every multiple of 100) โ the same set that drives its HUD celebration/sound |
๐งฌ The DTOs โ field-by-field reference
JournalEntry โ immutable, four public final fields:
public final long day; // in-game day (0-based) this entry belongs to
public final String text; // already-resolved human-readable description
public final Identifier sourceId; // null if typed manually in-game; otherwise who logged it
public final Identifier icon; // null unless logged via logCustomEvent(id, text, icon)/celebrateMilestone
public boolean isManual(); // shorthand for sourceId == null
For this mod's own automatic milestones, sourceId is namespaced under vanilladaytimecounter; for entries you log yourself, it's exactly the Identifier you passed to logCustomEvent.
TradeRecord, AdvancementRecord, and RaidRecord โ returned by getTrades()/getTrades(long), getCompletedAdvancements()/getCompletedAdvancements(long), and getRaids()/getRaids(long). All immutable, one instance per occurrence (a trade handing over a stack of 3 is one record with amount == 3, not three):
// TradeRecord
public final long day;
public final Identifier itemId; // what was received, e.g. minecraft:emerald
public final int amount; // how many, accounting for stack size
// AdvancementRecord
public final long day;
public final Identifier advancementId; // e.g. minecraft:nether/root
// RaidRecord
public final long day;
public final boolean victory; // true = defended, false = lost
PhotoRecord and WeatherRecord โ returned by getPhotos()/getPhotos(long) and getWeather(long):
// PhotoRecord
public final long day;
public final double x;
public final double y;
public final double z;
public final String dimensionKey; // DIMENSION_OVERWORLD / DIMENSION_NETHER / DIMENSION_END
public final String title; // "" if the player hasn't set one yet
public final String caption; // "" if the player hasn't set one yet
// WeatherRecord
public final long day;
public final boolean rained; // rained (or thundered) at any point that day
public final boolean thundered; // thundered at any point that day
HudBlockBounds โ returned by getHudBlockBounds():
public final int x;
public final int y;
public final int width;
public final int height;
public final boolean visible; // false = drawing nothing right now; x/y/width/height are all 0
The underlying screenshot image file is deliberately not exposed by PhotoRecord: this mod's on-disk journal/photo storage isn't part of the public API and may change at any time without notice.
๐ง Rules & limits โ what you can't do
- Namespace your own entries, bars, and counters.
logCustomEvent/hasLoggedEvent/HudBar.builder/recordCustomCounterall take a MinecraftIdentifier: always use your own mod id as the namespace (e.g.Identifier.fromNamespaceAndPath("yourmod", "your_event")), nevervanilladaytimecounterโ that's reserved for this mod's own entries and using it risks colliding with them. - Each exact event id can only be logged once, ever, per world/server. There's no "log this again on a later day" โ if you need a repeatable trigger, mint a new id per occurrence (e.g. suffix the day number into it, like
"scream_day_" + DayTimeApi.currentDay()). Same rule applies tocelebrateMilestone's sound: it only plays the first time a given id is logged. Custom counters are the exception โrecordCustomCounteris not de-duplicated, call it every time the thing you're counting happens. - Client-side only. Every call has to happen on the Minecraft client thread, same as any other Fabric client-side code โ there's no server-side counterpart, and no way to read another player's data from a dedicated server; every player who needs this data must have the mod installed on their own client.
- No breaking changes within
api.v1. New capability is added as new methods/events, never by changing what's already here. A hypothetical breaking change would ship as a newapi.v2package alongside (not replacing)api.v1. Onlydev.notesow.vanilladaytimecounter.api.v1is covered by this policy โ internal implementation classes (journal storage, file format, HUD rendering) can change at any time.
โ Common gotchas โ click to expand
- Reading
currentDay()/currentTimeOfDay()fromonInitializeClientgives0/ no data. That's expected: it runs at game startup before any world is joined, soisWorldLoaded()isfalsethere. RegisterDayTimeEventslisteners (andHudBarRegistry.registercalls) inonInitializeClient, but only read "current" values from inside a listener/supplier callback once a world is actually loaded. NoSuchMethodError/ClassNotFoundExceptionat runtime, but it compiles fine. You compiled against a different Vanilla DayTime Counter jar version than the one actually present inmods/. Make sure your"depends"constraint matches the jar you compiled against, and that only one version of this mod's jar exists inmods/.- Will my own mod get notified about an event it logs itself? Yes โ
logCustomEventfiresJOURNAL_EVENT_LOGGEDthrough the same path as every other entry, including to listeners registered by the mod that called it. If you only want to react to other sources, checkentry.sourceIdagainst your own namespace and skip it. - My registered
HudBardoesn't show up. Check the player's own "Custom HUD bars" setting is on, and that yourvisiblesupplier (if you set one) actually returnstrueโ a bar defaults to always visible if you don't set one. getHudBlockBounds()keeps returningvisible = false. Either you're calling it once at startup instead of from your own per-frame render callback, or the player has genuinely turned off every one of this mod's HUD elements (or hidden the whole HUD, or no world is loaded) โ nothing wrong on your end, there's just nothing to anchor to right now.- Unregistering a listener works via
ListenerList#unregister, but only if you kept a reference to the exact lambda/instance passed toregisterโ a freshly written lambda is a different object and won't match, even with identical code. - Works from Kotlin/Scala/Groovy with no special adapter โ every listener type is a plain
@FunctionalInterfaceand everyDayTimeApimethod is static Java.
๐ Licensing note
This mod's source is all-rights-reserved: you may download and use the mod, but its source is not licensed for redistribution or modification. Depending on the compiled jar at compile-time/runtime to call this public API โ the normal way any Fabric mod depends on another โ is ordinary use of the mod, not redistribution or modification of it. Players using your mod will need Vanilla DayTime Counter installed too, exactly like any other Fabric mod dependency.


