This is a simple achievement framework that adds custom achievements to the collections tab:

Custom achievements can have custom icons as pictured above, or use the default yellow star.
Creating Custom Achievements
Achievements are creating using
Content Patcher.
Achievement data is added to a dictionary at the path
custom_achievements_dictionary, e.g.:
{
<br /> "Format": "1.23.0",
<br /> "Changes": [
<br /> {
<br /> "Action": "EditData",
<br /> "Target": "custom_achievements_dictionary",
<br /> "Entries": {
<br /> "FarmingLevelTen": {
<br /> "ID": "FarmingLevelTen",
<br /> "name": "Professional Farmer",
<br /> "description": "Reach farming level ten.",
<br /> "iconPath": "LevelAchievementsFarmingLevelTen",
<br /> "drawFace": true
<br /> "achieved": false
<br /> }
<br /> },
<br /> "Update": "OnDayStart, OnLocationChange, OnTimeChange"
<br /> },
<br /> {
<br /> "Action": "EditData",
<br /> "Target": "custom_achievements_dictionary",
<br /> "Fields":
<br /> {
<br /> "FarmingLevelTen": {
<br /> "achieved": true
<br /> }
<br /> },
<br /> "When":{
<br /> "Query: {{SkillLevel:Farming}} > 9": true
<br /> },
<br /> "Update": "OnDayStart, OnLocationChange, OnTimeChange"
<br /> },
<br /> {
<br /> "Action": "Load",
<br /> "Target": "LevelAchievementsFarmingLevelTen",
<br /> "FromFile": "assets/FarmingLevelTen.png"
<br /> }
<br /> ]
<br />}
<br />
This sets the
achieved field to true when the farming skill level is greater than 9.
Achievement notifications will trigger when Content Patcher updates the
achieved field in accordance with the
Update field.
Custom Icons
The icon path can be omitted to make it use the default star. Otherwise, the png file must be supplied by your mod, as in the above example.
By default, achievement star faces are chosen at random by the game. If you set
drawFace to
false, it will just show whatever your icon is, with no added face.
You can also optionally specify an
iconRect rectangle with X, Y, Width, and Height fields if you are using a tilesheet, to only use part of the source png.
Technical
Requires
SMAPI and
Content Patcher, uses Harmony.
Compatible with
Mod Updater for automatic updates.
Code is at
https://github.com/aedenthorn/StardewValleyMods.
If you want to complain or ask for help or help me test my mods, you can visit
my Discord server.
A list of all my mods for Stardew Valley is available at
https://www.nexusmods.com/stardewvalley/articles/895.