Building From a Console or a Script¶
The /lcdev commands that need no player and no game window: bring a building in
from a file, look at it, see what changed, generate it and read back what came out.
This page documents the companion mod, not Lost Cities
These commands are in The Lost Cities - DevTool 3.3.0-7.5 only, the file for Lost Cities 7.5.1 to 7.5.6 on Minecraft 1.20.1 with Forge. The NeoForge files do not have them. Every number here was measured on Lost Cities 7.5.6. The rest of /lcdev is on The DevTool Commands. Nothing here is a claim about Lost Cities' behaviour, so it carries no verification chips: it describes a tool this wiki ships.
Everything at a glance¶
Every one needs permission level 2, as the rest of /lcdev does.
| Command | What it is for |
|---|---|
/lcdev at <plot> <command> |
Run any command standing on a named plot, in plot coordinates |
/lcdev json <command> |
Run any command and answer with one line of JSON |
/lcdev script <file> [keepgoing] |
Run a file of commands, one a line |
/lcdev schem list |
The building files in the schematics folder |
/lcdev schem info <file> |
A file's size, levels, the row it fits, and blocks the game does not have |
/lcdev schem place <file> [corner] [keep] [missing] [y=<n>] [cellars=<n>] |
Put a file's building on the plot |
/lcdev schem save <name> [replace] |
Write the plot out as a Sponge schematic |
/lcdev look [<from> <to>] [name] [cut=<n>] [scale=<n>] |
A plot, or any box, as pictures, floor plans and text |
/lcdev diff |
The cells of a plot that changed since it was imported or pasted |
/lcdev diff <file> [corner] [y=<n>] [name=<folder>] |
The cells of a plot that are not the file's |
/lcdev diff <file> <x> <y> <z> [name=<folder>] |
The same for any box of any dimension |
/lcdev note <words> |
Leave words on a block |
/lcdev note list, /lcdev note clear [all] |
Show them, take them away |
/lcdev verify [radius] [words] |
What Lost Cities chose and generated in a square of chunks |
/lcdev findings [namespace] |
The load check's findings, for one pack or all |
/lcdev profile [set <key> <value> \| clear <key>] |
The pack's profile keys |
Without a player¶
A plot command acts on the plot under the caller, and a console stands on no plot.
at puts the command on one.
/lcdev at building/1x1/0 fill ~ ~ ~ ~15 ~ ~15 minecraft:stone_bricks
/lcdev at building/1x1/0 lcdev plot set name tower
/lcdev at core lcdev plot set namespace mypack
| Coordinate | Direction | On a one chunk plot |
|---|---|---|
~x |
East | 0 to 15 |
~y |
Up, from the first layer a building occupies | 0 upward |
~z |
South | 0 to 15 |
A plot is named <row>/<index>, as /lcdev workshop rows lists them. core is the
front desk, which holds the settings of the pack as a whole.
json in front of any command gives its answer as data:
{"ok": true, "command": "...", "result": 1, "data": {}, "findings": [],
"failures": [], "warnings": [], "facts": [], "text": []}
| Field | Holds |
|---|---|
ok |
true when the command worked and nothing failed |
data |
The answer as numbers, lists and file paths |
failures |
{subject, where, fix} for each refusal: what, where, and what to change |
findings |
{severity, file, namespace, line, message, fix} for each fault in a pack |
warnings |
Things that exported and will not do what was meant |
text |
Every line as the console shows it |
script runs a file from config/lostcitiesdevtool/scripts/, one command a line. Under
at every line stands on the plot's corner. It stops at the first line that fails and
names it. keepgoing runs them all. A script may run a script, 8 deep.
A building from a file¶
Files are read from config/lostcitiesdevtool/schematics/ and nowhere else.
| Format | Is |
|---|---|
.schem |
A Sponge schematic, versions 1 to 3 |
.nbt |
What a structure block saves |
.json |
A text building: a palette of characters and layers of rows |
| Question | What schem place does |
|---|---|
| Larger than the plot | Refuses, with the row that fits |
| Smaller than the plot | Centres it. corner puts it on the plot's corner |
| What stood there | Saves it under backups/plots/, then clears it. keep pastes over it |
| A block the game does not have | Refuses by name. missing places the rest |
| Stairs, panes, fences | Keep the state the file gave them |
| A block entity's data | Pasted whole. A command block arrives with auto off |
| Entities in the file | Left out and counted |
| The plot's settings | floors and cellars are set to the height placed. cellars=<n> makes the lowest n levels cellars |
Lost Cities stacks a building in levels six blocks tall. A height that is not a whole
number of levels is one more level, part filled: 21 high is four levels, floors 3.
{
"format": "lcdev-building",
"palette": {
"#": "minecraft:bricks",
"g": "minecraft:glass_pane[east=true,west=true]",
"c": {"block": "minecraft:chest[facing=north]", "nbt": "{LootTable:\"minecraft:chests/simple_dungeon\"}"}
},
"layers": [
["####", "#..#", "#c.#", "####"],
["#gg#", "#..#", "#..#", "#gg#"],
1
]
}
| Rule | Detail |
|---|---|
| Layers | Bottom first |
| Rows in a layer | North to south, so a layer reads as a floor plan with north at the top |
| Characters in a row | West to east |
| A layer written as a number | That layer again, counted from 0 |
| A row one character short | Refused, with its layer and row |
/lcdev look writes this same format, so a plot can be written out, edited and placed
again.
Looking¶
/lcdev look on a plot, or /lcdev look <x1> <y1> <z1> <x2> <y2> <z2> for any box.
Files go in config/lostcitiesdevtool/views/<name>/.
| File | Shows |
|---|---|
sheet.png |
Each side as seen from outside, and the top, on one image |
plans.png |
A plan of every level of six layers, looking down into it |
blocks.json |
The box as a text building, with any notes left on it |
| Drawn as | What |
|---|---|
| Half a square | A slab |
| A square with its step darker | A stair seen from the front |
| A line | A pane seen edge on |
| A dark line down a picture | A chunk edge |
| A red line across a picture | Every sixth layer, where one level ends |
A plan is taken from under a level's ceiling when the level has one in its own top
layer. cut=<0 to 5> names the layer to look down from, and scale=<n> the pixels to
a block.
A block is drawn in its map colour, which for a mod's blocks is often nothing like the
texture. config/lostcitiesdevtool/colours.json gives a block the colour it names:
{"mymod:grey_paving": "#8A8A8A"}
In blocks.json, a palette entry that carries data has it three ways: nbt as text,
tag as an object, and lootTable by name when there is one.
What changed¶
| Command | Compares |
|---|---|
/lcdev diff |
The plot with how it stood when import or schem place last filled it |
/lcdev diff <file> |
The plot with a file, set down as schem place sets it |
/lcdev diff <file> <x> <y> <z> |
A box with a file whose lowest north west corner is at that block |
It reads from the file, or from the plot as it was, to the world as it stands. added
is a block the world has and the other side does not.
| In a changed cell | Holds |
|---|---|
x, y, z |
From the box's corner: east, up, south |
kind |
added, removed, block, state or tag |
was, now |
The block with its state |
properties |
Each property that differs, when the block is the same |
wasLootTable, nowLootTable |
The loot table on each side |
sideEffect |
opened for a container that had a loot table and has none, toggled for a door left open. Absent on a change somebody built |
Against a file, the world is held to what the file asks for: the properties a text building names, the data keys it gives, and a number by its value. Measured: a door, a chest with a loot table and a command block set to run, pasted and untouched, differ from their file in 0 cells.
/lcdev export writes the same list as changes.json in the export's folder, for
every plot filled by an import or a paste, with when and from what it was filled. A
plot filled by an older version has nothing to be compared with, and is listed under
noBaseline.
/lcdev note <words> leaves words on the block a player is looking at, or from a
console on the block the command stands on. look, diff and changes.json hand a
note on with its place and the block standing there.
What generated¶
/lcdev verify [radius], run in a dimension Lost Cities generates:
/execute in lostcities:lostcity run lcdev verify 8 mypack
| It reports | Detail |
|---|---|
| Each building chosen | How many chunks, the heights it came in, and up to three copies with the box each stands in |
| Each multibuilding | Placed whole, with its size in chunks |
| Buildings never chosen | For each namespace given. A building no city style names is never chosen anywhere |
| Chunks that failed | The chunk and the reason |
| Word after the radius | Does |
|---|---|
| A namespace | Lists that pack's buildings no chunk chose |
A building, as mypack:tower |
Generates that one first |
centre=<x>,<z> |
Puts the middle of the square on that chunk |
samples=<n> |
Up to n copies of each building, 1 to 8 |
The radius is 32 at most. A run generates the first copy of each building, 64 chunks at most. Measured on chunks that did not exist: 5 seconds at radius 8, 8 seconds at radius 32.
/lcdev profile set <key> <value> puts a profile key in the pack. A key Lost Cities
does not have is refused, and so is a value of the wrong type.
From a shell¶
lcdev.py drives a server from a command line: start it, stop it, run a command,
install an exported pack, restart and report what generated. It is one file with no
dependencies, in the
agent folder of this repository,
beside a guide to every verb and every field.
| Verb | Does |
|---|---|
start, stop, status |
The server itself |
cmd <command>, at <plot> <command> |
A command, answered as JSON |
install <pack>, uninstall |
Put an exported pack where the next start generates it, and take it out |
verify <pack> [radius] |
Stop, install, start, and report |
survey <dimension> [radius] |
The same report for a pack already in place |
Lost Cities reads its buildings as the server starts, so a pack that changed needs a restart. Everything else runs on a server left up.
Not checked¶
| What | Why |
|---|---|
note on the block a player is looking at |
The test rig has no player. Notes are left by position there |
A file written by schem save, opened in WorldEdit |
Not tried |
lcdev.py on Linux or macOS |
It ran on Windows only |
See also¶
- The DevTool Commands, for the workshop,
plot,exportandimport - Testing and Debugging Commands, for Lost Cities' own
/lostcities