When the game is launched, ItemBags will load each .json file located in the assets\Modded Bags folder, and create a custom bag from each one. You can manually create these .json files, but the recommended steps are to create them are:
- Start the game and load a save file.
- In the SMAPI console window, use the command generate_modded_bag. This command will export a .json file to your assets\Modded Bags. The exported .json will use default settings, but makes for a good starting point.
- Close Stardew Valley, then open the exported .json file in any text editor and fine-tune its settings as desired.
generate_modded_bag command:
- BagName - This is just the display name you want the exported bag to have. If the BagName contains spaces, you must enclose it in double quotes. For example: "Artisan Valley Bag"
- ModUniqueID - This is the ModUniqueID found in the manifest.json of the mod that you want to create a bag for. The exported bag will, by default, be able to store every JsonAssets modded item that belongs to this mod. If a mod contains multiple manifest.json files, then use the ModUniqueID of the manifest.json that corresponds to the JsonAssets part of the mod. For example, if you download this mod, you'll see that it contains several subfolders, that each have their own manifest.json. [CP] Artisan Valley, [JA] Artisan Valley Machine Goods, [MFM] Artisan Valley Letters, [PFM] Artisan Valley. In this case we would want the manifest.json in the [JA] Artisan Valley Machine Goods since this is the one that defines the JsonAsset items.
Suppose we typed the following into the SMAPI console:
generate_modded_bag "Artisan Valley Bag" ppja.artisanvalleymachinegoods
That would export a file that looks like this:
"IsEnabled": true,
"ModUniqueId": "ppja.artisanvalleymachinegoods",
"BagId": "7a6fc755-19ce-b6e3-d6d7-445120a0fd45",
"BagName": "Artisan Valley Bag",
"BagDescription": "A bag for storing items belonging to ppja.artisanvalleymachinegoods mod",
"IconTexture": "SpringObjects",
"IconPosition": "{X:0 Y:0 Width:0 Height:0}",
"Prices": {
"Small": 2500,
"Medium": 8000,
"Large": 28000,
"Giant": 85000,
"Massive": 400000
},
"Capacities": {
"Small": 30,
"Medium": 99,
"Large": 300,
"Giant": 999,
"Massive": 9999
},
"SizeSellers": {
"Small": [
"Pierre"
],
"Medium": [
"Pierre"
],
"Large": [
"Pierre"
],
"Giant": [
"Pierre"
],
"Massive": [
"Pierre"
]
},
"SizeMenuOptions": {
"Small": {
"GroupByQuality": true,
"InventoryColumns": 12,
"InventorySlotSize": 64,
"GroupedLayoutOptions": {
"GroupsPerRow": 5,
"ShowValueColumn": true,
"SlotSize": 64
},
"UngroupedLayoutOptions": {
"Columns": 12,
"LineBreakIndices": [],
"LineBreakHeights": [],
"SlotSize": 64
}
},
"Medium": {
"GroupByQuality": true,
"InventoryColumns": 12,
"InventorySlotSize": 64,
"GroupedLayoutOptions": {
"GroupsPerRow": 5,
"ShowValueColumn": true,
"SlotSize": 64
},
"UngroupedLayoutOptions": {
"Columns": 12,
"LineBreakIndices": [],
"LineBreakHeights": [],
"SlotSize": 64
}
},
"Large": {
"GroupByQuality": true,
"InventoryColumns": 12,
"InventorySlotSize": 64,
"GroupedLayoutOptions": {
"GroupsPerRow": 5,
"ShowValueColumn": true,
"SlotSize": 64
},
"UngroupedLayoutOptions": {
"Columns": 12,
"LineBreakIndices": [],
"LineBreakHeights": [],
"SlotSize": 64
}
},
"Giant": {
"GroupByQuality": true,
"InventoryColumns": 12,
"InventorySlotSize": 64,
"GroupedLayoutOptions": {
"GroupsPerRow": 5,
"ShowValueColumn": true,
"SlotSize": 64
},
"UngroupedLayoutOptions": {
"Columns": 12,
"LineBreakIndices": [],
"LineBreakHeights": [],
"SlotSize": 64
}
},
"Massive": {
"GroupByQuality": true,
"InventoryColumns": 12,
"InventorySlotSize": 64,
"GroupedLayoutOptions": {
"GroupsPerRow": 5,
"ShowValueColumn": true,
"SlotSize": 64
},
"UngroupedLayoutOptions": {
"Columns": 12,
"LineBreakIndices": [],
"LineBreakHeights": [],
"SlotSize": 64
}
}
},
"Items": [
{
"Name": "Absinthe",
"IsBigCraftable": false,
"HasQualities": true,
"RequiredSize": "Small"
},
{
"Name": "Affogato",
"IsBigCraftable": false,
"HasQualities": true,
"RequiredSize": "Small"
},
{
"Name": "Almond Butter",
"IsBigCraftable": false,
"HasQualities": true,
"RequiredSize": "Small"
},
The rest of the items have been omitted for brevity
]
}
As you can see, this file is massive. But it's not too complicated, so let's step through every piece of data defined in it and what they do.
Understanding the modded bag .json files
- "IsEnabled": true,
This just tells ItemBags if the file should be loaded. Default value: true
- "ModUniqueId": "ppja.artisanvalleymachinegoods",
This tells ItemBags what mod must be installed for this file to be usable. With it's current value of "ppja.artisanvalleymachinegoods", this file will only be loaded if a corresponding mod with that manifest.json UniqueID is found. This is optional. If you changed it to an empty string, ("ModUniqueID": "",) then the file would always be loaded.
- "BagId": "7a6fc755-19ce-b6e3-d6d7-445120a0fd45",
This is a GUID (Globally Unique Identifier) for the bag. You cannot have multiple bags with the same BagId. So if you generate multiple bags from the same ModUniqueID, then you will need to open the exported files, and make sure they do not have the same BagId. If they do, just go to this site: https://www.guidgenerator.com/, generate a guid, and use that as the BagId.
- "BagName": "Artisan Valley Bag",
This is the display name of the bag, not including the bag's size.
- "BagDescription": "A bag for storing items belonging to ppja.artisanvalleymachinegoods mod",
This is the tooltip description text when hovering over the bag, not including information about how many of each item it can store.
- "IconTexture": "SpringObjects",
This is the name of the Game texture that will be used to draw an icon to the bottom-right of the bag.
"SpringObjects" refers to the texture at "Content\Maps\springobjects.xnb", "Craftables" is "Content\TileSheets\Craftables.xnb", "Debris" is "Content\TileSheets\debris.xnb", "Tools" is "Content\TileSheets\tools.xnb", and "Cursors" is "Content\LooseSprites\Cursors.xnb"
- "IconPosition": "{X:0 Y:0 Width:0 Height:0}",
This is the position of the sprite within the "IconTexture" to use when drawing the icon. Typically this should be a 16x16 region of the texture.
Icon example:

