Valheim Plugin (BepInEx)
The Pixlpay Valheim plugin automatically delivers purchased items to players on your Valheim dedicated server using BepInEx.
Features
- Native BepInEx integration
- Automatic polling for pending deliveries
- Support for purchases, refunds, and chargebacks
- Online player queuing
- Item spawning via Server devcommands
- Detailed logging
Requirements
BepInExPack Valheim (v5.4.22+)
- Download: Thunderstore
Server devcommands by JereKuusela
- Download: Thunderstore
- Required for executing spawn commands on dedicated servers
Installation
Step 1: Install BepInEx
- Download BepInExPack Valheim from Thunderstore
- Extract to your Valheim server directory
- The folder structure should look like:
valheim_server/
├── BepInEx/
│ ├── config/
│ ├── plugins/
│ └── ...
├── valheim_server.exe
└── ...Step 2: Install Server devcommands
- Download Server devcommands from Thunderstore
- Copy
ServerDevcommands.dlltoBepInEx/plugins/
Step 3: Install PixlPay
- Download
PixlPay.dllfrom your Pixlpay dashboard under Settings > Game Servers > Downloads - Copy
PixlPay.dlltoBepInEx/plugins/ - Start the server once to generate the config file
- Stop the server and configure the plugin
Configuration
After first run, edit BepInEx/config/com.pixlpay.valheim.cfg:
[Authentication]
## Your PixlPay store secret key. Find this in your PixlPay dashboard under Game Servers.
StoreSecret = your_store_secret_here
## Your game server's secret key. Find this in your PixlPay dashboard under Game Servers.
ServerSecret = your_server_secret_here
[Debug]
## Enable debug logging for troubleshooting.
DebugMode = false
## Enable development mode to use a custom API URL.
DevMode = false
## Custom API URL for development mode.
DevApiUrl = http://localhost:8000Getting Your Secrets
- Log in to your Pixlpay Dashboard
- Go to Settings > Game Servers
- Add your Valheim server or select an existing one
- Copy the Store Secret and Server Secret
How It Works
- Polling: The plugin polls the Pixlpay API every 60 seconds for pending deliveries
- Execution: Commands are executed via Server devcommands when conditions are met
- Confirmation: Results are reported back to the API
- Offline Queue: If a player is offline and the product requires online delivery, the command is queued
Execution Modes
| Mode | Behavior |
|---|---|
| Instant | Commands execute immediately, even if player is offline |
| When Online | Commands are queued until the player connects |
Configure this per-product in your Pixlpay dashboard.
Setting Up Products
Example Commands
Configure products in your Pixlpay dashboard with commands like:
| Product | Command |
|---|---|
| 100 Coins | spawn Coins 100 |
| Iron Sword | spawn SwordIron 1 |
| Bronze Armor Set | spawn ArmorBronzeChest 1spawn ArmorBronzeLegs 1spawn HelmetBronze 1 |
| 50 Health Potions | spawn MeadHealthMajor 50 |
| VIP Kit | spawn SwordBlackmetal 1spawn ShieldBlackmetal 1spawn Coins 500 |
Available Placeholders
| Placeholder | Description |
|---|---|
{player} | Player's Steam ID |
{steam_id} | Player's Steam ID (alias) |
{quantity} | Quantity purchased |
{order_id} | Order ID |
{order_number} | Order number |
{product_name} | Product name |
{customer_email} | Customer email |
{customer_name} | Customer name |
Common Item IDs
Weapons:
SwordIron,SwordSilver,SwordBlackmetalAxeBlackMetal,AxeIron,AxeBronzeBowHuntsman,BowDraugrFangAtgeirBronze,AtgeirIron,AtgeirBlackmetal
Armor:
ArmorIronChest,ArmorIronLegsArmorWolfChest,ArmorWolfLegsArmorPaddedCuirass,ArmorPaddedGreavesCapeDeerHide,CapeWolf,CapeLox
Tools:
Hammer,Hoe,CultivatorPickaxeIron,PickaxeBronze,PickaxeBlackMetal
Resources:
Coins- In-game currencyIronScrap,Iron,IronNailsBlackMetal,BlackMetalScrapCrystal,DragonTear
Consumables:
MeadHealthMajor,MeadHealthMedium,MeadHealthMinorMeadStaminaMajor,MeadStaminaMedium,MeadStaminaMinorSerpentStew,LoxMeatPie
TIP
For a complete list of Valheim item IDs, see the Valheim Wiki - Item IDs.
Important Notes
Spawn Behavior
Items spawned with the spawn command appear at a fixed location in the world (typically near spawn or the command executor). This is a limitation of Valheim's command system.
For best results:
- Use When Online execution mode so players are present when items spawn
- Consider creating custom pickup points where items spawn
Player Identification
Players are identified by their Steam ID (SteamID64). When customers purchase from your store, they should log in with Steam to link their account.
Server-Side Only
This plugin runs server-side only. Players do not need to install anything on their clients.
Troubleshooting
Commands Not Executing
- Verify Server devcommands is installed in
BepInEx/plugins/ - Check the BepInEx log:
BepInEx/LogOutput.log - Enable debug mode in config and check for errors
- Ensure your Store Secret and Server Secret are correct
Players Not Being Detected
- Player must be connected and fully loaded
- Verify the correct Steam ID is being used in purchases
- Check debug logs for player connection events
API Connection Issues
- Ensure your server has internet access
- Check firewall rules for outbound HTTPS (port 443)
- Verify secrets in your configuration match the dashboard
Items Not Spawning
- Verify Server devcommands is installed and working
- Test the spawn command manually in-game
- Check that the item ID is correct (case-sensitive)
- Ensure the player is online if using "When Online" mode
Data Storage
The plugin stores data in BepInEx/config/PixlPay_data.json:
- Pending deliveries (for offline players)
- Command execution history (last 100 entries)
WARNING
This file is automatically managed - do not edit manually.
Log Files
Check BepInEx/LogOutput.log for plugin messages. Look for lines starting with [PixlPay].
With debug mode enabled, you'll see detailed information about:
- API polling
- Player connections
- Command execution
- Delivery confirmations
Security Best Practices
- Protect your config - Don't expose
BepInEx/config/publicly - Use unique Server Secrets - Each server should have its own secret
- Keep BepInEx updated - Ensure you're running the latest version
- Monitor logs - Check for unauthorized access attempts
- Backup data - Keep copies of configuration files
