Mod API changelog
This page lists what each version of the mod API holds. The "api" number in your mod.json says which level the mod was made for. The game runs level 1, at version 1.1.
How the API changes #
- A new field in a table the game hands a script, or a new value it can return, cannot break an old mod, so it changes nothing here.
- A new command, event, query or limit is a minor version of the level, such as 1.1. Nothing is removed or changed, so a mod keeps saying
"api": 1and works on the game it was made for and every later one. A playac-mod older than the version that added a name does not know it, and says the tool may be out of date. - Only a change that would refuse or change an existing mod is a new level. Mods made for the old level keep running by its rules while the game still supports it.
- A level is read for at least 12 months after the next level ships.
- Before a feature is removed, it is marked deprecated for at least two more levels and at least 90 days, whichever is later.
- A new level listed here will say how to move a mod up to it.
Version 1.1 #
26 November 2026. Additions, nothing removed or changed: a mod made for 1.0 works unchanged and keeps saying "api": 1. Commands cmd.save, cmd.set_weather and cmd.play_sound are applied at the end of a frame's update; cmd.set_hat, cmd.set_shirt and cmd.react are set at the call. The events button_pressed, button_released and player_acted. The queries game.input(), game.weather() and game.place(), and game.player() now also tells where the player stands and what they are doing. A playac-mod older than 1.1.0 does not know these names and says the tool may be out of date.
Version 1.1 adds:
Lua
game.weather: The weather where the player is now: { kind, intensity }, or nil before a town is loaded. kind is clear, rain or snow, the words shops and talk pools use: cherry blossom petals and falling leaves count as clear. Indoors it is the weather outside, on the island it is the island's, and on a visit it is the weather of the town being visited. Reading it changes nothing and needs no permission.game.place: Where the player is now: { scene, name, island, acre, acre_x, acre_z, unit_x, unit_z }, or nil before a town is loaded. scene and name are the scene, as scene_entered gives them. The acre fields are there only outdoors in the town or on the island, standing in an acre the town map shows. It names the acre and the square inside it, one of the 16 by 16 squares of an acre, the way the town map does; game.player() gives the exact position. Both are only ever the player's own: a mod never sees where another player is. On a visit it is the place in the town being visited, the same town game.town() names. Reading it changes nothing and needs no permission.game.input: The player's game inputs right now: { a, b, x, y, z, l, r, start, dpad_up, dpad_down, dpad_left, dpad_right, c_up, c_down, c_left, c_right, stick_x, stick_y }. Each button is true while held. The player's game inputs are the controller the game itself reads, so a keyboard key, a controller button and the on-screen touch pad are all the same button here, with the player's own key and button settings applied. A mod never sees which key was typed: the keyboard reaches it only through the buttons it plays, and nothing reaches it while the game's text editor is open (writing a letter or a name, by keyboard or by controller). It is nil while the text editor is open. Use it for a stick or a combination, such as L held while A is pressed; use button_pressed for a single press. It reads the controller when it is called, which in a button event that waited for a busy frame is a frame or two after the press.
Commands
cmd.save: Asks the game to save the town, as the Autosave setting does, for a mod such as a save-anywhere button. The game writes the home save only where the player could save at Gyroid: outdoors in their own town, in free control, with no menu, talk or scene change. It writes a settled copy of the town and never changes the town being played, so nothing is lost or doubled however often it runs. command_finished says via saved, or via unchanged when nothing changed since the last save (nothing is written). It is refused with command-indoors inside a house, a shop or any place that is not the town outdoors, command-busy when the player is not in free control, command-dream in a dream, command-not-ready before a save is loaded or while the page is replacing the save, command-too-soon within commands.save_spacing_seconds of any mod's last save, and command-save-failed when the write itself fails. It is refused on a visit and in The City, because a visitor's game does not hold the town it stands in. It does not run what Gyroid's save does on top: a villager's mood and clothes reach the save at the next change of scene or Gyroid save.cmd.set_weather: Sets the town's weather for the rest of the game day: kind "clear", "rain" or "snow", and for rain or snow an intensity, "light" (when left out) or "heavy". Heavy rain is a storm, with lightning in June to August, and heavy snow is a blizzard. The game changes it as its own weather changes: the last drops or flakes fall, then the new weather fades in with its light and sound. Villagers, fish, bugs and the rain sound follow it as they follow any rainy or snowy day. The next game day the game rolls its own weather again, and a day after rain or snow can bring a rainbow and a gyroid, as after a real rainy day. A reload the same day keeps it. Only weather the game itself could roll on that date is allowed. Clear is always allowed. Rain is allowed from February 25 to November 15, and snow from November 1 to February 24, but neither on the days the game keeps clear: January 1 to 7, April 1 to 8 (the cherry blossoms), April 20, October 31 and December 31. On an event day the event's weather holds, and the player's first day of work for Nook stays dry. Those are refused with command-weather. command_finished says via set, or via unchanged when the town already has that weather as game.weather() reads it: cherry blossom petals and falling leaves count as clear, so on those days "clear" is unchanged and the petals or leaves stay, and putting back the weather a mod read changes nothing. While a change of weather is under way the command waits for it to end. It is refused on a visit and in The City, because the host's game decides the weather and a visitor sees the host's. Needs scope world.cmd.play_sound: Plays one of the game's own sound effects, by its name in sounds.json: a jingle, a menu tick, a page turn. Only this player hears it: in a visit the friend does not, and nothing reaches the town or the save. Every sound in the list is one the game plays once and stops on its own, never a sound that loops. A sound changes nothing, so it does not wait for the player to be free: it plays at the end of the next frame's update, in a talk or a menu too. command_finished says via played. At most commands.sounds_per_event in one event and commands.sounds_per_minute in any minute for each mod (command-event-cap, command-sound-cap). A name not in sounds.json is refused with command-args. While an NES game is being played the game's sound is the NES game's, and a sound is refused with command-no-sound. It is refused in The City.cmd.set_hat: Puts a picture from the mod's own files on the hat of the player playing this game, in place of the design or the shirt the hat wears. nil takes it off. It is set at the call, with no queue, no daily cap and no command_finished, and shows from the next frame. The picture is the path of a PNG inside the mod, like "hats/stripes.png": exactly 32 x 32 pixels, every pixel opaque, at most 16 colours, as an Able Sisters design. Keep it outside the mod's textures folder. A mod's hat beats a design on the hat. When two mods set one, the mod later in the load order wins. The hat is this player's own, by who they are and their home town, so a hat set at home stays on when they visit a friend or go to The City. Only this player's own screen draws it: friends on a visit and players in The City see the hat as the game would draw it. Nothing is saved: the hat is gone when the game restarts. A reload of the mod's script in developer mode keeps it. Keep the player's pick in store.player and set it again from scene_entered. Away from home store.player starts empty, so set the hat only when the store holds a pick: a nil there is no reason to take it off. It changes only how the player looks, so it works in a Just you mod, on a visit and in The City.cmd.set_shirt: Puts a picture from the mod's own files on the shirt of the player playing this game, in place of the clothes they wear. nil takes it off. It is set at the call, with no queue, no daily cap and no command_finished, and shows from the next frame. The picture is the path of a PNG inside the mod, like "shirts/stripes.png": exactly 32 x 32 pixels, every pixel opaque, at most 16 colours, as an Able Sisters design, and it wraps the body and the sleeves the way a design does. Keep it outside the mod's textures folder. It beats the clothes the player wears: putting on other clothes changes what is underneath, and the picture stays on top until the mod takes it off. The hat matches the shirt, as in the game, so with no design or mod hat on the hat it wears the picture too. When two mods set one, the mod later in the load order wins. The shirt is this player's own, by who they are and their home town, so a shirt set at home stays on when they visit a friend or go to The City. Only this player's own screen draws it: friends on a visit and players in The City see the clothes the player wears. Nothing is saved: the shirt is gone when the game restarts, and the save keeps the clothes the player wears. A reload of the mod's script in developer mode keeps it. Keep the player's pick in store.player and set it again from scene_entered. Away from home store.player starts empty, so set the shirt only when the store holds a pick: a nil there is no reason to take it off. It changes only how the player looks, so it works in a Just you mod, on a visit and in The City.cmd.react: Plays one of the reactions from the reactions bar on the player's own character: "hooray", "dance", "hug", "thanks", "ouch", "trip", "spin", "hide" or "pose". It is the same reaction the bar plays, so friends on a visit and players in The City see it as they see one from the bar. It is set at the call, with no queue, no daily cap and no command_finished: the game is asked there and then, and the reaction plays from the next frame for at most 1.5 seconds; any move from 0.3 seconds on walks out of it. Only from standing, walking or running, and only while the player is free: refused (command-busy) during a menu, a talk, a message, a door, a cutscene or a scene change, and refused (command-cannot-react) when the game says no, such as while sitting, swinging a tool or holding furniture. One reaction at a time: once one is taken the player is in it, so another call in the same moment, or in a player_acted handler (the player is in the action that just started), is refused with command-busy. React from a later moment, such as a timer. At most commands.reacts_per_minute a minute for each mod (command-minute-cap). It moves only the player's own body and changes nothing saved, so it works in a Just you mod, on a visit and in The City. When it plays, player_acted fires with reacted.
Events
button_pressed: A button on the player's controller was pressed. The player's game inputs are the controller the game itself reads, so a keyboard key, a controller button and the on-screen touch pad are all the same button here, with the player's own key and button settings applied. A mod never sees which key was typed: the keyboard reaches it only through the buttons it plays, and nothing reaches it while the game's text editor is open (writing a letter or a name, by keyboard or by controller). Events come once a frame, only while the player's own game is running: releases first, then presses, each in button order. A button already held when play starts, or held through a change of scene or the text editor, is not a press. The C stick is the four c_ buttons. To read the stick, or several buttons held at once, call game.input(). A handler runs at the frame it was sent in unless the frame is already busy, when it can run a frame or two later: game.input() then reads the controller as it is when the handler runs, so a combination is safest tracked from the events themselves.button_released: A button on the player's controller was let go. The player's game inputs are the controller the game itself reads, so a keyboard key, a controller button and the on-screen touch pad are all the same button here, with the player's own key and button settings applied. A mod never sees which key was typed: the keyboard reaches it only through the buttons it plays, and nothing reaches it while the game's text editor is open (writing a letter or a name, by keyboard or by controller). Events come once a frame, only while the player's own game is running: releases first, then presses, each in button order. A button already held when play starts, or held through a change of scene or the text editor, is not a press. The C stick is the four c_ buttons. To read the stick, or several buttons held at once, call game.input(). A handler runs at the frame it was sent in unless the frame is already busy, when it can run a frame or two later: game.input() then reads the controller as it is when the handler runs, so a combination is safest tracked from the events themselves.player_acted: The player started one of the actions below. Only these, never standing, walking or running: poll game.player().state for those. Only the player playing this game: a friend on a visit or another player in The City does not send it. It is the action starting, not its result: axe_swung fires for every swing, and the tree falls or not afterwards. It fires on a visit too, where the player acts in the host's town, and in The City. It changes nothing, so it needs no permission.
Limits
commands.sounds_per_event: play_sound calls one mod may make in one event. They count toward commands.per_event too.commands.sounds_per_minute: Sounds one mod may play in any 60 seconds of the player's real clock, the ones waiting to play included. A sound counts when the game plays it. One refused does not count. A sound has no daily limit.commands.weather_per_day: set_weather per mod per game day in each town. A change counts when the game changes the weather. One refused, or one that found the town already in that weather (via unchanged), does not count. The count is per town and shared by its residents, not per player. It is a safety limit, not a game rule: a sky that changes every few minutes is no weather.commands.saves_per_day: save per mod per game day in each town. A save counts when the game writes the town. One refused, or one that found nothing changed (via unchanged), does not count. The count is per town and shared by its residents, not per player. It is a safety limit, not a game rule: every save also uploads the town to the cloud.commands.save_spacing_seconds: The least time between two saves by mods, all mods together, on the player's real clock. A save asked for sooner is refused with command-too-soon. A refused save does not start the wait; one that found nothing changed does.commands.hat_side: The width and the height of a picture cmd.set_hat puts on the hat or cmd.set_shirt on the shirt. It must be exactly this size, the size of an Able Sisters design.commands.hat_colors: The most colours a hat or shirt picture may have, as a design. Every pixel must be opaque. Colours are kept at 5 bits a channel, as the game keeps a design's.commands.hat_file_bytes: The largest PNG file cmd.set_hat or cmd.set_shirt reads. A 32 x 32 picture is far smaller.commands.reacts_per_minute: cmd.react per mod per minute of the game clock. A reaction the game refused does not count. It is a safety limit, so a mod cannot keep a player reacting in a friend's town or The City.
The Button Tricks example uses them all, one per D-pad button.
Level 1 #
16 November 2026. The first level. Content is textures (a file may carry a readable label before its name), lines (a messages file), shops (each by its id in the shop table, from Nook's store and the flower shop to Katrina's tent, one block shape for every shop, each block applying while its when holds), new furniture on a vanilla base with pictures of its own (an items file, renames), letter templates, calendar days and villager line pools. Scripts get the events in the events list, each handed one table. They also get log, message, the game queries, a store per town with a part per player and one per browser, settings, remote calls between mods, a seeded rng and timers on the game clock. Eight commands are declared in permissions: six (cmd.send_letter, give_item, show_line, ask, take_item, take_bells) are applied at the end of a frame's update, and two (cmd.set_shop_goods, set_shop_open) are set at the call. Mods also have depends and conflicts with version ranges, and data_version with the data_migrated event. Mods can name optional_depends, and a setting can be world or client.
Level 1 (version 1.0) contains:
mod.json
$schema: Optional. The JSON Schema an editor checks mod.json against, for autocomplete and errors as you type. The game ignores it.schema: The manifest format. Always 1.api: The mod API level the mod is made for. The game checks a mod by the rules of its own level. It runs an older level through shims while that level is supported. A level only changes for a breaking change; new names arrive as a minor version of the level (API 1.1), and a mod made for 1.0 still says 1. Use the newest level.id: author.mod-name, in lowercase letters, digits and dashes, with one dot. The author parts playaconline, official, admin and example are reserved for the site's own mods in the mod list. The mod list also refuses an author part that passes for one of them (official-, examples, playaconline-official).name: The name players see, 1 to 60 characters after trimming spaces. The mod list also refuses a name with a line break, another control character or a hidden text-direction character.version: x.y.z, each part 1 to 9 digits with no leading zero. Every upload needs a version number this mod has not used yet. The number of a refused upload can be used again.authors: 1 to 8 names, each 1 to 40 characters. The mod list also refuses a name with a line break, another control character or a hidden text-direction character.description: Optional text of at most 500 characters. null is refused. Leave the key out instead.tags: Optional. The mod list's filters: at most 5 different tags from a fixed list, lower case. Players filter the mod list by them. The game never reads them. Anything else is refused (manifest-tags).scope: client is a Just you mod, which only you see. world is a World mod, which changes what a visitor to your town would see. Only a World mod may hold a shop (content.shops) or a calendar file with a board notice. A friend visit needs the same World mods that count (see visit_scope) on both sides.content: What the mod adds, each a path inside the mod: textures, messages, shops, items, letters, calendar and talk. Anything else is refused. textures names a folder, and every other key names one file. Every text shows as written.scripts: A Lua script and the events it listens to. events may list data_migrated only with a data_version.permissions: The commands the mod's script may queue, each once. The game refuses any command the list leaves out. The Mods tab and the moderators' review show what the list lets the mod do. take_item and take_bells let the mod ask the player for items or Bells. The game itself shows the question with the true item and amount, and nothing is taken unless the player says yes. save lets the mod save the town where the player could save at Gyroid. play_sound lets the mod play the game's own sound effects, heard only by its own player. set_weather sets the town's weather for the day, and set_shop_goods and set_shop_open change a shop for the day. The three need scope world. set_hat and set_shirt change only how the player's hat or shirt looks on their own screen and work in any mod. react plays one of the reactions on the player's own character and works in any mod. Needs scripts.exports: A library's remote functions by name, each with a one-line description. These are what other mods may remote.call. At most 32 names, each 1 to 32 of a-z 0-9 _. Each description is 1 to 120 characters on one line. When exports is declared, the game lets remote.add offer only these names. The Mod log says when a listed name was never offered. Needs scripts.assets_original: Must be true. It is your promise that the mod holds only work its authors made, never files taken from the game.renames: Maps an old full item id of this mod to the full id of an item in this mod's items file. At most 64. Needs content.items. Each rename runs once per save, and mod-items.json records it. A renamed item already in a house therefore keeps working.depends: Mods this one needs, as mod id to version range. A range is "*", or up to 4 comparisons (>= <= > < = and a version) split by one space. At most 16. This mod loads after them. It does not load when one is missing, off, out of range or not loading. The game checks again when it starts: a mod whose dependency is not loaded before it, in range, is not loaded at all.optional_depends: Mods this one can use but does not need, as mod id to version range. Ranges are written as in depends. At most 16. This mod always loads. An optional dependency is present when it is installed, switched on, loading and inside the range. A present one loads before this mod. One that is missing, off, not loading or outside the range is absent, and nothing waits for it. A script asks with remote.version(id). remote.call to an absent one returns nil, a message and a code. It is not an error. A mod id may be in only one of depends, optional_depends and conflicts.conflicts: Mods this one cannot run with, as mod id to version range. At most 16. A mod id may be in only one of depends, optional_depends and conflicts. This mod stays off while a matching one is on.data_version: A whole number 1 to 1000000 for the shape of what the scripts save. When it changes, the data_migrated event runs once per town. Listing data_migrated in scripts.events needs it.settings: At most 16 settings the player sets on the Mods tab and scripts read with settings.get. The types are bool, number (whole, with min and max), choice (2 to 16 choices) and text (max_length 1 to 200). A setting may say "scope". "world" is the default: the value is part of the town, a friend visit compares it, and a visitor lent the mod runs the host's value. "client" is the player's own: it is never compared or sent, and each player keeps theirs on a visit. Use client for a choice that only changes what its own player sees or hears.
Files
shops: Changes shops, each by its id: "nook", "flower", "redd" and the rest of the shop table. A shop takes one block, or a list of blocks. A block says what changes (goods, open, own_goods, prices, services, name, lines) and, with "when", when. Every field means the same on every shop. The shop table says which fields each shop has; a field a shop does not have is left out and the mod's row says so (rule shop_fields). While a block applies its goods join the shop's own, in at most half the spots of their kind (rounded up), or with "own_goods": false they are the whole stock. When several blocks apply at once their goods are sold together, and for a single value the last of them counts. The game itself, not the page or the mod list, refuses goods with no shelf model, money, turnips, tickets, grab bags, fossils and reserve ids, and raises a price below the item's buy-back to the buy-back. items.json lists what may be stocked. A good may be an item of the same mod, by its full id, at Nook's and the flower shop. Without a price a good takes the shop's own price. Shops are off in The City. When two switched-on mods change the same shop, the one later in the load order has that shop whole and the other's change to it is not used (rule load_order_last_wins). The earlier mod's row says so.messages: Lines a script or another mod can use, by key. A script reads its own with message("key") and another mod's with message("author.mod:key"). This file cannot carry a $schema key, because every key is a line. Point your editor at messages.schema.json in its settings instead.textures: A folder of replacement textures, named the way Dolphin names a custom texture. A mod's texture beats the HD pack. Among mods, the one lower in the list wins. The exception is that a file for one exact palette beats any mod's "$" (every palette) file for the same texture (rule load_order_last_wins). All mods' DDS textures together may take 96 MB on the graphics card, or 24 MB on a phone. Their PNGs may take 96 MB of pixels, or 24 MB on a phone. A texture past its limit is left out and named on its mod's row. A mod's texture is read a little each frame after it is first drawn, so the game's own texture shows for a moment before it. Find a texture's name in the model viewer (/viewer/).scripts: Lua 5.4 source text, run once when the game starts. Bytecode is refused. The script registers handlers with on() and returns nothing. Each mod has its own Lua state, and mods cannot see each other's globals.items: New furniture, each on a vanilla base piece. The game also refuses a base with no model, fossils, gyroids, clothing, design pieces and pieces a player carries as an item: umbrellas, fish, bugs, tools, balloons, fans, pinwheels and diaries. In the save, a mod item is its base piece. A file beside the save (mod-items.json) maps it back. Removing the mod therefore leaves the base piece behind, and reinstalling restores the mod item. That file belongs to the save it was written beside. Next to another save of the same town, such as a backup put back or an older town file imported, it is not used. Those pieces are then plain base pieces again. An item may carry its own pictures ("textures"). They replace the base piece's textures on that item alone, in a house and on Nook's floor. On the flower shop's bench a furniture good is a leaf. Every other copy of the base keeps its look.mod-items sidecar: /save/card_a/mod-items.json. The game writes it beside the home save, and a mod never reads or writes it. It records which placed or carried base pieces are which mod item, and which renames have run. It rides in the cloud save and in a friend visit's town copy.letters: Letter templates that a mod command (send_letter) mails through the mailbox, named "<mod id>:<letter id>". The game wraps the body at the paper's width in its own font and refuses one that needs more than 6 lines. It also refuses a present that is money, turnips, a ticket, a grab bag, a fossil or not an item. Either scope.calendar: Calendar days: dated days with safe effects only, and no script. A day can have a notice on the town bulletin board. The notice is posted once on the day in the player's own town, never on a visit or in The City, and needs scope world. A day can have villager lines: talk.json pools that name the day's id as their "day", in any place of the talk. A day with no notice and no letter is a date for those pools. A day can have a letter from the same mod's letters file. The letter is mailed once on the day to the player's mailbox in their own town, never on a visit or in The City, and counts against the mod's daily letter limit. A day cannot add decorations, because the game has no data format for them.talk: Villager lines placed in a villager's talk. A talk is the hello, which ends in a menu (an errand, a chat, never mind); when the player chats, the game picks a topic, fresh every time: small talk (plain chat, the time of day, the weather, the month), a trade, a letter they got, a memory, a hint, or news of an event. Every pool's "place" says where its line goes; there is no default: "before" the hello (the hello and everything after it still play), as the "hello" (the menu and the topic still play; only an everyday greeting is replaced, never a hello with news such as a bee sting or a collection finished), as the "topic" (instead of the topic the game picked when it is one of the pool's "topics", small talk when it names none; the talk ends after it, as small talk does), "after" the topic (one more message before a chat ends), or the whole "conversation" (no hello, no menu, no topic: the pool's pages, then the talk ends). A line is one page or a list of pages. A special talk (a first meeting, an errand, a villager moving out, the first-job errands) never uses a pool, nor do a new player's first ten chats, whose topics are tips. For each place, the most specific pools that fit are used: this villager, else this personality, else everyone. A pool fits when its season, time, weather and calendar day, if it names them, are the ones now. Each pool that fits rolls its chance; the lines of the pools that pass are put together, from every mod, and one is picked, never the one this villager said last when there is another. When the most specific pools all roll no, that place stays the game's. A script's villager_talked line takes its place first. A pool kept to a calendar "day" speaks only on that day, in its place, like any other pool. A conversation pool is used only when no script took any place. Nothing is saved. Either scope. Pools run in The City too.
Lua
on: Registers a handler for an event. Call it while the mod's own script loads, not from inside a handler and not from a function another mod calls with remote.call. The event must be in mod.json's scripts.events. At most 16 handlers per event. A handler gets one table, e, holding the event's fields.log: Writes a line to the Mods tab's Mod log and the browser console as "[Mods] <id>: ...". Arguments are joined with spaces. A line is cut at 299 bytes. At most 20 lines per event and 500 per session. A refused cmd.* or timer.* call writes a line of its own, and those lines count toward the same two limits. A script error or stop is written to the Mod log too, with a Lua traceback, whatever the limits. The log keeps the newest 400 lines of all mods. When it is full, the oldest line of the mod with the most lines goes first, so one mod cannot push out another mod's lines.message: A line from a messages file. "key" reads this mod's own line, and "author.mod:key" reads another mod's. Returns nil when there is no such line.game.time: The game's clock now.game.day_number: The game clock's day as one whole number: days since 2000-01-01. It goes up by one each game day, so it tells one day from the next without date maths.game.pockets: The items the player holds, in slot order: { { slot, item, mod_item }, ... }. Only held items are listed, so an empty slot has no entry. Returns {} when the pockets are empty or before a town is loaded.game.bells: The wallet, or nil before a town is loaded.game.town: The town: { name, id, year, month, day, hour, minute, weekday, season }, or nil before a town is loaded. season is spring, summer, fall or winter, the word talk pools and shops use.game.villagers: The town's villagers: { { id, name, species, personality }, ... }. Returns {} before a town is loaded.game.player: The player playing this game: who they are, where they stand, what they hold and what they are doing, or nil before a town is loaded. A town has up to 4 residents, each playing it from their own save slot. Every call reads the game as it is now, so it is cheap to call from any event, such as button_pressed or timer_fired. On a visit it is the visitor, standing in the host's town. Where the player stands and what they do (every field after id) is nil while the scene is still being built, such as in day_started as the game starts.game.calendar_today: The ids of this mod's own calendar days that fall on the town's date today, in file order. Returns {} when there are none, or before a town is loaded. Only the calling mod's days are listed.store.get: A value this mod saved in this town, or nil. It is nil while the main chunk runs. Integers come back as integers.store.set: Saves a string, number or boolean under a key in this town. nil deletes the key. Keys are up to 64 bytes and strings up to 1024. A set that would take this town's store over 8 KB raises an error and changes nothing. So does a set before a town is loaded, in the main chunk.store.town: Which town the store is for now, as an opaque text that changes when the town does ("v:..." away from home). nil before a town is loaded. Compare it to reload what you keep in locals when the player moves to another town.store.client: The per-browser store. It has the same get, set and limits, with one store per mod per browser whatever town is loaded.store.player: This player's part of the town store. It has the same get and set, per mod, per town, per player (game.player().id). It lives inside the mod's town store and shares its 8 KB. Before a town is loaded, get answers nil and set raises an error. With a town but no player in the game yet, get answers nil and set raises its own error (no player is in the game yet). When a resident is deleted, everything mods saved for them here is deleted too and its room is given back. A new resident in that save slot starts with nothing. On a visit it lives in memory only.settings.get: A setting's value: the player's, else the default. It is a boolean, an integer or a string. nil for a name the mod does not declare.remote.add: Offers a function to other mods, while the script loads. Names are 1 to 32 of a-z 0-9 _, at most 32 per mod. With mod.json "exports", only the names it lists.remote.call: Calls a function another running mod offers. Its errors come back as yours, and it keeps running. When the mod is one of this mod's optional_depends and it is absent, nothing is called and nothing is raised: the call returns nil, a message and a code from dependency_codes.remote.has: Whether a running mod offers that function.remote.version: Whether a mod this one names in depends or optional_depends is present, and at what version. Returns its version, such as "1.2.0", when it loaded inside the range. Returns nil, a message and a code from dependency_codes when it did not. Ask in an event. In the main chunk an optional dependency that the cycle rule placed after this mod has loaded no script yet.rng: Seeded random numbers. rng() gives a number in [0,1), rng(n) a whole number 1..n and rng(m, n) a whole number m..n. The seed is the mod, the town, the game day and how many numbers this mod has drawn in this town on this game day. Each call in a day therefore gives another number, and a reload cannot reroll. The count is saved with the town store at the end of a run that drew numbers, and a reload carries on from it. If the tab closes before that write, the same numbers come again, never new ones. A new game day starts the count at 0, and changing the game's clock gives other numbers. The count is kept in memory only away from home, for a lent mod and before a town loads. Inside a remote.call, the called mod draws from its own counter. math.random and math.randomseed are not available. Use rng().timer.after: Sets a timer that fires once, at least that many game minutes from now. It returns the timer's id. When it is refused it returns nil, a message and a code (timer_codes). Setting a timer rewrites the town store, so it is charged to the event's budget like store.set.timer.cancel: Cancels a waiting timer of this mod in this town. It answers true when there was one. A timer that already fired, or an id from another town, answers false.
Commands
cmd.send_letter: Queues a letter in the player's own mailbox. The post office keeps it when the mailbox is full. The save holds an ordinary letter, so it loads without the mod.cmd.give_item: Queues an item into the first empty pocket. With full pockets it comes by letter. Also takes this mod's own new item by its full id (author.mod:thing). A mod item is given with its identity, as a shop sells it, and full pockets refuse it.cmd.show_line: Queues a line shown in a message box with no one speaking, like the game's own "My pockets are full!", once the player is free. One line or question at a time.cmd.ask: Queues a question with 2 to 4 answers in that same speakerless message box. The pick comes back as a question_answered event.cmd.take_item: Asks the player to hand over items from their pockets. The game shows its own question, which names the item, the count and this mod. The mod's name stands between quotes, and a mod item is named as the pockets show it. A script cannot change that text. On yes the items leave the pockets and command_finished says via taken. On no, or when the window closes with no pick, nothing is taken and command_finished carries command-declined. It is refused with command-not-held when the pockets do not hold that many. Only plain pocket slots count. A wrapped present or an item held for a villager's errand is never taken. Items a command cannot give cannot be taken either (money bags, turnips, tickets, grab bags, fossils). It is refused on a visit and in The City, so a lent mod can never take anything.cmd.take_bells: Asks the player to pay Bells from their wallet. The game shows its own question, which names the amount and this mod. The mod's name stands between quotes. A script cannot change that text. On yes the Bells leave the wallet and command_finished says via taken. On no, or when the window closes with no pick, nothing is taken and command_finished carries command-declined. It is refused with command-not-held when the wallet holds less than the amount, so the wallet never goes below zero. The bank account and money bags in the pockets are never touched. It is refused on a visit and in The City, so a lent mod can never take anything.cmd.set_shop_goods: Sets a shop's goods for the rest of the game day, as one more block after the mod's shops.json blocks for that shop. It is set at the call, with no queue, no daily cap and no command_finished, and applies from the next frame, also when the shop is shut, and is gone when the day changes or the game restarts, so set it again in day_started. nil clears it. Only for a shop with goods in the shop table, and refused when a mod later in the load order changes that shop. Needs scope world.cmd.set_shop_open: Opens or shuts a shop for the rest of the game day, as one more block after the mod's shops.json blocks for that shop. true opens it, false shuts it, nil clears it. It is set at the call, with no queue, no daily cap and no command_finished, and applies from the next frame and is gone when the day changes or the game restarts. Only for a shop with open in the shop table, and refused when a mod later in the load order changes that shop. Needs scope world.
Events
villager_talked: The player starts an ordinary talk with a villager. Return where your words go in it: nil to stay quiet, a talk table { place, line, topics, ask }, or a list of talk tables, one a place. Every line names its place: a plain string is refused and logged, with nothing said. place is "before" (ahead of the hello), "hello" (instead of an everyday hello; a hello with news is kept), "topic" (instead of the topic the game picks when the player chats, if it is one of topics, small_talk when you name none, "any" for all), "after" (after the topic, before a chat ends) or "conversation" (the whole talk: no hello, no menu, no topic). line is a page of 1 to 400 bytes or a list of 1 to 8 pages. ask = { text, choices } (2 to 4 answers) goes only with "conversation": its last page asks the question, and the player's pick goes to villager_answered. Every mod's handler is called, in load order. The first line returned for a place takes it; a later one for that place is logged and not said. A conversation needs every place free and ends the event. Lines are said only when that part of the talk comes: topic and after only when the player chats. A table that is not right is logged and nothing of it is said. Special talks never reach mods. These are a first meeting, a villager moving out, one with an errand, delivery or contest going with you, a complaint, a pitfall or a bee chase, an islander, Kamakura and summer camp. No handler is called for a special talk. The villager's next ordinary talk calls it as usual, so a line a script is keeping for "the next talk" waits for that one.day_started: A new day begins in the game. It fires once per day, also when the game starts on a new day. It does not fire again when the game restarts later on a day the town already saw, because the save holds the day it last began. If the game was not saved since that day began, the save still holds the day before, so the next start fires it again. Count days by storing the last date you saw, not by counting calls. Its handler sees the whole day, the first day of a session included: game.calendar_today() lists today's calendar days, game.town() has the date, and game.player() and store.player have the player. A command queued here is applied once the player is free in the town.item_picked_up: The player got an item. They picked it up, outdoors or off a room's floor, caught it with the net or the rod, or dug it up with the shovel. It fires once the item is in their pockets, or in the wallet for Bells. It does not fire for anything bought. A fish or a bug that goes into the pockets fires this event and then fish_caught or bug_caught, so a script that counts both counts that catch twice. It does not fire when the pockets were full. Outdoors the game then offers to swap the item for one in the pockets, and no event is sent whatever the player chooses. Indoors a full pocket refuses the pickup.scene_entered: A scene starts, such as the town, a house or a shop. Not in the title demo, at player select or in the intro (the rule own_game_only).data_migrated: Fires once per town, when mod.json "data_version" differs from the version the town's data was written at. It runs as the town loads, before any other event's handlers run in that town. from is 0 for data from before data_version. If the handler errors, the script stops and the version stays, so the next start tries again. Migrations run in load order. A remote.call from a data_migrated handler into a mod whose own data_migrated has not run in that town yet is refused. Needs data_version.hour_changed: The game's clock reached a new hour. This is the game's own hourly update, midnight included.item_bought: The player bought a good for Bells at any counter in the game. It fires as the seller takes the price. shop says which counter: "nook" (Nook's in every size, The City's Nookington's too), "flower" (the flower shop), "redd" (Crazy Redd), "saharah" (her carpet, swapped for one of yours and Bells), "joan" (turnips), "fireworks" (the fireworks show's stall), "shrine" (the New Year fortune slip), "gyroid" (what another player put up at their gyroid) or "villager" (a villager selling you something). Test e.shop == "nook" to keep to Nook's. price is the Bells paid. ordered is true for a Nook's catalog order, which is paid now and mailed tomorrow, so it is not in the pockets yet. Only Nook's and the flower shop sell mod items. A visitor buying in a friend's town gets a plain piece, so mod_item is nil there. Paid services that hand over no good are not purchases and do not fire it. These are the barber, Katrina, the Dream Suite and an Able Sisters design.item_sold: The player sold for Bells. It fires once the wallet is credited. shop says to whom: "nook" (Nook's in every size, The City's Nookington's too) or "villager" (a villager buying something from your pockets). Nobody else in the game buys. item is the first good, count is how many went and bells is what they fetched. mod_item is the first good's full id when it is a mod item. What another player buys at your gyroid does not fire it. The gyroid hands you the takings later as one sum, with no record of what sold.fish_caught: A fish was landed. pocketed says whether it went into the pockets. There is no size or length, because the game keeps none for a caught fish. Each kind has one fixed shadow size. Only the fishing tourney makes up a length, when the fish is shown to its host. When pocketed is true, item_picked_up fired for the same catch just before this event.bug_caught: A bug was netted. pocketed says whether it went into the pockets. When pocketed is true, item_picked_up fired for the same catch just before this event.letter_read: The player chose Read on a letter. item is the present, nil when the letter carries none. letter names the letters file letter it is, when a mod sent it.villager_moved_in: A villager with no house was given one. It fires at the game start after a move-in. A brand-new town fires it for its first villagers.visitor_arrived: A friend is riding into this player's own town. This is a friend visit, on the host's side. kind is "friend".command_finished: A command this mod queued was applied or refused. When applied, ok is true and via says how (mailbox, post_office, pockets, mail, shown, taken, saved, set, unchanged or played). When refused, ok is false, with a code (command_codes) and a message. Sent only to that mod.question_answered: The player answered this mod's ask, or closed it. choice counts from 1 and text is the answer picked. Both are nil when the window closed with no pick. Sent only to that mod.timer_fired: A timer this mod set with timer.after is due. It fires once, at the end of a frame's update, in whatever scene the player is in, and the timer is gone before the handler runs. It is an event like any other. Its handlers share one instruction budget, it waits for a later frame when the frame's time is spent, and the commands it queues count against the per-event and per-day caps. At most one timer per mod fires in a frame. A timer that came due while the game was closed fires soon after the town loads. Sent only to that mod.villager_answered: The player answered the question this mod's conversation asked (villager_talked returned place = "conversation" with an ask). Sent only to that mod, while the window waits. Return what the villager says next, in the same conversation: a line, or { line, ask } to ask again. Return nil and the talk ends. A reply that is not right is logged and the talk ends.
Rules
shops_need_world: content.shops requires scope world.shop_fields: Every shop takes the same block, and each field means the same on every shop. The shop table (files.shops.shop_table) lists the fields each shop has, and it is read from the game itself. A field a shop does not have is left out, not refused: the rest of the block applies and the mod's row in the Mods tab names the shop and the field (code shop-field-ignored). Nook's store and Able Sisters have no lines, because their keepers speak only the disc's own words.unknown_keys: A key the game does not know is refused. This applies at the top of mod.json, at the top of the shops, items, letters, calendar and talk files, and in each of their entries (a shop block, a good, a "when" and its hours, an item, a letter, a calendar day, a talk pool). The messages file is the exception, because its keys are the lines. The message is <file>: unknown key "<key>", followed by (did you mean "<known>"?) when a known key is close. $schema is known wherever a file may carry it. Keys are case-sensitive.json_strict: Duplicate keys and \u0000 are refused in every JSON file.extensions: A mod may hold only these file types (case-insensitive).repo_files: Files a mod repository holds for people, not for the game. playac-mod pack leaves them out, and the game and the mod list ignore them in any ZIP: they are dropped before any other rule, never unpacked or stored, and counted toward no limit. So a ZIP made by hand of a whole mod repository installs. They are any part of a path that starts with a dot (.git, .github, .gitignore, .vscode, .playac, .DS_Store), any part named in any_parts, and at the top of the mod (inside the one top folder, when the ZIP has one) a file named in top_files, a file whose name before its extension is in top_stems (LICENSE, LICENSE.md, license.txt), and everything in a folder named in top_folders (media/, for the README's pictures, film and media.json). Names match in any letter case.frame_cap: All mods share 4 ms of Lua time a frame. Past it, every game event without an answer (day_started, item_picked_up, scene_entered and the others) waits for the next frame. Events wait in order for each mod, at most 64 at a time, and one past that is dropped. villager_talked is skipped for the rest of that frame, so the villager says their own greeting. A mod with events still waiting is not asked for a villager_talked line until they have run. The next mod is asked instead. Each mod therefore sees its own events in the order they happened. A remote.call into a mod is not one of its events. It runs at once, inside the caller's event. command_finished and question_answered wait too, but are never dropped or skipped. villager_answered runs at once: the player is waiting on it. A command queued by a command_finished handler is applied at the next frame boundary, not the one that delivered the result. data_migrated runs as a town loads, outside the limit.data_migrated_needs_data_version: scripts.events may list data_migrated only with a data_version.depends_not_conflicts: A mod id may be in only one of depends, optional_depends and conflicts. None of them may name the mod itself.settings_world_hash: A World mod that declares world settings adds a hash of their values to its entry in the list of mods a friend visit compares. The entry gains +<sha256 of "name=value\n" per world setting, sorted>. The visit's list of mods carries that hash and the values too, so two towns on one mod with different settings are told "same mod, different settings". A setting whose scope is client is not in the hash, and its value is never in the list. A mod with only client settings adds no hash. A mod with no client setting hashes as it did before scopes existed.visit_scope: Which mods a friend visit compares. A Just you mod never counts. A World mod counts if its content has textures, shops or items (visit_scope_content), if its permissions name set_shop_goods or set_shop_open (they change a shop), or if its permissions are not a list of strings. Every other World mod does not count. That covers a mod with only lines, letters, calendar days or talk pools. No command makes a mod count. send_letter, give_item, take_item, take_bells, save and set_weather are refused on a visit, show_line, ask and play_sound reach only their own player, set_hat and set_shirt change only how the player's hat or shirt looks on their own screen, and react moves only the player's own character. A visitor sees the host's weather through the game itself, with or without the mod that set it. Only mods that count must match between the two towns. An optional dependency is a mod like any other here. When it is a World mod that counts, it is in the list, and installing it changes what a visit compares.visit_scope_content: The content keys that make a World mod count for visits, whatever its permissions. They are what a visitor must draw or meet in the town.world_scope: What needs scope world, because it changes the town a visitor sees: a shops file (content.shops), a calendar file with a board notice, and the permissions set_weather, set_shop_goods and set_shop_open. Everything else may be client (only you see it) or world.load_order_last_wins: When two mods change the same thing, the last in load order wins it whole. For a shop that is per shop id: the later mod's blocks are that shop, and the earlier mod's change to it is not used. Two mods that change different shops both apply. The earlier mod's row in the Mods tab names the shop and the mod that has it. Inside the mod that has a shop, all its blocks for it apply. For a texture, the kind of file comes first. A file for one exact palette (tex1_..._<tlut>_<fmt>) beats any mod's every-palette file (tex1_..._$_<fmt>) for the same texture, whatever the order. Between two files of the same kind, the later mod's is drawn. A mod's texture of either kind beats the HD pack's.load_order_first_wins: A villager's talk has five places for a mod's words: before, hello, topic, after and conversation. Each takes one line per talk, and every line names its place. Every mod's villager_talked handler runs, in load order, and the first line a handler returns for a place takes it. A conversation takes the whole talk, so it needs every place free; once one is taken, the event stops. Lines a script did not take a place with come from talk files, which are not first-wins: every mod's fitting pools of that place are put together and one line is picked from all of them, fresh on every talk.dev_reload_hot: Developer mode reloads these while you play, with no restart: the content files named here, any .lua script ("scripts") and the files under content.textures. Developer mode means a mod loaded from a folder or from playac-mod dev. Each value is a content key, or "scripts".dev_reload_restart: Developer mode loads a change to these only when the game restarts: mod.json and the content files named here. mod.json is read once at start, and so is a file added or removed. Each value is "mod.json" or a content key.visit_lend: Visiting with the host's mods. When every World mod of the host that counts is a reviewed version from the mod list, a visitor can load them for that visit only, after agreeing. They run with the host's world settings. Each mod's world values travel with the visit, are checked against what its mod.json allows, and are never kept on the visitor's game. A text setting the host changed from its default must pass the site's word checks (no rude words, contact details or risky phrases). If it does not, the visit is refused instead of lent. A client setting is the visitor's own. It keeps the value the visitor set on their installed copy of the mod, and it is the default when the visitor does not have the mod. Nothing is installed. The game restarts with the lent mods, and their scripts start with an empty store that is never saved. A lent mod acts only in the host's town. At home, in the restart before the trip and the one after it, its shop, Nook goods, board notices, items, renames and commands do nothing. It therefore never changes the visitor's own town or save. A mod installed from a file cannot be lent. Nothing is lent while mods are switched off for everyone. A set that would not load whole on the visitor's game, in the host's order, with the visitor's own Just you mods and under the same limits, is refused before the restart.city_set: The City's own mod set is a short list chosen by the site and changed only with a release. A City mod may hold only textures and messages. It has no shops, no scripts and no permissions.calendar_board_world: A calendar file with a board notice requires scope world. The board is the town's, and a visitor reads it.calendar_letter_once: A calendar day's "letter" goes out once per day per town. It goes out only in the player's own town, not on a visit and not in The City. It counts against the mod's daily send_letter limit. A refusal is written to the Mod log, never to a script.font_characters: The characters the game's font draws in a mod's lines (messages, talk lines, shop greetings, show_line and ask). Every printable ASCII character is drawn, except $ * ^ | \ which are each drawn as ?. The characters # + / ; are drawn by the font's own signs. [ ] { } are drawn as ( ), ` as ' and ~ as the villagers' wavy tilde. The letters and signs listed here are drawn too. Curly quotes, dashes, the ellipsis and a no-break space become their ASCII spelling. Any other character is drawn as ?. Letters and board notices take plain ASCII only. values holds the extra characters, from the font's own table.permissions_need_scripts: permissions requires scripts, because only a script can use a command.exports_need_scripts: exports requires scripts, because only a script offers functions.own_game_only: Nothing of a mod runs outside the player's own game. At the title screen, at player select and in the intro no event fires, no timer fires, no command is applied, no calendar letter goes out and no town data is loaded, so data_migrated does not run there either. The title screen plays a demo in the player's own save with the clock set to a date in 2001. A script never sees that date. Whatever was waiting keeps waiting and carries on when play starts: a timer that came due fires then, and a command queued before a save and quit is applied then. The one part of a script that runs outside the game is its main chunk, at start, before a town loads.commands_between_frames: An event handler never changes the game. Each cmd.* call queues a command. The game applies the queue at one point in each frame: at the end of the game's update, after the world moves and before that frame is drawn. It applies commands only while the player is free, which means not in a talk, menu, cutscene, door or scene change. A sound (play_sound) is the one exception: it changes nothing, so it plays at the next point in a frame wherever the player is, and never waits behind a line. A command's result comes back as a command_finished event to the mod that queued it.commands_host_only: Every command but set_hat, set_shirt and react is refused in The City. On a visit to a friend's town, send_letter, give_item, take_item, take_bells, save and set_weather are refused, because only the town owner's game changes a town, its weather or a player's save. show_line, ask, play_sound, set_hat, set_shirt and react still run, for the visitor only. The last three change only the player's own character and nothing saved.command_items: A letter's present and a given item follow the shop's item rules: no money, turnips, tickets, grab bags, fossils or reserve ids. give_item also takes this mod's own new item by its full id. Full pockets refuse a mod item, because a letter cannot carry its identity. A plain item comes by letter instead.ids_are_numbers: In Lua an id is always a number, never a hex string. That holds for an item, a villager and a scene. JSON data files write an item as a string, "0x2800". The commands take an item as a number, as "0x2800", or as the mod's own "author.mod:thing".settings_scope: A setting is world or client. A world setting is part of the town. A friend visit compares it, and a visitor lent the mod runs the host's value. A client setting is the player's own. It is never compared and never sent, and on a visit each player runs their own value. A client setting may decide only what its own player sees or hears: a line, a question, a display choice. It may not decide what the town gets or gives up. The game checks this where it can. In an event that read a client setting with settings.get, a command that changes the town is refused with the code command-client-setting. Those commands are the values of this rule. The check covers one event. A value kept in a variable, in store or in a timer's data and used in a later event is not caught, and neither is a value passed through remote.call. timer.after is not refused after a client setting was read, because a timer that only shows its player a line later is a proper use. Those cases are the modder's to avoid. Their failure is silent: the host's town gets what the host's value says, while a visitor's copy of the mod runs the visitor's value and can show a line that does not match.optional_depends_order: Load order with optional dependencies. A present optional dependency loads before the mod that names it, exactly as a needed one does. An absent one changes nothing. Present means installed, switched on, loading and inside the range. A mod whose optional dependency is outside the range still loads, and that dependency counts as absent for it.optional_depends_cycle: A cycle through an optional dependency never stops a mod from loading. When every mod left to place waits for another, the earliest of them in the player's order whose needed dependencies are all placed loads next. It loads before the optional dependencies it was waiting for, and they load after it. Such a dependency is still present. remote.version and remote.call work in events. Only the promise that it loads first is dropped for that one mod, so its main chunk must not count on the dependency. A cycle made only of needed dependencies is still refused.
Limits
zip.bytes: The largest mod ZIP, compressed.zip.unpacked_bytes: What every file in one mod adds up to, unpacked.zip.files: The most files one mod may hold. Folder entries and repository files (rule repo_files: hidden names starting with a dot, __MACOSX, Thumbs.db, node_modules, and at the top README.md, CHANGELOG.md, LICENSE and the media folder) are dropped first and not counted.zip.path_bytes: The longest path inside a mod, after the one top folder is stripped. ASCII only.file.manifest_bytes: The largest mod.json.file.json_bytes: The largest .json file other than mod.json.file.lua_bytes: The largest .lua file.json.depth: How deep JSON may nest. The top value is depth 0, and nothing may sit deeper than 32.mods.enabled: The most mods switched on at once.mods.enabled_unpacked_bytes: Every switched-on mod together, unpacked, on a computer.mods.enabled_unpacked_bytes_phone: Every switched-on mod together, unpacked, on a phone or a low-memory device.messages.lines: The most lines in one mod's messages file.messages.key_bytes: The longest line key.messages.text_bytes: The longest line, in UTF-8 bytes. Lines wrap by width, not by a count of characters. A row holds 180 pixels of the game's font, which is about 24 letters. Narrow letters like i and l take less room, and wide ones like W and m take more. A page holds 4 rows.shops.stock: The most goods in one block for the flower shop: one per bench spot.shops.blocks: The most blocks in the list one shop takes in shops.json.shops.lines: The most lines in one slot of a block's "lines". The keeper says one of them each time.shops.percent_max: The highest price_percent or buy_back_percent.shops.name_chars: The longest shop name (the flower shop's door sign), in Unicode code points.shops.line_chars: The longest shop line (a slot of "lines"), in Unicode code points.shops.line_newlines: The most line breaks in one shop line.shops.price_max: The highest price a mod shop may ask. The game raises a price below its own buy-back to the buy-back. The buy-back is what Nook pays for the item.lua.memory_bytes: Memory one mod's script may use. Over it, the script stops for the session.lua.memory_total_bytes: Memory every mod's script together may use.lua.budget: Instructions one mod may run per event, counting all its handlers for that event together. The main chunk gets its own count. Library work is charged too: every 64 bytes allocated, every 4 pattern-matching steps and every element a table function touches. An allocation the memory limit refuses is charged too: one instruction for every 64 bytes the script holds. Over the limit, the script stops for the session.lua.deadline_ms: Wall-clock backstop on a script's main chunk, for time the instruction count cannot see: one long call into C, or a garbage collection. The instruction budget is what stops a main chunk that does too much. On a slow device it is stretched by the device's pace (lua.pace_frame_ms).lua.handlers_per_event: The most handlers one mod may register for one event.lua.log_per_event: Mod log lines kept per event for one mod: its log() lines and the refusals written when it called cmd.* or timer.*. The rest are dropped, and the log says so once.lua.log_per_session: Mod log lines kept per mod per session: log() lines and every refusal of its commands and timers. A script stop is always written.store.bytes: The whole store of one mod in one town, store.player's values included. The whole store.client of one mod has the same limit. A set that would go over is refused and changes nothing.store.key_bytes: The longest store key.store.value_bytes: The longest string a store value may be.items.per_mod: Items in one mod's items file.items.total: Mod items across every switched-on mod.items.renames: Entries in one mod.json "renames".items.texture_files: Pictures in one mod item's own textures folder (its "textures" setting), counting the files in its subfolders.lua.event_deadline_ms: Wall-clock backstop on one event run, for time the instruction count cannot see: one long call into C, or a garbage collection. The instruction budget is what stops an event run that does too much, and it counts the same on every device. On a slow device it is stretched by the device's pace (lua.pace_frame_ms). A busy device does not stop a mod that stays inside its budget.lua.frame_budget_ms: Lua time all mods together get per frame. Once it is spent, every game event without an answer waits for the next frame, and villager_talked is skipped for the rest of that frame. command_finished and question_answered always run. It never stops or strikes a mod. At least one waiting event runs each frame, so on a slow device events wait longer but still run.lua.slow_run_ms: An event run longer than this is a strike. On a slow device it is stretched by the device's pace (lua.pace_frame_ms).lua.slow_runs: Strikes in a row before the script is stopped ("kept the game waiting"). A run under the limit clears the strikes.lua.pace_frame_ms: The game's own work per frame that counts as full speed. Mods' Lua time is left out of it. When the game's recent frames take longer (a slow phone, a busy machine), the wall-clock limits are stretched. The stretch is recent frame work divided by this, from 1 up to lua.pace_stretch_max. It applies to lua.deadline_ms, lua.event_deadline_ms and lua.slow_run_ms. The frame cap and the instruction budget are never stretched.lua.pace_stretch_max: The most a slow device stretches the wall-clock limits. At this stretch an event run's backstop is 1 second and a strike is a run over 64 ms.lua.deferred_events: Events waiting for a later frame. Past that, an event is dropped and logged.textures.label_chars: The longest label before a texture name in a mod, as in bookshelf-top_tex1_32x32_626709d910129694_$_8.png. A label is lowercase letters, digits and dashes, then one underscore.textures.png_side: The longest side of a PNG texture.textures.png_decoded_bytes: Decoded pixels of every mod's PNG textures together, on a computer. A PNG past it is left out and named on its mod's row.textures.png_decoded_bytes_phone: The same on a phone or low-memory device.textures.dds_bytes: Image bytes of every mod's DDS textures together on a computer, as the graphics card holds them. Only the first mip level counts: 1 byte a pixel for BC7 and DXT5, half a byte for DXT1 and 4 bytes uncompressed. A DDS past the limit is left out and named on its mod's row. The HD pack does not count.textures.dds_bytes_phone: The same on a phone or low-memory device.settings.per_mod: Settings one mod declares.depends.per_mod: Mods in depends, in optional_depends and in conflicts, each.data_version.max: The largest data_version.store.towns: Towns whose mod data one browser keeps. Writing a 17th drops the file of the least recently written other town.remote.copy_bytes: Data a remote.call copies each way.remote.functions: Functions one mod offers with remote.add.exports.per_mod: Remote functions one mod.json "exports" lists. It is also the most that remote.add offers.exports.description_chars: One "exports" description, on one line.nook.stock: The most goods in one block for Nook's store.visitors.stock: The most goods in one block for a visiting seller (Crazy Redd, Saharah, the fireworks stall).letters.per_file: Letters in one letters file.letters.header_chars: A letter header, not counting {player}.letters.body_chars: A letter body or a board notice.letters.body_lines: Lines on the letter paper or a board page.letters.footer_chars: A letter footer.letters.sender_chars: A letter's name in the mailbox list. It is the letter's optional sender. Without a sender, it is the footer's first 8 characters.calendar.per_file: Days in one calendar file.talk.pools: Pools in one talk file.talk.lines_per_pool: Lines in one pool.talk.line_chars: A page of a villager line (a pool's or a script's), in Unicode code points. It may have at most 3 line breaks. A line that is one string is one page, wrapped to as many windows as it needs.commands.per_event: Commands one mod may queue in one event.commands.waiting: Commands waiting, all mods together.commands.waiting_per_mod: Commands one mod may have waiting.commands.letters_per_day: send_letter per mod per game day in each town. The count is per town and shared by its residents, not per player. It is a safety limit, not a game rule. A command counts when the game applies it, and the count is kept across a reload. A command lost with a closed tab before then never counts. The limit check adds the commands still waiting. A command refused for where the player is (The City, a visit) does not count.commands.items_per_day: give_item per mod per game day in each town. The count is per town and shared by its residents, not per player. It is a safety limit, not a game rule.commands.lines_per_day: show_line per mod per game day in each town. One that cannot be drawn (command-not-shown) does not count. The count is per town and shared by its residents, not per player. It is a safety limit, not a game rule.commands.asks_per_day: ask per mod per game day in each town. One that cannot be drawn (command-not-shown) does not count. The count is per town and shared by its residents, not per player. It is a safety limit, not a game rule.commands.take_items_per_day: take_item per mod per game day in each town. A take counts when its question is shown, whatever the player answers. One that cannot be drawn (command-not-shown) does not count. The count is per town and shared by its residents, not per player. It is a safety limit, not a game rule.commands.take_bells_per_day: take_bells per mod per game day in each town. A take counts when its question is shown, whatever the player answers. One that cannot be drawn (command-not-shown) does not count. The count is per town and shared by its residents, not per player. It is a safety limit, not a game rule.commands.take_item_count: The most pieces of one item a single take_item may ask for. It is the number of pockets.commands.take_bells_amount: The most Bells a single take_bells may ask for. It is the most a wallet holds.timers.per_mod: The most timers one mod may have waiting in one town.timers.minutes_max: The longest a timer may wait, in game minutes. It is 7 game days. A timer never waits longer than this from any moment, so a clock set back cannot strand one.timers.name_bytes: The longest timer name. A name is letters, digits, _, - and . only.timers.data_bytes: The longest text a timer's data may be.commands.letter_chars: A letter's text. It must also fit the letter's 6 lines of 192 pixels.commands.letter_from_chars: A letter's signature, also the mailbox list's sender. It is one line. A line break or another control character is refused.commands.line_bytes: A show_line text.commands.ask_chars: An ask question.commands.choice_chars: One answer of an ask.commands.choices_min: The fewest answers an ask may offer.commands.choices_max: The most answers an ask may offer.commands.papers: Letter papers, numbered 0 to 63.calendar.board_per_day: Board notices that go up on one day across every mod. The first ones in load order go up. On a full board, a mod notice first takes the place of an earlier day's mod notice. It never pushes off a page dated today.store.towns_bytes: What every town's mod data in one browser adds up to. Writing past it drops the least recently written other towns' files first. Mod data therefore never pushes a save over the cloud's 5 MB.talk.line_newlines: The most line breaks in a page of a villager line (a pool's or a script's).talk.pages: Pages in one villager line, when the line is a list of pages (a pool line, or a line a script returns). Each page starts on a clean window.talk.villager_chars: A pool's "villager" name, as the game spells it.items.price_max: The highest price an item in a mod's items file may have.manifest.name_chars: The longest mod "name", in Unicode code points, spaces at the ends not counted.manifest.authors: The most names in "authors".manifest.author_chars: The longest name in "authors", spaces at the ends not counted.manifest.description_chars: The longest "description".manifest.tags: The most different tags in "tags".settings.label_chars: A setting's "label", spaces at the ends not counted.settings.description_chars: A setting's "description".settings.choices_min: The fewest "choices" a choice setting lists.settings.choices: The most "choices" a choice setting lists.settings.choice_chars: One choice of a choice setting, on one line.settings.text_chars: The largest "max_length" a text setting may ask for.settings.number_max: A number setting's "min" and "max" lie within minus this and this.depends.range_bytes: The longest version range in depends or conflicts.depends.range_parts: The most comparisons in one version range, like ">=1.0.0 <2.0.0" (two).