Download FiguraSVC — Minecraft Mods — MetaMods
FiguraSVC

FiguraSVC

Active

Downloads

5

Last update

3 months ago

Versions

1.20.1 — 1.21.6
Client
Fabric
Forge
Neoforge
Quilt
Decor
Social

FiguraSVC

This is an unofficial addon for the Figura mod that enables Figura Lua scripts to detect and interact with Simple Voice Chat functionality.

Documentation

Complete documentation and usage examples are available in the project repository. A wiki page with detailed instructions will be created in the near future.

Example Script

-- Talking animation
local microphoneOffTime = 0
local isMicrophoneOn = false

function pings.talking(state)
    -- (safe on servers) (visible to all players)
    animations.model.talk:setPlaying(state)
end

function events.tick()
    local previousMicState = isMicrophoneOn

    microphoneOffTime = microphoneOffTime + 1
    isMicrophoneOn = microphoneOffTime <= 2 -- has svc.microphone been called in the past 2 ticks?

    if previousMicState ~= isMicrophoneOn then
        pings.talking(isMicrophoneOn)
    end
end

if client:isModLoaded("figurasvc") and host:isHost() then
    function events.HOST_MICROPHONE(pcm)
        microphoneOffTime = 0
    end
end
Project members
KnownSH

KnownSH

Developer

Created: 7 Apr 2024

ID: 8099