# Changelog
## 1.3.0
### Added
**New condition types**
- **`totemUsed`** — plays when a Totem of Undying saves the player.
- **`bedSleep`** — plays when the player starts sleeping in a bed.
- **`itemObtained/<item>`** — plays when the player obtains a configured item (pickup, craft, or smelt result).
- **`itemCrafted/<item>`** — plays when an item is actually crafted (2×2 grid or crafting table); independent from `itemObtained` and never fired by pickups, `/give`, or smelting.
- **`recipeUnlocked/<recipe>`** — plays when a recipe is newly unlocked in the player's recipe book.
- **`scoreboard/<objective>`** — plays when a player's score satisfies a comparison. Supports the comparators `equal`, `less`, `greater`, `lessOrEqual`, `greaterOrEqual` (default `greaterOrEqual`) via a `value` + `comparator` field. Edge-triggered and re-armable (fires once on crossing, re-arms only after the comparison turns false), and persistent across reconnects (won't re-fire just because the score is still satisfied on rejoin).
- **`custom/<id>`** — a detector-less condition fired by the public API or the `play` command.
**Common configuration (`conditionalvideos-common.json`)**
- **`videoQuality`** (default `AUTO`) — strictly forces a quality on multi-variant sources, or `AUTO` for best available.
- **`alwaysShowCursor`** (default `false`) — keeps the mouse cursor visible during playback.
- **`allowGameSounds`** (default `false`) — keeps vanilla sounds playing during a video.
- **`blockMatureContent`** (default `true`) — client-only mature-content blocking that a server cannot override; applies to both server-provided and local/singleplayer sources.
**Server commands**
- `/conditionalvideos play <targets> <condition>`, `stop <targets>`, and `pause <targets>` (permission level 2+, usable from command blocks and the server console), with auto-completion for playable condition keys.
**Public API**
- A stable `org.mateof24.conditionalvideos.api` package for other mods: register custom conditions, trigger/force/stop/pause playback (server- or client-side), query playback state, and subscribe to playback start/end events. See the Developer Wiki.
**Playback & UI**
- **Playback queue** — overlapping triggers are postponed and played in sequence instead of cutting each other off; `firstJoin` is always guaranteed to play first.
- **Configurable skip key** — a dedicated, rebindable skip key (default unbound, falling back to `ESC`), with an on-screen hint that shows the active key.
- **Pause indicator** — a pause icon shown while a video is paused.
- **Singular/plural loading text** — the loading screen reads `Loading video…` or `Loading videos…` depending on playlist length.
- Command and keybind strings localized in `en_us`, `es_es`, `es_ar`, `es_mx`.
### Changed
- Updated the WATERMeDIA API from `3.0.0.16` to `3.0.0.17`.
- Config schema `v2` → `v3` — additive migration; existing entries and session history are preserved, new condition maps are created empty.
- Cleaner default config — only `firstJoin` ships preconfigured; every other condition is written as an empty `{}` until you add videos.
- Quieter console — native FFmpeg stream logging is lowered to error level, so playing streams no longer floods the console with HLS/TLS chatter (real errors are still shown).
- Startup performance — advancement detection is now event-driven (via the advancements packet) instead of scanning every advancement each tick, and the singleplayer config is cached briefly, reducing main-thread cost so early cinematics such as `firstJoin` start more smoothly.
### Fixed
- Minecraft toast notifications (advancements, recipes, system) were drawn on top of the playback screen and obstructed it. They are now hidden while a video is playing and shown afterward (postponed, not lost).
- The second playback of a `videoLoop`/`playlistLoop` URL video could stall for several seconds on a black screen each loop. The swap now happens as soon as the next clip is ready, making repeats near-instant.
- With the `doImmediateRespawn` gamerule on, dying to a configured entity always fell back to the generic death video (or no video, if the generic one wasn't configured) because the killer was resolved after the player had already respawned. The killer is now captured at the moment of death.
- When a video screen was replaced without closing normally, WATERMeDIA backends (textures / FFmpeg player / audio) were never released. Cleanup now runs on every screen removal.
Developer information
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle.
maven { name = "Modrinth"; url = "https://api.modrinth.com/maven" }