A Minecraft Fabric mod that forces every player to kill a mob on a repeating countdown timer — or die instantly. Supports 1.21–1.21.x, customizable timers, and multiplayer out of the box.
- Players join → placed in Adventure mode (lobby) until the host starts the game
- Host runs
/start→ all players switch to Survival, timers begin immediately - A live countdown ticks on every player's action bar (above the hotbar)
- Kill any hostile or passive mob → timer resets to full
- Run out of time → instant death, server announces it to everyone
- Host can end the game at any time with
/stophunt
| Time Remaining | Color | Message |
|---|---|---|
| 2:30 | 🟡 Yellow | Warning in chat |
| 1:00 | 🔴 Red | Urgent warning |
| 0:10 | ☠ Dark Red Bold | Final countdown |
| 0:00 | 💀 | Instant death, server broadcast |
The kill timer colour scales with how much time is left relative to the total:
| Time Remaining | Colour |
|---|---|
| > 50% of total | 🟢 Green |
| 10–50% of total | 🟡 Yellow |
| < 10% of total | 🔴 Red |
| Command | Description |
|---|---|
/start |
Start the game with the default 10-minute timer |
/start <minutes> |
Start with a custom timer (1–120 minutes) |
/stophunt |
Stop the game, reset all timers, return players to lobby |
Examples:
/start → 10:00 timer (default)
/start 5 → 5:00 timer
/start 30 → 30:00 timer
Note: These commands have no permission restriction by default — any player can run them. If you want to restrict them to ops only, wrap the executor in a
.requires(src -> src.hasPermissionLevel(2))check inMobHuntMod.java.
- Minecraft Java Edition 1.20–1.20.x
- Fabric Loader 0.15.11+ → Install here
- Fabric API (matching your MC version) → Download here
- Mod Menu (optional, for mod list UI) → Download here
Mod Menu releases are version-specific. Use the right one for your Minecraft version:
| Minecraft | Mod Menu |
|---|---|
| 1.20 / 1.20.1 | 11.x (e.g. 11.0.4) |
| 1.20.3 | 12.x (e.g. 12.0.1) |
| 1.20.4 | 13.x (e.g. 13.0.4) |
| 1.20.5 | 14.x (e.g. 14.0.2) |
MobHunt compiles against 11.0.4 (the lowest common API) and marks Mod Menu as optional, so it works correctly regardless of which version you install — or without it entirely.
- Install Fabric Loader 0.15.11+ for your MC version
- Download Fabric API and place it in your
mods/folder - Place
mobhunt-<version>.jarin yourmods/folder - (Optional) Add the correct Mod Menu jar for your MC version
- Launch Minecraft with the Fabric profile
- JDK 21 → Download
- Git
git clone https://github.com/F0xyN0xy/mobhunt
cd mobhunt
./gradlew buildOutput: build/libs/mobhunt-<version>.jar
On Windows use gradlew.bat build instead.
The default timer when /start is run with no argument is defined at the top of MobHuntMod.java:
public static final int DEFAULT_KILL_TIMER_TICKS = 12000; // 10 minutesCommon values:
| Duration | Ticks |
|---|---|
| 3 minutes | 3600 |
| 5 minutes | 6000 |
| 10 minutes | 12000 |
| 15 minutes | 18000 |
| 20 minutes | 24000 |
At runtime, any timer between 1 and 120 minutes can be set via /start <minutes> without touching the code.
mobhunt/
├── build.gradle ← Dependencies and build config
├── gradle.properties ← Versions (MC, Fabric, Mod Menu, mod)
├── settings.gradle ← Gradle root project name and plugin repos
└── src/main/
├── java/com/mobhunt/
│ └── MobHuntMod.java ← All mod logic lives here (single file)
└── resources/
├── assets/mobhunt/
│ └── icon.png ← Mod icon shown in Mod Menu
└── fabric.mod.json ← Mod metadata, dependencies, entrypoints
All game state is held in static fields on MobHuntMod:
private static boolean gameActive // whether a game is running
private static int killTimerTicks // current timer length in ticks
private static Map<UUID, Integer> ticksSinceKill // per-player tick counterWhy static? Fabric calls onInitialize() once per JVM session. Static fields survive across world loads within the same game launch, which is what keeps the timer running correctly when a player leaves and rejoins mid-game.
Why no SERVER_STOPPING reset? Resetting state on server stop caused the game to forget it had started whenever a singleplayer world was exited (the integrated server stops on world exit). State is intentionally only reset by /stophunt. If you need persistence across full game restarts, the right approach is to serialise gameActive, killTimerTicks, and ticksSinceKill to a file in the world's save directory using ServerLifecycleEvents.SERVER_STARTED / SERVER_STOPPING.
| Event | Purpose |
|---|---|
CommandRegistrationCallback |
Register /start and /stophunt |
ServerTickEvents.END_SERVER_TICK |
Advance per-player timers every tick |
ServerLivingEntityEvents.AFTER_DEATH |
Detect mob kills and reset the killer's timer |
ServerPlayConnectionEvents.JOIN |
Put joining players in the right mode; restore their timer |
New commands: register additional CommandManager.literal(...) blocks inside the existing CommandRegistrationCallback lambda.
Persistence across restarts: hook ServerLifecycleEvents.SERVER_STARTED to read a JSON file from the world save directory, and SERVER_STOPPING to write it. Use Gson (already on the classpath via Minecraft) for serialisation.
Per-player scores / kill counts: add a Map<UUID, Integer> killCount field alongside ticksSinceKill and increment it in the AFTER_DEATH handler.
Spectator on death (true hardcore feel): in the remaining <= 0 block, replace player.kill() with player.changeGameMode(GameMode.SPECTATOR) and add the UUID to a Set<UUID> eliminated so the tick loop skips them.
- Passive mobs count — cows, chickens, pigs, sheep all reset the timer if you're desperate
- Works in multiplayer — every player has their own independent timer
- Pair with a Hardcore world for permanent death on elimination
- The timer survives leaving and rejoining the same session — you can't escape it by logging out
MIT — free to use, modify, and share.