Suppose you wanted the bag's icon to be a Prismatic Shard. Prismatic Shard is located near the top-left corner of the texture. So, you would use these settings:
"IconTexture": "SpringObjects",
"IconPosition": "{X:32 Y:48 Width:16 Height:16}",
The top-left corner is X,Y = 0,0. The positive X-axis is to the right, and the positive Y-axis is down.
To open and view the textures in .xnb files, you need to use a program such as xnbcli to unpack the data first. More info at: Unpacking Game Files
- "Prices": { "Small": 2500, "Medium": 8000, "Large": 28000, "Giant": 85000, "Massive": 400000 },
These are the default shop prices of each size of the bag. There MUST be a value for each size ("Small", "Medium", "Large", "Giant", and "Massive"). Note that these prices are also affected by various values in the config.json file, such as "GlobalPriceModifier". For example, if the config.json file has "GlobalPriceModifier" = 1.5, then the Massive bag would cost 400000*1.5=600000 gold.
- "Capacities": { "Small": 30, "Medium": 99, "Large": 300, "Giant": 999, "Massive": 9999 },
These are the default maximum quantity of each item that can be stored in each size of the bag. There MUST be a value for each size ("Small", "Medium", "Large", "Giant", and "Massive"). Note that these capacities are also affected by various values in the config.json file, such as "GlobalCapacityModifier". For example, if the config.json file has "GlobalCapacityModifier" = 1.5, then the Massive bag would be able to store roughly 9999*1.5=15000 of each item inside of it.
- "SizeSellers": { "Small": [ "Pierre" ], "Medium": [ "Pierre" ], "Large": [ "Pierre" ], "Giant": [ "Pierre" ], "Massive": [ "Pierre" ] },
These are the names of the shops that will sell each size of the bag. There MUST be a value for each size ("Small", "Medium", "Large", "Giant", and "Massive"). The value for each size is a list of shop names. For example, you could use "Small": [ "Pierre", "Willy" ] to make the Small size of the bag sold by Pierre and Willy.
- "SizeMenuOptions": { ...
"GroupByQuality": true,
"InventoryColumns": 12,
"InventorySlotSize": 64,
"GroupedLayoutOptions": {
"GroupsPerRow": 5,
"ShowValueColumn": true,
"SlotSize": 64
},
"UngroupedLayoutOptions": {
"Columns": 12,
"LineBreakIndices": [],
"LineBreakHeights": [],
"SlotSize": 64
}
},
- "GroupByQuality": true,
If true, then items inside of the bag that are available in multiple different qualities will be grouped together according to the "GroupedLayoutOptions" settings. Things like fish, fruits, and vegetables can have multiple qualities (Regular/Silver/Gold/Iridium). While items like seeds, artifacts, resources, crafted items etc do not have multiple qualities. If GroupByQuality=false, then even the items that do have multiple qualities will still be arranged according to "UngroupedLayoutOptions" settings.
- "InventoryColumns": 12,
The number of columns to use when arranging the items in the bottom half of the bag's interface. This bottom part is usually the player's inventory, but it could also be the contents of a chest (if the bag was opened from inside of a chest)
- "InventorySlotSize": 64,
This is the size, in pixels, to use when drawing an item slot in the bottom half of the bag's interface. Note that the actual pixel size might not be exactly the same due to the game's zoom options. If you're playing at 75% zoom, then an inventory slot rendered at 64x64 pixels would actually appear as 64*.75=48 pixels on your monitor.
- "GroupedLayoutOptions": { ...
- "GroupsPerRow": 5,
A "Group" is a horizontally arranged set of the same item, in all 4 qualities that it is available in. So let's say your bag is displaying a Pufferfish. There would be 4 pufferfish slots next to each other, one for each quality (Regular/Silver/Gold/Iridium).
- "ShowValueColumn": true,
The "Value" column is just an extra column next to each group, that shows the summed value of all items in the group.
- "SlotSize": 64
The size, in pixels, of each slot in a group
- "UngroupedLayoutOptions": { ...
- "Columns": 12,
The number of columns to use when arranging items inside of the bag that are not being grouped by quality.
- "LineBreakIndices": [],
A line-break just forces the next item to be placed in the next row. Suppose your bag has 13 different items in it, and 12 columns. Obviously, after the 12th item, the first row is full so the 13th item slot would be in the 1st column of the 2nd row. LineBreakIndices just lets you force a linebreak before a row is full. For example, if I used "LineBreakIndices:" [ 0, 5 ], then the 1st item gets its own row. Items #2-#6 are on row #2, and the other items are on row #3. Note that the linebreak indices use "zero-based indexing". So a line break at index = 0 means there is a linebreak right AFTER the first item. Index = 5 then means there is another linebreak right AFTER the 6th item.
- "LineBreakHeights": [],
This is just extra vertical padding (in pixels) between 2 rows that have a forced linebreak between them. Usually this would just be 0 for each linebreak.
- "SlotSize": 64
The size, in pixels, of each slot in the ungrouped portion of the bag interface.
- "Items": [ ... ]
This list defines some basic data about each item that the bag should be capable of storing. Each entry in the list defines data that looks something like this:
"Name": "Absinthe",
"IsBigCraftable": false,
"HasQualities": true,
"RequiredSize": "Small"
},
- "Name": "Absinthe",
This is the name of the item that the bag should be capable of storing. It doesn't even have to be a modded item, it can be an item that belongs to the vanilla un-modded game, or even an item that belongs to another mod. If the name of the item is not unique, but it has a stable item Id, then you should instead fill in the ObjectId value.
- "IsBigCraftable": false,
BigCraftables are basically just items that can be placed onto a tile of the game world, such as Mayonnaise Machines, Furnaces, Crab Pots, Recycling Machines etc.
- "HasQualities": true,
Whether or not the item is obtainable in multiple different qualities (Regular/Silver/Gold/Iridium). This is typically for items like fish, fruits, and vegetables, but not items like resources, crafted items, seeds, artifacts etc.
- "RequiredSize": "Small"
This is the minimum size of the bag that is required in order to hold this item. If "RequiredSize"="Small", then all sizes of the bag can hold the item. If "RequiredSize"="Giant", then only Giant and Massive sizes can hold the item.
- "ObjectId":
OPTIONAL - only intended to be used by items with stable Ids that have ambiguous names, such as if you were trying to refer to the vanilla 'Large Egg' item, which could be Id=174 (White Egg) or Id=182 (Brown Egg). ObjectId is also useful when creating a bag that will work in multiple languages assuming the Id is unique.
You can also specify a value for the "ItemCategories" property to define a bag that can store any items belonging to specified category Ids (requires ItemBags v3.0.11 or later). This property expects a list of integers for each bag size. For example:
"ItemCategories": {
"Small": [-5],
"Medium": [-5],
"Large": [-5, -6],
"Giant": [-5, -6],
"Massive": [-5, -6]
}
This would allow storing all Eggs (category Id=-5) in small and medium bags, and all Eggs and Milks (cateogry Id=-6) in large, giant, and massive bags. (Category Ids can be found at: https://stardewvalleywiki.com/Modding:Items). If "Items" AND "ItemCategories" properties are defined, then the result set is unioned (it will include all items of the specified categories, and all items that were explicitly specified in the "Items" list)
EDIT: For even more control over the items the bag can store, you can use ItemFilters, described here
What items can I store inside modded bags?
You can store:
- Json Assets - Objects and BigCraftables
- Content Patcher - Objects and BigCraftables
- Vanilla game content - Objects and BigCraftables
Basically, MOST items are "Objects", and "BigCraftables" and a sub-classification of "Object". So you can store almost any stackable items that exist in the vanilla game, or that were added through Content Patcher or Json Assets. Items that you CANNOT store are generally things like: Equippables (Hats, Boots, Rings, Weapons, Clothing) and Tools.
Here is the full item hierarchy used in Stardew Valley:
........Boots
........Clothing
........Hat
........Ring
........SpecialItem
........Tool
................Axe
................Blueprints
................FishingRod
................GenericTool
................Hoe
................Lantern
................MagnifyingGlass
................MeleeWeapon
................MilkPail
................Pan
................Pickaxe
................Raft
................Shears
................Slingshot
................Stackable
........................Seeds
................Sword
................Wand
................WateringCan
........Object
................BreakableContainer
................Cask
................Chest
................ColoredObject
................CrabPot
................Furniture
........................StorageFurniture
........................TV
................IndoorPot
................MiniJukebox
................Sign
................SwitchFloor
................Wallpaper
................WoodChipper
................Workbench
From the above list, any Item classified as "Object" (but not sub-types of Object (with the exception of ColoredObject)) can be stored inside modded bags. All you need is the name of the item, whether or not it's a "BigCraftable" (objects that can be placed on a tile of the game world, typically these are just machines like Furnaces, Recycling Machines, Cheese Makers etc, or other place-able objects like Scarecrows or Sprinklers), whether or not the item is obtainable in multiple different qualities (Regular/Silver/Gold/Iridium), and the size of the bag that you want to be required to store the item.
Sharing modded bags
User-created modded bags can be found here
39 comments
I have looked at the Pokemon Ranch manifest.json and determined that this information designates the modID as bees.pkr.
"Name": "Pokemon Ranch",
"Author": "plaidbees",
"Version": "1.7",
"Description": "Adds Pokemon as new farm animals.",
"UniqueID": "bees.pkr",
Using the console command line as described in the article, I came up with
generate_modded_bag "PokeRanch Bag" bees.pkr
However, when I put that into SMAPI, I get this output
generate_modded_bag "PokeRanch Bag" bees.pkr
[Item Bags] ItemBags: Unhandled error while executing command: Object reference not set to an instance of an object.
I've created/modified so many new bags for my mods and this is my first time encountering this. Any ideas?
On a side note: is there a way to "disable" a default bag in the same way as shown in the modded bag options above, but it does not seem to actually work like that. Would I just need to remove those bags from the bagconfig.json (keeping an intact copy elsewhere, obviously)? Or is there a better way?
As for the default bags, no there isn't a way to enable/disable them. You'll have to edit the .json file and remove all relevant json data for whichever bags you don't want. Be very careful when doing so since if you have any save files which own any of the default bags you remove from bagconfig.json, then you could experience major errors (and possibly even be unable to load any save files). Make lots of backups.
I downloaded your update beta, ran the command again and got this:
generate_modded_bag "PR Test Bag" bees.pkr
[Item Bags] Failed to retrieve item metadata for bees.pkr_minccinoeg. ItemRegistry.ResolveMetadata("bees.pkr_minccinoeg") returned null. If this is a valid item, it will be skipped for processing. *[ERROR FOUND INSIDE THE MOD'S minccinodata.json FILE]*
[Item Bags] Failed to retrieve item metadata for bees.pkr_minkdrinktm. ItemRegistry.ResolveMetadata("bees.pkr_minkdrinktm") returned null. If this is a valid item, it will be skipped for processing. *[ERROR FOUND INSIDE THE MOD'S miltankdata.json FILE]*
[Item Bags] Failed to retrieve item metadata for bees.pkr_lunatonesmayo. ItemRegistry.ResolveMetadata("bees.pkr_lunatonesmayo") returned null. If this is a valid item, it will be skipped for processing. *[ERROR FOUND INSIDE THE MOD'S sunmoondata.json FILE]*
[Item Bags] Failed to retrieve item metadata for bees.pkr_gummi. ItemRegistry.ResolveMetadata("bees.pkr_gummi") returned null. If this is a valid item, it will be skipped for processing. *[UNABLE RESOLVE where this problem lies, but I have a suspicion that it's not actually an item. Each gummi is listed like "bees.pkr_[ColorNameHere]gummi."]*
[Item Bags] File exported to: F:\SteamLibrary\steamapps\common\Stardew Valley\Mods\ItemBags\assets\Modded Bags\bees.pkr.json
You will need to re-launch the game for this file to be loaded.
I'm putting together a message to the mod's author to inform him/her of the typos that I was able to locate. I, also, plan to ask the author the correct syntax for pulling ALL gummi data at once vs having to put it together manually. If you have any insight for this unsolved issue, I'd love to hear it!
Thank you again!
As for the gummi issue, it's probably a typo with the goldgummi in assorted/miscdata.json:
"{{ModId}}_goldgummi": {
"Name": "{{ModId}}_gummi",
"DisplayName": "{{i18n: goldgummi}}",
"Description": "{{i18n: goldgummi.d}}",
"Texture": "assorted/gummis",
"SpriteIndex": 16,
"Type": "Basic",
"Category": -17,
"Edibility": 15,
"Price": 500,
"ExcludeFromShippingCollection": "{{Treasure Box Items}}",
"ContextTags": [
"color_gold"
]
},
[Item Bags] Loading Modded Bags type info
[Item Bags] Failed to import modded bags. Error: Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
at ItemBags.Persistence.ModdedBag.<>c__DisplayClass55_1.<OnJsonAssetsIdsFixed>b__1(ModdedItem x) in C:\Programming\Source\Personal\SDV\Public\ItemBags\ItemBags\Persistence\ModdedItems.cs:line 281
at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
at ItemBags.Persistence.ModdedBag.OnJsonAssetsIdsFixed(IJsonAssetsAPI API, BagConfig Target, Boolean RevalidateInstances) in C:\Programming\Source\Personal\SDV\Public\ItemBags\ItemBags\Persistence\ModdedItems.cs:line 281
Full SMAPI log here: https://smapi.io/log/47f7f27ed6a5415ab4317adcc04217e8
**EDIT** If its any help, it only seems to be affecting the bags with affinity to specific mods. My single modded bag that does not use a source mod (by way of item names not IDs) works perfectly. Every other modded bag that uses a source mod to search for the items included don't load properly.
You'll probably have to try disabling your modded bags and then slowly re-enabling them one-by-one to figure out which one is causing it to fail and narrow down the problem.
I essentially ended up grabbing all of the bags out and dropping them into a folder on my desktop. I put one bag back at a time and loaded the game. If it went fine, I added another, then another, etc. until I located the particular bag causing the trouble.
It was indeed the Pokémon Ranch bag. I opened the .json to see where the issue might be, and as much as I hate to admit it, I spent an exorbitant amount of time looking for the issue, only to find there was an extra comma where it shouldn't have been.
Here we are FIFTEEN (15) hours later and everything is working beautifully. Only making minor adjustments to the visual layout of the bags now.
Thank you so very much for all of your help!
I'm trying to make myself a seed bag with all the vanilla and modded seeds I use. Sorting them by Season/Harvest-Type/etc. and while the Line Break makes for an easy way to spot the cut between categories it also enlarges the bag significantly.
I have been putting them in by hand (copy, pasting, and adjusting) from the instructions on this page.
Is that how it is supposed to work?
Unfortunately, the game doesn't have a clean way of getting all items belonging to a particular mod, so I had to try to guess items from a mod by looking for ones whose Id began with the mod's UniqueId (since it's a somewhat common naming convention to use your mod's id as a prefix to an item's id). For example, Ridgeside Village (Mod id = "Rafseazz.RSVCP") has items such as "Rafseazz.RSVCP_Autumn_Drop_Berry", "Rafseazz.RSVCP_Bladetail_Sturgeon", "Rafseazz.RSVCP_Caped_Tree_Frog". If a mod doesn't follow that naming convention, it's unable to find the item when generating the bag, so the item would have to be added to the bag json file manually.
However, I was wondering if there is a way, on our end, to make a Museum counter bag, like how the Bundle bag functions? That way we can keep track of which items have and haven't been donated to the museum at a glance? :)
I made some modded bags, but now I'm wondering is it possible to make a Gifts bag similair to the Community Center Bundle bag where you can have liked and loved gifts for each NPC. You can store 2 - 33 (week to year's worth of gifts and a birthday gift) and also prioritise higher quality items. This also means there has to be multiple instances of storing the same item.
Not looking forward to making 31+ individual gift bags.
Thanks!