Skip to content

Repository files navigation

VTS Underwater Toggle

A Fabric client mod that detects when the player goes underwater in Minecraft and triggers a VTube Studio Hotkey through its public WebSocket API — handy for toggling a "wet" expression, model, or parameter on your Live2D avatar.

How it works

  1. Every client tick, the mod checks player.isSubmergedInWater().
  2. On a dry -> wet transition it fires the configured enter water Hotkey.
  3. On a wet -> dry transition it fires the configured exit water Hotkey (optional — leave blank to only react to entering water).
  4. Communication with VTube Studio uses its built-in WebSocket API (ws://localhost:8001 by default). No VTube Studio plugin install is needed; you just need to enable the API in VTube Studio → Settings → General → "Start API".

Setup

  1. Enable the API in VTube Studio (Settings → General → Start API).
  2. In VTube Studio, create two Hotkeys (Settings → Hotkeys) — e.g. one that triggers a "wet" expression/parameter and one that reverts it — and note their Hotkey IDs (visible in the hotkey list/export).
  3. Launch Minecraft once with this mod installed. It writes a config file to config/vtsunderwater.json and requests an auth token from VTube Studio — approve the popup that appears in VTube Studio.
  4. Edit config/vtsunderwater.json and set enterWaterHotkeyId / exitWaterHotkeyId to the IDs from step 2, then restart Minecraft (or rejoin a world).

Config reference (config/vtsunderwater.json)

Key Description
enabled Master on/off switch for the mod.
host / port VTube Studio API address (default localhost:8001).
pluginName / pluginDeveloper Identity shown in the VTube Studio auth popup.
authToken Auto-populated after you approve the plugin once; delete to re-auth.
enterWaterHotkeyId Hotkey ID triggered when the player submerges.
exitWaterHotkeyId Hotkey ID triggered when the player surfaces (optional).
reconnectIntervalSeconds Delay between reconnect attempts while VTube Studio is unreachable.

Building

./gradlew build

The output jar is placed in build/libs/.

Requirements

  • Minecraft 26.2, Fabric Loader >= 0.19.5, Fabric API
  • VTube Studio with the API enabled

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages