StardewXnbHack is a one-way XNB unpacker for Stardew Valley. It supports every Stardew Valley asset type, is very easy to update for game changes, and is quick at unpacking many files at once.
To install it:
StardewXnbHack *.zip
file for your operating system under 'assets'.StardewXnbHack.exe
(Windows) or StardewXnbHack
(Linux/macOS) is in the same folder as
Stardew Valley.dll
.To unpack the entire Content
folder into Content (unpacked)
, just double-click on
StardewXnbHack.exe
(Windows) or StardewXnbHack
(Linux/macOS).
StardewXnbHack reads files through a temporary game instance, unlike other unpackers which read them directly. That lets it support custom Stardew Valley formats, but it can't repack files (which is rarely needed anyway) or support other games.
The main differences at a glance:
StardewXnbHack | xnbcli | XNBExtract | |
---|---|---|---|
Supported asset types | ✓ images ✓ maps ✓ dictionary data ✓ font texture ✓ font XML data ✓ structured data |
✓ images ✓ maps ✓ dictionary data ✓ font textures ✓ font XML data ❑ structured data |
✓ images ✓ maps ✓ dictionary data ✓ font textures ❑ font XML data ❑ structured data |
Export formats | ✓ .png for images✓ .tmx for maps✓ .json for data (CP-compatible) |
✓ .png for images✓ .tbin for maps¹❑ .json for data (custom format) |
✓ .png for images✓ .tbin for maps¹❑ .yaml for data |
Supported platforms | ✓ Windows ✓ Linux ✓ Mac |
✓ Windows ✓ Linux ✓ Mac |
✓ Windows ❑ Linux ❑ Mac |
Supported operations | ✓ unpack ❑ pack |
✓ unpack ✓ pack (uncompressed) |
✓ unpack ✓ pack |
Maintainable | ✓ easy to update | ❑ complex | ❑ complex, closed-source |
Sample unpack time (full Content folder) |
≈0m 43s | ≈6m 5s | ≈2m 20s |
License | MIT | GPL | n/a |
¹ .tmx
is the preferred map format, but you can open the .tbin
file in Tiled and export it as .tmx
.
That means it crashed for some reason.
First, make sure you have the latest versions of SMAPI and Stardew Valley.
If it still happens, here's how to see what the error is:
You can ask for help in #making-mods on the Stardew Valley Discord. If you're sure it's a StardewXnbHack bug (and not a usage error), you can report it on the issues page.
By default, unpacked data files include all of the fields. This can be very noisy, and doesn't really match how the data assets are formatted in the original code.
You can omit the default fields instead:
StardewXnbHack.exe --clean
to omit the default fields.This is still experimental, but it may become the default behavior in future versions.
This section explains how to edit or compile StardewXnbHack from the source code. Most users should use the release version instead.
.sln
solution file in Visual Studio.Just launch the project via Debug > Start Debugging. It will run from your bin
folder, but
should auto-detect your game folder and unpack its Content
folder.
To prepare a crossplatform SMAPI release:
StardewXnbHack.csproj
.build-scripts/prepare-release-packages.sh
on Linux or macOS.bin
folder.