Vanilla DayTime Counter

Quick rating

Community listing page, reviews here may not be monitored by the author.

Vanilla DayTime Counter

By notesowOwner

No reviews yet

A lightweight, vanilla-style day and clock counter for the HUD — shows the current day, time, and a vanilla XP-bar-style progress bar, with a toast reminder when it's time to sleep.

Mod Loaders
Minecraft
26.3 26.2

About

Description

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.

Fabric Client--side Minecraft


🌐 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

🆕 What's new in 1.4.6

A bug-fix release, headlined by a fix for Minecraft 26.3, plus a round of fixes shared by all three supported versions. No new features and no changes to the public API; everything from 1.4.5 still applies as-is (see For developers below).

  • Minecraft 26.3: clicking a photo in the World Journal now opens it again. 26.3 changed how the game numbers mouse buttons internally, so the journal was ignoring every click on a photo card (hovering still worked). 26.1 and 26.2 were never affected.
  • Editing a photo now returns you to the same journal page, instead of the last page of the journal.
  • A death is no longer counted twice when you quit on the death screen and rejoin the world — that re-shown death screen used to add an extra "Death" entry and reset your survival streak.
  • Items from mods you've since removed no longer show up as "Air" in "Materials collected" — a readable version of the item's id is shown instead.
  • Screenshots taken while "Screenshot photos" is off are no longer imported all at once when you turn the option back on.
  • The journal/screenshot buttons no longer appear on the F3+Esc "Game Paused" screen, only on the regular pause menu, and Esc in the "Add event" popup now returns to the journal instead of closing everything.
  • Fabric Loader 0.19.5 or newer is now actually required — 1.4.5 already documented it, and the 1.4.6 jars now enforce it.

See this version's changelog for the full list.


Feature

✨ 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

📖 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 add command (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

🎮 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

⌨️ 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> confirm deletes all of them
  • /journal clear — shows a warning about what's about to happen; /journal clear confirm permanently 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.


Configuration

🛠️ 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

⚙️ Compatibility

Three separate jars are published, one per Minecraft version — download the one matching your game:

  • Minecraft 26.1 — Fabric Loader 0.19.5+
  • Minecraft 26.2 — Fabric Loader 0.19.5+
  • Minecraft 26.3 — Fabric Loader 0.19.5+
  • Requires: Fabric API
  • Environment: Client-side only

FAQ

❓ 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

🧩 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.

1.4.6 was a bug-fix release — no new API, no behavior changes to anything documented below beyond getDeathCount()/the survival streak no longer counting a re-shown death screen, and PHOTO_CAPTURED/getPhotoCount() no longer including screenshots taken while photo capture was turned off. 1.4.5 was a Minecraft 26.3 porting release plus one bug fix; 1.4.4 was a stability/performance-only release.

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.6"
}

(>=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; >=1.4.3 for recordCustomCounter/getCustomCounterCount, DAY_MILESTONE_REACHED, and getHudBlockBounds/HudBlockBounds. 1.4.4 added no new API — >=1.4.3 is just as usable, >=1.4.4 only additionally guarantees the stability/performance fixes from that release; 1.4.5 added no new API either — >=1.4.4 is just as usable, >=1.4.5 only additionally guarantees the Minecraft 26.3 compatibility and fixes from that release; 1.4.6 added no new API either — >=1.4.5 is just as usable, >=1.4.6 only additionally guarantees the bug fixes from that release.) 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/recordCustomCounter all take a Minecraft Identifier: always use your own mod id as the namespace (e.g. Identifier.fromNamespaceAndPath("yourmod", "your_event")), never vanilladaytimecounter — 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 to celebrateMilestone's sound: it only plays the first time a given id is logged. Custom counters are the exception — recordCustomCounter is 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 new api.v2 package alongside (not replacing) api.v1. Only dev.notesow.vanilladaytimecounter.api.v1 is 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() from onInitializeClient gives 0 / no data. That's expected: it runs at game startup before any world is joined, so isWorldLoaded() is false there. Register DayTimeEvents listeners (and HudBarRegistry.register calls) in onInitializeClient, but only read "current" values from inside a listener/supplier callback once a world is actually loaded.
  • NoSuchMethodError / ClassNotFoundException at runtime, but it compiles fine. You compiled against a different Vanilla DayTime Counter jar version than the one actually present in mods/. Make sure your "depends" constraint matches the jar you compiled against, and that only one version of this mod's jar exists in mods/.
  • Will my own mod get notified about an event it logs itself? Yes — logCustomEvent fires JOURNAL_EVENT_LOGGED through 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, check entry.sourceId against your own namespace and skip it.
  • My registered HudBar doesn't show up. Check the player's own "Custom HUD bars" setting is on, and that your visible supplier (if you set one) actually returns true — a bar defaults to always visible if you don't set one.
  • getHudBlockBounds() keeps returning visible = 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 to register — 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 @FunctionalInterface and every DayTimeApi method 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.