XNBCLI

is a CLI tool for XNB packing/unpacking purpose built for Stardew Valley (but works for Jump King too!), made by LeonBlade.

This program can be used in command line only, but there are two batch files that help you out so you don’t have to do anything in command line.

Command line usage is:
xnbcli pack input-file output-file - to pack a file
xnbcli unpack input-file output-file - to unpack a file

Supported types

Supported images formats are: .png, .bmp and more.

Table of usage

Type of file file to XNB XNB to file
image
sound
font

Usage

  1. Install prerequisites of XNBCLI available here.
  2. Download the latest release for XNBCLI in the links above.
  3. Export the xnbcli-windows-x64.zip file.

Unpack images (from XNB to image file)

If you want to unpack an image from the game, put the file inside the packed folder and open the unpack.bat. If succeeded, you will find your files inside the unpacked folder.

Pack images (from image file to XNB)

If you want to pack an image to put on the mod, make sure you have the .json file of your file ready to get packed with your image. If you never unpacked an image you can use this simple .json and modify for your own use!

YOURFILENAMEHERE.json   Download

{
    "header": {
        "target": "w",
        "formatVersion": 5,
        "hidef": false,
        "compressed": false
    },
    "readers": [
        {
            "type": "Microsoft.Xna.Framework.Content.Texture2DReader",
            "version": 0
        }
    ],
    "content": {
        "format": 0,
        "export": "YOURFILENAMEHERE.png"
    }
}

Once put your image inside the unpacked folder with the .json file, you can open the pack.bat. And if succeeded, you managed to create your very own custom texture! The packed file can be found inside the packed folder.