Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
ValheimTwitch
Twitch interacts with Valheim through Streamer.bot: on-screen notifications, mob & item spawning with viewer-named enemies, native raid events, in-game /request item requests, and Twitch viewer portrait build pieces.
By CodeWithTD
| Last updated | 12 hours ago |
| Total downloads | 23 |
| Total rating | 0 |
| Categories | Mods Misc Client-side Utility AI Generated Deep North Update |
| Dependency string | CodeWithTD-ValheimTwitch-0.5.0 |
| Dependants | 0 other packages depend on this package |
This mod requires the following mods to function
denikson-BepInExPack_Valheim
BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.
Preferred version: 5.4.2351ValheimModding-Jotunn
Jötunn (/ˈjɔːtʊn/, 'giant'), the Valheim Library was created with the goal of making the lives of mod developers easier. It enables you to create mods for Valheim using an abstracted API so you can focus on the actual content creation.
Preferred version: 2.30.2README
ValheimTwitch
Bring your Twitch chat into Valheim. Follows, subs, raids and channel point rewards show up in your game, and viewers can spawn enemies, start raids and request items - all through Streamer.bot.
What it does
- Twitch alerts in-game: follows, cheers, subs, gift subs, raids and channel point redemptions appear as on-screen messages.
- Spawn enemies: a viewer can summon a monster (or a specific creature) for everyone to fight. Optionally the creature is named after the viewer.
- Spawn items: give yourself or drop items into the world.
- Raids: start a native Valheim raid - randomly, or pick one by name.
/requestin chat: players type/request <item>in-game and Streamer.bot decides what happens (grant the item, charge channel points, ...).- Viewer portraits: temporarily disabled while the piece is being rebuilt.
Requirements
- Valheim with the Thunderstore Mod Manager (or r2modman)
- BepInExPack for Valheim (installed automatically as a dependency)
- Jotunn (
ValheimModding-Jotunn, installed automatically as a dependency) - Streamer.bot with its WebSocket server enabled
Installation
- Install the mod from Thunderstore with the Mod Manager. Its dependencies come along automatically.
- Start Valheim with Start modded.
- Set up Streamer.bot (see below).
The mod's settings are in BepInEx/config/CodeWithTD.ValheimTwitch.cfg. You
only need to change them if your Streamer.bot setup is different from the
defaults.
Streamer.bot setup
- In Streamer.bot, open the WebSocket server settings (under its API or Servers settings) and turn the server on.
- Keep the default host (
127.0.0.1) and port unless you've changed them. The port must match the one in the mod's config. - Connect your Twitch account so Twitch events reach Streamer.bot.
To check it works, start Valheim and look for a line saying Streamer.bot is
connected in BepInEx/LogOutput.log. You can also see the connection listed in
Streamer.bot's WebSocket tab.
Quick test
Create an action in Streamer.bot with a C# sub-action and this code, then run the action. A message should appear on screen in Valheim:
using System;
public class CPHInline
{
public bool Execute()
{
string json = "{\"action\":\"show_message\",\"title\":\"HELLO\",\"message\":\"Twitch is connected!\"}";
CPH.WebsocketBroadcastJson(json);
return true;
}
}
Commands
Streamer.bot sends commands to the mod as JSON. Use the same C# sub-action pattern as above and change the JSON:
| What you want | Example JSON |
|---|---|
| Show a message | {"action":"show_message","title":"RAID!","message":"42 viewers"} |
| Show a big centre message | {"action":"show_notification","message":"RAID INCOMING!"} |
| Spawn monsters | {"action":"mob_spawn","mob":"Greydwarf","amount":5,"level":3,"viewer":"Andilippi"} |
| Spawn one specific enemy | {"action":"enemy_spawn","enemy":"Troll","amount":1,"level":2} |
| Give items | {"action":"item_spawn","item":"Wood","amount":10} |
| Start a raid | {"action":"raid_start"} or {"action":"raid_start","raid":"wolves"} |
| Stop the raid | {"action":"raid_stop"} |
vieweris optional. When set, the spawned creatures are named after the viewer ("Andilippi's Troll").levelis optional for monsters: 1 = normal, 2 = one star, 3 = two stars.- Monster and item names are listed in SPAWNS.md.
- Raid names include
wolves,foresttrolls,skeletonsandarmy_eikthyr. An unknown name is rejected and the log shows the full list.
Item requests (/request)
Players can type /request <item> in the in-game chat. Streamer.bot receives
the item name, a full stack amount and the player's name, and runs an action
you set up:
- Create an action named
ValheimItemRequest(or whatever name you set under[Requests] ActionNamein the config). - Add a C# sub-action that gives the item back:
using System;
public class CPHInline
{
public bool Execute()
{
string item = args["item"].ToString();
string amount = args["amount"].ToString();
string json = "{\"action\":\"item_spawn\",\"item\":\"" + item + "\",\"amount\":" + amount + "}";
CPH.WebsocketBroadcastJson(json);
return true;
}
}
Add a cooldown or channel point cost in Streamer.bot if you want to limit requests. The mod doesn't limit them itself.
Settings
The main options are in BepInEx/config/CodeWithTD.ValheimTwitch.cfg:
[WebSocket]- connection to Streamer.bot (host, port, optional password).[Notifications]- turn the on-screen Twitch alerts on or off.[Spawning]- how many monsters or items one command can create.[Raids]- turn raid commands on or off.[Requests]- turn/requeston or off, and choose its action name.
Troubleshooting
- Nothing happens in-game: check that Streamer.bot's WebSocket server is on
and the port matches the config. Look for "Connected to Streamer.bot" in
BepInEx/LogOutput.log. - Spawns or raids don't work: these only run on the host (the player running the world or server). Clients can't start them.
- Still stuck? Send your
LogOutput.logwhen reporting an issue.
Credits and more
- Technical details, build steps and the full command reference are in TECHNICAL.md.
- The full list of spawnable monsters, enemies and items is in SPAWNS.md.
- Changes are listed in CHANGELOG.md.