New items in mods
A mod can add furniture of its own for the house. Each item has its own id, name and price. It uses the model of a
real piece of furniture, called its base. Players buy it at your flower shop or at Nook's. Your script can
also give it with cmd.give_item.
The items file #
Name the file in mod.json:
{
"schema": 1,
"api": 1,
"id": "example.after-hours",
"name": "After Hours",
"version": "1.0.0",
"authors": [
"Play AC Online"
],
"description": "From 1 AM to 3 AM the town shop opens again, and all it sells is gyroids. A different few stand on the floor each night, and among them, now and then, a Ghost Lantern of the mod's own, its windows glowing green. Every other spot is empty. The rest of the day the shop is its usual self. Remove the mod and a Ghost Lantern you bought stays in your house as the plain tall lantern it is built on.",
"scope": "world",
"content": {
"items": "items.json",
"shops": "shops.json"
},
"assets_original": true
}
{
"items": [
{ "id": "ghost-lantern", "name": "Ghost Lantern", "base": "0x122C", "price": 2600, "textures": "items/ghost-lantern/" }
]
}
idis 1 to 32 characters from a-z, 0-9 and-. The item's full id is your mod id, a colon, then this id, as inexample.after-hours:ghost-lantern. Never change it once players have the item. Userenamesinstead.nameis 1 to 16 characters, the size of the game's item name box. It may use letters, digits, spaces and' . , ! & -. It starts with a letter or digit.baseis the furniture whose model the item uses. Write"0x"and 4 hex digits for the piece facing south. That is 0x1000 to 0x1FFC or 0x3000 to 0x33C4, in multiples of 4.- Some furniture cannot be a base. See Which furniture can be a base.
priceis optional, 1 to 99999 Bells. A shop asks this price when its stock sets none.texturesis optional: a folder of the item's own pictures. See Its own look.- A mod holds at most 64 items. An item takes no other key.
Reference: items.json, with every field, limit and error code.
Which furniture can be a base #
598 of the game's 1266 pieces of furniture can be a base. The game refuses the others, and the Mods tab names the piece and the reason:
| Reason | Pieces | Which |
|---|---|---|
| "is clothing" | 255 | Clothing, such as flame shirt, paw shirt, wavy pink shirt, future shirt |
| "turns into a pocket item" | 160 | Bugs, Fish, Umbrellas, Furniture, such as common butterfly, crucian carp, gelato umbrella, red balloon |
| "is a gyroid" | 127 | Gyroids, such as tall gongoid, mega gongoid, mini gongoid, gongoid |
| "has no model" | 84 | Furniture, such as dresser, tansu, sewing box, paper lantern |
| "is a fossil" | 25 | Fossils, such as tricera skull, tricera tail, tricera torso, T-rex skull |
| "takes a design" | 17 | Furniture, such as my mannequin 1, my mannequin 2, my mannequin 3, my mannequin 4 |
A piece "turns into a pocket item" when a player picks it up as an item rather than as furniture: umbrellas, fish, bugs, tools, balloons, fans, pinwheels and diaries. A piece that "takes a design" shows a player's own design.
The pieces that can be a base, with the model viewer a click away to see each one's textures:
598 of 2,333 items
Its own look #
Without textures an item looks exactly like its base. With it, the item draws pictures of its own on the
base's model. Every other copy of the base keeps its look. A texture mod is different: its pictures change a texture
everywhere it is drawn.
{ "id": "ghost-lantern", "name": "Ghost Lantern", "base": "0x122C", "textures": "items/ghost-lantern/" }- The folder holds 1 to 16
.pngor.ddsfiles. Subfolders count. - Each file is named after a texture of the base, the way a texture mod names its files:
tex1_16x32_0d673c8f9b3a70fb_$_8.png. The textures guide explains the parts. The model viewer lists the base piece's textures under these names. - A picture whose name the base never draws does nothing. A texture of the base with no picture keeps its own look.
- The folder may not be inside
content.texturesor hold it. There the pictures would be read as a texture mod and change every copy of the base. - The pictures count toward the same limits as a texture mod's: their decoded pixels and DDS bytes, and a PNG side of at most 2048. They are checked when you upload, and the reviewer sees them, like any picture in a mod.
- Draw the pictures yourself. A recolour of the game's own texture is not your work. The upload refuses an unchanged copy of a game texture and shows the reviewer a close one.
The item draws its own pictures in a house room and on Nook's floor. On Nook's floor every piece of that base is his good, so it shows the item's look. On the flower shop's bench, in the pockets and in the catalog an item is a leaf, as any furniture is. A piece outside, or the plain base piece a player keeps without your mod, has the base's look. A visitor sees your item's look when they have your mod too. A World mod always matches on a visit, so its items look the same for both players.
Sell it #
The flower shop stocks your item by its full id. So can Nook's, in a furniture spot. Two goods of one shop may not use the same base. Only your own items go on the flower shop's bench this way. The game's own furniture has no shop table model, so the flower shop leaves it out. Nook's sells it.
{
"shops": {
"nook": {
"when": { "hours": { "from": "01:00", "to": "03:00" } },
"open": true,
"own_goods": false,
"goods": [
{ "item": "example.after-hours:ghost-lantern" },
{ "item": "0x1768" },
{ "item": "0x1738" },
{ "item": "0x16E4" },
{ "item": "0x1780" },
{ "item": "0x15BC" },
{ "item": "0x15E0" },
{ "item": "0x16C0" },
{ "item": "0x16CC" },
{ "item": "0x16FC" },
{ "item": "0x16F0" },
{ "item": "0x16B0" },
{ "item": "0x1728" },
{ "item": "0x1744" },
{ "item": "0x1774" },
{ "item": "0x1798" }
]
}
}
}
On the shop's bench the item is a furniture leaf, as furniture off its spot always is. Joan calls it by your item's name. A shop changes
what visitors see, so the mod must be a World mod ("scope": "world").
How it is kept #
- In the save, your item is its base piece, which is a real piece of the game. The save stays a plain game save that any tool and any visitor can read.
- The record of which pieces are your items is kept beside the save. It travels with the cloud save.
- With your mod, the item has its own name in the pockets and at the shop.
- Without your mod, the player keeps the plain base piece. Nothing is deleted. When your mod comes back, the item has its name again.
- A visitor without your mod sees the plain base piece. The City has no mod items.
A player can carry your item to The City or to a friend's town and back. Away from home it shows as its base piece. It has its name again when the player comes home, in whatever pocket it ended up in. An item sold, given away or put down while away is the plain base piece from then on. A piece bought away from home is never your item.
Reference: mod-items.json (the game's), with what it records and where it goes.
Renaming an item #
To rename an item in a new version, map the old full id to the new one. Players' pieces move over once per save.
"renames": { "yourname.night-shop:lantern": "yourname.night-shop:ghost-lantern" }Both ids must start with this mod's id. The new id must be an item in this mod's items file. A mod cannot rename another mod's items.