Shops
A shop mod changes the game's shops: Nook's store, the flower shop, the visiting sellers and the shops that sell a service. Every shop takes the same block: your goods, prices, opening, and when it all applies. The writer path starts you with a kit.
One file, every shop #
Every shop of a mod goes in one file, shops.json. Its mod.json names it as content.shops. A shop changes the town for visitors, so the mod must be a World mod
("scope": "world").
shopsis an object. Each key is a shop's id from the shop table, like"nook"or"flower". A key that is not a shop id is refused, and the message suggests the id you meant.- A shop's value is one block, or a list of 1 to 8 blocks. See several blocks.
- A mod changes a shop with one key, so a shop can never be listed twice.
The shop kit's mod.json:
{
"schema": 1,
"api": 1,
"id": "yourname.my-shop",
"name": "My Shop",
"version": "1.0.0",
"authors": ["yourname"],
"description": "The flower shop with my own name, lines and goods from 9:00 to 21:00, and two goods of my own at Nook's.",
"scope": "world",
"content": {
"shops": "shops.json"
},
"assets_original": true
}
And its shops.json, which changes the flower shop and adds two goods at Nook's:
{
"shops": {
"flower": {
"when": { "hours": { "from": "09:00", "to": "21:00" } },
"own_goods": false,
"goods": [
{ "item": "0x2900", "price": 500 },
{ "item": "0x2908", "price": 300 },
{ "item": "0x2905", "price": 300 },
{ "item": "0x2902" }
],
"name": "My Shop",
"lines": {
"greeting": "Hello and welcome! Have a look around.",
"stock": "Saplings and seeds today. Point at one and I'll tell you the price."
}
},
"nook": {
"goods": [
{ "item": "0x1110", "price": 1800 },
{ "item": "0x2205", "price": 900 }
]
}
}
}
The block #
A block holds any of "when", "open", "own_goods", "goods", "price_percent", "buy_back_percent", "services", "name" and "lines", and at least one of them besides when.
Each field means the same on every shop.
| Field | Who has it | Rule |
|---|---|---|
when | every shop | When the block applies. Leave it out for always. See when. |
open | Nook's store, the flower shop and the barber shop | true: the shop is open while the block applies, also when its own hours have it shut. false: it is shut while the block applies. Leave it out for the shop's own hours. |
own_goods | Nook's store, the flower shop, Crazy Redd's tent, Saharah and the fireworks stall | true, the default: your goods join the shop's own, in at most half the spots of their kind, rounded up. false: the shop sells only the goods of the blocks that apply, and every spot of a kind they do not list is bare. The game's own event days still show: see event days. |
goods | Nook's store, the flower shop, Crazy Redd's tent, Saharah and the fireworks stall | 1 to the shop's goods limit in the table. Each good is { "item", "price", "when" }, with price and when optional. No item twice in a block. |
item | in goods | The item number as a string: "0x" and 4 hex digits, such as "0x2900". At Nook's and the flower shop it can also be one of your own mod items by its full id. |
price | in goods | A whole number of Bells, 1 to 99999. Leave it out for the shop's own price. See prices. |
when | in goods | Narrows one good further: it shows while its block's when and its own both hold. |
price_percent | Nook's store, the flower shop, Crazy Redd's tent, Saharah and the fireworks stall | 1 to 1000. The shop asks this percent of its own price for every good with no price of its own. 100 is the game's price. At Nook's, grab bags and Halloween candy keep the game's price. |
buy_back_percent | Nook's store | 1 to 1000. Nook pays this percent of what he would pay for what the player sells, never more than he asks for the item at that moment. Not turnips. |
services | Able Sisters, the barber shop, the Dream Suite and Katrina's tent | A service's price in Bells, 1 to 99999, by the service's name in the table. A name the shop does not have is refused. |
name | the flower shop | 1 to 40 characters on one line. The flower shop shows it on the sign by the door while it is shut. |
lines | the flower shop | What the keeper says, by slot. A slot is one line, or a list of 1 to 8 lines, and the keeper picks one each time. Each line is 1 to 160 characters, at most 3 line breaks. A slot the shop does not have is refused. |
A field a shop does not have, such as name at Nook's, is not refused. The game leaves that field out and
applies the rest of the block, and your mod's row in the Mods tab names the shop and the field
(shop-field-ignored).
Reference: shops.json, with every field, limit and error code.
When a block applies #
A when holds any of "hours", "time", "season", "weather", "weekday", "month" and "setting". The block applies while every key in it
holds. Leave when out and the block always applies.
| Key | Holds |
|---|---|
hours | { "from": "HH:MM", "to": "HH:MM" } on the 24 hour clock, two digits each: write "09:00", not "9:00". From the first time up to the second. They must differ. to may be past midnight, such as 23:00 to 03:00. |
time | "morning" 5 to 12, "day" 12 to 17, "evening" 17 to midnight, "night" midnight to 5. |
season | "spring" March to May, "summer" June to August, "fall" September to November, "winter" December to February. |
weather | "clear", "rain" or "snow". Cherry blossom and falling leaves count as clear. |
weekday | A list of days, "monday" to "sunday", each once. |
month | A list of months, 1 (January) to 12, each once. |
setting | The name of one of your mod's settings of type bool with scope world. Holds while it is on. |
When a change shows #
- A block with a
whenapplies at once. The moment itswhenholds, the shop has the block's goods, prices and opening. Walk in and they are there. That holds at Nook's and at every other shop. At Nook's the game's event days stay as they are: see event days. - At Nook's, the goods of a block with no
whenshow from the next restock. Awhenon any one of its goods counts as awhen. Nook sets out each day's goods the first time the town is played on that day at or after 6:00 AM, and the block's goods and itsown_goodsgo into that day's stock. A mod installed at noon shows its goods the next morning. - Everything else applies at once, with or without a
when: every other shop, and Nook'sopen,price_percentandbuy_back_percent.
What each shop has #
The shop table is read from the game. Each shop takes the fields in its row. Nook's store, the flower shop, Crazy Redd's tent, Saharah and the fireworks stall sell goods. Able Sisters, the barber shop, the Dream Suite and Katrina's tent sell a service. Only the flower shop take lines.
| Shop id | Fields it has | Goods in a block | Services, line slots | Spots | open |
|---|---|---|---|---|---|
"nook", Nook's store | when, open, own_goods, goods, price_percent, buy_back_percent | 1 to 16 | none | Spots by kind (furniture, stationery, clothing, carpets, wallpaper, tools, umbrellas, paint, saplings, flower bags), more in a bigger store. A new set of goods is picked each day when a block lists more than the spots. | open: true opens it when it is shut for the night, but not before its morning opening, on a renovation day or in a sale's hours. open: false shuts it. |
"flower", the flower shop | when, open, own_goods, goods, price_percent, name, lines | 1 to 6 | greeting, stock | Six spots on the benches, one kind. | open: true opens it when the clock has it shut (2 AM to 7 AM), but not while its keeper is out on her Sunday round. open: false shuts it, with its name on the door sign. |
"redd", Crazy Redd's tent | when, own_goods, goods, price_percent | 1 to 6 | none | Three furniture spots, set out each time the tent is entered while he is in town. | No open: it keeps its own hours. |
"saharah", Saharah | when, own_goods, goods, price_percent | 1 to 6 | none | One carpet, the one she offers for yours when the player talks to her. price_percent is her fee. | No open: it keeps its own hours. |
"fireworks", the fireworks stall | when, own_goods, goods, price_percent | 1 to 6 | none | Its goods for the night: fans, pinwheels and balloons, set out when the stall is set up. | No open: it keeps its own hours. |
"able", Able Sisters | when, services | none | design | No goods. Mabel sells one service, a design. | No open: it keeps its own hours. |
"barber", the barber shop | when, open, services | none | haircut | No goods. Monique sells one service, a haircut. | open: true opens it when the clock has it shut (2 AM to 7 AM). open: false shuts it. |
"dream", the Dream Suite | when, services | none | dream | No goods. Katrina sells one service, a dream visit. The suite keeps no hours, so it has no open. | No open: it keeps its own hours. |
"katrina", Katrina's tent | when, services | none | fortune | No goods. Katrina sells one service, a fortune, on the nights she visits. | No open: it keeps its own hours. |
Examples #
The flower shop as a tea stall #
From 6 PM to 4 AM the flower shop is a tea stall: its own name, its own words, and only fruit. open keeps it open after its own 2 AM closing. Outside those hours it is the game's flower shop.
{
"shops": {
"flower": {
"when": { "hours": { "from": "18:00", "to": "04:00" } },
"open": true,
"own_goods": false,
"goods": [
{ "item": "0x2800", "price": 600 },
{ "item": "0x2801", "price": 600 },
{ "item": "0x2807", "price": 800 }
],
"name": "Tea Stall",
"lines": {
"greeting": ["Welcome to the tea stall!", "Tea's hot. The fruit is fresh."],
"stock": "Fruit for your tea, picked this morning."
}
}
}
}The greeting is a list, so the keeper says one of the two each time you walk in.
Goods of your own at Nook's #
This block has no when, so it applies every day, and it keeps Nook's own goods:
{
"shops": {
"nook": {
"goods": [
{ "item": "0x1110", "price": 1800 },
{ "item": "0x1108", "price": 2400 },
{ "item": "0x1330" },
{ "item": "0x2205", "price": 900 },
{ "item": "0x2206", "price": 900 },
{ "item": "0x2410", "price": 700 },
{ "item": "0x2605", "price": 1500 }
]
}
}
}- That adds seven goods: three pieces of furniture, two umbrellas, a shirt and a carpet. Each stands where Nook's own goods of its kind stand. Fruit and the signboard have no spot.
- There is one umbrella spot, so the date picks which umbrella shows. A good with no
pricesells at the usual price. - A good can be one of your own mod items by its full id, like
your.mod:ghost-lantern. It stands in a furniture spot and keeps its name when bought. - This block has no
when, so its goods show from the next restock: the first time the town is played on a day at or after 6:00 AM. A mod installed at noon shows the next morning. See when a change shows.
After Hours: gyroids at night #
Nook's opens from 1 AM to 3 AM and sells only gyroids. open opens the shut store, and "own_goods": false leaves every spot of a kind you do not list bare:
{
"shops": {
"nook": {
"when": { "hours": { "from": "01:00", "to": "03:00" } },
"open": true,
"own_goods": false,
"goods": [
{ "item": "0x1768" },
{ "item": "0x1738" },
{ "item": "0x16E4" },
{ "item": "0x1780" },
{ "item": "0x15BC" },
{ "item": "0x15E0" }
]
}
}
}- With more goods of a kind than spots, the date and the town pick which show, so a different few stand each night.
- The store does not open in the hour before its morning opening, on a renovation day or in a sale's hours.
- A block with
whenapplies at once, inside its hours, with no restock. It never touches the day's own stock. When the hours end, the day's goods are back as they were, sold ones included. Withown_goodsleft attrue, a good of the day's own bought inside your hours stays sold. - Your goods bought inside the hours are sold out until the game restarts. A restart sets them out again.
- On the game's event days the event stays: grab bags stand beside the gyroids, and when the shelves are a raffle day's, the raffle takes the shop. See event days.
The After Hours example in the cookbook is this shop, with its own Ghost Lantern among the gyroids now and then.
Several blocks on one shop #
A list of blocks changes one shop in several ways at once. Here the flower shop always adds a sapling. On a rainy day it adds tulip seeds and says so. On winter evenings its own goods are 20 percent off.
{
"shops": {
"flower": [
{
"goods": [{ "item": "0x2900", "price": 500 }]
},
{
"when": { "weather": "rain" },
"goods": [{ "item": "0x2908", "price": 300 }],
"lines": { "greeting": "Rainy day! The tulip seeds love it." }
},
{
"when": { "season": "winter", "time": "evening" },
"price_percent": 80
}
]
}
}Able Sisters: the price of a design #
At the weekend a design costs 200 Bells at Able Sisters:
{
"shops": {
"able": {
"when": { "weekday": ["saturday", "sunday"] },
"services": { "design": 200 }
}
}
}Crazy Redd #
Redd adds a kadomatsu at a price of your own, and asks half again his own price for everything else:
{
"shops": {
"redd": {
"goods": [
{ "item": "0x1108", "price": 9800 },
{ "item": "0x1330" }
],
"price_percent": 150
}
}
}Saharah #
Saharah offers one of your carpets for yours, and price_percent halves her fee. With "own_goods": false she offers only your carpets.
{
"shops": {
"saharah": {
"own_goods": false,
"goods": [{ "item": "0x2606" }, { "item": "0x2607" }],
"price_percent": 50
}
}
}The Pampered Paw's hours #
Monique's salon, the Pampered Paw (its shop key is barber, its new look the haircut service) is
shut on Mondays. From 2 AM to 4 AM it is open for a late new look, Mondays too: when both blocks apply, the last
one decides open.
{
"shops": {
"barber": [
{
"when": { "weekday": ["monday"] },
"open": false
},
{
"when": { "hours": { "from": "02:00", "to": "04:00" } },
"open": true,
"services": { "haircut": 3000 }
}
]
}
}Several blocks and several mods #
- Inside one mod, every block of a shop whose
whenholds applies, together. - Their goods are sold together. A good in two of them takes the later block's price.
- For a single value,
open,own_goods, a percent, a service's price or a line slot, the last applying block that sets it counts. - The
nameis the last applying block's, or else the name of the last block that has one.
From a script #
A script can change a shop for the rest of the game day. cmd.set_shop_goods(shop, goods) sets its goods
and cmd.set_shop_open(shop, true) opens it (false shuts it). Each adds one more block after
your shops.json blocks for that shop, from the next frame until the day changes or the game restarts.
So set it again in day_started. nil clears it.
- They need the permissions
set_shop_goodsandset_shop_open, and a World mod. set_shop_goodstakes a list of{ item, price }, or{ goods = <list>, own_goods = false }to make them the whole stock.- They are refused when the shop is not in the table, does not have goods or
open, or a mod later in the load order changes it. - The cookbook has a Saturday market recipe.
Nook's spots by store size #
These are the spots Nook fills each morning on an ordinary day, by kind. Your goods keeping his own take up to the
number in brackets. With "own_goods": false they take them all, and the kinds you do not list stay bare.
| Kind | Nook's Cranny | Nook 'n' Go | Nookway | Nookington's |
|---|---|---|---|---|
| Furniture | 1 (1) | 2 (1) | 3 (2) | 5 (3) |
| Stationery (diaries too) | 1 (1) | 2 (1) | 3 (2) | 5 (3) |
| Clothing | 1 (1) | 2 (1) | 3 (2) | 5 (3) |
| Carpets | 1 (1) | 1 (1) | 2 (1) | 3 (2) |
| Wallpaper | 1 (1) | 1 (1) | 2 (1) | 3 (2) |
| Tools | up to 2 (1) | 3 (2) | 2 (1) | 3 (2) |
| Umbrellas | 1 (1) | 1 (1) | 1 (1) | 1 (1) |
| Paint | none | none | 1 (1) | 1 (1) |
| Saplings | 1 (1) | 1 (1) | 2 (1) | 3 (2) |
| Flower bags | 2 (1) | 3 (2) | 4 (2) | 5 (3) |
- Nook's Cranny sells fewer tools until the town has spent enough there.
- The rare furniture piece that Nookway and Nookington's show has its own spot. A mod never takes it. With
"own_goods": falseit stays bare, and so do the plants. - Some days have fewer spots. A grab bag sale has no stationery, tools, saplings or flower bags. The raffle has no goods. Halloween has candy instead of most flower bags, and no saplings.
Event days at Nook's #
A mod never changes what kind of day it is at Nook's. The game's events stay, inside your hours too:
- The grab bag sale (the day after the fourth Thursday of November): the grab bags fill the spots of the kinds the day has none of. Your goods take the spots the day has, so stationery, tools, saplings and flower bags of yours do not show that day.
- Halloween (October 16 to 30): the candy fills the flower spots.
- The raffle (the last day of each month): the raffle takes the whole shop, also with
"own_goods": false. Your goods show again the next day. - With
"own_goods": falseyour goods are still the whole stock on those days, with the grab bags or the candy beside them. - The kind of day follows the shelves, not the clock. A shop your mod opens after midnight still has the day before's shelves, and is the day before's kind of day, until Nook restocks at 6 AM.
- The flower shop has six spots, all of one kind, so your goods keeping its own take up to three of them.
Items you can stock #
- Money, turnips, tickets, grab bags and fossils are refused in every shop.
- At the flower shop, an item must be one a shop table can show, so special items cannot be stocked there either.
- The game's own furniture cannot be stocked at the flower shop, because no piece of it has a shop table model. To sell the game's furniture, stock Nook's instead.
- Your own mod items can be stocked at Nook's and the flower shop only.
- The game leaves out an item it cannot sell. Your mod's row in the Mods tab names the item and the reason, for example "has no shop shelf model". The rest of the shop still loads.
The flower shop sells these items itself, so they always work there:
| Item | Number |
|---|---|
| Apple | "0x2800" |
| Cherry | "0x2801" |
| Pear | "0x2802" |
| Peach | "0x2803" |
| Orange | "0x2804" |
| Coconut | "0x2807" |
| Sapling | "0x2900" |
| Cedar sapling | "0x2901" |
| White pansy seeds | "0x2902" |
| Purple pansy seeds | "0x2903" |
| Yellow pansy seeds | "0x2904" |
| White cosmos seeds | "0x2905" |
| Pink cosmos seeds | "0x2906" |
| Blue cosmos seeds | "0x2907" |
| Red tulip seeds | "0x2908" |
| White tulip seeds | "0x2909" |
| Yellow tulip seeds | "0x290A" |
The item list has every other item. It gives each item's name and
usual price, and says whether the flower shop or Nook's can stock it. The flower shop can stock
831 goods and Nook's 1996. Filter the list by name. playac-mod check warns
about a good the game would leave out and about a price under the floor.
All 2,333 items
0x107C Price1,300 Bells Nook's 0x1080 Price2,250 Bells Nook's 0x1084 Price1,400 Bells Nook's 0x108C Price800 Bells Nook's 0x1090 Price1,000 Bells Nook's 0x1094 Price1,200 Bells Nook's 0x1098 Price1,650 Bells Nook's 0x109C Price540 Bells Nook's 0x10A0 Price850 Bells Nook's 0x10B0 Price1,400 Bells Nook's 0x10B4 Price1,400 Bells Nook's 0x10C0 Price1,200 Bells Nook's 0x10CC Price1,600 Bells Nook's 0x10D0 Price1,600 Bells Nook's 0x10D4 Price1,600 Bells Nook's Prices #
- Leave a good's
priceout and it sells at the shop's own price, or atprice_percentof it while a block with one applies. - Each good has a floor: the lowest price it can sell for. The floor is what Nook pays for the good, a quarter of its usual price. The game raises a lower
price, or a lowerprice_percent, to the floor, so a shop can never be used to make free Bells. items.json gives each good's floor at Nook's and the flower shop. - The town fruits are apple, cherry, pear, peach and orange. Their floor is what Nook pays for fruit from another town, 500 Bells. This holds even for your town's own fruit, which Nook buys for 100.
- A coconut is not a town fruit. Its floor is its own buy-back price, 150 Bells.
- At Nook's,
priceis what he asks for the good on the shop floor. Catalog orders stay at the usual price. buy_back_percentnever makes Nook pay more for an item than he asks for it at that moment.
Two shop mods #
Each shop is decided on its own. If two switched-on mods both change the same shop, the mod lower in the Mods tab list has the whole of that shop. Nothing of the other mod's blocks for it is mixed in. One mod can have the flower shop while another has Nook's.
- A shop's lines are written for its own goods, so the winner has all its blocks for that shop. The two mods' goods are not added together, even when both keep the shop's own.
- The other mod's row in the Mods tab says its change to that shop is not used and names the mod that has it.
- A script's
villager_talkedline goes the other way: the first mod in the list that returns one speaks. See load order.
Visitors and The City #
- Friends who visit your town see your shops.
- A mod with a shop always counts for visits. The rule is in Multiplayer.
- In The City, a World mod's shops switch off. The City's shops are always the game's own.