API reference
Generated reference for SocketSVC's public Java APIs
這一頁還沒有翻譯,以下顯示英文原文。
These pages are generated from the Javadoc on the public API sources, so they always match the code in the repository. The prose guides explain how to use the APIs: Spatial audio API for servers and addons, and Proxy addon API for Velocity / BungeeCord relay addons.
Every release publishes these APIs as interface-only jars, served as Maven coordinates, so an addon names a version instead of vendoring a jar. Always compileOnly — SocketSVC supplies the classes at runtime, and shading them puts a second copy of the interfaces on the classpath.
repositories {
maven("https://socketsvc-updater.vercel.app/maven") {
name = "SocketSVC"
// Nothing else is published there, so no other lookup is slowed down by it.
content { includeGroup("com.socketsvc") }
}
}Generated pages
Run pnpm gen:api in apps/docs after changing any public API source. Do not edit the files under content/docs/api by hand — they are overwritten.
Shared types
Speaker, position and audio-source types in com.socketsvc.api. They are shared by the Paper plugin and the server mods, so addon logic written against them ports between the two unchanged.
Included in both server-side API jars below; there is no separate coordinate for them.
| Type | Summary |
|---|---|
| AudioPlayer | One-shot playback handle. |
| LocationalAudioChannel | An independent mono speaker. |
| MicrophoneAudio | One 20 ms slice of a player's microphone, handed to a MicrophoneTap. |
| MicrophoneTap | A consumer of players' inbound microphone audio, registered through subscribeMicrophone. |
| MicrophoneTapHandle | A live microphone subscription. |
| PcmSource | 48 kHz, mono, signed 16-bit PCM. |
| PcmSources | — |
| SpatialPosition | Immutable Bukkit world name and block coordinates; safe to use off the server thread. |
| SpatialSettings | Linear distance attenuation: full volume through fadeStart, silent at range. |
| VoiceClientState | Whether a player is running the SocketSVC client mod. |
| VoiceGroupInfo | An immutable snapshot of one voice group, as handed to addons and pushed to clients. |
| VoiceGroupType | How a group's audio relates to the ordinary proximity chat around it. |
| VoiceMuteInfo | One server-side voice mute, as addons and the console see it. |
Paper plugin API
The entry point for Bukkit/Paper plugins. Obtain it from the Bukkit ServicesManager, compile against the API JAR with compileOnly, and never shade it.
compileOnly("com.socketsvc:socketsvc-server-paper-api:0.2.5")| Type | Summary |
|---|---|
| SocketSvcApi | Obtain with Bukkit ServicesManager.load(SocketSvcApi.class); use compileOnly, never shade this API. |
Server mod API
The Fabric/NeoForge/Forge equivalent of the Paper API, identifying callers by mod id.
compileOnly("com.socketsvc:socketsvc-server-mod-api:0.2.5")| Type | Summary |
|---|---|
| SocketSvcModApi | Spatial speaker API for Fabric/NeoForge/Forge server mods - the mod-side equivalent of the Paper plugin's SocketSvcApi, identifying callers by mod id instead of a Bukkit plugin. |
Client API
Cross-mod client-side contract: query voice state and play sounds only the local player hears. Channels created here are local-only and never reach the voice connection.
compileOnly("com.socketsvc:socketsvc-client-api:0.2.5-mc26.3")This is the one API jar built per Minecraft version — SocketSvcClientApi takes a net.minecraft Entity — so the version names the game version it was built against, and there is one for every supported version. Its classes carry Minecraft's official (Mojang) names, which is what NeoForge and Forge compile against; a Fabric mod on Yarn mappings needs a remap step.
| Type | Summary |
|---|---|
| LocalAudioChannel | A locally-rendered sound: only the local player hears it. |
| LocalEntityAudioChannel | A LocalAudioChannel that follows a Minecraft entity, fading out past #getRange(). |
| LocalPositionalAudioChannel | A LocalAudioChannel fixed (or movable) at a point in the world, fading out past #getRange(). |
| LocalStaticAudioChannel | A LocalAudioChannel with no spatialization - plays at a flat volume regardless of camera position, e.g. |
| PcmSource | 48 kHz, mono, signed 16-bit PCM. |
| PcmSources | — |
| SocketSvcClientApi | Cross-mod client-side contract: query voice state (mute/talking/connection) and render sounds that only the local player hears, positioned in 3D like a normal in-game sound. |
| SpatialDirection | Which way a positional channel points, and how much quieter it is off-axis. |
| SpatialPosition | Immutable in-world coordinates for a LocalPositionalAudioChannel, in the player's current world. |
| VoiceScreen | A screen the server has published: where it is, what is on it, and where the playhead was. |
Proxy API
Routing and observation for the Velocity / BungeeCord relay: which backend a player is relayed to, and what the relay is doing. The relay never decodes audio, so nothing about speakers, positions or volume lives here — that is the server-side spatial audio API.
compileOnly("com.socketsvc:socketsvc-proxy-api:0.2.5")| Type | Summary |
|---|---|
| ProxyBackendResolver | Chooses which backend voice listener a connecting player is relayed to, overriding the servers: map in the relay's own config.yml. |
| ProxyRelayListener | Observes the relay's connection lifecycle. |
| RelaySession | One relayed voice connection, from the moment the relay has picked a backend until the connection closes. |
| SocketSvcProxyApi | Addon API for the SocketSVC proxy relay plugin, on both Velocity and BungeeCord/Waterfall (the relay ships as one jar for both, and this is the same API on either). |