


A Valheim server mod to add shared dice roll commands that show up in player's message hud.
With this plugin enabled on the server, players can use the following three commands from the chatbox. Server operators can customize the prefix and name of each command, so check with them if you are having trouble.
!roll <die size>
<die size>.!roll -> Soandso rolled a 100 sided die and got a 73!!roll 20 -> Soandso rolled a 20 sided die and got a 10!
!award <list of recipients> <item description>
<list of recipients>.!award Alice,Bob,Charlie -> !award Alice,Bob,Charlie some extra silver ->
!results
!results -> 
A feature common to MMO's is some kind of "dice roll" command, to give people a fair way to randomly decide on who gets a rare piece of loot. This mod adds this to a server in a way that is usable by all players. There are other mods out there that do this client-side, but having the rolls handled by the server allows the server to serve as a neutral, trustworthy 3rd party (meaning, you don't have to rely on another player's client-side roll mod being honest).
All of the options are fully documented in the config file that the plugin generates. Here are some extra notes:
Options in the [Color] section allow you to customize the color of messages by their type.
You can use HEX color codes (RGB, and RGBA), or the following color names: black, blue, green, orange, purple, red, white, and yellow.
Setting the option to an empty string disabled color overriding and uses the Valheim default. For more information see Unity's RichTextColor docs.
Under the hood this mod uses the Valheim MessageHud to send messages to clients. The two possible locations for messages (at time of writing these docs)
are TopLeft and Center. Both have tradeoffs.
The TopLeft option is where Valheim shows messages like "Unloading unused assets", and "Saving...".
The Center option is where Valheim shows messages like "The forest is moving".
TopLeft messages are more out of the way (i.e. less annoying to other players), but they fade fast and are harder to read.
Center messages, conversely, take up more screen space and are easier to read, but are (probably) more annoying for uninvolved players and can only show 5 lines at a time.
The default is TopLeft as it is the least intrusive option. But if you are playing on a server with just friends, give Center a try.
Why can't roll messages go to the chatbox? That would obviously be better!
Unfortunately it is not possible for the server to send chats to clients in Valheim (at least not without adding dependencies on other mods), as all chats must come from a real/authenticated user. If you can figure out a workaround, submit a PR or let me know.
BepinEx for Valheim is required for this plugin to work.
Install from your favorite mod manager, or manually by following these instructions:
bbar.Mods.ServerDiceRoll.dll file into <GameDirectory>\Bepinex\plugins<GameDirectory>\BepinEx\config\bbar.Mods.ServerDiceRoll.cfg