# Free Known Recipes - Valheim Mod
A smart Valheim mod that enables **free crafting and building for recipes you've already discovered**, while maintaining game progression and balance.
## ๐ฏ **What It Does**
- **Free Crafting**: Craft items at any station without consuming materials (for known recipes only)
- **Free Building**: Build structures with the hammer without materials (for known pieces only)
- **Smart Detection**: Only works for recipes and building pieces you've legitimately discovered
- **Always Active**: No need to toggle - automatically detects when you're using known recipes
- **Maintains Progression**: You still need to discover recipes naturally through gameplay
## โจ **Key Features**
### ๐ง **Intelligent Recipe Detection**
- Uses reflection to automatically find recipe fields in your Valheim version
- Adapts to game updates without breaking
- Only activates for recipes you've actually unlocked
### ๐๏ธ **Context-Aware Functionality**
- **Building Mode**: Detects when you're placing known building pieces with hammer
- **Crafting Mode**: Detects when you're crafting known items at stations
- **Station Requirements**: Still requires proper crafting stations and upgrade levels
### ๐ฎ **Quality of Life**
- **F7 Toggle**: Disable/enable the mod if desired
- **Visual Feedback**: Shows status when toggling
- **Error Safe**: Won't crash if Valheim updates change internal structures
## ๐ **Requirements**
- **BepInEx 5.4.2200+** for Valheim
- **Valheim** (any recent version)
- **.NET Framework 4.6.2** or higher
## ๐ง **Installation**
### Automatic (Recommended)
1. Use **Thunderstore Mod Manager** or **r2modman**
2. Search for "Free Known Recipes"
3. Click Install
### Manual Installation
1. **Install BepInEx** for Valheim if not already installed
2. **Download** the latest FreeKnownRecipesMod.dll
3. **Copy** the DLL to: Valheim\\BepInEx\\plugins\\
4. **Launch Valheim**
## ๐ฎ **Usage**
### Default Behavior
- The mod is **always active** by default
- **No setup required** - just play normally
- Free crafting automatically applies to known recipes
### Controls
- **F7**: Toggle the mod on/off (optional)
- **Visual confirmation** appears when toggling
### How It Works
1. **Discover recipes** through normal gameplay (finding materials, defeating bosses, etc.)
2. **Craft freely** - the mod detects when you're using known recipes
3. **Build freely** - place known building pieces without material costs
4. **Station requirements still apply** - you need proper workbenches, forges, etc.
## โ๏ธ **Configuration**
Configuration file: BepInEx\\config\\com.yourname.freeknownrecipes.cfg
```ini
[General]
ModEnabled = true # Enable/disable the mod
ToggleKey = F7 # Key to toggle mod on/off
```
## ๐ฏ **What's Included/Excluded**
### โ
**Works With:**
- All crafting stations (Workbench, Forge, Cauldron, etc.)
- Hammer building (walls, floors, furniture, etc.)
- Item upgrades and repairs
- All recipes you've discovered
### โ **Doesn't Work With:**
- **Unknown recipes** - you must discover them first
- **Station requirements** - you still need proper crafting stations
- **Skill progression** - crafting/building still gives XP
## ๐ ๏ธ **Development**
### Building from Source
1. **Clone/download** the repository
2. **Open** in Visual Studio 2017+
3. **Set target framework** to .NET Framework 4.6.2
4. **Add references**:
ย - BepInEx.dll
ย - 0Harmony.dll
ย - Assembly-CSharp.dll (from Valheim)
ย - UnityEngine.dll (from Valheim\unstripped_corlib\)
5. **Build** โ **Build Solution**
### Post-Build Auto-Install
Add to Project Properties โ Build Events โ Post-build:
```bash
xcopy "$(TargetPath)" "C:\Program Files (x86)\Steam\steamapps\common\Valheim\BepInEx\plugins\" /Y
```
## ๐ **Technical Details**
### How It Works
- **Patches** Player.NoCostCheat() method using Harmony
- **Uses reflection** to find known recipe fields automatically
- **Context detection** determines when you're crafting/building known items
- **Selective activation** - only enables free crafting for discovered recipes
### Compatibility
- **Valheim**: Any recent version
- **Other mods**: Should be compatible with most mods
- **Multiplayer**: Client-side only, works on any server
## ๐ **Troubleshooting**
### Mod Not Working
- Ensure **BepInEx** is properly installed
- Check **BepInEx console** for error messages
- Verify mod is in correct folder: BepInEx\\plugins\\
### Build Errors
- Confirm **.NET Framework 4.6.2** target
- Check all **references** are correctly added
- Use **publicized assemblies** if available
### Still Having Issues?
Check the mod logs in BepInEx\\LogOutput.log for detailed error information.
## ๐ **Changelog**
### v1.0.0
- Initial release
- Smart recipe detection using reflection
- Context-aware free crafting/building
- F7 toggle functionality
- Comprehensive error handling
## ๐ค **Contributing**
Feel free to:
- **Report bugs** or suggest improvements
- **Submit pull requests** for enhancements
- **Share feedback** on gameplay balance
## ๐ **License**
This project is licensed under the MIT License - see the LICENSE file for details.
## ๐ **Credits**
- **Valheim** by Iron Gate Studio
- **BepInEx** modding framework
- **Harmony** patching library
- **Valheim modding community** for guides and examples
## โ ๏ธ **Disclaimer**
This mod modifies game behavior and could be considered "cheating" by some players. Use according to your personal preferences and server rules. The mod maintains game progression by only working with discovered recipes.