Head to the Google AI Studio and create an API key by pressing the white create API key button
Copy the token
Either the config file via text editor in config/yacl-mc_talking.json5 or via the in-game GUI. Set the token and your desired speaking language:
// This key is used to authenticate with the Gemini API. You can get one at https://aistudio.google.com/apikey geminiApiKey: "Put your api key here", // don't forget the comma!
(The free tier allows up to 3 citizens to be spoken at the same time)
Usage
Craft a Citizen Communication Device using a Book and Quill and a Redstone Torch (I would really appreciate it if someone could create a better texture for it): Then left click on a citizen you want to talk to and something similar to this will show:
Now the citizen will complain if they are unhappy or missing some resources, just talk right away!
How do I change the language of the citizens?
First have a look at this table and remember your languages "BCP-47 Code" and update the config via notepad in your minecraft serer/modpack location or via ingame ui:
language = "put your languages code here"
Troubleshooting
The Citizen isn't speaking, it just shows "listening"
This issue might be related to having the wrong input device set. To make sure your set up is working correctly, open the voice chat settings (by default this is done by pressing v), then click on "Settings" and press the microphone button. If you can't hear yourself talking, adjust input / output devices
My Citizen Status shows "Talking" but I can't hear anything
Same issue as above
Can I include this in my modpack?
Yup
Just a quick disclaimer: If you are using the free tier, google may use data for improvement outside the UK/CH/EEA/EU