# MMS > MMS (Minecraft Metascript) is a language for Minecraft Java Edition data packs and resource packs. Declarations such as `LootTable`, `Recipe` and `Function` compile to the JSON files and `.mcfunction` files the game reads. Minecraft version: 26.3. # Getting started MMS is a small language that compiles to Minecraft Java Edition data packs. You declare resources and functions in `.mms` files, and `mms build` writes the JSON and `.mcfunction` files. The target is Minecraft 26.3. ## Install - **In the browser:** the [editor](https://minecraftmetascript.github.io/mms/) needs no install. Projects are saved in your browser (click the project name to switch between them), and **Download pack** gives you the data pack as a zip. - **Command line:** download `mms` for your system from the [releases page](https://github.com/MinecraftMetascript/mms/releases). Or, with Go installed, run `go install github.com/minecraftmetascript/mms/engine/cmd/mms@latest`. - **VS Code:** install **Minecraft Metascript** from the Extensions view (it is on the VS Code Marketplace and, for Cursor, VSCodium and other editors, on Open VSX), or run `code --install-extension minecraftmetascript.mms`. It updates itself, and includes `mms` for its own use, so the editor needs nothing else; to run `mms init` and `mms build` in a terminal, as this page does, install the command line too. For a build of every change merged to `main`, click **Switch to Pre-Release Version** on the extension's page. Each release also has the `.vsix` files, for **Extensions → … → Install from VSIX**: take the one for your system, such as `mms-darwin-arm64-.vsix`, since the universal `mms-.vsix` has no `mms` in it and runs `mms` from your `PATH` or `mms.path`. ## A first project ```sh mkdir gems && cd gems mms init -namespace gems ``` `mms init` writes `mms.json` (the namespace, the pack description, the output folder) and a starter file. Its `$schema` line points at the [mms.json schema](https://minecraftmetascript.github.io/mms/mms.schema.json), so editors with JSON Schema support (VS Code, JetBrains) complete, describe and check every field. The VS Code extension knows the schema even without that line. Every `.mms` file in the folder belongs to the project. Put this in `gems.mms`: ```mms /** Gems that drop from the gem chest. */ ItemTag gems = [diamond, emerald, amethyst_shard] LootTable chests/gems { pools = [Pool(1..3, #gems)] } Recipe gem_block = Shaped(["GG", "GG"], { G = #gems }, emerald_block) Objective found Function find { found[@s] += 1 /loot give @s loot gems:chests/gems tell(@s, "You have found ${found[@s]} gem chests") } ``` Then build: ```sh mms build # writes build/ mms build -world ~/.minecraft/saves/MyWorld # installs into a world ``` ## Declarations Each declaration is `Kind name = value`, or `Kind name { fields }` for an object: - **Kinds** are PascalCase: `LootTable`, `DensityFunction`, `ItemTag`. Every resource folder in a data pack has one. The [reference](https://minecraftmetascript.github.io/mms/docs/reference.md) lists them all. - **Names** become ids in the file's namespace: `chests/gems` in namespace `gems` is `gems:chests/gems`, written to `data/gems/loot_table/chests/gems.json`. - **Doc comments** (`/** ... */`) describe the declaration right below them. See [Doc comments](#doc-comments). A `Namespace` line switches the namespace for the rest of the file: ```mms Namespace minecraft ItemTag swords = [diamond_sword] ``` Replacing a vanilla resource like this is allowed. The editor notes that it happens, since vanilla's version is lost. ## Doc comments A comment that starts with `/**` documents the declaration, `let` or parameter list that follows it. Only blank space may come between the two. The text is Markdown, and it appears on hover over the name, both where it is declared and wherever it is used: in other files, in calls, in `kills[@s]` scores, inside commands such as `/function gems:find`, and in `${...}`. Completion and signature help show it too. ```mms Objective found /** * Gives a player their reward and counts it. * * @param count how many diamonds to give * @returns the player's new total * @deprecated use `reward_all` */ Function reward(count: int): int { /** Rewards before this one. */ let before = found[@s] /give @s diamond ${count} found[@s] = before + 1 return found[@s] } ``` These JSDoc-style tags are understood: - `@param name text` documents a parameter. Hovering the parameter shows its text, and so does signature help while typing that argument. - `@returns text` (or `@return`) describes the result. - `@deprecated [text]` marks the declaration as deprecated. Every use gets a `deprecated` lint warning and is struck through in the editor. - `@example` starts a code example, and `@see text` adds a pointer elsewhere. - `@label text` names an entry of a template pool's `elements` list. A doc comment works above an entry too, and the jigsaw preview and its export show its label (or else the first line of its text) next to the piece. That tells apart one structure listed several times with different processors: ``` elements = [ WeightedElement(50, SinglePoolElement(rigid, StructureFile("structures/road_cap.nbt"), [])), /** @label Worn road cap */ WeightedElement(10, SinglePoolElement(rigid, StructureFile("structures/road_cap.nbt"), road_wear_medium)), ] ``` Other tags are shown as written. The formatter lines doc comments up with a ` * ` on every line and keeps the indentation inside them, so indented code and nested lists survive. ## Projects with several files A project is every `.mms` file under the folder that holds `mms.json`, including subfolders. The build output folder, `node_modules` and any folder whose name starts with `.` are skipped, at any depth. To limit the project to some files, list glob patterns in `sources` in `mms.json`, such as `["src/**/*.mms"]`. - **One namespace of names.** A declaration in any file can be used from any other, and the order of files and declarations does not matter. Declaring the same id twice for one kind is an error that points to the other declaration. Tags are the exception: declarations of the same tag merge, so a tag can be built up across files. Different kinds can share an id, such as a `Recipe` and a `LootTable` both named `gem_block`. - **Namespaces per file.** Each file starts in the namespace from `mms.json`. A `Namespace` line changes it for the rest of that file only. - **Folders are for you.** A file's folder does not change the ids it declares: `LootTable chests/buried` in `loot/chests.mms` is still `:chests/buried`. - **Editors see the whole project.** The language server loads every project file, not only the open ones, so go-to-definition, references and rename work across files. The web editor's sidebar adds, renames and deletes files, and file names can include folders, such as `recipes/crafting.mms`. The [`treasure`](https://github.com/MinecraftMetascript/mms/blob/main/examples/treasure/) and [`functions-advanced`](https://github.com/MinecraftMetascript/mms/blob/main/examples/functions-advanced/) examples are split this way. ## Values - **Object literals** mirror the JSON: `{ key = value }`. Fields are separated by newlines or commas. - **Lists** are `[a, b, c]`. - **Enum values** are bare words: `action = show_text`, `color = red`. They are written exactly as the game spells them; only ids get `minecraft:`. - **Colors** (fields such as `shadow_color` or a biome's `water_color`) take `"#RRGGBB"`, or `"#AARRGGBB"` where the color has an alpha (alpha first, so `"#80FF0000"` is half-transparent red). The game's own forms work too: an integer, or `[r, g, b]` / `[r, g, b, a]` with each part from 0 to 1. MMS writes a `"#hex"` string as the integer where the game wants one. - **Ids** can drop `minecraft:`. A bare name such as `diamond` or `#gems` means your own declaration if one exists, otherwise the vanilla one. - **Helpers** build typed objects: `Pool(...)` is a loot pool, and `Noise(...)` is `{ type = noise, ... }`. Every dispatched type has a helper named after its type, and arguments can be positional or named. See [Writing resources](https://minecraftmetascript.github.io/mms/docs/guides/resources.md) and the [reference](https://minecraftmetascript.github.io/mms/docs/reference.md). Every value is checked against the 26.3 schema as you type. Completion offers the fields, helpers and ids that fit where the cursor is, and hover shows the field's documentation. ## Formatting and lint `mms fmt` (and format-on-save in the editors) prints every file in one style, so there is nothing to configure. `mms check` reports errors and [lint](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) findings, and `mms fix` applies the fixes that are always safe. `mms test` runs the project's [`Test` declarations](https://minecraftmetascript.github.io/mms/docs/guides/functions.md#tests). ## Next Tutorials build one thing from start to finish: - [A magic wand](https://minecraftmetascript.github.io/mms/docs/start/tutorial-custom-item.md): a custom item with a right-click spell, a cooldown and a recipe. - [A wave arena](https://minecraftmetascript.github.io/mms/docs/start/tutorial-minigame.md): a small game with typed data, state, functions and tests. - [A guide book](https://minecraftmetascript.github.io/mms/docs/start/tutorial-book.md): written books, text markup and messages in chat. - [A custom dimension](https://minecraftmetascript.github.io/mms/docs/start/tutorial-dimension.md): a complete worldgen project. - [A jigsaw dungeon](https://minecraftmetascript.github.io/mms/docs/start/tutorial-structure.md): a structure grown from pieces you build in the game. Guides go deeper into one subject: - [Writing resources](https://minecraftmetascript.github.io/mms/docs/guides/resources.md): the shorthand for loot tables, recipes, density functions and more. - [Functions](https://minecraftmetascript.github.io/mms/docs/guides/functions.md): variables, control flow, calls and strings in function code. - [Keeping state](https://minecraftmetascript.github.io/mms/docs/guides/state.md): choosing between scores, Globals, Storage and tags. - [Cutting repetition](https://minecraftmetascript.github.io/mms/docs/guides/repetition.md): constants, templates and loops. - [Making your own kinds](https://minecraftmetascript.github.io/mms/docs/guides/blueprints.md): Blueprints, step by step. - [Testing functions](https://minecraftmetascript.github.io/mms/docs/guides/testing.md): tests that run without the game. - [Shaping terrain](https://minecraftmetascript.github.io/mms/docs/guides/terrain.md): density functions, noise and splines. - [Building and playing](https://minecraftmetascript.github.io/mms/docs/guides/building.md): the loop from an edit to the game, and sharing a pack. - [A tour of the editors](https://minecraftmetascript.github.io/mms/docs/guides/editors.md): what the web editor and VS Code can do. The [language reference](https://minecraftmetascript.github.io/mms/docs/reference/language/declarations.md) covers declarations, values, constants and templates, Blueprints, functions, text and tests, each with examples. ## Importing `mms import` reads a data pack folder or zip and writes one `.mms` file per resource folder, such as `loot_table.mms`, using the shorthand wherever it applies. In the browser, use **Project ▾ → Import zip…**, or paste one JSON file with **Paste JSON as MMS…**. # Tutorial: a magic wand This tutorial makes a Blink Wand: a stick that throws its holder six blocks forward on right click, with a cooldown, durability, a recipe and a place in a loot table. It takes about fifteen minutes, and each step builds, so you can try the wand in a world as you go. Data packs cannot add items to the game. What they can do is give a vanilla item a name, a look and components of its own, and watch for players using it. By hand that takes an item model, a translation, an advancement per event and the same list of components at every `/give`, recipe and loot table. A `CustomItem` declaration writes all of it. ## 1. Set up the project ```sh mkdir wands && cd wands mms init -namespace wands ``` Everything below goes in the starter `main.mms`. Each step shows the declarations it changes: where a step shows `CustomItem blink_wand` or `Function blink` again, change the one you have instead of adding a second, and keep the fields from earlier steps. [The whole file](#the-whole-file) at the end is where the steps arrive. In the web editor, start a new project instead and set its namespace to `wands`. ## 2. Declare the item ```mms /** A stick that throws its holder six blocks forward. */ CustomItem blink_wand { base = stick name = "Blink Wand" components = { rarity = epic lore = ["{gray}Right-click to blink forward."] } } /** /function wands:give hands one over. */ Function give { /give @s ${blink_wand} } ``` - `base` is the vanilla item the wand is made from. It decides how the item behaves, so pick one that does nothing on right click, such as `stick`, `paper` or `amethyst_shard`. - `name` is the item's name. It goes into the lang file, so it is plain text: the `rarity` component colours it. - `components` holds any other [item components](https://minecraft.wiki/w/Data_component_format). Completion lists them, and `lore` lines are [text markup](https://minecraftmetascript.github.io/mms/docs/guides/resources.md#text-markup). - `${blink_wand}` in a command stands for the whole item: `stick[item_name=..., rarity="epic", lore=[...]]`. Hover it to see what it writes. Build into a world and try it: ```sh mms build --world ~/.minecraft/saves/MyWorld ``` Open the world (or run `/reload` if it is open), then run `/function wands:give`. ## 3. Make it do something An `on_*` field names a function to run when something happens with the item. `on_right_click` runs once per press, as the player and at the player: ```mms CustomItem blink_wand { base = stick name = "Blink Wand" on_right_click = blink } /** Throws the player six blocks the way they are looking. */ Function blink { /particle portal ~ ~1 ~ 0.3 0.5 0.3 0.1 40 /tp @s ^ ^ ^6 /playsound entity.enderman.teleport player @a ~ ~ ~ } ``` A line that starts with `/` is a command, checked against the game's command tree as you type. `^ ^ ^6` is six blocks along the player's line of sight. There are hooks for hitting, killing, eating, picking up, breaking and shooting too. [Item hooks](https://minecraftmetascript.github.io/mms/docs/guides/functions.md#item-hooks) lists them all and explains how right click is detected. ## 4. Add a cooldown The wand is too strong when it can be spammed. A cooldown needs a number per player, which is what a scoreboard objective is: ```mms /** Ticks until a player can blink again. */ Objective blink_cooldown Function blink { if (blink_cooldown[@s] > 0) { actionbar(@s, "{red}The wand is cooling down") return } blink_cooldown[@s] = 40 /particle portal ~ ~1 ~ 0.3 0.5 0.3 0.1 40 /tp @s ^ ^ ^6 /playsound entity.enderman.teleport player @a ~ ~ ~ } OnTick { /scoreboard players remove @a[scores={blink_cooldown=1..}] blink_cooldown 1 } ``` - `blink_cooldown[@s]` is the score of whoever runs the function. It reads and writes like a variable. - `OnTick` runs its body twenty times a second. Here it counts every running cooldown down by one, so 40 is two seconds. - `actionbar` shows a line above the hotbar. It takes the same markup as `lore`. ## 5. Make it wear out Two fields make each use cost something. `damage_on_use` takes durability, and the item breaks when it runs out. `consume_on_use` takes items from the stack instead. ```mms CustomItem blink_wand { base = stick name = "Blink Wand" on_right_click = blink damage_on_use = 1 components = { max_damage = 64 rarity = epic lore = ["{gray}Right-click to blink forward."] } } Function blink { /tp @s ^ ^ ^6 } ``` A stick has no durability of its own, so the wand sets `max_damage`. Leave it out and MMS says so, on the `damage_on_use` line. ## 6. Hand it out The wand's name works wherever an item stack goes, so a recipe result and a loot entry are both just `blink_wand`: ```mms CustomItem blink_wand { base = stick name = "Blink Wand" } /** An ender pearl on a stick. */ Recipe blink_wand = Shaped([" E", "S "], { E = ender_pearl, S = stick }, blink_wand) /** One chest in five holds a wand. */ LootTable chests/wizard { pools = [ Pool(1, [Item(name = blink_wand, weight = 1), Item(name = ender_pearl, weight = 4)]), ] } /** Places a wizard's chest where you stand. */ Function chest { /setblock ~ ~ ~ chest{LootTable:"wands:chests/wizard"} } ``` A loot table does nothing until something uses it. `/function wands:chest` places a chest that rolls this one when it is opened. A `Recipe` and a `CustomItem` can share a name, because different kinds never clash. One thing to know: the game matches recipe ingredients and item tags by item id only. A custom item written there means its base item, so a recipe that takes `blink_wand` as an ingredient accepts any stick. The editor marks each such use with a hint. ## 7. Give it a look Without a texture the wand looks like a stick. To draw your own, save a 16×16 `.png` in the project, here as `art/blink_wand.png`, and name it by its path: ``` CustomItem blink_wand { base = stick name = "Blink Wand" texture = Texture("art/blink_wand.png") parent = item/handheld } ``` `parent = item/handheld` holds the item like a tool. MMS writes the model, the item model definition and the texture into a resource pack next to the data pack, and `mms build --world` installs both. In the web editor, **+ Add texture or sound** adds the file under its own name, so the path there is `Texture("blink_wand.png")`. See [Custom items](https://minecraftmetascript.github.io/mms/docs/guides/resources.md#custom-items) for the other ways to pick a model. ## The whole file ```mms /** Ticks until a player can blink again. */ Objective blink_cooldown /** A stick that throws its holder six blocks forward. */ CustomItem blink_wand { base = stick name = "Blink Wand" on_right_click = blink damage_on_use = 1 components = { max_damage = 64 rarity = epic lore = ["{gray}Right-click to blink forward."] } } /** Throws the player forward, unless the wand is still cooling down. */ Function blink { if (blink_cooldown[@s] > 0) { actionbar(@s, "{red}The wand is cooling down") return } blink_cooldown[@s] = 40 /particle portal ~ ~1 ~ 0.3 0.5 0.3 0.1 40 /tp @s ^ ^ ^6 /playsound entity.enderman.teleport player @a ~ ~ ~ } OnTick { /scoreboard players remove @a[scores={blink_cooldown=1..}] blink_cooldown 1 } /** An ender pearl on a stick. */ Recipe blink_wand = Shaped([" E", "S "], { E = ender_pearl, S = stick }, blink_wand) /** One chest in five holds a wand. */ LootTable chests/wizard { pools = [ Pool(1, [Item(name = blink_wand, weight = 1), Item(name = ender_pearl, weight = 4)]), ] } /** Places a wizard's chest where you stand. */ Function chest { /setblock ~ ~ ~ chest{LootTable:"wands:chests/wizard"} } /** /function wands:give hands one over. */ Function give { /give @s ${blink_wand} } ``` ## Next steps - Make a second wand. Once two items share their cooldown code, a [Blueprint](https://minecraftmetascript.github.io/mms/docs/guides/blueprints.md) turns "a wand" into a kind of declaration of its own. - [Keeping state](https://minecraftmetascript.github.io/mms/docs/guides/state.md) covers scores, Globals and Storage, for when a cooldown is not enough. - The [`embers`](https://github.com/MinecraftMetascript/mms/blob/main/examples/embers/) example has items with their own textures, a use cost and a block hook, and [`arrows`](https://github.com/MinecraftMetascript/mms/blob/main/examples/arrows/) has arrows that do things where they land. # Tutorial: a wave arena This tutorial builds a small game: mark some spawn points, start the arena, and waves of mobs come at you, each after a short rest. Beat the last wave and you win. Along the way it covers typed data, state that survives a `/reload`, function code, compile-time loops and tests that run without the game. The [`waves`](https://github.com/MinecraftMetascript/mms/blob/main/examples/waves/) example is a slightly bigger version of the same game. In the web editor, open it from **Examples**. ## 1. Set up the project ```sh mkdir arena && cd arena mms init -namespace arena ``` Everything below goes in `main.mms`. ## 2. Describe the waves Start with the data. A `Type` describes a record, and a `const` holds a value the compiler knows: ```mms /** One wave of the game. */ Type Wave { /** The mob it summons. */ mob: Id /** How many at each spawn point. */ count: int = 1 } /** The waves, in order. */ const waves: [Wave] = [ { mob = zombie, count = 2 }, { mob = skeleton, count = 2 }, { mob = witch }, ] /** Ticks of rest before each wave: five seconds. */ const rest = 100 ``` `mob` is an `Id`, so the editor completes mob names and `zombi` is an error. `count` has a default, so the witch comes alone. Neither the type nor the constants write a file: they exist for the code below to use. ## 3. Keep the game's state The game needs to remember which wave it is on and whether players are resting or fighting. A `Storage` keeps a record in command storage, where functions read and write its fields by name: ```mms /** Where the game is. */ Type Game { phase: "idle" | "resting" | "fighting" | "won" = "idle" /** The wave being rested for or fought, from 1. */ wave: int = 0 /** Ticks of rest left. */ timer: int = 0 } Storage game: Game ``` `phase` is one of four words. Comparing it with a word that is not on the list, such as `game.phase == "restng"`, is an error. In the game, `/data get storage arena:mms game` shows the record. [Keeping state](https://minecraftmetascript.github.io/mms/docs/guides/state.md) compares Storage with scores and Globals. ## 4. Start the game Three functions get the game going. They use the `waves`, `rest` and `game` declared above: ``` /** Marks a spawn point where you stand. */ Function mark_spawn { /summon marker ~ ~ ~ {Tags:["arena.spawn"]} tell(@s, "{gray}Spawn point marked") } /** Clears the arena and rests for the first wave. */ Function start { /kill @e[tag=arena.enemy] game.wave = 0 next_wave() } /** Rests for the next wave, or ends the game after the last one. */ Function next_wave { game.wave += 1 if (game.wave > len(waves)) { game.phase = "won" title(@a, "{gold}The arena is yours!") return } game.phase = "resting" game.timer = rest title(@a, "{yellow}Wave ${game.wave} of ${len(waves)}", subtitle = "{gray}Get ready") } ``` - A marker is an entity that does nothing, which makes it a good bookmark for a place. - `len(waves)` is worked out when compiling, so adding a wave to the list is all it takes to make the game longer. - In the title, `${game.wave}` is read from storage when the title shows, and `${len(waves)}` is written in as `3`. ## 5. Summon a wave Summoning is where the wave list meets the game. The mob is part of a command, and the game has no way to pick a command by number. So the pack needs one `summon` line per wave, and MMS can write them. A `Template` that returns `Commands` is code that is written out where it is called. Its `for` loops run at compile time: ``` /** Summons the mobs of one wave at every spawn point. */ Template summon_wave(w: Wave): Commands { As(@e[tag=arena.spawn]).At(@s) { for n in 1..w.count { /summon ${w.mob} ~ ~ ~ {Tags:["arena.enemy"]} } } } /** Summons the current wave: one `if` per wave once the loop unrolls. */ Template summon_current(): Commands { for i in 1..len(waves) { if (game.wave == i) { summon_wave(waves[i - 1]) } } } /** Starts the fight. */ Function spawn { summon_current() game.phase = "fighting" } ``` `As(...).At(@s) { }` runs its body as each marker, at that marker. The built `spawn.mcfunction` tests the wave three times, and each branch holds that wave's own `summon` lines: ``` execute store result score #spawn.-t0 mms.arena run data get storage arena:mms game.wave execute if score #spawn.-t0 mms.arena matches 1 run function arena:spawn/_if0 ... ``` The same loop over `1..len(waves)` written inside a `Function` would be a loop the game runs, and a `Wave` cannot be looked up as the game runs. The editor says so if you try. Hover a template call to see the commands it writes. ## 6. Run it every tick ``` OnTick { if (game.phase == "resting") { game.timer -= 1 if (game.timer <= 0) { spawn() } } else if (game.phase == "fighting" && !exists(@e[tag=arena.enemy])) { next_wave() } } ``` `OnTick` runs twenty times a second. While resting it counts the timer down. While fighting it waits for the last enemy to die: `exists(selector)` is true when the selector finds anything. ## 7. Test it A `Test` runs functions in an interpreter built into `mms`, so there is no need to start the game to find out whether the logic holds: ``` Test start_rests_before_the_first_wave { run start() expect game.phase == "resting" expect game.wave == 1 expect game.timer == 100 } Test a_wave_spawns_at_every_spawn_point { setup { /summon marker 0 64 0 {Tags:["arena.spawn"]} /summon marker 8 64 0 {Tags:["arena.spawn"]} game.wave = 2 } run spawn() expect game.phase == "fighting" expect count(@e[type=skeleton, tag=arena.enemy]) == 4 } Test beating_the_last_wave_wins { setup { game.wave = 3 } run next_wave() expect game.phase == "won" } ``` ```sh mms test -v ``` ``` ok start_rests_before_the_first_wave said: Get ready said: Wave 1 of 3 ok a_wave_spawns_at_every_spawn_point ok beating_the_last_wave_wins said: The arena is yours! ok: 3 tests passed ``` Each test starts in a fresh world. `setup` puts the world in the state the test needs, `run` calls a function and `expect` checks the result. The web editor's Tests tab runs them after every edit. [Testing functions](https://minecraftmetascript.github.io/mms/docs/guides/testing.md) has more. ## 8. Play ```sh mms build --world ~/.minecraft/saves/MyWorld ``` In the world, run `/reload` and make sure the difficulty is not Peaceful, where hostile mobs vanish as they spawn. Stand where mobs should appear and run `/function arena:mark_spawn` a few times, then `/function arena:start`. ## The whole file ```mms /** One wave of the game. */ Type Wave { /** The mob it summons. */ mob: Id /** How many at each spawn point. */ count: int = 1 } /** The waves, in order. */ const waves: [Wave] = [ { mob = zombie, count = 2 }, { mob = skeleton, count = 2 }, { mob = witch }, ] /** Ticks of rest before each wave: five seconds. */ const rest = 100 /** Where the game is. */ Type Game { phase: "idle" | "resting" | "fighting" | "won" = "idle" /** The wave being rested for or fought, from 1. */ wave: int = 0 /** Ticks of rest left. */ timer: int = 0 } Storage game: Game /** Marks a spawn point where you stand. */ Function mark_spawn { /summon marker ~ ~ ~ {Tags:["arena.spawn"]} tell(@s, "{gray}Spawn point marked") } /** Clears the arena and rests for the first wave. */ Function start { /kill @e[tag=arena.enemy] game.wave = 0 next_wave() } /** Rests for the next wave, or ends the game after the last one. */ Function next_wave { game.wave += 1 if (game.wave > len(waves)) { game.phase = "won" title(@a, "{gold}The arena is yours!") return } game.phase = "resting" game.timer = rest title(@a, "{yellow}Wave ${game.wave} of ${len(waves)}", subtitle = "{gray}Get ready") } /** Summons the mobs of one wave at every spawn point. */ Template summon_wave(w: Wave): Commands { As(@e[tag=arena.spawn]).At(@s) { for n in 1..w.count { /summon ${w.mob} ~ ~ ~ {Tags:["arena.enemy"]} } } } /** Summons the current wave: one `if` per wave once the loop unrolls. */ Template summon_current(): Commands { for i in 1..len(waves) { if (game.wave == i) { summon_wave(waves[i - 1]) } } } /** Starts the fight. */ Function spawn { summon_current() game.phase = "fighting" } OnTick { if (game.phase == "resting") { game.timer -= 1 if (game.timer <= 0) { spawn() } } else if (game.phase == "fighting" && !exists(@e[tag=arena.enemy])) { next_wave() } } Test start_rests_before_the_first_wave { run start() expect game.phase == "resting" expect game.wave == 1 expect game.timer == 100 } Test a_wave_spawns_at_every_spawn_point { setup { /summon marker 0 64 0 {Tags:["arena.spawn"]} /summon marker 8 64 0 {Tags:["arena.spawn"]} game.wave = 2 } run spawn() expect game.phase == "fighting" expect count(@e[type=skeleton, tag=arena.enemy]) == 4 } Test beating_the_last_wave_wins { setup { game.wave = 3 } run next_wave() expect game.phase == "won" } ``` ## Next steps - Give each wave its own rest, as the [`waves`](https://github.com/MinecraftMetascript/mms/blob/main/examples/waves/) example does, or a reward when it is beaten. - Show the wave on a boss bar or the action bar. [Text commands](https://minecraftmetascript.github.io/mms/docs/guides/functions.md#text-commands) covers `tell`, `title` and `actionbar`. - Read [How functions compile](https://minecraftmetascript.github.io/mms/docs/concepts/how-functions-compile.md) to see what the pack looks like inside. # Tutorial: a guide book This tutorial writes the book a map hands to new players: a few pages with headings, colours, links that turn pages and run commands, and the reader's death count. Then it puts longer books in files of their own and hides them in a chest. In the game's own format, each page of a written book is a tree of text components. In MMS a page is a few lines of markup, and the editor shows the open book as you type. The finished project is close to the [`library`](https://github.com/MinecraftMetascript/mms/blob/main/examples/library/) example. ## 1. Set up the project ```sh mkdir library && cd library mms init -namespace library ``` ## 2. A first book Each step below shows the declarations it is about. Where a step shows `Book guide` again, it is the same book with something new: change the one you have instead of adding a second, since two books cannot share a name. ```mms Book guide { title = "Library Guide" author = "The Librarian" text = [ "# Welcome", "This world hides {gold}three diaries{/} in old chests.", "", "Press {key:inventory} to see what you carry.", ] } Function guide { /give @s ${guide} } ``` `text` holds one string per line of the book. `# ` makes a bold heading, `{gold}...{/}` colours what is between, and `{key:inventory}` shows whichever key the reader has bound, so it is right for everyone. `${guide}` in a command is the finished book item. Put the cursor in the book and open the **Preview** tab of the web editor (in VS Code, click **Preview** above the `Book`). It draws the open book with the game's own font and texture. ## 3. More pages, and links A line of `---` starts a new page. A link looks like Markdown's, and its target says what a click does: ```mms Book guide { title = "Library Guide" author = "The Librarian" text = [ "# Welcome", "This world hides {gold}three diaries{/} in old chests.", "", "[Contents](page:2 \"Turn to the contents\")", "---", "# Contents", "[Find a chest](run:/function library:chest \"Places a chest here\")", "[About the diaries](page:3)", "---", "# The diaries", "A miner kept them while digging too deep. Collect the set to learn what ||happened||.", ] } Function chest { /setblock ~ ~ ~ chest } ``` - `page:2` turns to a page, and the quoted text after a target is what shows on hover. - `run:/function library:chest` runs a command as the reader. MMS checks that command like any other, so a link to a function that does not exist is an error here and not a dead link in the game. - `||happened||` is obfuscated: the scrambled text the game uses for secrets. In the preview, click the links and the page arrows to walk through the book. The full list of markup is in [Text markup](https://minecraftmetascript.github.io/mms/docs/guides/resources.md#text-markup). ## 4. Values that change `${...}` puts a value in the text. The game fills it in when the reader first opens the book: ```mms /** How many times each player has died. */ Objective deaths: deathCount Book guide { title = "Library Guide" author = "The Librarian" text = [ "# Your record", "Reader: ${@s}", "You have died ${deaths[@s]} times. {dark_gray}Careful.{/}", ] } ``` `Objective deaths: deathCount` is a score the game keeps by itself. `${deaths[@s]}` is the reader's score and `${@s}` their name. The preview lists the values a book uses, with boxes to try numbers and names in. ## 5. Keep long text in a file Strings in a list are fine for a short guide. A story reads better in a file of its own. Make `books/day_12.mmsbook`: ``` # Day 12 The lamps went out again at the bottom of the shaft. We relit them with the last of the *dry* matches. Tomas says the stone down here is **warm**. --- Something knocks behind the east wall. Three knocks, a pause, three knocks. {dark_red}We do not knock back.{/} ``` and read it with `TextFile`: ```mms in=examples/library Book diary_12 { title = "Diary, Day 12" author = "A Miner" generation = tattered text = TextFile("books/day_12.mmsbook") } ``` Step 6 reads `books/day_13.mmsbook` and `books/day_14.mmsbook` too, so make those the same way, with any text. A `.mmsbook` file is the same markup without the quotes. The editor highlights and completes it, previews each page, and checks it in place. A book page shows 14 lines of about 19 characters, and the game cuts off the rest without a word. MMS measures each page with the vanilla font and warns where one runs over ([`book-page-overflow`](https://minecraftmetascript.github.io/mms/docs/guides/lint.md)). Add a `---` there. ## 6. Many books from one declaration Three diaries would be three declarations that differ by a number. A `for` at the top of a file repeats a declaration, and `${day}` in the name gives each copy its own id: ```mms in=examples/library for day in [12, 13, 14] { /** The miner's diary for day ${day}. */ Book diary_${day} { title = "Diary, Day ${day}" author = "A Miner" generation = tattered text = TextFile("books/day_${day}.mmsbook") } } /** A chest of old things: one diary, and some clutter. */ LootTable old_chest { pools = [ Pool(1, [diary_12, diary_13, diary_14]), Pool(1..3, [torch, coal, paper]), ] } /** Places a chest of old things where you stand. */ Function chest { /setblock ~ ~ ~ chest{LootTable:"library:old_chest"} } ``` A book's name works as a loot entry, as a recipe result and in `/give`, like a [custom item](https://minecraftmetascript.github.io/mms/docs/start/tutorial-custom-item.md)'s. The first pool drops one diary, and the second one to three bits of clutter. ## 7. Greet new players The same markup works in chat, titles and the action bar. `OnFirstJoin` runs once for each player, the first time they join: ```mms Book guide { title = "Library Guide" author = "The Librarian" text = ["# Welcome"] } /** The welcome a new reader sees in chat. */ const welcome: Text = "Welcome to the {gold}Library{/}, ${@s}! Press {key:inventory} to find your guide." OnFirstJoin { /give @s ${guide} title(@s, "{gold}The Library", subtitle = "{gray}*mind the shelves*") tell(@s, welcome) } ``` A `const` of type `Text` names a piece of text. Hover it to see it drawn, and put the cursor on a `tell` or `title` to see it in the Preview tab as chat or as a title. Text for chat can live in a file too: a `.mmstext` file is markup without pages, read with `TextFile` in the same way. ## 8. Build and read ```sh mms build --world ~/.minecraft/saves/MyWorld ``` Run `/reload` in the world. You have already joined it, so the first-join greeting will not fire for you: run `/function library:guide` for a copy, or `/advancement revoke @s only library:mms_gen/first_join` to be new again. ## Next steps - [Text](https://minecraftmetascript.github.io/mms/docs/reference/language/text.md) in the language reference lists every piece of markup and where values can go. - Use the same markup in an advancement's title, an item's `lore` or a sign: anywhere the game takes a text component, a string is markup. - The [`library`](https://github.com/MinecraftMetascript/mms/blob/main/examples/library/) example adds a rules message in a `.mmstext` file. # Tutorial: a custom dimension This tutorial builds a dimension of floating islands, step by step. The finished project is [`examples/sky-islands`](https://github.com/MinecraftMetascript/mms/blob/main/examples/sky-islands/), split into `dimension.mms`, `terrain.mms` and `visit.mms`. In the web editor, open it from **Examples**. The tests build it on every change, so it stays in step with the language. A dimension is made of several resources that refer to each other by id: | Resource | Kind | Says | |---|---|---| | `dimension_type` | `DimensionType` | how the world behaves: height, light, sky | | `worldgen/biome` | `Biome` | climate, colours, mobs and features | | `worldgen/noise` and `worldgen/density_function` | `Noise`, `DensityFunction` | the terrain's shape | | `worldgen/material_rule` | `SurfaceRule` | which blocks cover the terrain | | `worldgen/noise_settings` | `NoiseSettings` | the generator: terrain, surface, sea level | | `dimension` | `Dimension` | the dimension itself, tying the rest together | In MMS they can share one file or be split across several, since every file in the project sees every declaration. A name such as `islands` refers to the declaration of that kind in your namespace, and every reference is checked. Completion inside each `{ }` lists the fields the game accepts. ## 1. Set up the project ```sh mkdir sky-islands && cd sky-islands mms init -namespace sky ``` This writes `mms.json` and a starter `main.mms`. You can put everything below in that file, or split it up the way the example does: the dimension type, biome and dimension in `dimension.mms`, steps 4 to 6 in `terrain.mms`, and the function in `visit.mms`. The order of files and declarations does not matter. ## 2. The dimension type ```mms DimensionType islands { height = 256 logical_height = 256 min_y = 0 coordinate_scale = 1 ambient_light = 0.1 has_skylight = true has_ceiling = false has_ender_dragon_fight = false infiniburn = #infiniburn_overworld default_clock = overworld monster_spawn_block_light_limit = 0 monster_spawn_light_level = 0 attributes = { "minecraft:visual/sky_color" = "#9ad0ff" "minecraft:visual/fog_color" = "#d8ecff" "minecraft:visual/cloud_height" = 40 } } ``` The world runs from y = 0 to y = 255. Low clouds at y = 40 drift below the islands. `attributes` holds environment attributes, the 26.3 home of sky, fog and music settings. Hover a field to read what it does. ## 3. A biome ```mms Biome meadow { temperature = 0.7 downfall = 0.6 has_precipitation = true effects = { water_color = "#3f76e4" } carvers = [] features = [] } ``` With no carvers and no features, the islands are bare stone, grass and dirt. To add trees or ores later, list placed features in `features`, one list per generation step. ## 4. The terrain Terrain comes from a density function. Where it is above 0 the generator places `default_block`, and where it is below 0 it leaves air (or `default_fluid` below the sea level). ```mms Noise island_noise { base_octave = -6 amplitude_modifiers = [1, 1, 0.5] } ``` Each entry in `amplitude_modifiers` is one octave. Minecraft also needs `octave_count`, which must match the length of the list. MMS fills it in for you when you leave it out, and reports an error if you set it to a different number. ``` // 0 at y = 128, rising to 1 at y = 32 and y = 224. DensityFunction height = Gradient( axis = y, from_coordinate = 32, to_coordinate = 224, from_value = -1, to_value = 1, ) DensityFunction islands = Noise(island_noise, 1, 2) - height * height - 0.3 ``` - `island_noise` is smooth 3D noise. A lower `base_octave` gives bigger shapes. - `height` is a gradient from -1 to 1 over the height of the world. Squared, it is 0 in the middle and 1 at the ends. - `islands` subtracts that from the noise. Solid blocks appear only where the noise is high and the height is near y = 128. Raising `0.3` makes the islands smaller and further apart. The infix arithmetic compiles to `sub` and `mul` density functions. See [Writing resources](https://minecraftmetascript.github.io/mms/docs/guides/resources.md#density-functions). ## 5. The surface ```mms SurfaceRule surface = [ If(StoneDepth(Floor)) { Block(grass_block) }, If(StoneDepth(Floor).Offset(3)) { Block(dirt) }, ] ``` The rules are tried in order. The top block of each floor becomes grass, and the three blocks below it become dirt. Everything else stays stone. ## 6. The generator settings ``` NoiseSettings islands { sea_level = 0 default_block = stone default_fluid = air disable_mob_generation = false legacy_random_source = false noise = { min_y = 0 height = 256 } material_rule = surface spawn_target = [] noise_router = { final_density = islands temperature = 0 vegetation = 0 continents = 0 erosion = 0 depth = 0 ridges = 0 chunk_surface_level = 0 } } ``` `noise` must match the dimension type's `min_y` and `height`. The router's other entries drive biome placement and aquifers. With a single biome they can all be `0`. ## 7. The dimension ``` Dimension islands { type = islands generator = Noise(settings = islands, biome_source = Fixed(biome = meadow)) } ``` `Noise(...)` and `Fixed(...)` are shorthand for the generator and biome source objects, `{ type = noise, ... }` and `{ type = fixed, ... }`, and completion lists their fields. The names on the right are resolved by the field they are in: `type` names a `DimensionType`, `settings` names a `NoiseSettings`, and `biome` names a `Biome`. They all become `sky:islands` and `sky:meadow` in the JSON. If you mistype one, the editor reports it at once. ## 8. A way in ```mms Function visit { /execute in sky:islands run tp @s 0 160 0 tell(@s, "Welcome to the sky islands") } ``` The command checker knows your project's dimensions, so `in sky:islandz` would be an error. ## 9. Build and play ```sh mms build --world ~/.minecraft/saves/MyWorld ``` Custom dimensions load when a world starts, so restart the world, not just `/reload`, then run `/function sky:visit`. ### Seeing worldgen changes The game never generates a chunk twice: once you have visited a place, a change to the terrain only shows in chunks you have not been to yet. To look at the same place again with your changes, leave the world and build with `--reset-dimensions`: ```sh mms build --world ~/.minecraft/saves/MyWorld --reset-dimensions ``` It deletes the saved chunks of each project dimension whose worldgen changed in this build, following ids: editing a noise that a density function in the dimension's noise settings uses counts, and so does a structure set that can place a structure in one of the dimension's biomes. The seed stays the same, so you see what your change did to the same terrain. The overworld, nether and end are never reset this way; name a dimension to reset it whatever changed, as in `--reset-dimensions=sky:islands` (or `minecraft:the_nether`, which deletes everything built there). The old chunks move to the world's `mms-reset` folder, which keeps only the latest reset, so you can put them back. The build refuses to reset while Minecraft has the world open, because the game would save the chunks it has loaded again; save and quit to title first. If you logged out inside the dimension, you come back at the same place in fresh terrain, which may be inside a hill. In VS Code, tick **Reset changed dimensions** under **Build into world** in the MMS side bar, or use **Reset terrain…** in a dimension's ⋯ menu. ## Next steps - Use a `multi_noise` biome source and the router's `temperature` and `vegetation` entries for several biomes. - Add features to the biome's `features` lists. - Turn on aquifers by adding an `aquifers` block to the settings. - Import a vanilla dimension with `mms import` to see a complete one written in MMS. # Tutorial: a jigsaw dungeon This tutorial grows a dungeon out of rooms and halls, the way the game grows villages and bastions. You build the pieces in the game, MMS wires them together, and the editor shows the layouts the game will make before you open a world. The finished project is the [`jigsaw`](https://github.com/MinecraftMetascript/mms/blob/main/examples/jigsaw/) example. Its pieces are plain stone boxes, so you can also open it from **Examples** in the web editor and follow along without building anything. ## How jigsaw structures work A jigsaw structure starts from one piece. Every piece is a saved build (a `.nbt` structure file), and its doorways are **jigsaw blocks**. A jigsaw block says three things: - its **name**, which other blocks join it by - a **pool**, the list of pieces the next piece is picked from - a **target**, the name of the jigsaw block in that next piece to join onto The game places the start piece, then for each jigsaw block picks a piece from its pool and lines up the two blocks, and so on until the pieces run out, overlap, or the structure is deep enough. ## 1. Plan the names Decide the names before building anything, because they are typed into every piece. This dungeon has rooms and halls that alternate: | Name | On | Draws from pool | Joins onto | | --- | --- | --- | --- | | `room_exit` | each doorway of a room | `halls` | `hall_entry` | | `hall_entry` | the near end of a hall | | | | `hall_exit` | the far end of a hall | `rooms` | `room_entry` | | `room_entry` | one doorway of a room | | | Set up the project and declare the names: ```sh mkdir dungeon && cd dungeon mms init -namespace dungeon ``` ```mms /** The doorways of the start room and of rooms, leading on to a hall. */ JigsawHole room_exit /** The near end of a hall, where it joins a room_exit. */ JigsawHole hall_entry /** The far end of a hall, leading on to a room. */ JigsawHole hall_exit /** The doorway a room joins a hall_exit by. */ JigsawHole room_entry ``` A `JigsawHole` writes no file. It is there so that the editor can offer the names, and so that a typo made in the game's jigsaw screen is a warning in the editor instead of a dungeon that stops growing. ## 2. Build the pieces Build in a flat creative world. Choose it in the editor first: the **World** tab in the web editor (Chrome and Edge), or **Choose World** in the MMS side bar in VS Code. Build the project into it once, so the game knows the `dungeon` namespace. For each piece: 1. **Build it.** Keep to a grid, so that any two pieces meet doorway to doorway. The example uses rooms of 7×7 and halls 5 wide. [Building jigsaw pieces](https://minecraftmetascript.github.io/mms/docs/guides/jigsaw-pieces.md) is a checklist of the things worth agreeing on first: sizes, doorways, materials and lighting. 2. **Place the jigsaw blocks.** Each goes in the outer layer of the piece, in a doorway, facing out. The editor's **Jigsaw** tab (the **Jigsaw** view in VS Code) sets one up: pick the pool, the target and the name, and it copies a `/give` command for a jigsaw block that already has them. The names come from the `JigsawHole` declarations. The pools `halls` and `rooms` are not declared until step 4, so type them for now. Paste it in the game and place the block. 3. **Save it.** Run `/give @s structure_block`, place it at a corner of the piece, switch it to **Save** mode, set the size to cover the piece and name it after its file: `dungeon:halls/hall`. Press **SAVE**. The pieces of this dungeon: | File | Jigsaw blocks | | --- | --- | | `start` | four `room_exit` doorways | | `halls/hall`, `halls/short_hall` | a `hall_entry` at one end and a `hall_exit` at the other | | `rooms/room` | a `room_entry`, and three `room_exit` doorways | | `rooms/vault` | a `room_entry` only: a dead end on purpose | | `caps/hall_cap`, `caps/room_cap` | one `hall_entry` or `room_entry`, turning into stone bricks | The caps are small plugs of wall. They close a doorway when no hall or room fits there. ## 3. Bring them into the project The game saves each piece under the world's `generated` folder. The **Structures** list, in the World tab or the VS Code side bar, shows what the world has saved and marks each one new, imported or changed. **Import** copies it to `structures/` in the project, so `dungeon:halls/hall` becomes `structures/halls/hall.nbt`. After changing a piece in the game, save it again with its structure block and import it again. ## 4. Wire it up One declaration turns the files into a structure. Add it next to the holes from step 1: ```mms in=examples/jigsaw JigsawStructure dungeon { biomes = #minecraft:is_overworld step = underground_structures spacing = 32 separation = 12 height = AboveBottom(20) depth = 6 start = start pools = { start = [Piece("start")] halls = { fallback = caps, elements = [Piece("halls/hall", 3), Piece("halls/short_hall")] } rooms = { fallback = caps, elements = [Piece("rooms/room", 2), Piece("rooms/vault")] } caps = [Piece("caps/hall_cap"), Piece("caps/room_cap")] } } ``` - **Where it generates.** `biomes` is the biomes it may start in, `step` the stage of world generation it belongs to, and `height` where the start piece goes. `spacing` and `separation` are in chunks: one try per 32×32 chunks, at least 12 apart. - **How big it gets.** `depth = 6` stops the dungeon six pieces from the start. - **The pools.** Each entry of `pools` is a pool that jigsaw blocks name. `Piece("halls/hall", 3)` is the file `structures/halls/hall.nbt` with weight 3, so long halls are three times as common as short ones. - **Fallbacks.** When nothing in `halls` fits, or the dungeon is at its depth, the game tries the pool's `fallback`. Here that is `caps`, which walls the doorway up. By hand this is a structure set, a structure and four template pools, each in its own file and each naming the next by id. ## 5. Look before you load Put the cursor in the `JigsawStructure` and open the **Preview** tab (in VS Code, click **Preview** above it). - **Connections** draws the pools and which pieces can join which. A jigsaw block with nothing to join shows red. - **Simulation** grows one layout the way the game does, in 3D. Each jigsaw block is green (joined), red (found nothing) or grey (an end on purpose). **Re-roll** grows another, and **Slice** cuts the view open. `mms check` reads the piece files too. The `jigsaw-` lint rules report a block whose name or pool is unknown, and a target no piece in the pool has. They do not prove that every piece finds room, which is what the simulation is for. Fixing those here is much faster than hunting for a dungeon in a world and finding half of it missing. The simulation leaves the terrain out, and a layout seed is not a world seed. It shows what kind of dungeon the pieces make, not the dungeon at one place in one world. ## 6. Find one in the game ```sh mms build --world ~/.minecraft/saves/MyWorld ``` From the web editor, use **Build into world** in the World tab instead, since the imported pieces are in the browser's project. Structures are read when a world opens, so leave the world and open it again. Then: - `/place structure dungeon:dungeon` builds one where you stand, which is the quickest way to see it. - `/locate structure dungeon:dungeon` finds one that generated. Only chunks made after the pack was added have them, so travel somewhere new. ## Next steps - Add a room. A new piece is one more file and one more `Piece(...)` in a pool, and every layout can use it. - Fill the chests: a chest saved in a piece can name a loot table, and the `structure-unknown-loot-table` lint checks that the table exists. - [Structures](https://minecraftmetascript.github.io/mms/docs/guides/resources.md#structures) in the resources guide covers processors, `spawn_overrides`, pool aliases and the other fields. - The [`treasure`](https://github.com/MinecraftMetascript/mms/blob/main/examples/treasure/) example reuses a vanilla template with its own loot. # Writing resources Every JSON resource kind can be written as an object literal that mirrors the JSON. Two kinds of shorthand sit on top of that. **Helpers from the schema.** Every dispatched type has a helper named after its case: - `Noise(noise = ridge, xz_scale = 1, y_scale = 1)` is `{ type = noise, ... }`. - `SurvivesExplosion()` is `{ type = survives_explosion }`. - Positional arguments fill fields in schema order. A list field takes the remaining arguments. **Shorthand.** Short forms for common shapes, listed below. Each one lowers to exactly the JSON shown, and the schema still checks every field. The `use-shorthand` lint rule suggests the short forms, and imported packs use them automatically. **Vanilla ids.** An id the game itself defines, such as the noise `ridge`, the density function `overworld/continents`, the loot table `chests/simple_dungeon` or the tag `#minecraft:logs`, needs no declaration. Go to definition on one opens the game's own JSON file for it, read-only, in VS Code and the web editor. This works in commands too. ## Loot tables ```mms LootTable chests/gems { pools = [ Pool(1..3, diamond, emerald, #minecraft:logs), Pool(1, [Item(name = gold_ingot).Weight(3)]), ] } ``` | Write | Means | | --- | --- | | `Pool(rolls, entries...)` | `{ rolls, entries = [...] }` | | `diamond` in `entries` | `{ type = item, name = diamond }` | | `#minecraft:logs` in `entries` | `{ type = tag, items = "#minecraft:logs", expand = true }`. The tag is expanded, so each item is equally likely. | | `1..3` as a number provider (`rolls`, `count`, ...) | `{ type = uniform, min = 1, max = 3 }` | ## Conditions and predicates ```mms Predicate stormy_night = WeatherCheck(thundering = true) && !(TimeCheck(clock = overworld, value = 0..12000) || RandomChance(0.5)) ``` | Write | Means | | --- | --- | | `a && b && c` | `{ type = all_of, terms = [a, b, c] }` | | `a \|\| b` | `{ type = any_of, terms = [a, b] }` | | `!a` | `{ type = inverted, term = a }` | A chain of the same operator becomes one list of terms. Parentheses keep a group nested: `(a && b) && c` is `all_of(all_of(a, b), c)`. The same operators work wherever a loot condition is expected, such as an entry's or pool's `condition`. ## Bounds | Write | Means | | --- | --- | | `10..` | `{ min = 10 }` | | `..2` | `{ max = 2 }` | | `1..5` | `{ min = 1, max = 5 }` | These work for int and float ranges and for min/max bounds (scores, counts, distances). ## Recipes and item stacks ```mms Recipe ruby_block = Shaped(["RRR", "RRR", "RRR"], { R = emerald }, emerald_block) Recipe rubies = Shapeless([emerald_block], emerald * 9) ``` | Write | Means | | --- | --- | | `Shaped(pattern, key, result)` | `{ type = crafting_shaped, pattern, key, result }` | | `Shapeless(ingredients, result)` | `{ type = crafting_shapeless, ingredients, result }` | | `emerald * 9` as an item stack | `{ id = emerald, count = 9 }` | ## Advancements ```mms Advancement first_gem { criteria = { has_gem = InventoryChanged(items = [{ items = [diamond, emerald] }]) } } ``` A trigger helper's named arguments are the criterion's conditions. `InventoryChanged(items = ...)` is `{ trigger = inventory_changed, conditions = { items = ... } }`. ## Tags ```mms ItemTag gems = [diamond, #minecraft:logs, Optional(emerald)] ``` | Write | Means | | --- | --- | | `#minecraft:logs` | `"#minecraft:logs"`: another tag's entries | | `Optional(emerald)` | `{ id = emerald, required = false }`: the tag still loads if the entry is missing | ## Structures A structure that generates in new chunks takes four resources, each naming the next: | Kind | Says | | --- | --- | | `StructureSet` | how far apart structures start, with `RandomSpread(spacing = 24, separation = 8, salt = 1)` | | `Structure` | the biomes, the height, and for `Jigsaw(...)` the pool to start from | | `TemplatePool` | the templates (`.nbt` files) to place, with their processors | | `ProcessorList` | rules that change blocks as a template is placed | ### Jigsaw structures `JigsawStructure` writes the first three for a structure grown from jigsaw pieces: ```mms in=examples/jigsaw JigsawStructure dungeon { biomes = #minecraft:is_overworld step = underground_structures spacing = 32 separation = 12 height = AboveBottom(20) depth = 6 start = start pools = { start = [Piece("start")] halls = { fallback = caps, elements = [Piece("halls/hall", 3), Piece("halls/short_hall")] } caps = [Piece("caps/hall_cap")] } } ``` Each entry of `pools` is a `TemplatePool` of that name, so a jigsaw block draws from `:halls`. An entry is a list of pieces, or a whole pool with its `fallback`. `Piece("halls/hall", 3)` is the structure file `structures/halls/hall.nbt` with weight 3. It also takes `projection`, and `processors`: a processor list's id, such as `processors = minecraft:street_plains`, or the processors written inline, such as `processors = [BlockRot(integrity = 0.8)]`. Any other pool element, such as a vanilla template, can go in the list too. The structure set's `salt` is made from the structure's id unless you set it, so two structures never share one by accident. `heightmap = WORLD_SURFACE_WG` measures `height` from the ground, as villages do. `terrain_adaptation` and `max_distance` (80 by default) are the `Structure`'s fields of those names. The name stands for the structure's id in a command, as in `/locate structure ${dungeon}`. The [`jigsaw`](https://github.com/MinecraftMetascript/mms/blob/main/examples/jigsaw/) and [`treasure`](https://github.com/MinecraftMetascript/mms/blob/main/examples/treasure/) examples use it. The other fields of a jigsaw `Structure` are there too, by their own names. `spawn_overrides` replaces the biome's mobs inside the structure, by mob category: this village keeps hostile mobs out of its pieces. ```mms in=examples/jigsaw JigsawStructure village { biomes = #minecraft:has_structure/village_plains step = surface_structures spacing = 34 separation = 8 height = Constant(Absolute(0)) heightmap = WORLD_SURFACE_WG start = start pools = { start = [Piece("start")] } spawn_overrides = { monster = { bounding_box = piece, spawns = [] } } } ``` `bounding_box = piece` covers only the pieces, and `full` the whole box around them. `start_jigsaw_name` names the jigsaw block in the start piece that sits at the structure's center. `liquid_settings = ignore_waterlogging` keeps pieces placed in water from being waterlogged. `pool_aliases` binds stand-in pool names to real pools when the structure starts, as trial chambers do, and `dimension_padding` keeps pieces that many blocks from the bottom and top of the world (a number, or `{ bottom = 10, top = 0 }`). `biomes` has the type `Ids`: a list of ids, or one id or tag. A Blueprint field can use `Ids<...>` the same way. ### Simulating a jigsaw structure The Preview of a jigsaw structure has two tabs. **Connections** shows which pools grow into which. **Simulation** grows one layout the way the game does and shows it in 3D: **Boxes** draws each piece as a box coloured by its depth, with its jigsaw blocks marked green (joined), red (found nothing) or grey (an end on purpose); **Blocks** draws the pieces' blocks as plain coloured cubes. **Slice** cuts the view along x, y or z to see inside. Click a piece to see its pool, its depth, how it is turned and what each of its jigsaw blocks joined. The **layout seed** picks the layout, and **Re-roll** picks another. The simulation is best effort. It follows the game's rules for pools, weights, fallbacks, `depth`, `max_distance`, rotations, overlaps and jigsaw priorities, but leaves out the terrain (`terrain_matching` pieces are placed like rigid ones, and `heightmap` and `terrain_adaptation` are ignored), processors, pool aliases and world height limits. A layout seed is not a world seed: the same layout seed always gives the same layout, but not the one a world shows in some chunk. ### Jigsaw holes A jigsaw block joins pieces by name: its target is the name of a jigsaw block in a piece of its pool. Those names are typed into the game's jigsaw screen, so a typo only shows as a structure that stops growing. `JigsawHole` declares a name, and writes no file: ```mms /** The far end of a hall, leading on to a room. */ JigsawHole hall_exit ``` This declares `:hall_exit`. The editors list the declared holes where a jigsaw block's name or target is chosen: the **Jigsaw** view in VS Code, and the **Jigsaw** tab in the web editor, which copy a `/give` command for a set-up jigsaw block, keep the ones you copied under **Recent**, list the jigsaw blocks already in the project's structure files, and offer **Declare it** for a name no `JigsawHole` declares. Once a namespace declares a hole, the `jigsaw-unknown-name` lint reports a jigsaw block in a structure file whose name or target in that namespace is not declared, with the closest declared hole and a fix that declares it. The [`jigsaw`](https://github.com/MinecraftMetascript/mms/blob/main/examples/jigsaw/) example declares its holes. The jigsaw preview's piece details also copy a `/give` for each jigsaw block of a piece, for another block set up the same way. To have several people or AI agents build pieces at once, write down the names, sizes and materials first: [Building jigsaw pieces](https://minecraftmetascript.github.io/mms/docs/guides/jigsaw-pieces.md) is a template for that spec. A template's chests can get a loot table from a `Rule` processor with `block_entity_modifier = AppendLoot(chests/buried)`. That works on vanilla templates too, so a structure can reuse one without its own `.nbt` file. The [`treasure`](https://github.com/MinecraftMetascript/mms/blob/main/examples/treasure/) example does this in `worldgen.mms`. ## Density functions `+`, `-`, `*` and `/` build `add`, `sub`, `mul` and `div`. Arithmetic on constants is folded. A unary `-x` is `x * -1`. ### Splines A `Spline` maps its coordinate through a curve. Each point has a `location` on the coordinate, the `value` there and the curve's slope there (`derivative`). A point's value can be another spline, which is how vanilla mixes continentalness, erosion and weirdness into terrain height. `SplinePoint(...)` takes location, derivative and value, in that order: ```mms DensityFunction offset = Spline({ coordinate = overworld/continents points = [ SplinePoint(-1.1, 0, 0.044), SplinePoint(-0.2, 0, { coordinate = overworld/erosion points = [SplinePoint(-0.8, 0, 0.3), SplinePoint(0.5, 0, -0.1)] }), SplinePoint(0.6, 0.4, 0.8), ] }) ``` With the cursor in a spline, the Preview tab of the web editor shows its curve, worked out the way the game does. Drag a point to change its location and value, or select it and drag its handle to change its slope; hold Shift to snap. Each drag rewrites the numbers in the source, so undo works as usual. Double-click the graph to add a point, and press Delete to remove the selected one. To start a spline from the graph, write `Spline()` and double-click: the first point writes the spline, with `coordinate = 0` to replace. A number written as a const or an expression shows but cannot be dragged. A hollow point's value is a spline of its own: click it to open that spline, and use the sliders under the graph to pick the values of the nested splines' coordinates. In VS Code, the **Edit spline** lens above a `Spline(` opens it in the preview panel, which then follows the spline at the cursor. Points must go from the lowest location to the highest, because the game looks them up in that order. The `spline-order` lint reports a point out of order, with a fix that sorts them. ## Inline values where an id is needed Some fields need an id, and the game will not load an inline value there. Examples are a surface rule's `NoiseThreshold` noise, a biome source's biome, and a template pool's fallback. A density function's noise is in the same group. The schema allows it inline, but the game seeds each noise from its id, so an inline noise fails when the world loads. You can still write the value inline in those fields. MMS checks it as its own declaration, writes it under `mms_gen/`, and puts its id in the field: ```mms DensityFunction hills = Noise({ base_octave = -6, amplitude_modifiers = [1, 1] }, 1, 1) ``` This writes `worldgen/noise/mms_gen/hills/noise.json` and gives `hills` the noise `:mms_gen/hills/noise`. A second inline value of the same kind in the same declaration is named `noise_2`, and so on. Each inline noise gets its own id, so two identical inline noises still produce different noise. To share one noise, declare it with a name. Where the game does take inline values, such as density functions, features and surface rules, they stay inline. To turn an inline value into a declaration of its own, put the cursor in it and open the code actions (Ctrl/⌘+. in VS Code and the web editor). **Extract { ... } to a Noise declaration** moves the value above the declaration that holds it, as `Noise hills_noise { ... }`, and writes `hills_noise` in its place. The action is offered for every value the build would write under `mms_gen/`, and for any inline value where an id of its kind would also do, such as an inline density function or predicate. The new name is the holding declaration's name and the field's name (or the kind's, for an argument), with a number added if it is taken. VS Code and the web editor open the rename box on it straight away. A function id takes `run { }`, a block of commands compiled as a `Function` with no parameters: ```mms Advancement found { criteria = { got = { trigger = inventory_changed } } rewards = { function = run { /say found it } } } ``` A plain `{ }` there is an error, with a quick fix that adds `run`. ## Asset files Textures, sounds and structure templates are files, not declarations. Keep them anywhere in the project and name them where they are used: ``` PaintingVariant sunset { width = 2, height = 1, asset_id = Texture("art/sunset.png") } JukeboxSong tune { sound_event = Sound("music/tune.ogg"), description = "Tune", length_in_seconds = 30, comparator_output = 3 } TemplatePool houses { fallback = minecraft:empty, elements = [WeightedElement(1, SinglePoolElement(rigid, StructureFile("builds/house.nbt"), minecraft:empty))] } ``` Each call stands for the id the file gets in your namespace: its base name, lowercased, or the second argument, as in `Texture("art/Sunset Final.png", "sunset")`. Only files that code uses are copied, to the path the game expects: | Helper | File | Copied to | | --- | --- | --- | | `Texture` | `.png` | `assets//textures/.png`, where the field sets the prefix, such as `painting/` | | `Sound` | `.ogg` | `assets//sounds/.ogg`, plus an entry in a generated `sounds.json` | | `StructureFile` | `.nbt` | `data//structure/.nbt` | Inside the quotes, completion lists the project's files of the helper's type, in VS Code and the web editor. A path to a file that is not there is an error. Textures, sounds and [resource pack declarations](#resource-packs) go into a resource pack built next to the data pack: `build-resources/` (set `resourcePack.output` in `mms.json` to change it), `-resources.zip` with `mms build --zip`, and `/resourcepacks/resources.zip` with `mms build --world`, the world's bundled pack, which Minecraft applies by itself when you open the world (rejoin after a rebuild). It is not sent to LAN players; a server needs `resource-pack` in `server.properties`. `"icon": "art/icon.png"` in `mms.json` becomes `pack.png` in both packs. A world has only one bundled pack, so `--world` merges into it instead of overwriting it: build several projects into the same world and each keeps its files. Rebuilding a project replaces only the files it wrote last time, recorded in `mms-world-pack.json` inside the zip (Minecraft ignores it). Lang files, `sounds.json`, atlases and fonts that several projects write are merged: keys are combined and atlas sources and font providers are appended. Any other file two projects both write goes to the one built last, with a warning. A `resources.zip` that MMS did not write, such as a hand-made pack, is kept the same way. The description in `pack.mcmeta` lists every pack in the zip. Data packs already sit side by side, in `/datapacks/`. The last line `mms build --world` prints says what to do in the game, from what changed since the last build into that world: `next step: run /reload in the world` when only functions, loot tables, recipes, advancements, predicates, item modifiers, structure templates or tags of built-in registries (blocks, items, entity types...) changed, and `next step: exit and rejoin the world` when worldgen, dimensions, other registry entries (enchantments, variants, damage types, dialogs...), their tags or the resource pack changed, since Minecraft reads those only when the world is opened. `next step: none` means the build wrote the same files as before. The VS Code World view shows the same advice after each build. The web editor's **World** tab does the same build in Chrome and Edge: **Choose world…** picks a world folder (the browser asks to let the page edit it, and asks again on the first build of a later visit), and **Build into world** writes the data pack and merges the resource pack exactly as `mms build --world` does. Below it, **Structures** lists what structure blocks saved in the world, to import into the project for template pools, and marks imported ones that no pool uses yet, like VS Code's Structures view. Other browsers cannot write to a folder: the World tab offers the downloads instead, and Structures reads a picked world folder as it was when picked. Where the game takes a sound event either by id or inline, as a jukebox song's `sound_event` does, `Sound(...)` writes it inline, `{ "sound_id": "my_pack:tune" }`: the game's sound event registry is fixed, so a pack's own sound cannot be named there by id. Once a file is included, its id can also be written plainly elsewhere, with its namespace, such as `asset_id = my_pack:sunset`. An id in your namespace that nothing provides is reported by the [`external-asset`](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) lint rule. Ids never include the file extension: the game adds `.png`, `.ogg`, `.nbt` or `.json` itself, so `my_pack:sunset.png` would name `sunset.png.png`. MMS warns about an id written with one (`mms/asset-extension`, with a quick fix) and leaves it out of the output. The web editor holds asset files too: **+ Add texture or sound** under the sources adds `.png`, `.ogg` and `.nbt` files, which keep their file name as their path. **Download resources** appears next to **Download pack** once there is a resource pack. Project zips carry the asset files both ways. The [`embers`](https://github.com/MinecraftMetascript/mms/blob/main/examples/embers/) example ships its own art: [custom items](#custom-items) with their own textures, a painting, a music disc with its own song, translations and a pack icon. ## Resource packs Block states, models and the other JSON files of a resource pack are declarations too. They are written to `assets//...` in the resource pack, and the schema checks them like any other resource. ``` BlockState minecraft:glowstone { variants = { "" = [ { model = block/glowstone_1, weight = 3 }, { model = block/glowstone_2, y = 90 }, ] } } Model block/glowstone_1 { parent = block/cube_all, textures = { all = Texture("art/glow1.png") } } Model block/glowstone_2 { parent = block/cube_all, textures = { all = Texture("art/glow2.png") } } ``` | Kind | Writes | For | | --- | --- | --- | | `BlockState` | `blockstates/` | which model a block shows in each state: `variants`, weighted lists, `multipart` | | `Model` | `models/` | block and item models, with `parent`, `textures` and `elements` | | `ItemModel` | `items/` | the item model definition that the `item_model` component names | | `Lang` | `lang/` | translations, such as `Lang en_us { "item.my_pack.charm" = "Charm" }` | | `Equipment` | `equipment/` | worn armour layers, named by the `equippable` component's `asset_id` | | `Font`, `Atlas`, `Particle`, `PostEffect`, `WaypointStyle` | `font/`, `atlases/`, `particles/`, `post_effect/`, `waypoint_style/` | as in the game | A block state is named after the block it replaces, such as `minecraft:glowstone`: the game only reads block states of its own blocks. Variant keys (`"facing=north,lit=true"`, or `""` for every state) and multipart `when` conditions are checked against the block's properties, and the editor completes property names in `when`. In a model's `textures`, a value is a texture id, `"#name"` for another slot, or `Texture("file.png")`. A texture id can name a vanilla texture, such as `block/stone`. The game only finds a model's textures in two atlases: the blocks atlas, which stitches every file under `textures/block/`, and the items atlas, which stitches `textures/item/`. So `Texture("art/glow1.png")` in a model copies the file to `textures/block/glow1.png` and stands for `:block/glow1`, which works in block and item models alike. Give it an id name to put it elsewhere, such as `Texture("art/glow1.png", "item/glow1")`. A texture a model names that neither atlas stitches shows as the missing texture, and the [`texture-outside-atlas`](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) lint rule warns about it; an `Atlas minecraft:blocks` declaration that adds the texture as a source counts. Keep a model's textures in one atlas: the game rejects a model that mixes the two. `sounds.json` is still generated from `Sound(...)`, and textures cannot have `.png.mcmeta` animation yet. The [`resource-pack`](https://github.com/MinecraftMetascript/mms/blob/main/examples/resource-pack/) example shows each kind with vanilla textures; [`embers`](https://github.com/MinecraftMetascript/mms/blob/main/examples/embers/) uses files of its own. ## Custom items Data packs cannot add items, but they can give a vanilla item a new look and name with its `item_model` and `item_name` components. That takes a model, an item model, a translation and the same components at every use. `CustomItem` writes all of it from one declaration: ```mms in=examples/embers CustomItem ember_shard { base = amethyst_shard name = "Ember Shard" texture = Texture("art/ember_shard.png") components = { rarity = rare } } ``` This writes `models/item/ember_shard.json` (a flat `item/generated` model of the texture), `items/ember_shard.json`, and `"item.embers.ember_shard": "Ember Shard"` in `lang/en_us.json`, merged with any `Lang en_us` declaration in the namespace. `Texture("...")` copies the file to `textures/item/ember_shard.png`. | Field | | | --- | --- | | `base` | the vanilla item it is made from, which decides how it behaves | | `name` | its name in English, or one per language: `{ en_us = "Ember Shard", de_de = "Glutsplitter" }`. The `item_name` component also carries the English text as a fallback, so the name shows without the resource pack | | `texture` | the picture for a flat item model | | `parent` | the generated model's parent: `item/generated` by default, `item/handheld` for tools | | `model` | an existing model to show instead of one made from `texture` | | `item_model` | an `ItemModel` id, or an item model body such as `{ model = Select(...) }`, instead of the generated one | | `on_right_click`, `on_hit`, ... | functions to run when a player uses the item; see [item hooks](https://minecraftmetascript.github.io/mms/docs/guides/functions.md#item-hooks) | | `components` | more item components, given to every use | Without `texture`, `model` or `item_model`, the item keeps its base item's look and only gets its name and components. The item's name stands for the base item with its components: ``` Recipe ember_shard = Shapeless([blaze_powder, amethyst_shard], ember_shard * 2) LootTable cache { pools = [Pool(1, [Item(name = ember_shard, modifier = [SetCount(2..5)])])] } Function give { /give @s ${ember_shard} 16 } ``` - **Item stacks**, such as recipe results: `ember_shard`, `ember_shard * 2`, or `{ id = ember_shard, count = 2, components = { ... } }`, whose components are added to the item's own. - **Loot entries**: `ember_shard` or `Item(name = ember_shard, ...)` drop the base item with a `set_components` modifier ahead of the others. - **Commands**: `${ember_shard}` writes `amethyst_shard[item_model="embers:ember_shard",item_name={...}]`. Anywhere else that takes an item id, such as a recipe ingredient or an item tag, a custom item is written as its base item, so changing `base` updates every use. The game matches those fields by item id only, so `{ A = ember_shard }` in a recipe accepts any amethyst shard, not only ember shards. The [`custom-item-as-base`](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) hint marks each such use, and editors show the base item after the name. A custom item's own `base` must be a vanilla item. A `Model`, `ItemModel` or `Lang` entry that the custom item also writes is reported as a duplicate. To run code when a player right-clicks with the item, hits with it, eats it and so on, set its `on_*` fields to functions; see [item hooks](https://minecraftmetascript.github.io/mms/docs/guides/functions.md#item-hooks). ## Books A `Book` is a written book. Its pages are written in book markup, a small Markdown-like format, instead of text components: ``` Objective deaths: deathCount Book guide { title = "Library Guide" author = "The Librarian" text = [ "# Welcome", "This world hides {gold}three diaries{/} in old chests.", "Press {key:jump} to climb.", "---", "[Find a chest](run:/function library:chest \"Places a chest here\")", "You have died ${deaths[@s]} times.", ] } ``` `text` holds one string per line. A line of `---` starts a new page. Long text reads better from its own file: `text = TextFile("books/diary.mmsbook")` reads a `.mmsbook` file in the project, where the editor checks and completes the markup and shows its problems in the file itself. A book can also read a `.mmstext` file, which has no pages. | Field | | | --- | --- | | `title` | the title on the cover and the item's name, at most 32 characters | | `author` | shown as "by ..." under the title | | `generation` | `original` (the default), `copy`, `copy_of_copy` or `tattered`. The last two cannot be copied in a crafting table | | `text` | the pages in book markup, as strings or `TextFile("....mmsbook")` (or a `.mmstext` file) | | `pages` | the pages as text components, for full control, instead of `text` | | `components` | more item components, such as `lore`, given to every use | Raw `pages` are text components written as MMS objects, so click and hover events read like the JSON: ``` pages = [ { text = "Hi!" shadow_color = "#80000000" hover_event = { action = show_text, value = "Yeet!" } click_event = { action = change_page, page = 2 } }, ] ``` The book's name stands for the book wherever a [custom item](#custom-items) name works: `guide` in a loot entry, `guide * 2` as a recipe result, and `${guide}` in `/give @s ${guide}`. `Book` is a Blueprint in the prelude, like `CustomItem`. It lays out its text with `book_pages(text)`, which also works anywhere else a list of pages goes, such as the `pages` of a `SetWrittenBookPages` loot function: `pages = book_pages(TextFile("books/diary.mmsbook"))`. ### Text markup Book markup is the language's one text format. Wherever a text component goes, such as an advancement's title, a text display, a sign, an item's `lore` or a dialog, a string is markup. A string with no markup in it is the same string in the output, so plain names stay plain: ``` Advancement first_gem { display = { title = "**First gem**" description = "{gray}Mine a {aqua}diamond{/} or an {green}emerald" ... } } ``` `TextFile("text/rules.mmstext")` reads markup from a `.mmstext` file in the project, for text anywhere. Page breaks (`---`) and page links (`[..](page:2)`) work only in a book's text: in a `.mmsbook` file or a Book's `text`. Outside a book, a `{...}` style runs to the end of the text without `{/}`, and a style mark that is never closed, such as the `*` in `"5 * 3"`, is the character itself, which the [`accidental-markup`](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) hint points out. Write `\*` to say so. | Markup | Shows | | --- | --- | | `# Heading` | a bold line | | `**bold**`, `*italic*`, `__underlined__`, `~~struck~~`, `\|\|obfuscated\|\|` | styled text | | `{gold}...{/}` | a color: one of the 16 named colors, or `#ff8800` | | `{bold red}...{/}` | styles combined: `bold`, `italic`, `underlined`, `strikethrough`, `obfuscated`, colors, `shadow:#3f1f00` (or `#3f1f0080`, or `none`) and `font:uniform` | | `{key:jump}` | the key the reader has bound, such as Space | | `{sprite:item/diamond}` | an inline icon; `atlas:gui` picks another atlas | | `{head:Notch}` | a player's head | | `{t:block.minecraft.stone}` | a translated text | | `[text](page:2)` | turns to page 2, in a book | | `[text](run:/function demo:start)` | runs a command as the reader; MMS checks the command | | `[text](suggest:/tp @s ~ ~10 ~)`, `[text](copy:12345)`, `[text](https://...)` | puts text in chat, copies it, or opens a web page | | `[text](hover:A red gem)`, `[text](page:2 "Next")` | hover text, alone or after a target | | `${kills[@s]}`, `${wave}` | a score or a Global, filled in when the text is shown (for a book, when the reader first opens it) | | `${@s}` | the names of the entities a selector finds, filled in the same way | | `\*` | the character itself | A book page shows 14 lines of about 19 characters. Text past the last line is cut off in game, so the [`book-page-overflow`](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) warning marks where a page runs over, measured with the vanilla font. Add a `---` line there. ### Previewing a book The web editor's Preview tab shows a book as the game does: the open book texture, the page in the vanilla font with its colors and styles, scrambled `||obfuscated||` text, inline sprites and heads, and the page arrows. Click a page link or the arrows to turn pages, and point at a link to see its hover text. Clicking a command, copy or web link says what it would do. Scores, Globals and selectors are filled in when the reader first opens the book, so the preview lists them with sample values to try. The preview opens on the page the cursor is in, including in a `.mmsbook` file. In VS Code, the Preview lens above a `Book` opens it in the preview panel, and each page of a `.mmsbook` file has a "Preview page N" lens. The font, book texture and English translations come from the game's 26.3 assets, downloaded on first use. Project fonts that use their own textures, project textures in sprites, and real player skins are not drawn: those show as boxes, the missing-texture square and the default skin. The [`library`](https://github.com/MinecraftMetascript/mms/blob/main/examples/library/) example has a guide given on first join and diaries in a chest loot table. # Functions `Function` bodies and event hooks (`OnLoad`, `OnTick`, `OnFirstJoin`, `OnRespawn`, `OnAdvancement`) compile to `.mcfunction` files. ## Raw commands A line that starts with `/` is a command. It is written to the output as it is, without the slash: ```mms Function greet { /say hello /execute as @a at @s run particle minecraft:heart ~ ~2 ~ } ``` Every command is checked against the 26.3 command tree, the same one the game uses. The checker reports: - unknown commands and options, with the alternatives - missing and extra arguments - argument syntax: numbers and their bounds, selectors and their options, coordinates, ids, ranges, and balanced NBT and text - unknown vanilla ids, such as `minecraft:diamnd` - ids in your own namespaces that nothing declares, such as `function demo:missing` Completion inside a command offers the next literal and values for the argument being typed. These include selectors, game modes, registry ids, and your project's functions, tags and objectives. Hovering a word of a command shows the forms the command can take from that word on, in the game's `/help` syntax, so hovering `/data` lists `data get (block|entity|storage)` and the rest, and hovering `get` lists the arguments of each `data get` form. The checker checks syntax, not meaning. Whether an entity exists, or whether an NBT path fits the entity, is left to the game. ## Values and variables Function code computes with whole numbers (`int`, 32-bit, wrapping like the game's scoreboards) and `bool`s. ```mms Global deaths: int = 0 // one value for the whole pack Objective kills: deathCount // a score per player Function on_death { deaths += 1 kills[@s] = 0 // a score: objective[holder] let streak = kills[@s] * 2 // a local; its type is inferred let lucky: bool = streak > 10 } ``` - **Globals** are set once, when the pack first loads. A `/reload` keeps their values. - **Locals** (`let`) belong to their function. A name in an inner block can shadow an outer one. - **Objective scores** are written `objective[holder]`. The holder is a selector, or a fake player name in quotes, such as `kills["#total"]`. ### Storage records A `Storage` keeps a record, a `Type` with fields, in command storage. Functions read and write its `int`, `bool` and `string` fields by name: ```mms /** The state of a siege. */ Type SiegeState { wave: int = 0 boss_alive: bool /** Mobs still to spawn this wave. */ queue: [Id] = [] } /** Kept in storage siege:mms game. */ Storage game: SiegeState Function next_wave { game.wave += 1 game.boss_alive = game.wave % 5 == 0 tell(@a, "Wave ${game.wave} begins") } ``` A field that holds a record, written in place or as another `Type`, is reached by its path, such as `game.spawn.x`. A field can also hold one of a few strings, such as `mode: "siege" | "raid"`, or one of a few whole numbers, such as `tier: 1 | 2 | 3`. Functions read it as a string or an int, and setting it to any other literal is an error. The load function sets each missing field to its default. A field without one starts at `0`, `false`, `""`, or the first of its strings or numbers. A `/reload` keeps the values, and a field added later starts at its default. The record is at `:mms `, so `/data get storage siege:mms game` shows it in the game. Fields of other types, such as `queue`, are stored and given their defaults, but functions do not read them yet. Completion after `game.` lists the fields, and hovering one shows its type and doc comment. A field costs a storage read and write each time a function uses it. A `Global` is a score, so it is cheaper in a tight loop. ### Selectors A selector used in many places can be named with a `const`, and one that changes with a value with a `Template` of type `Selector`. Either works wherever a selector does: as a score holder, in `tell`, in an execute helper, and in a raw command as `${boss}`: ```mms Objective hp const boss = @e[tag=siege.boss, limit=1] Template near(r: int): Selector = @a[distance=..${r}] Function hit_boss { /effect give ${boss} glowing 5 hp[boss] -= 1 tell(near(16), "The boss has ${hp[boss]} hp left") As(near(8)).At(@s) { /particle minecraft:crit ~ ~1 ~ } } ``` Square brackets after a named selector add options to it: ```mms Objective hp Objective kills const guards = @e[type=zombie, tag=guard, scores={hp=1..}] const veterans = guards[tag=veteran, scores={kills=5..}] const mobs = @e[type=!player, tag=mob] Function patrol { tell(guards[limit=1, sort=nearest], "Halt!") As(mobs[type=!item]) { /say on patrol } /effect give ${veterans} strength 10 } ``` `veterans` is `@e[type=zombie,tag=guard,scores={hp=1..,kills=5..},tag=veteran]`. Options add up as the game reads them: | Options | Added | |---|---| | `tag`, `predicate`, `nbt` | always, and each one narrows the match | | `type`, `name`, `gamemode`, `team` | when every one is negated, as in `type=!item` | | `scores`, `advancements` | merged into the base's, one entry per objective or advancement | | any other, such as `limit` or `distance` | only when the base does not set it | Anything else is an error that names the option the base already sets. The value is written into each place it is used, so a named selector costs nothing in the game. Hovering the name shows the selector. Option names are checked where the selector is written, with a fix for a misspelled one, and a value given for a `Selector` must be a selector or a player name in quotes. `exists(target)` tells whether a selector finds any entity, and `count(target)` how many it finds: ```mms const boss = @e[tag=siege.boss, limit=1] Function check { if (!exists(boss)) { /summon wither_skeleton ~ ~ ~ {Tags:["siege.boss"]} } let zombies = count(@e[type=zombie, distance=..16]) } ``` ### Predicates A `Predicate` is a condition in function code: its name is a `bool` that tests `if predicate :` for the entity and place the code runs as. ```mms Predicate sneaking = EntityProperties(entity = this, predicate = { flags = { is_sneaking = true } }) Function on_use { if (sneaking && !exists(@e[tag=boss, distance=..8])) { /say quiet now } let crouched: bool = sneaking } ``` It works wherever a condition does, with `!`, `&&` and `||`, and a predicate of another namespace is written with its id, as in `other:sneaking`. A local or parameter of the same name hides it, with a hint, and a `Global` of the same name wins, with a warning. Either way, `:sneaking` still names the predicate. ### Operators | Operators | Meaning | |---|---| | `+ - * / %` | Arithmetic. Division rounds down and `%` takes the divisor's sign, as the scoreboard does. | | `< <= > >= == !=` | Comparisons. | | `&& \|\| !` | Logic. The right side of `&&` and `\|\|` only runs when it is needed. | Constant parts are folded at compile time. ### Command results A command after `=` is a value: what the command returns, as `execute store result` would store it. Assigned to a `bool`, it is whether the command succeeded, as `execute store success` would store it. ```mms Objective checks Function inspect { let items = /data get block ~ ~ ~ Items let is_chest: bool = /execute if block ~ ~ ~ chest if (is_chest && items > 20) { /say this chest is nearly full } checks[@s] = /time query gametime } ``` - The command runs to the end of the line, as a command on a line of its own does, and `${...}` works in it the same way. - It works wherever a value is assigned: `let`, `=` to a local, a `Global`, a score or a `Storage` field. It is not part of a larger expression, so write `let n = /data get ...` and then use `n`. - A result is a whole number. To read text, such as a block's id, copy it into a `Storage` field with `/data modify storage ... set from ...` and read the field. ### Strings `string` values live in command storage (`:mms`). They can be joined with `+`, appended with `+=`, and compared with `==` and `!=`. Ints and bools join as their text. ```mms Global motd: string = "Welcome" Function welcome(name: string) { let line = motd + ", " + name + "!" if (name == "Notch") { line += " Nice to meet you." } tell(@a, "${line}") } ``` ### Lists of constants A `const` list of ints or strings can be read in function code. `len(list)` is its length, and `list[i]` is an item. When `i` is known only as the function runs, such as a Storage field, each item gets its own branch. An index outside the list gives `0` or `""`. Shift-right-clicking an item to cycle through modes looks like this: ```mms const modes: [string] = ["Measure", "Replace"] Type ToolState { mode: int } Storage tool: ToolState Function next_mode { tool.mode = (tool.mode + 1) % len(modes) actionbar(@s, "Mode: ${modes[tool.mode]}") } ``` `index_of(list, value)` goes the other way: the position of the first item equal to `value`, counting from 0. A value known when compiling, such as `index_of(modes, "Replace")`, becomes its number, and it must be in the list. A value known only as the function runs is tested against each item, and gives `-1` when none matches: ```mms const modes: [string] = ["Measure", "Replace"] Type ToolState { mode: int picked: string = "Measure" } Storage tool: ToolState Function pick_mode { let i = index_of(modes, tool.picked) if (i == -1) { actionbar(@s, "No mode named ${tool.picked}") return } tool.mode = i } ``` ## Interpolation `${expr}` puts a value into a command: ```mms Function report(points: int) { /say ${points} points, ${points * 2} doubled /scoreboard players set @s kills ${points} } ``` - **Constant values** (literals, constant arithmetic) are written into the command at compile time. - **Run-time values** turn the line into a [macro](https://minecraft.wiki/w/Function_(Java_Edition)#Macros): the values are copied into storage, and a one-line macro function runs the command. - **Quotes:** a string with a `"` in it will break a command that wraps it in quotes, just as it would in a hand-written macro. ## Text commands `tell`, `title` and `actionbar` show [text markup](https://minecraftmetascript.github.io/mms/docs/guides/resources.md#text-markup) to players: ```mms Global wave = 1 Objective kills Function start_wave { tell(@a, "{red}Wave ${wave}{/} begins. [Rules](run:/function siege:rules)") title(@a, "{gold}Wave ${wave}", subtitle = "{gray}*hold the banner*") actionbar(@s, "**${kills[@s]}** kills") } ``` - `tell(target, message)` writes `/tellraw`, `title(target, message, subtitle = ...)` writes `/title ... title` (after `subtitle`, when it is given), and `actionbar(target, message)` writes `/title ... actionbar`. - The message is a string of markup, a `const` or `Template` of type `Text`, or `TextFile("text/rules.mmstext")`. - `${...}` in the message is part of the text component, filled in by the game when the message is shown: a score, a Global, a variable, a selector such as `${@s}` (the names it finds), or a constant. A computed value such as `${n * 2}` is worked out just before the command. No macro is needed. In the web editor, the Preview tab shows the message at the cursor as the game shows it: in chat, as a title with its subtitle, or above the hotbar, with values to try for the scores and selectors in it. The cursor in a `.mmstext` file that a text command reads shows that message. ## Control flow ```mms Function classify(x: int): int { if (x > 100) { return 2 } else if (x > 0) { return 1 } return 0 } Function count { for i in 1..10 { // both ends included, like 1..10 in a selector if (i % 2 == 0) { continue } /say odd } let n = 0 while (n < 5) { n += 1 if (n == 3) { break } } } ``` A function with a return type must end with `return` on every path. ## Calls A call looks like `add(1, 2)`, or `other_ns:add(1, 2)` for a function in another namespace. Arguments are passed by position. A call can stand on its own, or be used as a value when the function has a return type. Parameters are `int`, `bool` or `string`. Functions return `int` or `bool`. A `Type` that names one of these, such as `Type Count = int`, can be used instead. To hand a string back, assign it to a Global. ## Command templates A `Template` that returns `Commands` writes its body where it is called, at compile time. Its loops unroll and its `${...}` pieces are filled in, so it costs no function call in the game: ```mms /** A ring of particles around the executor. */ Template particle_ring(p: Id, radius: int, points: int = 8): Commands { for i in 0..points - 1 { /particle ${p} ^${radius * cos(i * 360 / points)} ^1 ^${radius * sin(i * 360 / points)} } } Function celebrate { As(@a).At(@s) { particle_ring(flame, 2) } } ``` Its call looks like a function call, so the editor marks it with an `inlined` hint. Hovering the hint or the name shows the commands it writes. Arguments are compile-time values. A variable, a `Global` or a `Storage` field is passed as its value when the function runs, so the template can use it in commands and code but not in a compile-time loop. ## Execute blocks A chain of execute helpers followed by a block runs the block under `execute`: ```mms Objective hits Function zap { As(@e[tag=tower]).At(@s) { /particle minecraft:flame ~ ~1 ~ hits[@s] += 1 } Positioned(~ ~1 ~) { /say above } Execute("if entity @e[tag=boss]").In(the_nether) { /say the boss is here } } ``` | Helper | Subcommand | |---|---| | `As(targets)` | `as` | | `At(targets)` | `at` | | `Positioned(pos)`, `Positioned(targets)` | `positioned`, `positioned as` | | `Rotated(rot)`, `Rotated(targets)` | `rotated`, `rotated as` | | `Facing(pos)`, `Facing(targets, anchor)` | `facing`, `facing entity` (the anchor defaults to `eyes`) | | `In(dimension)` | `in` | | `Anchored(eyes)` | `anchored` | | `Align(xyz)` | `align` | | `On(relation)` | `on` | | `Summon(entity)` | `summon` | | `Execute("...")` | any subcommands, written as text | Arguments are written into the command as they appear: selectors as `@e[tag=x]`, coordinates as `~ ~1 ~` or `0, 64, 0`, ids as `the_nether`. The chain is checked against the command tree like a raw command, and `Execute("...")` covers conditions such as `if block` and anything without a helper. A whole coordinate or angle of `Positioned`, `Rotated` or `Facing` can also be a value the function computes: a variable, a parameter, a `Global`, a `Storage` field, a score or arithmetic on them. A relative or local coordinate takes a name straight after its `~` or `^`, as `~dx` or `^-step`; the name is a variable, a parameter, a `Global` or a `Storage` field such as `~game.height`, and anything bigger goes in a `let` first. A `const` is written straight into the command. ```mms Global spawn_y: int = 64 Function mark(x: int, z: int, dy: int) { Positioned(x, spawn_y + 1, z).Rotated(x * 2, 0) { /summon minecraft:marker ~ ~ ~ {Tags:["mark"]} } Positioned(~ ~dy ~-x) { /summon minecraft:marker ~ ~ ~ {Tags:["offset"]} } } ``` The game only takes numbers written into a command there, so a chain that holds such a value runs as a macro: MMS copies the values into storage and calls a one-line function, here `$execute positioned $(a0) $(a1) $(a2) rotated $(a3) 0 run summon ...` and `$execute positioned ~ ~$(a0) ~$(a1) run summon ...`. The values are whole numbers, worked out once before the block runs. `~dx` is one word: `~ dx` is a coordinate and then a name. A body with one command is written inline, as `execute as @a at @s run particle ...`. A longer body becomes a sub-function, such as `demo:zap/_exec0`. The body can use the function's variables. They are not per entity: a body that runs for five entities updates one `n` five times. Keep per-entity values in an objective, such as `hits[@s]`. `break`, `continue` and `return` cannot leave an execute block, because the block may run once per entity. Set a variable inside it and act on it afterwards. ## Event hooks These declarations run their body when something happens, as the player it happens to, at their position: ```mms Objective banners /** Counts every banner a player places. */ OnAdvancement placed_banner = PlacedBlock(location = LocationCheck(predicate = { block = { blocks = #banners } })) { banners[@s] += 1 } OnFirstJoin { /give @s minecraft:bread 4 } OnRespawn { /effect give @s minecraft:regeneration 5 1 } ``` - **`OnAdvancement name = Trigger(...) { ... }`** runs each time a player meets a trigger. The trigger is one of the criterion helpers, such as `PlacedBlock`, `PlayerKilledEntity`, `InventoryChanged` or `Tick`, and its named arguments are the conditions. It writes the advancement `:` and a reward function, `:mms_gen/advancement/`, which revokes the advancement and then runs the body, so it fires again next time. Commands can refer to it, as in `/advancement grant @s only demo:placed_banner`. - **`OnFirstJoin { ... }`** runs once per player, the first time they are in the world with the pack. It uses a tick advancement, `:mms_gen/first_join`, that is never revoked; `/advancement revoke @s only :mms_gen/first_join` makes it run again. - **`OnRespawn { ... }`** runs right after a player respawns. A `deathCount` objective, `mms_respawn.`, notes the death, and the tick function runs the body once the player is alive again. ### Item hooks A [custom item](https://minecraftmetascript.github.io/mms/docs/guides/resources.md)'s `on_*` fields each name a function to run when something happens with the item. The functions take no parameters and can be in any file. A field can also hold the commands themselves in a `run { ... }` block, written like a function body (each command on its own line). That block is compiled as a function of its own, under `mms_gen//`. They run as the player, at the player unless the table says otherwise: ```mms CustomItem ember_wand { base = stick name = "Ember Wand" on_right_click = cast_ember on_use_on_block = light_block } Function cast_ember { /particle flame ^ ^1.5 ^1 0.2 0.2 0.2 0.05 20 } Function light_block { /setblock ~ ~1 ~ fire keep } ``` | Field | Runs when the player... | | --- | --- | | `on_right_click` | right-clicks with the item, once per press, unless `on_use_on_block` or `on_right_click_entity` runs for that press | | `on_hold_right_click` | holds right click with the item: every tick, from the first | | `on_use_on_block` | right-clicks a block with the item, once per press. It runs positioned at the centre of the block | | `on_right_click_entity` | right-clicks an entity with the item, once per press. It runs at the entity, which has the tag `mms_target` while the function runs, so `@e[tag=mms_target,limit=1]` is the entity | | `on_hit` | hurts an entity while holding the item in their main hand | | `on_kill` | kills an entity while holding the item in their main hand | | `on_consume` | finishes eating or drinking the item. It needs a `consumable` component, or a base item that is food or a potion | | `on_pickup` | picks the item up from the ground | | `on_break` | uses up the item's durability, so it breaks. It needs a base with durability, or a `max_damage` component | | `on_projectile_hit_block` | shoots an arrow that hits a block (see [Projectile hooks](#projectile-hooks)). It runs as the arrow, at the point it hit | | `on_projectile_hit_entity` | shoots an arrow that hurts an entity. It runs as and at the entity hit | | `on_projectile_land` | throws the item, a splash or lingering potion, and it lands. It runs at the spot it landed | Every hook marks the item with `mms_item: ":"` in its `custom_data`, wherever it is used: in `/give`, recipes and loot. A `custom_data` of your own keeps its keys and gains the marker. Each hook is an advancement, `:mms_gen/item_hook//`, whose trigger matches the base item with that marker, and a reward function of the same name that revokes it and calls your function. **Right click.** The four right-click hooks use the consumable method from the [datapack.wiki guide](https://datapack.wiki/guide/right-click/consumable_component): - The item gets a `consumable` component that takes about eleven days to eat, with no animation, sound or particles, so right click "uses" it without using it up. It also gets `use_effects`, so the player is not slowed down while holding the button. Set `consumable` or `use_effects` in the item's `components` to use your own instead. - A `using_item` advancement, `.../press`, fires on every tick the button is held. `on_hold_right_click` runs on each of those ticks. For the others, a score, `mms_click.`, notes that the player is still holding the button. The tick function counts it down, and they run only once it has reached 0. - `on_use_on_block` and `on_right_click_entity` step a ray from the player's eyes, 0.1 blocks at a time, out to their `block_interaction_range` and `entity_interaction_range`. It stops at the first block or entity it meets. The ray counts a whole block as solid, so it can stop short of a slab or a flower's actual shape, and it skips items, arrows, markers and display entities. - A press runs one hook. When the ray reaches a block and the item has `on_use_on_block`, or an entity and it has `on_right_click_entity`, that hook runs. Otherwise `on_right_click` runs, so in the `ember_wand` above, clicking a block lights it and clicking the air casts an ember. An item with only `on_right_click` runs it on every press. - The press score also notes which item was pressed, so holding the button while switching to another custom item counts as a new press of that item. **Use cost.** Two more fields make each right-click use cost something: ``` CustomItem ember_wand { base = blaze_rod on_use_on_block = kindle damage_on_use = 1 components = { max_damage = 32 } } ``` - `consume_on_use = n` takes `n` of the item from the stack. - `damage_on_use = n` costs `n` points of durability. When the durability runs out, the item breaks with the break sound, and `on_break` runs. The item needs a `max_damage` component. MMS doesn't know vanilla items' durability, so a base item's own durability is not enough. A damageable item cannot stack, so the item gets `max_stack_size = 1` unless it sets one, and any other stack size is an error. The cost is paid once per press, from the hand that holds the item, by whichever hook the press runs. With `on_right_click` every press runs a hook, so every press pays. Without it, a click at the air runs nothing and costs nothing. `on_hold_right_click` alone pays no cost. A base item that already does something on right click keeps doing it, and then none of the right-click hooks runs. A block is still placed and a bow still draws, and a chest still opens when clicked. Pick a base such as `stick`, `paper` or `amethyst_shard` that does nothing on its own. A `use_cooldown` component has no effect, because the item is never finished being used. Keep a cooldown in a score instead. `on_consume` cannot be combined with the right-click hooks, because they stop the item from ever being finished. ### Projectile hooks `on_projectile_hit_block` and `on_projectile_hit_entity` follow arrows. What they follow depends on the item's base: - **A bow or crossbow**: every arrow shot from the item, whatever the arrow is. - **An `arrow`, `tipped_arrow` or `spectral_arrow`**: the item itself, once it is shot from any bow, crossbow or dispenser. Prefer `tipped_arrow`: Infinity makes plain `arrow` items free, and a tipped arrow can be coloured with `potion_contents.custom_color`. ```mms CustomItem explosive_arrow { base = tipped_arrow name = "Explosive Arrow" on_projectile_hit_block = boom on_projectile_hit_entity = boom } Function boom { /summon tnt ~ ~ ~ {fuse:0s,explosion_power:2f} } ``` On a block hit the function runs as the arrow, at the point it hit, so `execute on origin` is whoever shot it, and `kill @s` keeps the arrow from being picked up. On an entity hit it runs as and at the entity hurt, and `execute on attacker` is the shooter. **How it works.** An arrow keeps the bow or crossbow it was shot from as its `weapon`, and when it hits, the game runs the weapon's enchantment effects at the exact spot: `hit_block` as the arrow, `post_attack` as the entity it hurt. Each item with projectile hooks gets an enchantment, `:mms_gen/item_hook//projectile`, whose effects run the functions. The tick function looks once at each new arrow (it tags them `mms_shot.`), and adds the enchantment to the weapon of an arrow that is the item, or that was shot from it. An arrow from a dispenser has no weapon, so it gets a plain bow. The enchantment is never on the item, so it shows in no tooltip and gives no glint. Several items' hooks combine: an Explosive Arrow shot from a bow with hooks runs both. **Thrown potions.** `on_projectile_land` works on a `splash_potion` or `lingering_potion` base, and runs where the thrown potion lands, whatever it hits: ``` CustomItem blast_potion { base = splash_potion name = "Blast Potion" on_projectile_land = boom } ``` A thrown potion keeps no weapon, so no enchantment runs for it. Instead the tick function puts a marker on each new one, riding it, with the function's id in its `data`. The game drops a projectile's passengers where it removes it, so a marker that is no longer riding anything (`:mms_gen/projectile/riding`) marks the spot. The function runs as that marker, at it, and the marker is removed afterwards. The spot is where the potion was at the end of its last tick of flight, so up to about half a block short, and the function can't tell what the potion hit or who threw it. The potion still splashes as usual. ## Tests A `Test` checks functions without starting the game. It has a `setup { }` block, then `run` and `expect` lines: ```mms Type SiegeState { wave: int = 0 } Storage game: SiegeState Function next_wave { game.wave += 1 for i in 1..game.wave * 2 { As(@e[tag=siege.spawn]).At(@s) { /summon zombie ~ ~ ~ {Tags:["siege.enemy"]} } } } Test second_wave_spawns_four { setup { game.wave = 1 /summon marker 0 64 0 {Tags:["siege.spawn"]} } run next_wave() expect game.wave == 2 expect count(@e[tag=siege.enemy]) == 4 } ``` Each test runs in a fresh world after the pack's load functions. `setup` holds function code and commands, and its `let` variables stay in scope for the `expect` lines. `run` calls a function, and a test of a function that returns a value can skip it: `expect fib(10) == 55`. `expect` checks a condition, and the test stops at the first one that fails. A failing comparison of ints shows both sides: `expected game.wave == start, but game.wave is 6 and start is 5`. A test can have several `run` and `expect` lines, in any order after `setup`. `mms test` runs every test and exits with 1 when one fails. `-run ` runs the tests whose names match, and `-v` lists the passing tests too and prints what each test's commands said. The web editor shows a Tests tab once the project has a test, and runs the tests after every edit. VS Code lists them in its Testing view. All three run the same interpreter, so they give the same results. Tests compile to functions under `:mms_test/` that the pack never includes. The interpreter runs the commands that functions compile to (scoreboard, storage, `execute`, `function`, `return`, `say`, `tellraw`, `title` and `give`, which a verbose run lists) and keeps entities that `summon` creates, with their type, tags, position and scores, for `kill`, `tag`, `execute as`, `execute at` and `if entity`. Selectors are `@e` and `@s`, with `type`, `tag`, `scores`, `limit` and `sort=arbitrary`, and work as score holders: `hp[@s] -= 1` changes the score of the entity running the code. There are no players, blocks or ticks, so `@a` selects no one. A command or selector argument the interpreter does not know fails the test and names it, so a test never passes by skipping a command. To see what functions become in the data pack, read [How functions compile](https://minecraftmetascript.github.io/mms/docs/concepts/how-functions-compile.md). # Keeping state A data pack has a few places to remember things between commands: scoreboards, command storage and tags on entities. MMS gives each a name you can read and write like a variable. This guide is about choosing between them. | You need | Use | Lives in | | --- | --- | --- | | a value while one function runs | `let` | a scratch score | | a number or flag for the whole pack | `Global` | a score | | a number for each player or entity | `Objective` | a scoreboard objective | | several values that belong together, or text | `Storage` | command storage | | a yes or no for each entity | a tag | the entity | ## One value for the whole pack A `Global` is a single value that every function sees: ```mms /** The round being played. */ Global round: int = 1 /** Whether new players may join the round. */ Global open: bool = true Function next_round { round += 1 open = round < 10 tell(@a, "Round ${round} begins") } ``` The value after `=` is where it starts. It is set once, when the pack first loads, and a `/reload` keeps whatever it has become. An `int` or `bool` Global is a score, the cheapest thing to read and change, so it is the right home for a counter or a timer that runs every tick. A `string` Global is kept in storage. To look at an `int` or `bool` Global in the game, run `/scoreboard players get $round mms.`. A `string` one is in `/data get storage :mms g`. ## A number for each player An `Objective` is a scoreboard objective. `objective[holder]` is one holder's score: ```mms /** Mana each player has, up to 20. */ Objective mana /** The game counts these by itself. */ Objective kills: playerKillCount OnFirstJoin { mana[@s] = 20 } Function cast { if (mana[@s] >= 5) { mana[@s] -= 5 /effect give @s speed 5 1 } else { actionbar(@s, "{red}Not enough mana") } } OnTick { /scoreboard players add @a[scores={mana=..19}] mana 1 } /** Adds a player's kills to the server's total. */ Function bank_kills { kills["#total"] += kills[@s] kills[@s] = 0 } ``` - **The holder** is a selector, such as `@s`, or a name in quotes. A name that starts with `#`, such as `"#total"`, is a made-up holder that never shows on the sidebar, which makes it a handy pack-wide slot on an objective. - **A criterion** after the colon makes the game keep the score: `deathCount`, `playerKillCount`, `minecraft.used:minecraft.carrot_on_a_stick` and the rest. Without one the objective is `dummy`, changed only by your code. - **Mobs have scores too.** `hp[@e[tag=boss, limit=1]]` works like a player's, and the score goes away with the entity. - **A score nobody has set is not 0.** It counts as 0 in arithmetic, but `<`, `<=`, `>`, `>=` and `==` are all false for it and no selector matches it: `mana[@s] < 5` is false for a player whose mana was never set, and `@a[scores={mana=..19}]` skips them. Give each player a starting value in `OnFirstJoin`, as above, and prefer asking whether a player has enough (`>=`) over whether they have too little. Raw commands and score variables mix freely. One selector that changes many players at once, as in the `OnTick` above, is cheaper than a loop. ## Values that belong together A `Storage` keeps a record in command storage. The record's shape is a `Type`, so fields are completed, checked and documented: ```mms /** The settings an admin can change. */ Type Settings { difficulty: "easy" | "hard" = "easy" max_players: int = 8 /** Where players start. */ spawn: { x: int, y: int = 64, z: int } /** Shown to players who join. */ motd: string = "Welcome" } Storage settings: Settings Function harder { settings.difficulty = "hard" settings.max_players = 4 settings.spawn.y += 10 tell(@a, "${settings.motd}. The game is now ${settings.difficulty}.") } ``` Reach for Storage when: - the values are one thing, such as a game's phase, wave and timer, and reading `game.phase` beats three Globals with a shared prefix - a value is text, or one of a few words such as `"easy" | "hard"`, where a wrong word should be an error - other commands need the data: the record is at `:mms `, so `/data get storage demo:mms settings` shows it, and macros and `data modify` can use it Each read or write of a field is a `data` command, which costs a little more than a score. In code that runs for every entity on every tick, copy the field into a `let` first, or keep that value in a `Global`. A field added later starts at its default the next time the pack loads, and existing values are kept, so a record can grow without resetting a world. ## Locals `let` names a value inside one function. Its type comes from the value: ```mms Objective mana Function refill { let missing = 20 - mana[@s] let full: bool = missing <= 0 if (!full) { mana[@s] += missing } } ``` A local is not per entity. Inside `As(@a) { ... }` there is still one `missing`, which each player's turn overwrites. Anything that must be remembered per entity goes in an objective. ## Flags on entities For a yes or no per entity, the game's own tags are enough, and selectors read them directly: ```mms const frozen = @a[tag=frozen] Function freeze { /tag @s add frozen } OnTick { /effect give ${frozen} slowness 1 255 true } ``` A [named selector](https://minecraftmetascript.github.io/mms/docs/guides/functions.md#selectors) keeps the tag's name in one place. Prefix tags with your namespace, such as `siege.boss`, when other packs may be loaded. ## Values the game already has Not everything needs storing. A command after `=` reads a value straight from the game: ```mms Function report { let time = /time query gametime let online = /execute if entity @a let holding_sword: bool = /execute if items entity @s weapon.mainhand #swords tell(@s, "Tick ${time}, with ${online} players online") } ``` `exists(selector)` and `count(selector)` cover the common questions about entities, and a [`Predicate`](https://minecraftmetascript.github.io/mms/docs/guides/functions.md#predicates) is a condition by name, such as `if (sneaking)`. ## Starting values and resets - `OnLoad { ... }` runs each time the pack loads, including every `/reload`, after Globals and Storage fields have their values. Defaults are given only once, so use `OnLoad` for anything that must be put back on every load. - `OnFirstJoin { ... }` runs once per player, which is the place to give a starting score. - A reset is a function that assigns the starting values again: ```mms Global round: int = 1 Objective mana Function reset { round = 1 mana[@a] = 20 } ``` ## Checking state without the game A [`Test`](https://minecraftmetascript.github.io/mms/docs/guides/testing.md) can set state up, run a function and check what changed, with Globals, scores and Storage fields all readable in `expect` lines. State is where most pack bugs live, so it is the part most worth testing. # Cutting repetition Data packs repeat themselves. Sixteen colours need sixteen recipes, every mob's loot table has the same Looting rule, and a number that matters is typed into ten files. MMS has four tools for this, and they all run when the pack is compiled: the game only ever sees plain files. | When you have | Use | | --- | --- | | the same value in several places | `const` | | the same shape with different values | `Template` | | the same declaration for each item of a list | a top-level `for` | | a list that follows from another list | a comprehension | This guide works through each with a small example. [Constants, templates and loops](https://minecraftmetascript.github.io/mms/docs/reference/language/reuse.md) is the reference. ## Name a value A `const` gives a value a name. Any value will do: a number, a list, a selector, a loot pool, a piece of text. ```mms /** Ticks a round lasts: three minutes. */ const round_length = 3 * 60 * 20 /** Everyone taking part. */ const players = @a[tag=playing] Global timer: int = 0 Function start_round { timer = round_length tell(players, "The round lasts ${round_length / 20} seconds") } ``` The value is written into each place that names it, so a `const` costs nothing in the game. Hover the name to see the value, and rename it everywhere with one rename. A constant can have a type, as in `const gem_pool: LootPool = Pool(1..3, #gems)`. Without one, it takes the type of the first place it is used, and the shorthand of that place works inside it. ## Name a shape When the values differ but the shape is the same, write a `Template`: a helper of your own, with parameters. Here every mob drop has the same Looting rule: ```mms /** A drop of up to `max` of one item, with more for Looting. */ Template drop(item: Id, max: int = 2): LootPool = Pool(1, [ Item(name = item, modifier = [ SetCount(0..max), EnchantedCountIncrease(enchantment = looting, count = 0..1), ]), ]) LootTable mobs/guard { pools = [drop(iron_nugget), drop(bread, 1)] } LootTable mobs/captain { pools = [drop(iron_ingot), drop(emerald, max = 1)] } ``` - **Parameters are typed.** `item: Id` completes item names at each call and rejects `drop(zombie)`. - **The return type** is what the body is checked against. `LootPool` here means the body is a loot pool, so `Pool(...)` and `0..max` work as they do in a loot table. - **Calls look like built-in helpers.** Arguments go by position or by name, and a parameter with a default can be left out. A template is expanded where it is called, and the JSON tab of the web editor shows the finished loot table. Hover a call to see its signature and doc comment. ## Repeat a declaration A `for` at the top of a file repeats the declarations inside it, once for each item of a list. `${...}` in a name gives each copy its own id: ```mms const colors = [white, orange, magenta, light_blue, yellow, lime, pink, gray] for c in colors { /** Unravels ${c} wool into string. */ Recipe ${c}_wool_to_string = Shapeless([${c}_wool], string * 4) } ``` That is eight recipes, `white_wool_to_string` to `gray_wool_to_string`. Each is an ordinary declaration: completion offers it, go to definition lands on the loop with `c = white` shown beside it, and rename works. The list has to be known at compile time, which is what lets the editor know every id the loop makes. Loops nest, and `for k, v in map` walks the names and values of an object. ## Build a list from a list A comprehension makes a list out of another one, with an optional `if`. `...` spreads a list into the one around it: ```mms const colors = [white, orange, magenta, light_blue, yellow, lime, pink, gray] ItemTag bright_wool = [for c in colors if c != gray: ${c}_wool] ItemTag soft_things = [ ...[for c in colors: ${c}_wool], ...[for c in colors: ${c}_carpet], hay_block, ] ``` ## Drive it from data These tools are strongest together. Describe the things once, as a list of records, and let loops write everything that follows from them. Here each kit becomes a function: ```mms /** A starting kit. */ Type Kit { name: string /** What the player is given. */ items: [Id] /** Coins it costs. */ price: int = 0 } const kits: [Kit] = [ { name = "miner", items = [iron_pickaxe, torch, bread] }, { name = "archer", items = [bow, arrow], price = 10 }, ] Objective coins OnFirstJoin { coins[@s] = 0 } for k in kits { /** Gives the ${k.name} kit, for ${k.price} coins. */ Function kit/${k.name} { if (coins[@s] >= k.price) { coins[@s] -= k.price for item in k.items { /give @s ${item} } } else { tell(@s, "{red}The ${k.name} kit costs ${k.price} coins") } } } ``` A third kit is one more line in `kits`. The `Type` means that line is completed and checked: a missing `name` or a misspelled item is an error on the line itself. For a player with ten coins, `/function demo:kit/archer` takes them and runs two `give` commands. Nothing of the list or the loops is left in the pack. ## Repeat commands Inside a `Function`, a `for` over a list the compiler knows is written out, as `for item in k.items` was above. A `for` over a range, such as `for i in 1..10`, is a loop the game runs. To write a range out at compile time too, or to reuse a run of commands, put them in a `Template` that returns `Commands`: ```mms /** A circle of particles around whoever runs it. */ Template ring(p: Id, radius: int, points: int = 12): Commands { for i in 0..points - 1 { /particle ${p} ^${radius * cos(i * 360 / points)} ^1 ^${radius * sin(i * 360 / points)} } } Function celebrate { As(@a).At(@s) { ring(flame, 2) ring(end_rod, 3, points = 16) } } ``` `celebrate` becomes 28 `particle` commands with the positions worked out, and no loop runs in the game. The editor marks each call with an `inlined` hint, and hovering it shows the commands. See [Command templates](https://minecraftmetascript.github.io/mms/docs/guides/functions.md#command-templates). ## Keep helpers to their file Every file sees every other file's constants and templates. A helper that only makes sense where it is written can be `private`: ```mms private const gap = 4 private Template spaced(n: int): int = n * gap LootTable chests/spaced { pools = [Pool(spaced(2), stone)] } ``` Another file cannot name `gap`, and can have a private `gap` of its own. Only things the compiler expands away can be private: a `LootTable` or a `Function` is a file in the pack, which every file shares. ## When to stop A loop over two items is longer than the two declarations, and harder to read. Reach for these tools when a third copy turns up, or when one number has to agree in several places. When a group of declarations keeps appearing together, such as an item, its recipe and its cooldown, the next step is a [Blueprint](https://minecraftmetascript.github.io/mms/docs/guides/blueprints.md): a kind of declaration of your own, with fields the editor checks. # Making your own kinds `CustomItem`, `Book` and `JigsawStructure` are not built into the compiler. Each is a `Blueprint`: a kind of declaration written in MMS, which turns a few fields into the declarations the game needs. You can write your own, and yours get the same completion, checking and hover as the built-in ones. This guide builds one step by step. [Blueprints](https://minecraftmetascript.github.io/mms/docs/reference/language/blueprints.md) in the language reference lists every part. ## When a Blueprint helps A [`Template`](https://minecraftmetascript.github.io/mms/docs/guides/repetition.md#name-a-shape) stands for one value. A Blueprint is for when a thing in your pack is **several declarations that belong together**. A wand, for example, is a custom item, a cooldown score, a line in the tick function and a recipe. Write the second wand by copying the first, and the two will drift apart. With a Blueprint, a wand is this: ``` Wand fire_wand { name = "Fire Wand" cast = shoot_fireball cooldown = 60 reagent = blaze_powder } ``` ## 1. Fields and emit A Blueprint starts with its fields, and an `emit` block that says what an instance writes: ```mms /** A wand: a stick that casts a spell on right click. */ Blueprint Wand { /** The wand's name. */ name: string /** The function that casts the spell. */ cast: Function emit { primary CustomItem ${self.path} { base = stick name = name on_right_click = cast } } } Function shoot_fireball { /summon fireball ^ ^1.5 ^1 } Wand fire_wand { name = "Fire Wand" cast = shoot_fireball } Function give { /give @s ${fire_wand} } ``` - **Fields** are `name: Type`. `cast: Function` takes the name of a function, and the editor completes the project's functions there. The doc comments show on hover and in completion, in every file that declares a `Wand`. - **`emit`** holds ordinary declarations. Field names stand for the instance's values, and `${self.path}` is the instance's own name, so `Wand fire_wand` writes `CustomItem fire_wand`. - **`primary`** marks the declaration the instance stands for. That is why `${fire_wand}` works in the `give` command: the wand's name means what the custom item's name means. ## 2. Defaults and optional fields A field with `= value` has a default, and one with `?` after its type can be left out. Anything else is required, and leaving it out is an error with a fix that adds it. ``` /** Ticks between casts. */ cooldown: int = 20 /** What the wand is crafted from, with a stick. Left out, it has no recipe. */ reagent: Id? ``` `emit` can use `if`, `for` and `let`, so an optional field can decide whether a declaration is written at all: ``` if (reagent != none) { Recipe ${self.path} = Shapeless([stick, reagent], ${self.path}) } ``` ## 3. Code in emit An emitted function is written like any other, with the fields in reach. `run { }` holds commands where a function's name is expected, which keeps the cooldown logic inside the Blueprint: ``` /** Ticks until a player can use ${self.path} again. */ Objective ${self.path}_cooldown primary CustomItem ${self.path} { base = stick name = name on_right_click = run { if (${self.path}_cooldown[@s] > 0) { actionbar(@s, "{red}${name} is cooling down") return } ${self.path}_cooldown[@s] = cooldown cast() } } OnTick { /scoreboard players remove @a[scores={${self.path}_cooldown=1..}] ${self.path}_cooldown 1 } ``` Each wand gets its own objective, `fire_wand_cooldown`, so two wands cool down separately. `cooldown` is written into the function as a number, and `cast()` calls whichever function the instance names. `OnTick` is a kind that merges: every instance's block is added to the pack's one tick function, along with any `OnTick` the project writes itself. Tags, `Lang` and `OnLoad` merge in the same way. ## 4. Rules of your own `check` runs on every instance at compile time, and reports problems on the field that caused them: ``` check { if (cooldown < 1) { error(cooldown, "a cooldown is at least one tick") } if (cooldown > 200) { warn(cooldown, "slow-wand", "a cooldown of over ten seconds feels broken") } } ``` A `Wand` with `cooldown = 0` now gets an error on that line, in the editor and in `mms check`, with your message. `warn` and `hint` report softer problems. The name between the two, `"slow-wand"`, makes the rule one that `// mms-ignore slow-wand` silences and the `lint` settings in `mms.json` can turn off or promote, like the built-in [lint rules](https://minecraftmetascript.github.io/mms/docs/guides/lint.md). Mistakes inside the instance's own values are caught without any `check`: a `cast` that names no function, a `cooldown` given as text, or an unknown `reagent` are errors from the field's type. ## The whole Blueprint ```mms /** A wand: a stick that casts a spell, with a cooldown. */ Blueprint Wand { /** The wand's name. */ name: string /** The function that casts the spell. */ cast: Function /** Ticks between casts. */ cooldown: int = 20 /** What the wand is crafted from, with a stick. Left out, it has no recipe. */ reagent: Id? check { if (cooldown < 1) { error(cooldown, "a cooldown is at least one tick") } if (cooldown > 200) { warn(cooldown, "slow-wand", "a cooldown of over ten seconds feels broken") } } emit { /** Ticks until a player can use ${self.path} again. */ Objective ${self.path}_cooldown primary CustomItem ${self.path} { base = stick name = name on_right_click = run { if (${self.path}_cooldown[@s] > 0) { actionbar(@s, "{red}${name} is cooling down") return } ${self.path}_cooldown[@s] = cooldown cast() } } OnTick { /scoreboard players remove @a[scores={${self.path}_cooldown=1..}] ${self.path}_cooldown 1 } if (reagent != none) { Recipe ${self.path} = Shapeless([stick, reagent], ${self.path}) } } } Function shoot_fireball { /summon fireball ^ ^1.5 ^1 } Function blink { /tp @s ^ ^ ^6 } Wand fire_wand { name = "Fire Wand" cast = shoot_fireball cooldown = 60 reagent = blaze_powder } Wand blink_wand { name = "Blink Wand" cast = blink } LootTable chests/wizard { pools = [Pool(1, fire_wand, blink_wand)] } ``` Two wands are now eleven lines. Between them they write two custom items with their right-click hooks, two objectives, two lines of the tick function, a recipe and the translations. ## Seeing what an instance writes - **Expanded.** With the cursor in `Wand fire_wand`, the web editor's Expanded tab shows the declarations it emits, with the field values filled in. In VS Code, click the **Expand** lens above it. - **Errors point both ways.** A problem in emitted code is reported on each instance that runs into it, and the editor also marks the line of the Blueprint that wrote it. - **Go to definition** on `Wand` opens the Blueprint, and on `fire_wand` the instance. ## What a name means elsewhere `primary` forwards the instance's name to one emitted declaration. For finer control, `as Type = value` says what the name means where that type is expected. The prelude's `CustomItem` uses it to be an item stack in a recipe result, a loot entry in a pool and its base item in a tag. See [as](https://minecraftmetascript.github.io/mms/docs/reference/language/blueprints.md#as). ## Sharing and hiding A Blueprint can be used from any file of the project. Put `private` before it to keep it to its own file. The prelude's Blueprints are a good place to read real ones: each page under [Declaration kinds](https://minecraftmetascript.github.io/mms/docs/reference/kinds.md) lists the fields, and the [`shop`](https://github.com/MinecraftMetascript/mms/blob/main/examples/shop/) example has a Blueprint that emits a function, with tests. # Testing functions Finding out whether a function works usually means building the pack, opening a world, running `/reload`, setting up some scores by hand and watching chat. A `Test` does that in a fraction of a second, without the game: `mms` has an interpreter for the commands functions compile to, and a test runs your functions in it and checks what they did. ## A first test ```mms Function double(n: int): int { return n * 2 } Test doubling { expect double(21) == 42 expect double(-1) == -2 } ``` ```sh mms test ``` ``` ok: 1 test passed ``` A test of a function that returns a value needs nothing but `expect` lines. Tests are never written into the pack, so they can sit next to the code they test or in a file of their own, such as `tests.mms`. ## Where tests run - **`mms test`** runs every test and exits with 1 when one fails. `-run ` keeps the tests whose names match, and `-v` lists passing tests too, with everything the functions said in chat, titles and the action bar. - **The web editor** shows a Tests tab once a project has a test, and runs them all again after every edit. - **VS Code** lists them in its Testing view, and marks a failing `expect` at its line. All three use the same interpreter, so they agree. ## Setup, run, expect Most functions change state instead of returning something. A test of one has three parts: ```mms Type SiegeState { wave: int = 0 boss_alive: bool } Storage game: SiegeState Function next_wave { game.wave += 1 game.boss_alive = game.wave % 5 == 0 } Test every_fifth_wave_has_a_boss { setup { game.wave = 4 } run next_wave() expect game.wave == 5 expect game.boss_alive } ``` | Part | Does | | --- | --- | | `setup { }` | puts the world in the state the test needs. It is function code: assignments, commands, calls, `let`. | | `run f()` | calls a function | | `expect cond` | checks a condition, and stops the test when it is false | Every test starts in a fresh world, right after the pack's load function, so Globals and Storage fields hold their defaults and no test sees what another one did. `run` and `expect` lines can alternate, which suits anything that happens over time: ```mms Global timer: int = 2 Global rang: bool = false Function tick { timer -= 1 if (timer == 0) { rang = true } } Test rings_on_the_second_tick { run tick() expect !rang run tick() expect rang } ``` ## Standing in for a player There are no players in a test, so `@a` finds no one, and `@p` and `@r` are not supported. Most function code only needs *something* to run as, and a summoned entity will do. Give it a tag, name the selector, and run the function as it: ```mms /** Mana each player has. */ Objective mana /** Spells cast since the pack loaded. */ Global casts: int = 0 /** Takes the cost from whoever runs it. False when they can't pay. */ Function pay(cost: int): bool { if (mana[@s] >= cost) { mana[@s] -= cost casts += 1 return true } return false } /** Stands in for a player. */ const caster = @e[tag=caster, limit=1] Test paying_takes_mana { setup { /summon armor_stand 0 64 0 {Tags:["caster"]} mana[caster] = 12 let paid = false As(caster) { paid = pay(5) } } expect paid expect mana[caster] == 7 expect casts == 1 } Test the_poor_pay_nothing { setup { /summon armor_stand 0 64 0 {Tags:["caster"]} mana[caster] = 3 let paid = true As(caster) { paid = pay(5) } } expect !paid expect mana[caster] == 3 } ``` A `let` in `setup` stays in scope for the `expect` lines, which is how `paid` gets out of the `As` block. Entities keep their type, tags, position and scores, so `count(@e[type=zombie, tag=wave])` and `exists(...)` can check what a function summoned or killed. ## When a test fails ``` FAIL paying_takes_mana main.mms:39:3: expected mana[caster] == 8, but mana[caster] is 7 1 of 3 tests failed ``` A failed comparison shows both sides with their values. The line is the `expect`, and the editors mark it in place. ## What the interpreter runs The interpreter knows the commands that function code compiles to, and enough of the game to check logic: | Works | | | --- | --- | | scores, Globals, Storage, strings | `scoreboard`, `data` on storage | | control flow and calls | `execute if`/`unless`/`as`/`at`/`positioned`/`store`, `function`, `return` | | entities | `summon`, `kill`, `tag`, and `@e` and `@s` with `type`, `tag`, `scores`, `limit` | | messages | `say`, `tellraw`, `title`, which `-v` prints | | `give` | listed by `-v` | There are no blocks, no players and no ticks. A command the interpreter does not know, such as `particle`, `effect` or `setblock`, fails the test and names the command. That is on purpose: a test never passes by skipping something. ## Writing code that can be tested The limit suggests a habit that is good anyway: keep **deciding** apart from **showing**. The function that works out what happens changes scores and storage, and returns the answer. The function the game calls asks it, and then does the particles, sounds and effects. ```mms Objective mana /** Deciding: can be tested. */ Function pay(cost: int): bool { if (mana[@s] >= cost) { mana[@s] -= cost return true } return false } /** Showing: a wand's right-click hook. */ Function cast { if (!pay(5)) { actionbar(@s, "{red}Not enough mana") return } /particle flame ~ ~1 ~ 0.2 0.2 0.2 0.05 20 /effect give @s speed 5 1 } ``` `pay` holds everything that can go wrong, and the tests above cover it. `cast` is short enough to check by eye, and a test can still run its refusing branch, since that stops before the first particle. `pay` asks whether the player *has* enough, not whether they have too little, and that matters. A score nobody has set is not a number yet, so every comparison with it is false: `mana[@s] < cost` would let a brand new player cast for free. A test with a caster whose mana is never set would catch it. ## What to test - **Rules with edges.** Costs, limits, cooldowns, the last wave, an empty list: anywhere `<` could have been `<=`. - **State machines.** Set a phase, run the tick function, expect the next phase. The [wave arena tutorial](https://minecraftmetascript.github.io/mms/docs/start/tutorial-minigame.md) tests its game this way. - **Blueprints.** A test can call the functions an instance emits, which checks the Blueprint itself. The [`shop`](https://github.com/MinecraftMetascript/mms/blob/main/examples/shop/) example does. - **Bugs you have fixed.** A test named after the bug keeps it fixed. `mms test` needs only the project folder, so it fits a CI step next to `mms check`. An AI agent can run the same tests through [`mms mcp`](https://minecraftmetascript.github.io/mms/docs/guides/agents.md). The [`functions-advanced`](https://github.com/MinecraftMetascript/mms/blob/main/examples/functions-advanced/), [`waves`](https://github.com/MinecraftMetascript/mms/blob/main/examples/waves/), [`shop`](https://github.com/MinecraftMetascript/mms/blob/main/examples/shop/) and [`treecapitator`](https://github.com/MinecraftMetascript/mms/blob/main/examples/treecapitator/) examples all have a `tests.mms` to read. # Shaping terrain A world's shape comes from one number per block, the **density**. Where it is above 0 the generator places stone, and where it is below 0 it leaves air, or water below sea level. A `DensityFunction` is the formula for that number, and shaping terrain means writing formulas. In JSON a formula is a deep tree of `add` and `mul` objects. In MMS it is arithmetic, and the editor draws the result as you type. This guide is a set of recipes to combine. For the resources around the terrain (dimension, biome, surface), follow the [custom dimension tutorial](https://minecraftmetascript.github.io/mms/docs/start/tutorial-dimension.md) first. ## See what you are doing Put the cursor on a `Noise`, a `DensityFunction` or a `NoiseSettings` and open the **Preview** tab of the web editor (in VS Code, click **Preview** above it). It draws the function as a slice of the world: the raw density, the blocks it makes, or a 3D view. The picture redraws on every edit, so changing a number and watching is the normal way to work. Every sample on this page is a file of its own. Paste one into a new project to see it. ## Ground with a height Almost every terrain starts from a gradient: solid at the bottom, air at the top. ```mms /** 1 at the bottom of the world, 0 at y 64, -1 at y 192. */ DensityFunction slope = Gradient( axis = y, from_coordinate = -64, to_coordinate = 192, from_value = 1, to_value = -1, ) ``` On its own this is a flat world with its surface at y = 64, where the value crosses 0. Everything else is added to it. ## Hills Noise is a smooth random value between about -1 and 1. Adding it to the slope moves the surface up where the noise is high and down where it is low: ```mms /** Rolling hills, a few hundred blocks across. */ Noise rolling { base_octave = -7 amplitude_modifiers = [1, 0.5, 0.25] } DensityFunction slope = Gradient( axis = y, from_coordinate = -64, to_coordinate = 192, from_value = 1, to_value = -1, ) /** The surface rises and falls about 32 blocks around y 64. */ DensityFunction hills = slope + Noise(rolling, 1, 0) * 0.25 ``` Three numbers do the work: - **`base_octave`** sets the size of the shapes. Each step down doubles it: `-7` gives features about 128 blocks across, `-8` about 256. - **`amplitude_modifiers`** adds detail. Each entry is another layer of noise at half the size, with that strength. `[1]` is smooth, and `[1, 0.5, 0.25]` has bumps on its bumps. - **The multiplier** sets the height. The slope changes by 1 over 128 blocks, so `* 0.25` moves the surface up to 32 blocks either way. The arguments after the noise are its scale across (`xz_scale`) and up (`y_scale`). A `y_scale` of `0` makes the noise the same at every height, so the ground has no overhangs. With `1`, the noise changes with height too, and hills grow overhangs and floating bits. ## Caves Caves are a second formula that is below 0 where there should be air. `Min` takes the lower of two values, so a block is solid only when both say so: ```mms Noise cave_noise { base_octave = -5 amplitude_modifiers = [1, 0.5] } DensityFunction slope = Gradient( axis = y, from_coordinate = -64, to_coordinate = 192, from_value = 1, to_value = -1, ) /** Below 0 inside a cave. The y scale of 2 makes caves wider than tall. */ DensityFunction caves = 0.45 - Noise(cave_noise, 1, 2) DensityFunction carved = Min(slope, caves) ``` Lower `0.45` for more and bigger caves. `Max` does the opposite and joins two terrains, such as islands floating above a ground. A few more helpers cover most shapes: | Helper | Use it to | | --- | --- | | `Abs(x)` | turn a noise into sharp ridges, or into thin tunnels along the lines where it is 0 | | `Square(x)` | flatten values near 0 | | `Clamp(x, min, max)` | keep a value in a range, so that it cannot overpower the rest | | `Lerp(alpha, a, b)` | blend from one terrain to another, by a third function | | `IntervalSelect(x, [...], [...])` | switch between terrains by a value, such as one terrain per region | Hover a helper for what it does. The [`cave-siege`](https://github.com/MinecraftMetascript/mms/blob/main/examples/cave-siege/) example builds a whole cave world from these, with comments on each step. ## Plains and cliffs with a spline Adding noise gives hills that are equally bumpy everywhere. Real landscapes have flat places and steep ones. A `Spline` maps a value through a curve you draw, so the same noise can mean "flat" over most of its range and "cliff" in a narrow band: ```mms Noise rolling { base_octave = -7 amplitude_modifiers = [1, 0.5, 0.25] } DensityFunction slope = Gradient( axis = y, from_coordinate = -64, to_coordinate = 192, from_value = 1, to_value = -1, ) /** How far the ground is lifted: plains, a cliff, then a plateau. */ DensityFunction lift = Spline({ coordinate = Noise(rolling, 1, 0) points = [ SplinePoint(-1, 0, -0.1), SplinePoint(0.1, 0, 0), SplinePoint(0.3, 0, 0.35), SplinePoint(1, 0, 0.4), ] }) DensityFunction plateaus = slope + lift ``` Each `SplinePoint` is a location on the coordinate, the slope of the curve there, and the value. Between noise values of 0.1 and 0.3 the lift jumps from 0 to 0.35, which is a cliff about 45 blocks high. Everywhere else it barely changes. Typing the numbers is the hard way. With the cursor in the spline, the Preview tab shows the curve: drag a point to move it, drag its handle to change the slope, double-click to add a point and press Delete to remove one. Each drag rewrites the numbers in the source. In VS Code, the **Edit spline** lens above `Spline(` opens the same editor. [Splines](https://minecraftmetascript.github.io/mms/docs/guides/resources.md#splines) has the details, including splines inside splines, which is how vanilla mixes continents, erosion and ridges. ## Keep the world closed A world with caves needs a floor, or players fall out of it. Blend towards solid near the bottom: ```mms DensityFunction terrain = Gradient(axis = y, from_coordinate = -64, to_coordinate = 192, from_value = 1, to_value = -1) /** 0 at the bottom of the world, 1 from y -48 up. */ DensityFunction floor_fade = Gradient( axis = y, from_coordinate = -64, to_coordinate = -48, from_value = 0, to_value = 1, ) /** Solid at the bottom, the terrain from y -48 up. */ DensityFunction closed = Lerp(floor_fade, 1, terrain) ``` The fade starts at the bottom of the world, which is -64 here. Use your own dimension's `min_y`: in a world that starts at y = 0, this fade would be 1 everywhere and do nothing. The same trick at the top, blending towards `-1`, keeps terrain from being cut off flat at the height limit. ## Use it in a world The terrain is the `final_density` of a `NoiseSettings`, which a `Dimension` names as its generator with `Noise(settings = hills, ...)`. The sample below uses the flat slope, to stay short. Put the name of your own formula in its place, and keep `noise` in step with the dimension type's `min_y` and `height`: ```mms DensityFunction terrain = Gradient(axis = y, from_coordinate = -64, to_coordinate = 192, from_value = 1, to_value = -1) NoiseSettings hills { sea_level = 48 default_block = stone default_fluid = water disable_mob_generation = false legacy_random_source = false noise = { min_y = -64, height = 384 } material_rule = Block(stone) spawn_target = [] noise_router = { final_density = Interpolated(terrain, 4, 8) temperature = 0 vegetation = 0 continents = 0 erosion = 0 depth = 0 ridges = 0 chunk_surface_level = 0 } } ``` `Interpolated(terrain, 4, 8)` works the formula out once per 4×8×4 cell and blends between, as vanilla does. It is much faster and smooths out single-block noise. The preview of the `NoiseSettings` shows the finished blocks, with water and the surface rule applied. Give each step a name, as the samples here do. A named `DensityFunction` can be previewed on its own, which is how you find the step that went wrong, and its doc comment says what its numbers mean. ## Try it in the game ```sh mms build --world ~/.minecraft/saves/MyWorld --reset-dimensions ``` The game never generates a chunk twice, so a change to the terrain only shows in new chunks. `--reset-dimensions` deletes the saved chunks of the project's dimensions whose worldgen changed, so the same place generates again with the new shape. Close the world first. [Seeing worldgen changes](https://minecraftmetascript.github.io/mms/docs/start/tutorial-dimension.md#seeing-worldgen-changes) explains what is reset and how to get the old chunks back. ## Borrow from vanilla Vanilla's own density functions and noises can be used by id, with no declaration: `overworld/continents`, `overworld/erosion`, or the noise `ridge`. Go to definition on one opens the game's JSON for it. To study a whole vanilla dimension as MMS, run `mms import` on the vanilla data pack. The [`sky-islands`](https://github.com/MinecraftMetascript/mms/blob/main/examples/sky-islands/), [`badlands`](https://github.com/MinecraftMetascript/mms/blob/main/examples/badlands/) and [`cave-siege`](https://github.com/MinecraftMetascript/mms/blob/main/examples/cave-siege/) examples are complete terrains to take apart. # Building jigsaw pieces A jigsaw structure is only as good as the agreement between its pieces. The game joins two pieces when their jigsaw blocks face each other and their names match, and checks nothing else: a doorway one block too high, a floor at the wrong level or a wall of the wrong stone still joins, and looks wrong. Write the agreement down once, as a short spec, and anyone can build pieces to it: you, other people, or several AI agents at once, each building a few pieces in parallel. Pieces built to the same spec fit together the first time. This page is a template for that spec. Copy it, fill it in, and hand the same copy to everyone who builds pieces. The [`jigsaw`](https://github.com/MinecraftMetascript/mms/blob/main/examples/jigsaw/) example is a small dungeon built this way. ## Why names make variety Each jigsaw block has a **name**, the name it is joined by, and a **target** and **pool**: the next piece comes from the pool, and joins by its jigsaw block named the target. So any piece with a `hall_entry` block can join any `room_exit` that draws from the `halls` pool. Nothing else needs to know about it. That is what makes variety cheap. Keep the set of names small and fixed, and a new piece is one more file in a pool: the more pieces share the same names, the more layouts the game can grow. Decide the names before anyone builds, and declare each one as a [`JigsawHole`](https://minecraftmetascript.github.io/mms/docs/guides/resources.md#jigsaw-holes), so that a typo in the game's jigsaw screen is a `jigsaw-unknown-name` warning instead of a structure that quietly stops growing: ```mms /** The doorways of a room, leading on to a hall. */ JigsawHole room_exit /** The near end of a hall, where it joins a room_exit. */ JigsawHole hall_entry ``` ## The spec Fill in each section. Everything in angle brackets is yours to choose; the rest is a starting point that works. ``` # : piece spec Namespace: Structure: : Pieces are built in a flat creative world with the data pack loaded. ## Size - The grid is <7> blocks. Every piece's footprint is a whole number of cells: 7x7, 7x14, 14x14. Height is <6> blocks per storey. - The piece's floor is its bottom layer (y = 0 in the structure block). Ground level outside is . - No piece is bigger than 48x48x48, the most a structure block saves. ## Doorways and jigsaw blocks - A doorway is <3> wide and <4> high, centred on a cell's edge, with its sill on the floor. - The jigsaw block sits in the outermost layer of the piece, in the middle of the doorway's bottom row, facing out of the piece. - Its final state is for an open doorway; a cap's is , so a closed doorway becomes wall. - Names (each one is a JigsawHole in the project): | Name | On | Pool | Target | | ----------- | -------------------- | ----- | ----------- | | room_exit | rooms, each doorway | halls | hall_entry | | hall_entry | halls, near end | (none, it is joined onto) | | hall_exit | halls, far end | rooms | room_entry | | room_entry | rooms, one doorway | (none) | | - A piece that is joined onto has exactly one block with its entry name. Every other doorway is an exit. ## Pools and pieces | Pool | Fallback | Pieces (file, weight) | Builder | | ----- | -------- | -------------------------------------- | ------- | | start | none | start (1) | | | halls | caps | halls/hall (3), halls/short_hall (1) | | | rooms | caps | rooms/room (2), rooms/vault (1) | | | caps | none | caps/hall_cap, caps/room_cap | | - Every pool that a jigsaw draws from has a cap in its fallback, so a doorway with nothing to join is walled up rather than left open. ## Materials - Walls: , with for at most a quarter of them. - Floor: . Ceiling: . - Trim and doorframes: . - Never: . - Fill the parts of the piece that are not the building with structure void, so the piece does not carve out the terrain around it. ## Lighting - Hostile mobs spawn where block light is 0. Every floor block a mob could stand on is within <7> blocks of a light source. - Light sources: . No torches on doorframes, where the next piece's wall goes. ## Containers - Chests and barrels carry a loot table: :chests/. Each table named here is declared in the project before the piece is saved. ## Saving - Save each piece with a structure block named :, such as :halls/hall. Include entities: . - The game writes it to /generated//structure/.nbt. Import it into the project as structures/.nbt. ## Done means - mms check passes with no warnings: jigsaw-unknown-name, jigsaw-unknown-pool, jigsaw-unreachable-target, jigsaw-facing and jigsaw-fit all clean. - The piece's file is in its pool, so unused-asset does not report it. - The structure's Simulation preview grows through the piece, with every jigsaw block green (joined) or grey (an end on purpose). ``` ## Notes on each section **Size.** A grid is what makes pieces interchangeable: if every doorway sits in the middle of a cell's edge, any two pieces meet doorway to doorway, and walls line up. Pick the cell size from the narrowest piece you want, such as a corridor. Pieces taller than one storey, such as a tower, are still a whole number of storeys. **Jigsaw blocks.** The game places the next piece so that its jigsaw block is the block in front of this one, so keep jigsaw blocks in the outer layer facing out, and the two pieces meet without overlapping. A jigsaw block inside its own piece is an *internal* one, and only pieces that fit inside the parent are placed there; `jigsaw-fit` reports one whose pool has pieces too big. The game turns pieces only about the y axis, so a jigsaw facing up joins only one facing down (`jigsaw-facing`). For those, the joint is `rollable` (the next piece may turn) or `aligned` (it keeps the turn of this one). **Pools.** Writing down who builds which piece lets several builders work at once without two of them making the same file. The pools and weights become the `pools` of the [`JigsawStructure`](https://minecraftmetascript.github.io/mms/docs/reference/kinds/JigsawStructure.md), with a `Piece` for each file. A `@label` doc comment on a `Piece` names it in the editor's preview. **Materials and lighting.** These are the parts the game does not check, so they are the parts pieces disagree on when the spec leaves them out. Name blocks by their ids, so there is no question which stone is meant. **Containers.** A loot table id in a chest is not checked when the piece is saved, and a missing table gives an empty chest. Declaring the tables first, in the spec and in the project, keeps builders from inventing names. A `Rule` processor with `AppendLoot` is another way, which puts the loot table in the pool instead of in the piece: see [Jigsaw holes](https://minecraftmetascript.github.io/mms/docs/guides/resources.md#jigsaw-holes). **Saving.** The structure block's name is the file's path, so naming it `:halls/hall` puts it where `Piece("halls/hall")` reads it. The **World** tab in the web editor and the World view in VS Code list the structures saved in a world, import them into `structures/`, and mark the ones no pool uses yet. See [Asset files](https://minecraftmetascript.github.io/mms/docs/guides/resources.md#asset-files). **Done means.** The jigsaw lints read the pieces' `.nbt` files, so a builder can check their own pieces before anyone puts the structure together. An AI agent can run the same checks through [`mms mcp`](https://minecraftmetascript.github.io/mms/docs/guides/agents.md). # Building and playing Writing a pack is a loop: edit, check, build, look at it in the game. This guide is about making that loop short, and about what to do with the pack once it works. ## The loop | Step | Command line | Web editor | VS Code | | --- | --- | --- | --- | | Check | `mms check` | as you type | as you type | | Test | `mms test` | Tests tab, on every edit | Testing view | | Build into a world | `mms build --world ` | World tab | **Build into world** in the MMS side bar | | Share | `mms build --zip pack.zip` | **Download pack** | | Most mistakes never need the game. The checker knows the game's schema and command tree, [tests](https://minecraftmetascript.github.io/mms/docs/guides/testing.md) run functions in an interpreter, and the previews draw terrain, loot, recipes, books and structures. Open the game for what only the game can show: how it feels to play. ## Check, fix and format ```sh mms check # errors and warnings mms check -hints # style suggestions too mms fix # apply every safe fix mms fmt . # format every file ``` `mms check` exits with 1 when there is an error, and `mms build` refuses to write a pack with errors in it, so a broken pack never reaches a world. `mms fix` applies only fixes that leave the built pack unchanged. `mms fmt -check .` lists unformatted files without changing them, for CI. `mms fmt` needs the folder or the files to format: without one it formats what it reads from standard input. [Lint rules](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) covers the rules and how to set their severity. ## Build into a world ```sh mms build --world ~/.minecraft/saves/MyWorld ``` This writes the data pack to `/datapacks/`. If the project has textures, sounds or other resource pack files, it merges them into `/resourcepacks/resources.zip`, the pack the game applies by itself when the world opens. Several projects can build into one world: each keeps its own files. The world's folder is under `saves` in the Minecraft folder: `%APPDATA%\.minecraft\saves` on Windows, `~/Library/Application Support/minecraft/saves` on macOS and `~/.minecraft/saves` on Linux. - **Web editor.** In Chrome and Edge, the World tab's **Choose world…** picks the folder, and **Build into world** does the same build. Other browsers cannot write to a folder and offer the downloads. - **VS Code.** The MMS side bar lists the worlds of the Minecraft launcher, Prism Launcher and MultiMC. Pick one and click **Build into world**. ## Reload or rejoin The last line of a build says what the game needs: | The build says | When | Do | | --- | --- | --- | | `next step: run /reload in the world` | functions, loot tables, recipes, advancements, predicates, item modifiers, structure templates or tags of blocks, items and entities changed | run `/reload` | | `next step: exit and rejoin the world` | worldgen, dimensions, enchantments and other registry entries, or the resource pack changed | save and quit to title, then open the world | | `next step: none` | the build wrote the same files as before | nothing | Function work is therefore the fastest loop: keep the game open, build, `/reload`, try. Worldgen is slower, because the game never generates a chunk twice. Add `--reset-dimensions` to delete the saved chunks of the project's own dimensions whose worldgen changed, so the same place generates again. The world must be closed. See [Seeing worldgen changes](https://minecraftmetascript.github.io/mms/docs/start/tutorial-dimension.md#seeing-worldgen-changes). ## A world for testing A few habits save time: - Make a creative world just for the pack, with cheats on, and keep it out of worlds you care about until the pack works. - Give every pack a `give` function that hands over its items, since custom items are not in the creative menu. - `/function :` and Tab lists the pack's functions. Names under `mms_gen/` are written by MMS, and [How functions compile](https://minecraftmetascript.github.io/mms/docs/concepts/how-functions-compile.md) explains them. - To look at state, `/scoreboard objectives setdisplay sidebar ` shows an objective and `/data get storage :mms` shows every `Storage` record and string. - When something does nothing, check the game's log. The game reports files it could not load there, and `mms check` should have caught it first: if it did not, that is a bug worth [reporting](https://github.com/MinecraftMetascript/mms/issues). ## What gets built ```sh mms build # writes build/ and, if needed, build-resources/ mms build --out dist # another folder ``` The `build` folder is a complete data pack: `pack.mcmeta`, and under `data//` one JSON or `.mcfunction` file per declaration. It is plain output, so read it when you want to know exactly what a declaration became. The web editor's JSON tab shows the file of the declaration at the cursor, and its Pack tab (the **Pack** view in VS Code) lists every file. `mms.json` at the project's root holds the settings: ```json { "$schema": "https://minecraftmetascript.github.io/mms/mms.schema.json", "namespace": "gems", "description": "Gems that drop from the gem chest", "icon": "art/icon.png", "output": "build", "sources": ["src/**/*.mms"], "lint": { "unused": "warning" } } ``` Only `namespace` is needed. `description` and `icon` are what the game's pack list shows, `sources` limits the project to some files, and `resourcePack.output` moves the resource pack. Editors complete and check the file from its schema. ## Share it ```sh mms build --zip gems.zip ``` This writes `gems.zip`, and `gems-resources.zip` when there is a resource pack. In the web editor, **Download pack** and **Download resources** give the same two files. - **A data pack** goes in a world's `datapacks` folder, as the zip. On a server, that is the `datapacks` folder of the server's world. - **A resource pack** goes in each player's `resourcepacks` folder, or in `/resourcepacks/resources.zip` for a single-player world. A server sends one to its players with `resource-pack` in `server.properties`. A pack with custom item textures needs both. Without the resource pack the items still work and keep their names, and look like their base items. ## In CI `mms` is one binary with no dependencies, so checking a pack on every push takes three lines: ```sh mms fmt -check . mms check mms test ``` Each exits with 1 on failure. `mms build --zip pack.zip` after them gives a release file. ## Start from an existing pack `mms import` turns a data pack into a project: ```sh mms import old-pack.zip my-project ``` It writes `mms.json` and one `.mms` file per resource folder, such as `loot_table.mms`, using the shorthand wherever it applies. In the web editor, **Import zip…** does the same, and **Paste JSON…** converts one JSON file into a declaration at the cursor. Importing the vanilla data pack is a good way to see how the game's own loot tables or worldgen read in MMS. Functions come across as they are, command for command. They are valid MMS, and you can rewrite them with variables and control flow one at a time: see [Functions](https://minecraftmetascript.github.io/mms/docs/guides/functions.md). # A tour of the editors MMS has two editors: the [web editor](https://minecraftmetascript.github.io/mms/), which needs no install, and the VS Code extension. Both run the same engine as the `mms` command line, so they report the same problems and build the same pack. This page shows what they can do and where to find it. ## Choosing one - **The web editor** is the quickest start. Projects are kept in your browser, examples are one click away, and **Download pack** gives you a zip. Use it to try the language, to share a small pack, or on a computer where you cannot install anything. - **VS Code** suits a project you keep: the files are on your disk, so they work with git, with other tools and with `mms` in a terminal. Install **Minecraft Metascript** from the Extensions view. It also works in Cursor, VSCodium and other editors that use Open VSX. A project moves between them as a zip: **Export project zip** and **Import zip…** in the web editor's project menu. ## While you type These work the same in both editors. - **Errors as you type.** Every value is checked against the game's schema and every command against its command tree. Unknown ids, missing fields, wrong types and misspelled commands are underlined with the reason. - **Completion.** It offers what fits at the cursor: the fields of an object, the helpers and ids a field takes, the next word of a command, selector options, your own functions and objectives, and the markup inside text. - **Hover.** A field shows its documentation, a helper its signature, a name its doc comment, a `const` its value, a command the forms it can take, and a piece of text how the game will draw it. - **Go to definition, references and rename** work across files, on declarations and on ids inside commands. Go to definition on a vanilla id, such as a loot table or a noise, opens the game's own JSON for it. On `CustomItem` or another built-in Blueprint it opens the prelude source. - **Quick fixes.** Ctrl/⌘+. lists the fixes at the cursor, such as adding missing fields, correcting a misspelled name or declaring something that does not exist yet. **Fix all** applies every safe one. - **Format.** One style, nothing to configure. Ctrl/⌘+S formats in the web editor, and VS Code formats on save. - **Inlay hints** mark template calls that are written out at compile time (`inlined`) and show loop values beside generated names. ## Previews Put the cursor on a declaration and open the **Preview** tab in the web editor. In VS Code, click the **Preview** lens above the declaration, and the panel stays on it while you edit. | Declaration | The preview shows | | --- | --- | | `Noise`, `DensityFunction`, `NoiseSettings`, `Dimension` | the terrain: density, blocks or 3D. See [Shaping terrain](https://minecraftmetascript.github.io/mms/docs/guides/terrain.md) | | `Dimension` | also a map of its biomes and the climate behind them. See [Why a biome doesn't appear](#why-a-biome-doesnt-appear) | | `SurfaceRule` | the blocks it places on the terrain | | a `Spline` | its curve, which you can drag. See [Splines](https://minecraftmetascript.github.io/mms/docs/guides/resources.md#splines) | | `LootTable`, `Recipe`, `Biome` | an inspector: a table's pools and entries, a recipe's grid, a biome's settings | | `Book`, a `.mmsbook` file | the open book, page by page. See [Previewing a book](https://minecraftmetascript.github.io/mms/docs/guides/resources.md#previewing-a-book) | | `tell`, `title`, `actionbar`, a `Text` | the message in chat, as a title or above the hotbar | | `JigsawStructure`, `TemplatePool` | which pieces join which, and a 3D simulation of one layout. See [Simulating a jigsaw structure](https://minecraftmetascript.github.io/mms/docs/guides/resources.md#simulating-a-jigsaw-structure) | ### Why a biome doesn't appear A `MultiNoise` biome source picks, at each spot, the entry whose `parameters` are nearest the climate sampled there. The dimension's **Biomes** map helps when a biome never wins: - Hover the map to fill the table below it: the six climate values at that spot (at the camera's Y, which is what `depth` depends on), then the nearest entries, best first, with each one's distance and parameter ranges. The ranges the climate is outside of are in red. Click the map to pin a point: the table then stays on it while you move the pointer, until you click **Unpin**. - **Show** switches the map to one climate parameter, coloured over its range in view, with the biome outlines kept on top. - **Explain** picks a biome to follow. Biomes the source lists that win nowhere in view are marked *not in view*, and also listed under the legend. If the chosen biome isn't among the nearest entries, its nearest entry is added to the table in amber. **Show: Distance to win** maps how far that biome is from winning: 0 where it wins, and the darker the closer. Distances are the game's: the square root of the sum of squares of how far each value is outside its range, with the entry's `offset` added as one more term. Previews redraw as you type. The pin button in the web editor keeps the Preview tab on one declaration while you edit another, which is how you watch terrain change while editing the noise behind it. ## Seeing the output - **JSON** (web) shows the file the declaration at the cursor becomes. - **Expanded** (web), and the **Expand** lens in VS Code, show what a Blueprint instance such as a `CustomItem`, or a command template call, writes. - **Pack**, in the sidebar of both, lists every file of the data pack and the resource pack. Reading the output is the fastest way to learn what a piece of shorthand means, and to trust it. ## Tests Once a project has a [`Test`](https://minecraftmetascript.github.io/mms/docs/guides/testing.md), the web editor shows a **Tests** tab that runs them all after every edit. VS Code lists them in its Testing view. A failing `expect` is marked at its line. ## Working with a world | | Web editor | VS Code | | --- | --- | --- | | Build the pack into a world | **World** tab (Chrome and Edge) | **World** view in the MMS side bar | | Import pieces saved with structure blocks | **Structures**, in the World tab | **Structures** view | | Set up a jigsaw block and copy its `/give` | **Jigsaw** tab | **Jigsaw** view | After each build the editor says whether the game needs `/reload` or a rejoin. See [Building and playing](https://minecraftmetascript.github.io/mms/docs/guides/building.md). ## The web editor's own corners - **Projects.** Click the project's name to switch projects or start a new one. They are saved in the browser, so keep a copy of anything you would be sad to lose: **Export project zip**, in the project menu, saves the sources. **Download pack** is the built pack, which cannot be turned back into a project. - **Examples** opens any of the example projects as a new project. - **Paste JSON…** turns a JSON file from a data pack into the MMS declaration that writes it. - **+ Add texture or sound** adds `.png`, `.ogg` and `.nbt` files to the project. - **Symbols**, in the sidebar, lists the project's declarations. - **Docs search.** On these pages, Ctrl/⌘+K or `/` searches every page and the reference. ## VS Code's own corners - **`mms.json`** gets completion, hover and validation, including every lint rule's name. - **A separate world for structures.** Build pieces in one world and test the pack in another: **Use a separate world…** in the Structures view. - **Pre-release builds.** **Switch to Pre-Release Version** on the extension's page follows every change merged to `main`. ## For AI agents An agent that writes MMS can use the same checks through [`mms mcp`](https://minecraftmetascript.github.io/mms/docs/guides/agents.md), and read these pages as Markdown: every page has a `.md` twin, and [llms.txt](https://minecraftmetascript.github.io/mms/llms.txt) links them all. # Lint rules The engine lints every declaration that checks without errors. Findings appear in the editor, in `mms check` (hints only with `-hints`), and as LSP diagnostics with quick fixes. `mms fix` and the editor's "Fix all" (Ctrl/⌘+Alt+F) apply every *safe* fix. In the web editor, Ctrl/⌘+. lists the quick fixes at the cursor, and Format is Shift+Alt+F (⌘+Shift+I on macOS) or Ctrl/⌘+S. A safe fix never changes the generated pack. Every rule, with its default severity and what it reports, is listed in the [lint rule reference](https://minecraftmetascript.github.io/mms/docs/reference/lint.md), which is generated from the engine. The ones you will meet most: - `unused` (hint): a declaration nothing references, by id or in a command. The editor fades the name. Declarations in `minecraft` are skipped, because they override vanilla files. - `quoted-name`, `redundant-namespace`, `use-shorthand` and `constant-expression` (hint, safe fixes): a shorter way to write the same thing, such as `stone` for `"minecraft:stone"` or `Noise(noise = ridge)` for `{ type = noise, noise = ridge }`. - `deprecated` (warning): a use of a declaration whose [doc comment](https://minecraftmetascript.github.io/mms/docs/start/getting-started.md#doc-comments) has a `@deprecated` tag. - `external-asset` (warning) and `unused-asset` (info): an asset id that no `Texture`, `Sound` or `StructureFile` call provides, and an asset file nothing uses. See [Asset files](https://minecraftmetascript.github.io/mms/docs/guides/resources.md#asset-files). - `texture-outside-atlas` (warning): a texture a model names that neither the blocks atlas (`textures/block/`) nor the items atlas (`textures/item/`) stitches, so the game shows the missing texture. See [Resource packs](https://minecraftmetascript.github.io/mms/docs/guides/resources.md#resource-packs). - `spline-order` (warning): a [spline](https://minecraftmetascript.github.io/mms/docs/guides/resources.md#splines) point whose location is lower than the one before it. The quick fix sorts the points. - `book-page-overflow` (warning): a [Book](https://minecraftmetascript.github.io/mms/docs/guides/resources.md#books) page with more text than the book screen shows. - The `jigsaw-` rules (warning or info): jigsaw blocks in structure files that can never join, name an unknown pool or hole, or place pieces that stick out or overlap. - `structure-unknown-loot-table` (warning): a chest, barrel, chest minecart or other container in a structure file whose `LootTable` tag names a table that is not vanilla and that no `LootTable` declares, so the game leaves it empty. The quick fix declares the table. Blueprints add rules of their own: the prelude's `custom-item-as-base` hint on a [custom item](https://minecraftmetascript.github.io/mms/docs/guides/resources.md#custom-items) written where a plain item id is expected, and any rule a project's Blueprint names in `warn(field, "rule", "message")` or `hint("rule", "message")`. They are configured and ignored like the built-in rules. A setting for a rule that neither MMS nor a Blueprint has is a warning on `mms.json`, with the closest rule name. ## Configuration Set severities in `mms.json`. Each value is `error`, `warning`, `info`, `hint` or `off`: ```json { "namespace": "my_pack", "lint": { "unused": "warning", "quoted-name": "off" } } ``` ## Suppression - `// mms-ignore [, ]` silences findings on its own line and on the next line. - `// mms-ignore` with no rule silences every rule. - `// mms-ignore-file ` applies to the whole file. Every lint finding offers a quick fix that inserts the comment for you. ## Quick fixes for errors Some checker errors have a quick fix too. A "missing field" error on an object or a helper call offers **Add missing fields**, which writes every required field with a placeholder value: ```mms error DensityFunction d = Clamp(1) // missing fields 'min', 'max' DensityFunction d = Clamp(1, min = 0, max = 0) ``` In an object that spans lines, each field goes on its own line before the closing brace. A placeholder is `0` (or the nearest number the field's range allows), `false`, the first enum value, `[]`, `""` or `{}`. For a value that can take several forms, the simplest form is used, so a loot pool's `rolls` becomes `0`. An inserted `{}` reports its own missing fields, with its own fix. Placeholders are guesses, so these fixes are not safe and "Fix all" leaves them alone. A list of ids can't hold a tag, but a field that takes either one tag or a list, such as a structure's `biomes`, can take a tag declaration holding the whole list, and a tag may list other tags. So a tag in such a list ("a tag is not allowed here") offers **Move the list into a BiomeTag** (or `BlockTag`, `ItemTag` and so on, for the field's registry). It writes the list as a new tag above the declaration, named after the declaration and the field, and puts the tag in its place: ```mms error JigsawStructure village { biomes = [#minecraft:is_forest, desert, savanna] // a tag is not allowed here // ... } ``` becomes ``` BiomeTag village_biomes = [#minecraft:is_forest, desert, savanna] JigsawStructure village { biomes = #village_biomes // ... } ``` The fix adds a resource to the pack, so it is not safe and "Fix all" leaves it alone. # AI agents `mms mcp` is a [Model Context Protocol](https://modelcontextprotocol.io) server. It gives an AI agent that writes MMS the same engine the editors use, so the agent can check its work, see what it compiles to, run its tests and look names up without guessing. ## Setting it up The server is part of the `mms` command line and speaks over stdin and stdout. It needs a version of `mms` newer than 0.5.0: run `mms mcp -check`, which tests the server and prints the lines below. Its `claude mcp add` line has the path of your own `mms` filled in; the `.mcp.json` entry keeps plain `mms`, which everyone who shares the file needs on their PATH. If it says `unknown command "mcp"`, the `mms` it found is too old. In Claude Code, for yourself in one project folder: ``` claude mcp add mms -- mms mcp ``` To share it with everyone who works on a project, put a `.mcp.json` file at the project's root instead: ``` { "mcpServers": { "mms": { "command": "mms", "args": ["mcp"] } } } ``` Claude Code does not start a server from `.mcp.json` until you approve it. It asks the next time you start `claude` in that folder, and until you answer the server is not loaded. Claude Desktop, Cursor and other clients take the same `mcpServers` entry in their own settings file. The server has no settings and does not use the network. Everything it knows is inside the `mms` binary, including these docs and the vanilla data of the Minecraft version MMS targets. ## Checking that it is connected `claude mcp list` starts each server and says how it went. Inside Claude Code, `/mcp` shows the same and lists the tools. | `claude mcp list` says | What it means | | --- | --- | | `Connected` | It works. The agent has the tools below. | | `Pending approval` | The entry is in `.mcp.json` and nobody has approved it yet. Start `claude` in the folder and accept the server. | | `Failed to connect`, `Connection closed` | `mms` started and quit, which is what a version without `mcp` does. Run `mms mcp -check`. | | `Failed to connect`, `ENOENT` | The client did not find `mms`. Give the full path as the command; `mms mcp -check` prints it. | | no `mms` line | The client did not read the entry. Check the file's name and place, and that it is valid JSON. | `mms mcp` on its own waits for a client. It writes one line to stderr and nothing to stdout, so use `mms mcp -check` to test it by hand. ## The tools The tools that read a project take either `dir`, the project folder on disk, or `source`, the text of one `.mms` file checked on its own. An agent without file access can use `source` for everything. | Tool | What it does | | --- | --- | | `check` | Lists every problem with its place, the source line and the fixes MMS offers. `hints` adds style suggestions. | | `explain` | Lists the files the project writes. With `name`, prints the JSON or `.mcfunction` files of one declaration, and what its Blueprint instance or Template calls expand to. | | `test` | Runs the project's [`Test` declarations](https://minecraftmetascript.github.io/mms/docs/guides/functions.md#tests) in the interpreter and reports each failing `expect`. `run` keeps the tests whose names match a regular expression. | | `fix` | Applies every safe [lint](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) fix. With `dir` it writes the files; with `source` it returns the text. | | `fmt` | Formats, in place for `dir` or returning the text for `source`. | | `convert_json` | Turns the JSON of one pack file into the MMS declaration that writes it. | | `lookup` | Searches the reference: kinds, helpers, the prelude's Templates, Blueprints and Types, and lint rules. An exact name gives the whole entry. | | `vanilla` | Lists the game's registries and ids, a block's states, and the files of the vanilla data pack. | | `docs` | Lists these pages, returns one, or searches them. | `fix` and `fmt` with `dir` are the only calls that write files, and they write only the project's own source files. The pages are also MCP resources, as `mms://docs/`, and so is the prelude's source, as `mms://prelude/`. ## Without MCP An agent that can run commands can use `mms check`, `mms test` and `mms fix` directly. For reading, [llms.txt](https://minecraftmetascript.github.io/mms/llms.txt) links every page and [llms-full.txt](https://minecraftmetascript.github.io/mms/llms-full.txt) is the docs and the whole reference in one file. # How functions compile What a [function](https://minecraftmetascript.github.io/mms/docs/guides/functions.md) becomes in the data pack: where its values live, and how branches, loops and early exits turn into commands. You don't need this to write functions, but it helps when reading the generated `.mcfunction` files. ## Values Values live on one scoreboard objective per namespace, `mms.`: | Holder | Value | |---|---| | `$` | a Global | | `#.` | a parameter or local | | `#._t`, `#._f` | temporaries and condition flags | | `#c` | the constant `n`, for multiplication, division and comparison | | `#cf`, `#rv` | control flow, see below | String values and macro arguments live in storage `:mms`: `g.` for globals, `l."".` for locals, and `m` for the arguments of the macro being called. **Branches and loops.** `if` with a one-command body becomes `execute if ... run `. Longer bodies become sub-functions next to the function, such as `demo:check/_if0`. A loop is a function that checks its condition, runs its body and calls itself. `break` returns from it, and `continue` calls it again. **Leaving early.** When `break`, `continue` or `return` happens inside a sub-function, it sets `#cf`, and the calling function passes it on. The return value travels in `#rv`. **Results.** Functions return values with the `return` command, and callers read them with `execute store result score`. **Recursion.** A call that can lead back to the calling function, directly or through other functions, pushes the caller's scores onto a stack in storage, `:mms stack`, and pops them afterwards. Only the scores read after the call are saved. Every other call costs nothing extra. **Optimisation.** Temporaries that only carry a value from one place to the next are removed, so `x = x + 1` becomes one `scoreboard players add`. **Load.** The generated load function creates the objective, sets the constants, and gives each global its first value. ## Generated functions `OnLoad { ... }` and `OnTick { ... }` bodies, and `Objective` declarations, are collected into `:mms_gen/load` and `:mms_gen/tick`. These are registered in `#minecraft:load` and `#minecraft:tick`. `OnFirstJoin` and `OnRespawn` bodies are collected the same way, into `:mms_gen/first_join` and `:mms_gen/respawn`. A hook body that holds only commands is copied into these functions as it is. A body with variables or control flow compiles to its own function, such as `:mms_gen/load/`, which the generated function calls. # Declarations A file is a list of declarations. Each one starts with its kind, a PascalCase word, then its name: ```mms ItemTag gems = [diamond, emerald, amethyst_shard] LootTable chests/gems { pools = [Pool(1..3, #gems)] } ``` Write `Kind name { fields }` when the value is an object, and `Kind name = value` for anything else: a list, a helper call, a number. There is one spelling for each. The [Declaration kinds](https://minecraftmetascript.github.io/mms/docs/reference/kinds.md) page lists every kind. Lowercase words such as `const`, `let` and `for` are not kinds: they declare values the compiler works with, and never write a file. See [Constants, templates and loops](https://minecraftmetascript.github.io/mms/docs/reference/language/reuse.md). ## Names and ids A declaration's name is its id without the namespace. Names can have folders: `chests/gems` in the namespace `gems` is `gems:chests/gems`, and a `LootTable` of that name is written to `data/gems/loot_table/chests/gems.json`. Where a field takes an id, write the name bare. A bare name means the project's own declaration when there is one, and the vanilla one otherwise, so `diamond` is `minecraft:diamond` and `#gems` is your `ItemTag gems`. Write `minecraft:` only to reach vanilla when the project has a declaration of the same name. Different kinds can share a name, such as a `Recipe` and a `LootTable` both called `gem_block`. Two declarations of one kind with the same id are an error, except tags, which merge. ## Namespaces A file starts in the namespace from `mms.json`. A `Namespace` line changes it for the rest of that file: ```mms Namespace minecraft /** Adds to vanilla's swords tag. */ ItemTag swords = [diamond_sword] ``` ## Several at once Kinds whose declarations carry no value take a comma list, which declares each name: ```mms JigsawHole room_exit, hall_entry, hall_exit Objective wins, losses ``` ## Doc comments A `/** ... */` comment right above a declaration documents it. The text is Markdown, and hover shows it on the declaration and on every use, including ids inside commands. JSDoc tags such as `@param`, `@returns` and `@deprecated` are understood: ```mms Objective found /** * Gives a player their reward and counts it. * * @param count how many diamonds to give * @deprecated use `reward_all` */ Function reward(count: int) { /give @s diamond ${count} found[@s] += 1 } ``` A `@deprecated` tag makes every use a `deprecated` lint warning. [Getting started](https://minecraftmetascript.github.io/mms/docs/start/getting-started.md#doc-comments) lists every tag. ## Names made from values Inside a top-level `for` or a Blueprint's `emit`, a name can be a template, so one declaration writes many real ids: ```mms const colors = [red, green, blue] for c in colors { /** A ${c} banner from wool. */ Recipe ${c}_banner_from_wool = Shaped(["WWW", "WWW", " S "], { W = "${c}_wool", S = stick }, "${c}_banner") } ``` That declares `red_banner_from_wool`, `green_banner_from_wool` and `blue_banner_from_wool`. Each is an ordinary id: go to definition, find references and rename all work on it. See [Constants, templates and loops](https://minecraftmetascript.github.io/mms/docs/reference/language/reuse.md#repeating-declarations). # Values and types Values look like the JSON they become, with less punctuation. Every value is checked against the type its place expects, and that type also decides what shorthand means there. ## Literals | Write | Means | | --- | --- | | `12`, `-3`, `0.5` | numbers | | `true`, `false` | booleans | | `"text"` | a string. In a text position it is [markup](https://minecraftmetascript.github.io/mms/docs/reference/language/text.md). | | `diamond`, `minecraft:stone`, `chests/gems` | an id, or an enum word such as `rigid` | | `#gems`, `#minecraft:logs` | a tag | | `1..3`, `5..`, `..10` | a range: a number provider, or bounds | | `[a, b, c]` | a list. Items are separated by commas, and a comma after the last one is allowed. | | `{ key = value }` | an object. Fields are separated by newlines or commas. | | `none` | no value: a field set to `none` is left out | ```mms LootTable chests/gems { pools = [ { rolls = 1..3 entries = [Item(diamond), Item(emerald)] }, ] } ``` ## Helpers A helper builds one typed object. `Pool(...)` is a loot pool, and `Noise(...)` is `{ type = noise, ... }`. Arguments are positional in the order the reference lists, or named: ```mms LootTable chests/gems { pools = [Pool(rolls = 1..3, entries = [diamond, emerald])] } ``` Every type the game picks by a `type` field has a helper named after it. The [Helpers](https://minecraftmetascript.github.io/mms/docs/reference/helpers.md) reference lists them by what they make. Your own [Templates](https://minecraftmetascript.github.io/mms/docs/reference/language/reuse.md#templates) are called the same way. ## Operators | Operators | On | | --- | --- | | `+`, `-`, `*`, `/`, `%` | numbers. On density functions, `+`, `-`, `*` and `/` build `add`, `sub`, `mul` and `div`. | | `==`, `!=`, `<`, `<=`, `>`, `>=` | numbers and other values | | `&&`, `\|\|`, `!` | booleans, and loot and advancement predicates | | `a ?? b` | `a`, or `b` when `a` is `none` | | `if (c) a else b` | `a` when `c` holds, else `b` | | `xs[i]`, `x.field` | an item of a list, a field of an object or record | Arithmetic on numbers known at compile time is folded, so `Constant(16 * 4)` writes `64`. ```mms const raining = WeatherCheck(raining = true) Predicate dry_night = !raining && TimeCheck(clock = overworld, value = 13000..23000) DensityFunction hills = Noise(minecraft:ridge, 1, 1) * 0.5 + 0.25 ``` ## Shorthand The expected type decides what a short form means, so the same spelling works wherever it makes sense: - A bare id in a loot pool's entries is an item entry, and `#tag` is every item of the tag. - `diamond * 4` is a stack of four where an item stack goes. - `1..3` is a uniform number provider, or bounds in a predicate. - A trigger helper such as `InventoryChanged(...)` is a whole advancement criterion. The `use-shorthand` lint hint points at an object that has a shorter form, with a fix. [Writing resources](https://minecraftmetascript.github.io/mms/docs/guides/resources.md) shows each form. ## Types Types come from three places: the game's own schema (`ItemStack`, `LootPool`, `HeightProvider`, `ClimateParameter`), the language, and `Type` declarations. Every schema type has an entry in the [Types reference](https://minecraftmetascript.github.io/mms/docs/reference/types.md), which says what it is, gives values that fit and lists where it is used; hovering a type's name in the editor shows the same, and completion where a value goes offers each way of writing one, such as `0` or `[-2, 2]` for a `ClimateParameter`. The language's types are: - Numbers and words: `int`, `float`, `double`, `long`, `short`, `byte`, `bool`, `string`, and `any` for a value of any type. - `Text`: a text component, written as [text markup](https://minecraftmetascript.github.io/mms/docs/reference/language/text.md). - `BookText`: a book's text, a list of markup lines or `TextFile("books/guide.mmsbook")`, where `---` starts a page. - `Commands`: the statements a Template writes where it is called. - `Function`: a function, by its name. - `Selector`: a target selector such as `@e[tag=boss]`. - `Texture`, `Sound` and `StructureFile`: an asset file in the project, read by the helper of the same name. | Write | Means | | --- | --- | | `T?` | optional: the value can be `none` | | `[T]` | a list | | `{string: T}` | a map from names to values | | `A \| B` | either. The first one that matches is used. | | `Id` | an id in a registry, vanilla or the project's | | `Ids` | an id, a tag, or a list of ids | | `"rigid" \| "terrain_matching"` | one of these words | | `1 \| 2 \| 3` | one of these whole numbers | | `LootTable`, any kind's name | an id of one, or a value of one written in place | A `Type` declaration names a record or an alias: ```mms /** One wave of a siege. */ Type Wave { mob: Id /** How many to spawn. */ count: int = 1 } /** Text in English, or one text per language. */ Type Label = string | {string: string} /** How strong a spell is. */ Type Tier = 1 | 2 | 3 const waves: [Wave] = [{ mob = zombie, count = 3 }, { mob = skeleton }] ``` A field can hold a record written in place, with its fields between braces as in a `Type` body: `spawn: { x: int, z: int = 0 }`. A lone field named `string`, as in `{string: string}`, is a map instead. A record's fields get completion, hover and the missing-field fix, like the game's own types. Records are used by [Templates](https://minecraftmetascript.github.io/mms/docs/reference/language/reuse.md#templates), [Blueprints](https://minecraftmetascript.github.io/mms/docs/reference/language/blueprints.md) and [Storage](https://minecraftmetascript.github.io/mms/docs/reference/language/functions.md#values). # Constants, templates and loops Four tools cut repetition: `const` names a value, `Template` names a value with parameters, comprehensions build lists, and a top-level `for` repeats declarations. They all run at compile time and write nothing of their own: only the declarations that use them reach the pack. `private` keeps a name to the file it is written in. ## Constants `const name = value` names a value. Any value can be a constant: a number, a list, a loot pool, a predicate, a selector, a text. A constant never becomes a file. It is checked against its type, written after the name or taken from the first place it is used, and copied in wherever it is named, so shorthand and completion work inside it as they do in place. ```mms /** Chunks between dungeon starts. */ const dungeon_spacing: int = 32 const woods = [oak, spruce, birch, jungle, acacia, dark_oak, mangrove, cherry] ItemTag gems = [diamond, emerald, amethyst_shard] const gem_pool: LootPool = Pool(1..3, #gems) const stormy: Predicate = WeatherCheck(thundering = true) && TimeCheck(clock = overworld, value = 13000..) LootTable chests/gems { pools = [gem_pool] } ``` Constants work at file level, in templates, in Blueprints and in function bodies. In a function, a constant is folded into each command that uses it, so `const boss = @e[tag=siege.boss, limit=1]` writes the selector itself. Hover on a constant's name shows its value. ## Templates A `Template` is a helper you write. A call looks like a built-in helper's, and completion, signature help and hover treat it the same way. The return type is the type its body is checked against, so shorthand applies inside it: ```mms /** A pool of one item, rolled a number of times. */ Template single(item: Id, rolls: int = 1): LootPool = Pool(rolls, item) LootTable chests/apples { pools = [single(apple, 3), single(golden_apple)] } ``` Parameters have a type, and an optional default. Arguments are positional or named, as with helpers: `single(rolls = 2, item = bread)`. A Template that returns `Commands` writes function code where it is called, and one that returns `Text` builds text. See [Functions](https://minecraftmetascript.github.io/mms/docs/reference/language/functions.md#command-templates) and [Text](https://minecraftmetascript.github.io/mms/docs/reference/language/text.md#named-text). The prelude's own templates, such as `Piece` for jigsaw pools, are listed in the [Helpers](https://minecraftmetascript.github.io/mms/docs/reference/helpers.md) reference. ## Comprehensions and spread `[for x in xs: f(x)]` builds a list from another one, and `[for x in xs if cond: f(x)]` keeps only some items. `...list` inside a list puts that list's items in its place: ```mms const woods = [oak, spruce, birch, jungle, acacia, dark_oak, mangrove, cherry] ItemTag planks_and_logs = [ ...[for w in woods: "${w}_planks"], ...[for w in woods if w != mangrove: "${w}_log"], ] ``` A string with `${...}` in it, such as `"${w}_planks"`, makes an id where an id is expected. ## Repeating declarations A `for` at file level repeats the declarations in its body. Each name is a template over the loop variable, so every copy has an ordinary id of its own: ```mms const woods = [oak, spruce, birch, jungle, acacia, dark_oak, mangrove, cherry] for w in woods { /** A crate made of ${w}. */ Recipe ${w}_crate = Shaped(["PPP", "P P", "PPP"], { P = "${w}_planks" }, barrel) LootTable blocks/${w}_crate { pools = [Pool(1, barrel)] } } ``` That declares `oak_crate`, `spruce_crate` and so on. Go to definition on `oak_crate` lands on the loop, with `w = oak` shown inline, and find references and rename work as on any other name. Nothing is addressed by index, as `crate["oak"]` would be. The list must be known at compile time, so the editor always knows every id the loop makes. `for k, v in map` walks a map's names and values. Loops can be nested. ## Private names Every file in a project sees every other file's constants, templates, Types and Blueprints. Write `private` before one to keep it to its own file: ```mms private const gap: int = 4 private Template spaced(n: int): int = n * gap LootTable chests/spaced { pools = [Pool(spaced(2), stone)] } ``` Another file can't name `gap` or `spaced`, and it may keep a private `gap` of its own: the two never clash. A template or Blueprint still sees its own file's private names when another file uses it, so a public `Template` can be built from private helpers. A private name that hides a public one declared in another file is fine. The file means its own, and a hint (`mms/shadowed-private`) points it out. The same name declared both public and private in one file is a duplicate. Only names the compiler expands away can be private: `const`, `Template`, `Type` and `Blueprint`. A declaration that writes a file into the pack, such as a `LootTable` or a `Function`, lands in the namespace every file shares, so `private` on one is an error. # Blueprints A `Blueprint` declares a new kind of declaration. Its fields are checked and completed like the game's own, its `check` block reports problems, and its `emit` block writes the declarations it stands for. `CustomItem`, `Book` and `JigsawStructure` are Blueprints written this way, in the prelude: their pages under [Declaration kinds](https://minecraftmetascript.github.io/mms/docs/reference/kinds.md) list their fields. ```mms Objective wand_cooldown /** A wand: a stick that casts a spell, with a cooldown. */ Blueprint Wand { /** The wand's name. */ name: string /** The function that casts the spell. */ cast: Function /** Ticks between casts. */ cooldown: int = 20 check { if (cooldown < 1) { error(cooldown, "a cooldown is at least one tick") } if (cooldown > 200) { warn(cooldown, "slow-wand", "a cooldown of over ten seconds feels broken") } } emit { primary CustomItem ${self.path} { base = stick name = name on_right_click = run { if (wand_cooldown[@s] > 0) { return } wand_cooldown[@s] = cooldown cast() } } } } OnTick { /scoreboard players remove @a[scores={wand_cooldown=1..}] wand_cooldown 1 } Function shoot_fireball { /summon fireball ^ ^1.5 ^1 } Wand fire_wand { name = "Fire Wand" cast = shoot_fireball } Recipe fire_wand = Shapeless([stick, blaze_powder], fire_wand) ``` A Blueprint has four parts, each optional. ## Fields A field is `name: Type`, with `= default` or a `?` on the type when it can be left out. A field without either is required, and leaving it out is an error with a fix that adds it. Doc comments on fields show in completion and hover. See [Values and types](https://minecraftmetascript.github.io/mms/docs/reference/language/values.md#types) for the types. `let name = value` between the fields names a value worked out from them, for `check`, `as` and `emit` to share. ## check `check { }` runs at compile time on each declaration of the kind. `error(field, "message")`, `warn(...)` and `hint(...)` report a problem on that field's value. A rule name between the two, as in `warn(cooldown, "slow-wand", "...")`, lets `// mms-ignore slow-wand` and the `lint` settings in `mms.json` turn it off or change its level. A rule without a name is reported under the kind's name, such as `mms/wand`. ## as `as Type = value` says what the declaration's name means where a `Type` is expected. This is how a custom item's name becomes an item stack in a recipe result and a loot entry, and its base item in a tag: ```mms /** A trophy: a gold ingot with a name. */ Blueprint Trophy { /** What it was won for. */ title: string let trophy_components = { item_name = title, rarity = epic } /** In a recipe result or a give command: the trophy itself. */ as ItemStack = { id = gold_ingot, components = trophy_components } as ItemStackTemplate = { id = gold_ingot, components = trophy_components } as LootPoolEntry = Item(name = gold_ingot, modifier = [{ type = set_components, components = trophy_components }]) /** Where only an item id fits, it is any gold ingot. */ as Id = gold_ingot hint("trophy-as-item", "'${self.path}' stands for gold_ingot here") } Trophy dragon_slayer { title = "Dragon Slayer" } LootTable trophies { pools = [Pool(1, dragon_slayer)] } ``` The first `as` that fits the expected type is used. `hint(...)` after the value reports a lint hint wherever that `as` is used, for a meaning a reader might not expect. ## emit `emit { }` holds the declarations the kind writes. It can use `if`, `for` and `let`, and the fields by name. `self.path` is the declaration's name and `self.id` its id with the namespace, and names can be templates, as in a [top-level for](https://minecraftmetascript.github.io/mms/docs/reference/language/reuse.md#repeating-declarations). Emitting into a kind that merges, such as a tag, `Lang`, `OnLoad` or `OnTick`, merges with the project's own. One emitted declaration can be marked `primary`. It must have the declaration's own id, and the name then forwards to it: wherever none of the Blueprint's `as` fits, `fire_wand` means what the custom item `fire_wand` means. That is why `fire_wand` above works as a recipe result. A Blueprint has at most one primary. ### Consts of an instance A `const` at the top of an `emit` block belongs to each instance, and other code reads it as `name.const`. Use one for a value that has no file of its own, such as a biome's entry in a multi-noise biome source: ```mms Blueprint CustomBiome { climate: ClimateParameters biome: Biome emit { primary Biome ${self.path} = biome const noise_entry: BiomeNoiseEntry = { biome = self.id parameters = climate } } } CustomBiome ash_fields { climate = { temperature = [0.5, 1] humidity = [-1, 0] continentalness = 0 erosion = 0 weirdness = 0 depth = 0 offset = 0 } biome = { has_precipitation = false temperature = 2 downfall = 0 effects = { water_color = "#3F76E4" } carvers = [] features = [] } } CustomBiome frost_fields { climate = { temperature = [-1, -0.5] humidity = 0 continentalness = 0 erosion = 0 weirdness = 0 depth = 0 offset = 0 } biome = { has_precipitation = true temperature = -0.5 downfall = 0.5 effects = { water_color = "#3D57D6" } carvers = [] features = [] } } const fields_source: BiomeSource = MultiNoise( biomes = [ash_fields.noise_entry, frost_fields.noise_entry] ) ``` `ash_fields.noise_entry` is the entry that `CustomBiome ash_fields` worked out. It can be read anywhere a const can, in any file and before the instance is written, and in a command as `${ash_fields.noise_entry}`. Only the consts at the top of an `emit` block are read this way. A `let`, a field, or a const inside an `if` or a `for` stays inside the Blueprint. An instance that reads its own consts while it is being declared is an error. # Functions A `Function` body is code that compiles to a `.mcfunction` file. It mixes raw commands, which start with `/`, with statements that compile to commands. The [Functions guide](https://minecraftmetascript.github.io/mms/docs/guides/functions.md) explains each part at length, and [How functions compile](https://minecraftmetascript.github.io/mms/docs/concepts/how-functions-compile.md) shows what it becomes. ```mms /** The state of a siege, kept in storage. */ Type SiegeState { wave: int = 0 boss_alive: bool = false } Storage game: SiegeState const max_wave = 10 const boss = @e[tag=siege.boss, limit=1] const wave_mobs = [zombie, skeleton, spider, creeper] Function next_wave { if (game.wave >= max_wave) { tell(@a, "{gold}**Victory!**{/} The banner holds.") return } game.wave += 1 for mob in wave_mobs { /execute at @e[tag=siege.spawn] run summon ${mob} ~ ~ ~ {Tags:["siege.enemy"]} } if (game.wave % 5 == 0 && !exists(boss)) { /summon wither_skeleton ~ ~ ~ {Tags:["siege.boss"]} game.boss_alive = true } title(@a, "{gold}Wave ${game.wave}", subtitle = "{gray}*hold the line*") } ``` ## Statements | Write | Does | | --- | --- | | `/say hi` | a command, checked against the game's command tree | | `let n = 3`, `let ok: bool = n > 2` | a local variable | | `let n = /data get block ~ ~ ~ Items`, `let ok: bool = /execute if block ~ ~ ~ chest` | a command's result, or for a bool whether it succeeded | | `const n = 3` | a value folded into every use | | `n = 1`, `n += 1`, `-=`, `*=`, `/=`, `%=` | assignment | | `if (c) { } else if (c) { } else { }` | a branch | | `while (c) { }` | a loop | | `for i in 1..10 { }` | a loop over a range, both ends included | | `for x in [a, b, c] { }` | the body once per item, unrolled at compile time | | `break`, `continue`, `return`, `return value` | leave a loop or the function | | `f()`, `f(1, 2)`, `other:f()` | a call | | `As(@a).At(@s) { }` | the block under `execute` | | `run { }` | an inline function, as a value, such as a custom item's `on_right_click` | ## Values Function code computes with `int` (32-bit, wrapping like a scoreboard), `bool` and `string`. | Write | Is | | --- | --- | | `Global deaths: int = 0` | one value for the pack, set when it first loads | | `Objective kills: deathCount`, `kills[@s]` | a score per holder: a selector, or a name such as `kills["#total"]` | | `Storage game: SiegeState`, `game.wave` | a record's field in command storage | | `let n = 0` | a local of the function | | `@e[tag=x]`, `exists(sel)`, `count(sel)` | a selector, whether it finds any entity, and how many | | `Predicate sneaking = ...`, `if (sneaking)` | whether a predicate holds, as `if predicate :sneaking` | `Objective name` with no criterion is a `dummy` score, and a comma list declares several: `Objective wins, losses`. ## Parameters and results ```mms Function classify(x: int): int { if (x > 100) { return 2 } else if (x > 0) { return 1 } return 0 } Function report { let c = classify(150) /say class ${c} } ``` Parameters are `int`, `bool` or `string`, and a function returns `int` or `bool`. A `Type` that is one of these, such as `Type Count = int` a union of strings like `Type Mode = "easy" | "hard"`, or a union of whole numbers like `Type Tier = 1 | 2 | 3`, works in their place, and in `let` and `Global` too. A `let` can also write the union in place, as in `let tier: 1 | 2 | 3`; setting it to a literal outside the union is an error, and without a value it starts at the first one. A function with a return type must return on every path. ## Interpolation `${expr}` puts a value into a command. A value known at compile time is written in. A run-time value, such as a score or a parameter, turns the line into a macro, and the editor marks it with a `macro` inlay. In text, `${...}` never needs a macro: see [Text](https://minecraftmetascript.github.io/mms/docs/reference/language/text.md#values-in-text). ## Command templates A `Template` that returns `Commands` writes its body where it is called. Its loops unroll and its `${...}` pieces are worked out at compile time, so it costs no function call: ```mms /** Draws a ring of particles around the executor. */ Template particle_ring(p: Id, radius: float, points: int = 16): Commands { for i in 0..points - 1 { let a = i * 360 / points /particle ${p} ^${radius * cos(a)} ^1 ^${radius * sin(a)} } } Function celebrate { As(@a).At(@s) { particle_ring(flame, 2) } } ``` The editor marks each call with an `inlined` inlay, and hover shows the commands it writes. `cos` and `sin` take degrees. ## Execute blocks `As`, `At`, `Positioned`, `Rotated`, `Facing`, `In`, `Anchored`, `Align`, `On`, `Summon` and `Execute("...")` chain into an `execute` command whose `run` is the block. A coordinate or angle of `Positioned`, `Rotated` or `Facing` can be a whole-number value the function computes, `Positioned(x, 64, z)`, or a name right after `~` or `^`, `Positioned(~dx ~ ~-dz)`. A value only known at run time runs the chain as a macro, and a `const` is written straight in. The [guide](https://minecraftmetascript.github.io/mms/docs/guides/functions.md#execute-blocks) lists each one. ## Events | Declaration | Runs | | --- | --- | | `OnLoad { }` | when the pack loads, and on `/reload` | | `OnTick { }` | every tick | | `OnFirstJoin { }` | once per player, the first time they join | | `OnRespawn { }` | when a player respawns | | `OnAdvancement name = Trigger(...) { }` | each time a player meets the trigger, such as `PlacedBlock(...)` | The body runs as the player, at their position, except `OnLoad` and `OnTick`, which run as the server. The unnamed ones merge: several `OnTick` blocks in a project become one tick function. A [custom item](https://minecraftmetascript.github.io/mms/docs/guides/resources.md#custom-items) has its own hooks, such as `on_right_click` and `on_hit`. ```mms Objective banners /** Counts every banner a player places. */ OnAdvancement placed_banner = PlacedBlock(location = LocationCheck(predicate = { block = { blocks = #banners } })) { banners[@s] += 1 } OnRespawn { /effect give @s minecraft:regeneration 5 1 } ``` # Text Wherever the game takes a text component, a string is markup: a small Markdown-like format for Minecraft text. A string without markup is the same plain string in the output. ```mms CustomItem ember_shard { base = amethyst_shard name = "Ember Shard" components = { lore = ["{#ff8800}A shard that glows like a coal.", "{gray}*Still warm.*"] } } ``` ## Markup | Markup | Shows | | --- | --- | | `**bold**`, `*italic*`, `__underlined__`, `~~struck~~`, `\|\|obfuscated\|\|` | styled text | | `{gold}...{/}`, `{#ff8800}...{/}` | a color | | `{bold red}...{/}` | styles combined, also `shadow:#3f1f00` and `font:uniform` | | `{key:jump}` | the key the player has bound | | `{sprite:item/diamond}`, `{head:Notch}` | an inline icon, a player's head | | `{t:block.minecraft.stone}` | a translated text | | `[text](run:/function demo:start)` | runs a command when clicked; also `suggest:`, `copy:` and `https://` | | `[text](hover:A red gem)`, `[text](run:/say hi "Says hi")` | hover text, alone or after a target | | `# Heading` | a bold line | | `${kills[@s]}`, `${@s}` | a value, filled in by the game | | `\*` | the character itself | [Writing resources](https://minecraftmetascript.github.io/mms/docs/guides/resources.md#text-markup) has the full table, with what each piece becomes. ## Values in text `${...}` in text becomes part of the component, so the game fills it in when it shows the text, with no macro: a score (`${kills[@s]}`), a Global or a storage field (`${game.wave}`), or the names a selector finds (`${@s}`). A constant is written in. ## Chat, titles and the action bar `tell(target, text)` writes `/tellraw`, `title(target, text, subtitle = text)` a title, and `actionbar(target, text)` a line above the hotbar. In a raw command, `${text}` writes the text's JSON. ```mms Objective deaths: deathCount OnRespawn { tell(@s, "You have died **${deaths[@s]}** times, ${@s}.") title(@s, "{red}Back again", subtitle = "{gray}*try the stairs*") actionbar(@s, "Press {key:inventory} to check your gear") } ``` ## Named text There is no text declaration. A fixed piece of text is a `const` of type `Text`, and text with parameters is a `Template` that returns `Text`. Hover shows either one rendered, and the web editor's Preview tab shows it as chat, a title or a book page. ```mms const welcome: Text = "Welcome to **the Library**, ${@s}! Press {key:inventory} to open your bag." /** Shown when a wave starts. */ Template wave_start(wave: int): Text = "{red}Wave ${wave}{/} begins. [Rules](run:/say rules \"Show the rules\")" OnFirstJoin { tell(@s, welcome) tell(@s, wave_start(1)) } ``` ## Text files `TextFile("text/rules.mmstext")` reads markup from a file in the project. The editor checks and completes markup in the file itself. - A `.mmstext` file is text for anywhere: chat, a title, an item's lore. - A `.mmsbook` file is a book's text. A `---` line starts a new page, `[..](page:2)` turns to a page, and the `book-page-overflow` lint marks text past the end of a page. Page breaks and page links work only in book text, in a `.mmsbook` file or a `Book`'s `text`. Anywhere else they are an error with a fix that removes them. ```mms Objective deaths: deathCount Book guide { title = "Library Guide" author = "The Librarian" text = [ "# Welcome", "This world hides {gold}three diaries{/} in old chests.", "---", "You have died ${deaths[@s]} times.", ] } OnFirstJoin { /give @s ${guide} } ``` See [Books](https://minecraftmetascript.github.io/mms/docs/guides/resources.md#books) for the `Book` fields and the book preview. # Tests A `Test` runs functions in an interpreter, without starting the game, and checks what they did: ```mms Type SiegeState { wave: int = 0 } Storage game: SiegeState Function next_wave { game.wave += 1 for i in 1..game.wave * 2 { As(@e[tag=siege.spawn]).At(@s) { /summon zombie ~ ~ ~ {Tags:["siege.enemy"]} } } } Function fib(n: int): int { if (n < 2) { return n } return fib(n - 1) + fib(n - 2) } Test second_wave_spawns_four { setup { game.wave = 1 /summon marker 0 64 0 {Tags:["siege.spawn"]} } run next_wave() expect game.wave == 2 expect count(@e[tag=siege.enemy]) == 4 } Test fibonacci { expect fib(10) == 55 } ``` | Part | Does | | --- | --- | | `setup { }` | function code and commands that run first. Its `let` variables are in scope for the lines after it. | | `run f()` | calls a function | | `expect cond` | checks a condition. The test stops at the first one that fails, and a failed comparison shows both sides. | Each test starts from a fresh world after the pack's load functions. `run` and `expect` lines can come in any order after `setup`. `mms test` runs every test, the web editor's Tests tab runs them after every edit, and VS Code lists them in its Testing view. The [Functions guide](https://minecraftmetascript.github.io/mms/docs/guides/functions.md#tests) lists what the interpreter can run. # Reference Everything MMS knows about Minecraft 26.3, for looking things up. The generated pages come from the same schema and rules the checker uses. To learn MMS, start with [Getting started](https://minecraftmetascript.github.io/mms/docs/start/getting-started.md) instead. ## Language - [Declarations](https://minecraftmetascript.github.io/mms/docs/reference/language/declarations.md): A file is a list of declarations. Each one starts with its kind, a PascalCase word, then its name: - [Values and types](https://minecraftmetascript.github.io/mms/docs/reference/language/values.md): Values look like the JSON they become, with less punctuation. Every value is checked against the type its place expects, and that type also decides what shorthand means there. - [Constants, templates and loops](https://minecraftmetascript.github.io/mms/docs/reference/language/reuse.md): Four tools cut repetition: const names a value, Template names a value with parameters, comprehensions build lists, and a top-level for repeats declarations. They all run at compile time and write nothing of their own: only the declarations that use them reach the pack. private keeps a name to the file it is written in. - [Blueprints](https://minecraftmetascript.github.io/mms/docs/reference/language/blueprints.md): A Blueprint declares a new kind of declaration. Its fields are checked and completed like the game's own, its check block reports problems, and its emit block writes the declarations it stands for. CustomItem, Book and JigsawStructure are Blueprints written this way, in the prelude: their pages under Declaration kinds list their fields. - [Functions](https://minecraftmetascript.github.io/mms/docs/reference/language/functions.md): A Function body is code that compiles to a .mcfunction file. It mixes raw commands, which start with /, with statements that compile to commands. The Functions guide explains each part at length, and How functions compile shows what it becomes. - [Text](https://minecraftmetascript.github.io/mms/docs/reference/language/text.md): Wherever the game takes a text component, a string is markup: a small Markdown-like format for Minecraft text. A string without markup is the same plain string in the output. - [Tests](https://minecraftmetascript.github.io/mms/docs/reference/language/tests.md): A Test runs functions in an interpreter, without starting the game, and checks what they did: ## Generated - [Declaration kinds](https://minecraftmetascript.github.io/mms/docs/reference/kinds.md): 92 kinds, and the folder each one writes to. - [Helpers](https://minecraftmetascript.github.io/mms/docs/reference/helpers.md): 758 helpers in 54 groups, each building one typed object. - [Templates and forms](https://minecraftmetascript.github.io/mms/docs/reference/prelude.md): the prelude's templates and types, and what each operator means by type. - [Types](https://minecraftmetascript.github.io/mms/docs/reference/types.md): 1589 named types from the game's schema, with values that fit. - [Lint rules](https://minecraftmetascript.github.io/mms/docs/reference/lint.md): 21 rules, their default severity and what they catch. ## For AI tools - [llms.txt](https://minecraftmetascript.github.io/mms/llms.txt): what MMS is, and a link to every page. - [llms-full.txt](https://minecraftmetascript.github.io/mms/llms-full.txt): every page and the whole reference as one Markdown file. - [reference.yaml](https://minecraftmetascript.github.io/mms/docs/reference.yaml): kinds, helpers, types and lint rules as data. # Declaration kinds Every declaration starts with its kind: `LootTable gems { ... }` or `ItemTag gems = [...]`. There are 92 of them. ## MMS kinds These are MMS's own, for functions, text and other things the game has no single file for. - `Function`: A function: commands, variables and control flow, compiled to .mcfunction files. - `Global`: A value for the whole pack, set when the pack first loads. - `JigsawHole`: A name for jigsaw blocks, used only by the editor: `JigsawHole road_end` lists `:road_end` in the Jigsaw view's Name and Target lists, so pieces built in the game join by names spelled the same way. It writes no file. - `Namespace`: Sets the namespace for the declarations after it in the file. - `Objective`: A scoreboard objective, created by the generated load function. - `OnAdvancement`: Code that runs as and at a player each time they meet a trigger: `OnAdvancement name = Trigger(...) { ... }` writes the advancement, its reward function and the revoke. - `OnFirstJoin`: Code that runs once for each player, the first time they are in the world with the pack, as and at that player. - `OnLoad`: Code that runs when the pack loads, from #minecraft:load. - `OnRespawn`: Code that runs as and at a player right after they respawn. - `OnTick`: Code that runs every tick, from #minecraft:tick. - `Storage`: A record kept in command storage: `Storage game: GameState` keeps a `Type GameState { wave: int = 0 }` at `:mms game`. Functions read and write its fields as `game.wave`; the pack sets each missing field to its default when it loads. - `Test`: A test of the pack's functions, run by `mms test` and the editor: a `setup { }` block, then `run f()` and `expect condition` lines. Tests run in a fresh world after the pack loads and are never written to the pack. ## Blueprint kinds These are written in MMS, in the prelude. Each one writes several resources from one declaration, and has a page of its own. - [`Book`](https://minecraftmetascript.github.io/mms/docs/reference/kinds/Book.md): A written book with pages in book markup: `Book guide { title = "Guide", author = "The Garrison", text = ["# Welcome", "Plant the **banner** on gold."] }`. Its name stands for the book in item stacks, loot entries and `${...}` in commands. - [`CustomItem`](https://minecraftmetascript.github.io/mms/docs/reference/kinds/CustomItem.md): A vanilla item with its own look and name. It writes the model drawn from its texture, the item model that its item_model component names and its name in the lang files. Its name then stands for the base item with those components wherever an item stack goes: recipe results, loot entries and `${...}` in commands. - [`JigsawStructure`](https://minecraftmetascript.github.io/mms/docs/reference/kinds/JigsawStructure.md): A structure grown from jigsaw pieces, with how often it appears: `JigsawStructure dungeon { biomes = #minecraft:is_overworld, step = underground_structures, spacing = 32, separation = 12, height = AboveBottom(20), start = start, pools = { start = [Piece("start")] } }`. It writes the structure set, the structure and one template pool per entry of `pools`. Its name stands for the structure, as in `/locate structure ${dungeon}`. ## Resource kinds Each of these makes one resource in the folder shown: in the data pack, or for `assets/` folders in the resource pack. Tags of other registries follow the same pattern, such as `DamageTypeTag`. - `Advancement`: writes `data//advancement/` - `Atlas`: writes `assets//atlases/` - `BannerPattern`: writes `data//banner_pattern/` - `Biome`: writes `data//worldgen/biome/` - `BiomeTag`: writes `data//tags/worldgen/biome/`. A tag of worldgen/biome entries. Other tags of the same registry follow `Tag` the same way. - `BlockState`: writes `assets//blockstates/` - `BlockStateProvider`: writes `data//worldgen/block_state_provider/` - `BlockTag`: writes `data//tags/block/`. A tag of block entries. Other tags of the same registry follow `Tag` the same way. - `BlockTransformer`: writes `data//block_transformer/` - `Carver`: writes `data//worldgen/carver/` - `CatSoundVariant`: writes `data//cat_sound_variant/` - `CatVariant`: writes `data//cat_variant/` - `ChatType`: writes `data//chat_type/` - `ChickenSoundVariant`: writes `data//chicken_sound_variant/` - `ChickenVariant`: writes `data//chicken_variant/` - `ContextFloatProvider`: writes `data//context_float_provider/` - `ContextIntProvider`: writes `data//context_int_provider/` - `CowSoundVariant`: writes `data//cow_sound_variant/` - `CowVariant`: writes `data//cow_variant/` - `DamageType`: writes `data//damage_type/` - `DamageTypeTag`: writes `data//tags/damage_type/`. A tag of damage_type entries. Other tags of the same registry follow `Tag` the same way. - `DecoratedPotPattern`: writes `data//decorated_pot_pattern/` - `DensityFunction`: writes `data//worldgen/density_function/` - `Dialog`: writes `data//dialog/` - `Dimension`: writes `data//dimension/` - `DimensionType`: writes `data//dimension_type/` - `Enchantment`: writes `data//enchantment/` - `EnchantmentProvider`: writes `data//enchantment_provider/` - `EntityTypeTag`: writes `data//tags/entity_type/`. A tag of entity_type entries. Other tags of the same registry follow `Tag` the same way. - `Equipment`: writes `assets//equipment/` - `Feature`: writes `data//worldgen/feature/` - `FlatLevelGeneratorPreset`: writes `data//worldgen/flat_level_generator_preset/` - `FluidTag`: writes `data//tags/fluid/`. A tag of fluid entries. Other tags of the same registry follow `Tag` the same way. - `Font`: writes `assets//font/` - `FrogVariant`: writes `data//frog_variant/` - `FunctionTag`: writes `data//tags/function/`. A tag of function entries. Other tags of the same registry follow `Tag` the same way. - `Instrument`: writes `data//instrument/` - `ItemModel`: writes `assets//items/` - `ItemModifier`: writes `data//item_modifier/` - `ItemTag`: writes `data//tags/item/`. A tag of item entries. Other tags of the same registry follow `Tag` the same way. - `JukeboxSong`: writes `data//jukebox_song/` - `Lang`: writes `assets//lang/` - `LootTable`: writes `data//loot_table/` - `Model`: writes `assets//models/` - `MultiNoiseBiomeSourceParameterList`: writes `data//worldgen/multi_noise_biome_source_parameter_list/` - `Noise`: writes `data//worldgen/noise/` - `NoiseSettings`: writes `data//worldgen/noise_settings/` - `PaintingVariant`: writes `data//painting_variant/` - `Particle`: writes `assets//particles/` - `PigSoundVariant`: writes `data//pig_sound_variant/` - `PigVariant`: writes `data//pig_variant/` - `PlacedFeature`: writes `data//worldgen/placed_feature/` - `PostEffect`: writes `assets//post_effect/` - `Predicate`: writes `data//predicate/` - `ProcessorList`: writes `data//worldgen/processor_list/` - `Recipe`: writes `data//recipe/` - `SlotSource`: writes `data//slot_source/` - `Structure`: writes `data//worldgen/structure/` - `StructureSet`: writes `data//worldgen/structure_set/` - `SulfurCubeArchetype`: writes `data//sulfur_cube_archetype/` - `SurfaceCondition`: writes `data//worldgen/material_condition/` - `SurfaceRule`: writes `data//worldgen/material_rule/` - `TemplatePool`: writes `data//worldgen/template_pool/` - `TestEnvironment`: writes `data//test_environment/` - `TestInstance`: writes `data//test_instance/` - `Timeline`: writes `data//timeline/` - `TradeSet`: writes `data//trade_set/` - `TrialSpawner`: writes `data//trial_spawner/` - `TrimMaterial`: writes `data//trim_material/` - `TrimPattern`: writes `data//trim_pattern/` - `VillagerTrade`: writes `data//villager_trade/` - `WaypointStyle`: writes `assets//waypoint_style/` - `WolfSoundVariant`: writes `data//wolf_sound_variant/` - `WolfVariant`: writes `data//wolf_variant/` - `WorldClock`: writes `data//world_clock/` - `WorldPreset`: writes `data//worldgen/world_preset/` - `ZombieNautilusVariant`: writes `data//zombie_nautilus_variant/` # Book A written book with pages in book markup: `Book guide { title = "Guide", author = "The Garrison", text = ["# Welcome", "Plant the **banner** on gold."] }`. Its name stands for the book in item stacks, loot entries and `${...}` in commands. ``` Book name { title = ... author = ... } ``` `Book` is a [Blueprint](https://minecraftmetascript.github.io/mms/docs/reference/language/blueprints.md) in the prelude: it is written in MMS, and every project has it. ## Fields - `title`: string. The title on the cover and the item's name, at most 32 characters. - `author`: string - `generation`: BookGeneration? (optional) - `text`: BookText? (optional). The book's text in book markup, one string per line, or `TextFile("books/guide.mmsbook")` to read it from a file. A line of `---` starts the next page. Markup: `# heading`, `**bold**`, `*italic*`, `__underlined__`, `~~struck~~`, `||obfuscated||`, `{gold}...{/}` (colors, `#ff8800`, `bold`, `shadow:#000000`, `font:uniform`, combined as `{bold red}`), `{key:jump}`, `{sprite:item/diamond}`, `{head:Notch}`, `{t:translation.key}`, `[text](page:2)` (also `run:/command`, `suggest:/command`, `copy:text`, `hover:text`, `https://...`; add `"hover text"` after the target), `${kills[@s]}` for a score or Global, `\` before a character to write it as is. - `pages`: [Text]? (optional). The pages as text components, for full control. Use `text` instead for book markup. - `components`: DataComponentPatch (default `{}`). More item components, such as `lore` or `custom_data`. Every use of the book gets them. ## What its name stands for Where one of these types is expected, the declaration's name means: - where `ItemStackTemplate` goes: In a recipe result, a loot entry, or `${...}` in a command: a written book with these pages. - where `ItemStack` goes - where `LootPoolEntry` goes - where `Id` goes: A Book used where the game takes a plain item id, such as a recipe ingredient or an item tag. It stands for written_book there, so any written book matches. # CustomItem A vanilla item with its own look and name. It writes the model drawn from its texture, the item model that its item_model component names and its name in the lang files. Its name then stands for the base item with those components wherever an item stack goes: recipe results, loot entries and `${...}` in commands. ``` CustomItem name { base = ... } ``` `CustomItem` is a [Blueprint](https://minecraftmetascript.github.io/mms/docs/reference/language/blueprints.md) in the prelude: it is written in MMS, and every project has it. ## Fields - `base`: Id. The vanilla item this one is made from. It keeps the base item's behaviour; recipes and item tests that ask for an item id match the base. - `name`: LangText? (optional). The item's name: text for `en_us`, or one text per language such as `{ en_us = "Ember Shard", de_de = "Glutsplitter" }`. It becomes an `item..` entry in the lang files and the item's `item_name` component. - `texture`: Texture? (optional). The item's picture, usually `Texture("art/name.png")`, which is copied to textures/item/.png. It makes a flat item model, like most vanilla items. - `parent`: Id? (optional). The parent of the model drawn from `texture`: `item/generated` (the default) for flat items, `item/handheld` for tools held like a sword. - `model`: Id? (optional). An existing model to show instead of one drawn from `texture`, such as a `Model` declared in the project. - `item_model`: ItemModel? (optional). An item model to use instead of the generated one: the id of an `ItemModel`, or its body, such as `{ model = Select(...) }` for an item that changes its look. - `components`: DataComponentPatch (default `{}`). More item components, such as `max_stack_size` or `rarity`. Every use of the item gets them. - `consume_on_use`: int? (optional). How many of the item each right-click use takes from the stack, paid once per press by on_right_click, on_use_on_block or on_right_click_entity. - `damage_on_use`: int? (optional). How much durability each right-click use costs, paid like consume_on_use. The item needs a `max_damage` component, and gets `max_stack_size = 1` unless it sets one. When the durability runs out the item breaks, and on_break runs. - `on_right_click`: Function? (optional). A `Function` without parameters to run, as and at the player, when they right-click with the item: once per press, not again while the button is held. When the item also has on_use_on_block or on_right_click_entity, a press that runs one of those does not run this one too, so this is the click at anything else, such as the air. - `on_hold_right_click`: Function? (optional). A `Function` without parameters to run, as and at the player, on every tick they hold right click with the item. - `on_use_on_block`: Function? (optional). A `Function` without parameters to run when a player right-clicks a block with the item, once per press: as the player, positioned at the centre of the block. - `on_right_click_entity`: Function? (optional). A `Function` without parameters to run when a player right-clicks an entity with the item, once per press: as the player, at the entity, which has the tag `mms_target` while it runs. - `on_hit`: Function? (optional). A `Function` without parameters to run, as and at the player, when they hurt an entity while holding the item in their main hand. - `on_kill`: Function? (optional). A `Function` without parameters to run, as and at the player, when they kill an entity while holding the item in their main hand. - `on_consume`: Function? (optional). A `Function` without parameters to run, as and at the player, when they finish eating or drinking the item. The item needs a `consumable` component, or a base item that is food or a potion. It cannot be combined with the right-click hooks. - `on_pickup`: Function? (optional). A `Function` without parameters to run, as and at the player, when they pick the item up from the ground. - `on_break`: Function? (optional). A `Function` without parameters to run, as and at the player, when the item runs out of durability and breaks. The item needs durability: a tool, weapon or armor base, or a `max_damage` component. - `on_projectile_hit_block`: Function? (optional). A `Function` without parameters to run when an arrow hits a block: an arrow shot from the item, for a bow or crossbow base, or the arrow that is the item, for an arrow, tipped_arrow or spectral_arrow base. It runs as the arrow, at the point it hit; `execute on origin` is the shooter. - `on_projectile_hit_entity`: Function? (optional). A `Function` without parameters to run when an arrow hurts an entity: an arrow shot from the item, for a bow or crossbow base, or the arrow that is the item, for an arrow, tipped_arrow or spectral_arrow base. It runs as and at the entity hit; `execute on attacker` is the shooter. - `on_projectile_land`: Function? (optional). A `Function` without parameters to run where a thrown splash or lingering potion that is the item lands, whatever it hits. It runs at the spot, as a marker that is removed afterwards. Needs a splash_potion or lingering_potion base. ## What its name stands for Where one of these types is expected, the declaration's name means: - where `ItemStackTemplate` goes: In a recipe result, a loot entry, or `${...}` in a command: the base item with the custom item's components. - where `ItemStack` goes - where `LootPoolEntry` goes - where `Id` goes: A CustomItem used where the game takes a plain item id, such as a recipe ingredient or an item tag. It stands for its base item there, so it also matches the base item without the custom components. # JigsawStructure A structure grown from jigsaw pieces, with how often it appears: `JigsawStructure dungeon { biomes = #minecraft:is_overworld, step = underground_structures, spacing = 32, separation = 12, height = AboveBottom(20), start = start, pools = { start = [Piece("start")] } }`. It writes the structure set, the structure and one template pool per entry of `pools`. Its name stands for the structure, as in `/locate structure ${dungeon}`. ``` JigsawStructure name { biomes = ... step = ... spacing = ... separation = ... height = ... start = ... pools = ... } ``` `JigsawStructure` is a [Blueprint](https://minecraftmetascript.github.io/mms/docs/reference/language/blueprints.md) in the prelude: it is written in MMS, and every project has it. ## Fields - `biomes`: Ids. Where it can start: a biome, a tag such as `#minecraft:is_overworld`, or a list of biomes. - `step`: DecorationStep. The generation step it is placed in, such as `surface_structures` or `underground_structures`. - `spacing`: int. The size in chunks of the grid cells it is spread over; about one structure per cell. - `separation`: int - `salt`: int? (optional) - `height`: HeightProvider. The height of the start piece, such as `AboveBottom(20)` or `Constant(64)`. - `heightmap`: Heightmap? (optional). The start piece's y is taken from the ground's surface instead, with `height` added to it, as villages do. - `depth`: int (default `7`). How many pieces deep it grows from the start piece, from 1 to 20. - `max_distance`: int (default `80`). How far in blocks a piece can be from the start piece, from 1 to 128. - `terrain_adaptation`: TerrainAdaptation? (optional). How the terrain fits around it: `beard_thin` and `beard_box` raise the ground under it, `bury` sinks it, `encapsulate` fills around it. - `start`: Id. The pool the start piece comes from, usually one of `pools`. - `pools`: {string: [WeightedElement] | TemplatePool}. The template pools, by name: a list of pieces, such as `start = [Piece("start")]`, or a whole pool, such as `halls = { fallback = caps, elements = [Piece("halls/hall")] }`. Each one is a TemplatePool of that name, so jigsaw blocks draw from `:`. - `start_jigsaw_name`: string? (optional). The jigsaw block in the start piece that sits at the structure's center, by its name, such as `minecraft:city_anchor`. The start piece's own center is used unless set. - `spawn_overrides`: {MobCategory: SpawnOverride} (default `{}`). The mobs that spawn in it instead of the biome's, by mob category: `monster = { bounding_box = piece, spawns = [] }` stops hostile mobs spawning inside its pieces. `full` covers its whole bounding box. - `liquid_settings`: LiquidSettings? (optional). Whether pieces placed in water are waterlogged: `apply_waterlogging` (the game's default) or `ignore_waterlogging`. - `pool_aliases`: [PoolAlias]? (optional). Stand-in pool names that jigsaw blocks can draw from, each bound to a real pool when the structure starts, as trial chambers do: `[{ type = random, alias = my:spawner, targets = [{ data = zombies, weight = 1 }] }]`. - `dimension_padding`: (int | DimensionPaddingConfig)? (optional). How many blocks from the bottom and top of the world its pieces keep: a number for both, or `{ bottom = 10, top = 0 }`. # Templates and forms Every project has the prelude: [Templates](https://minecraftmetascript.github.io/mms/docs/reference/language/reuse.md#templates), Types and [Blueprint kinds](https://minecraftmetascript.github.io/mms/docs/reference/kinds.md#blueprint-kinds) written in MMS, and the built-in templates the compiler supplies. Call a template like any helper. ## Templates ### book_pages Built in. Lays out book markup as a book's pages: a `---` line starts the next page. The text is a list of lines, or `TextFile("books/guide.mmsbook")`. ``` book_pages(text: BookText): [Text] ``` - `text`: BookText ### cos Built in. The cosine of an angle in degrees. ``` cos(degrees: double): double ``` - `degrees`: double ### sin Built in. The sine of an angle in degrees. ``` sin(degrees: double): double ``` - `degrees`: double ### len Built in. The number of items in a list, fields in an object, or characters in a string. ``` len(value: any): int ``` - `value`: any ### by_language Built in. A LangText as an object of language code to text; plain text is English. ``` by_language(text: LangText?): {string: string} ``` - `text`: LangText? (optional) ### english Built in. The English text of a LangText, or its first text when it has no English. ``` english(text: LangText): string ``` - `text`: LangText ### contains Built in. Whether a list holds a value. ``` contains(list: [any], value: any): bool ``` - `list`: [any] - `value`: any ### index_of Built in. The position of the first item of a list equal to `value`, counting from 0: `index_of(modes, "Replace")`. A value known when compiling must be in the list. In a function, a value known only as it runs is tested against each item, giving -1 when none matches. ``` index_of(list: [any], value: any): int ``` - `list`: [any] - `value`: any ### matches Built in. Whether a string matches a regular expression, as a whole. ``` matches(text: string, pattern: string): bool ``` - `text`: string - `pattern`: string ### replace Built in. A string with every `old` replaced by `new`. ``` replace(text: string, old: string, new: string): string ``` - `text`: string - `old`: string - `new`: string ### named Built in. An asset call such as Texture("art/ruby.png") with an id name, unless it has one: named(texture, "item/ruby"). ``` named(asset: any, name: string): any ``` - `asset`: any - `name`: string ### kind_of Built in. The kind of a value: "none", "bool", "number", "string", "name", "list", "object", "range", "commands", or "runtime" for a value only known when the pack runs. ``` kind_of(value: any): string ``` - `value`: any ### hash Built in. A whole number from 0 to 2147483647 made from a string, the same in every build: `hash("dungeon:dungeon")`. ``` hash(text: string): int ``` - `text`: string ### tell Built in. Sends `message` to the chat of each player `target` selects: `tell(@a, "Wave ${wave} begins")`. The message is text markup, and `${...}` in it shows a score, a Global, a selector's names or a constant. ``` tell(target: Selector, message: Text): Commands ``` - `target`: Selector - `message`: Text ### title Built in. Shows `message` in large text in the middle of the screen of each player `target` selects, with `subtitle` under it. ``` title(target: Selector, message: Text, subtitle: Text?): Commands ``` - `target`: Selector - `message`: Text - `subtitle`: Text? (optional) ### exists Built in. Whether `target` selects at least one entity, in a function: `if (exists(@e[tag=boss])) { ... }`. ``` exists(target: Selector): bool ``` - `target`: Selector ### count Built in. How many entities `target` selects, in a function: `let n = count(@e[type=zombie, distance=..16])`. ``` count(target: Selector): int ``` - `target`: Selector ### actionbar Built in. Shows `message` just above the hotbar of each player `target` selects. ``` actionbar(target: Selector, message: Text): Commands ``` - `target`: Selector - `message`: Text ### Piece One structure file as a weighted pool entry: `Piece("halls/hall", 3)` reads structures/halls/hall.nbt and gives it weight 3. The file becomes the structure `:halls/hall` in the pack. `processors` is a processor list's id, or the processors written inline: `Piece("halls/hall", processors = [BlockRot(integrity = 0.8)])`. ``` Piece(path: string, weight: int = 1, processors: Id | ProcessorList = minecraft:empty, projection: Projection = rigid): WeightedElement ``` - `path`: string - `weight`: int (default `1`) - `processors`: Id | ProcessorList (default `minecraft:empty`) - `projection`: Projection (default `rigid`) ## Types ### BookGeneration How many times a written book has been copied. ``` Type BookGeneration = "original" | "copy" | "copy_of_copy" | "tattered" ``` ### LangText Text in English, or one text per language: `{ en_us = "Ruby", de_de = "Rubin" }`. ``` Type LangText = string | {string: string} ``` ## Forms of expression Operators and literals are forms of expression. What one means depends on the type expected where it is written, so `1..3` is a uniform number in a loot pool's rolls and bounds in a predicate. This is the [shorthand](https://minecraftmetascript.github.io/mms/docs/reference/language/values.md#shorthand) the language builds in. ### Range `lo..hi`, a range. Either end can be left out. - where `IntNumberProviderRef` goes: `1..3` where a number provider goes: a uniform number from 1 to 3. - where `FloatNumberProviderRef` goes: `0.5..2` where a number provider goes: a uniform number from 0.5 to 2. - where `IntRange` goes: `1..3`, `1..` or `..3` where bounds go. - where `FloatRange` goes: `0.5..2`, `0.5..` or `..2` where bounds go. - where `MinMaxBounds` goes: `1..3`, `1..` or `..3` where bounds go. ### Not `!x`. - where `LootCondition` goes - where `MaterialCondition` goes: `!a` on a surface condition. ### And `a && b && ...`. A chain of `&&` is one form, with every term; parentheses keep a group. - where `LootCondition` goes: `a && b` on loot conditions: true when every term is. ### Or `a || b || ...`. A chain of `||` is one form, with every term; parentheses keep a group. - where `LootCondition` goes: `a || b` on loot conditions: true when any term is. ### Sum `a + b`. - where `DensityFunction` goes ### Difference `a - b`. - where `DensityFunction` goes ### Product `a * b`. - where `DensityFunction` goes - where `ItemStackTemplate` goes: `diamond * 4`: a stack of four diamonds. ### Quotient `a / b`. - where `DensityFunction` goes ### Negation `-x`, where x is not a number. - where `DensityFunction` goes ### BareId A bare id, such as `diamond` or `minecraft:diamond`. - where `LootPoolEntry` goes ### TagRef A tag, such as `#logs`. - where `LootPoolEntry` goes ### NumberLiteral A number. - where `VerticalAnchor` goes ### ListLiteral A list. Lists inside it are flattened into it. - where `MaterialRule` goes: `[a, b]` where a surface rule goes: the first rule that applies. # Helpers A helper builds one typed object. `Name(a, b)` fills the parameters in the order listed, and `Name(a = 1)` names them. There are 758 helpers, grouped by what they make. - [Objects](https://minecraftmetascript.github.io/mms/docs/reference/helpers/objects.md): 164 helpers - [Biome source](https://minecraftmetascript.github.io/mms/docs/reference/helpers/biome_source.md): 4 helpers, `minecraft:biome_source` - [Block predicate](https://minecraftmetascript.github.io/mms/docs/reference/helpers/block_predicate.md): 16 helpers, `minecraft:block_predicate` - [Block state provider](https://minecraftmetascript.github.io/mms/docs/reference/helpers/block_state_provider.md): 10 helpers, `minecraft:block_state_provider` - [Carver config](https://minecraftmetascript.github.io/mms/docs/reference/helpers/carver_config.md): 2 helpers, `minecraft:carver_config` - [Chunk generator](https://minecraftmetascript.github.io/mms/docs/reference/helpers/chunk_generator.md): 3 helpers, `minecraft:chunk_generator` - [Click event](https://minecraftmetascript.github.io/mms/docs/reference/helpers/click_event.md): 7 helpers, `minecraft:click_event` - [Context float provider](https://minecraftmetascript.github.io/mms/docs/reference/helpers/context_float_provider.md): 28 helpers, `minecraft:context_float_provider` - [Context int provider](https://minecraftmetascript.github.io/mms/docs/reference/helpers/context_int_provider.md): 23 helpers, `minecraft:context_int_provider` - [Density function](https://minecraftmetascript.github.io/mms/docs/reference/helpers/density_function.md): 45 helpers, `minecraft:density_function` - [Dialog](https://minecraftmetascript.github.io/mms/docs/reference/helpers/dialog.md): 5 helpers, `minecraft:dialog` - [Dialog action](https://minecraftmetascript.github.io/mms/docs/reference/helpers/dialog_action.md): 7 helpers, `minecraft:dialog_action` - [Dialog body](https://minecraftmetascript.github.io/mms/docs/reference/helpers/dialog_body.md): 2 helpers, `minecraft:dialog_body` - [Enchantment provider](https://minecraftmetascript.github.io/mms/docs/reference/helpers/enchantment_provider.md): 3 helpers, `minecraft:enchantment_provider` - [Feature config](https://minecraftmetascript.github.io/mms/docs/reference/helpers/feature_config.md): 65 helpers, `minecraft:feature_config` - [Feature size](https://minecraftmetascript.github.io/mms/docs/reference/helpers/feature_size.md): 2 helpers, `minecraft:feature_size` - [Float provider](https://minecraftmetascript.github.io/mms/docs/reference/helpers/float_provider.md): 4 helpers, `minecraft:float_provider` - [Foliage placer](https://minecraftmetascript.github.io/mms/docs/reference/helpers/foliage_placer.md): 12 helpers, `minecraft:foliage_placer` - [Glyph provider](https://minecraftmetascript.github.io/mms/docs/reference/helpers/glyph_provider.md): 5 helpers, `minecraft:glyph_provider` - [Height provider](https://minecraftmetascript.github.io/mms/docs/reference/helpers/height_provider.md): 6 helpers, `minecraft:height_provider` - [Hover event](https://minecraftmetascript.github.io/mms/docs/reference/helpers/hover_event.md): 3 helpers, `minecraft:hover_event` - [Input control](https://minecraftmetascript.github.io/mms/docs/reference/helpers/input_control.md): 4 helpers, `minecraft:input_control` - [Int provider](https://minecraftmetascript.github.io/mms/docs/reference/helpers/int_provider.md): 8 helpers, `minecraft:int_provider` - [Item model](https://minecraftmetascript.github.io/mms/docs/reference/helpers/item_model.md): 7 helpers, `minecraft:item_model` - [Level based value](https://minecraftmetascript.github.io/mms/docs/reference/helpers/level_based_value.md): 6 helpers, `minecraft:level_based_value` - [List operation](https://minecraftmetascript.github.io/mms/docs/reference/helpers/list_operation.md): 4 helpers, `minecraft:list_operation` - [Loot condition](https://minecraftmetascript.github.io/mms/docs/reference/helpers/loot_condition.md): 20 helpers, `minecraft:loot_condition` - [Loot function](https://minecraftmetascript.github.io/mms/docs/reference/helpers/loot_function.md): 42 helpers, `minecraft:loot_function` - [Loot pool entry](https://minecraftmetascript.github.io/mms/docs/reference/helpers/loot_pool_entry.md): 9 helpers, `minecraft:loot_pool_entry` - [Material condition](https://minecraftmetascript.github.io/mms/docs/reference/helpers/material_condition.md): 11 helpers, `minecraft:material_condition` - [Material rule](https://minecraftmetascript.github.io/mms/docs/reference/helpers/material_rule.md): 5 helpers, `minecraft:material_rule` - [Nbt provider](https://minecraftmetascript.github.io/mms/docs/reference/helpers/nbt_provider.md): 2 helpers, `minecraft:nbt_provider` - [Placement modifier](https://minecraftmetascript.github.io/mms/docs/reference/helpers/placement_modifier.md): 18 helpers, `minecraft:placement_modifier` - [Pos rule test](https://minecraftmetascript.github.io/mms/docs/reference/helpers/pos_rule_test.md): 3 helpers, `minecraft:pos_rule_test` - [Recipe serializer](https://minecraftmetascript.github.io/mms/docs/reference/helpers/recipe_serializer.md): 22 helpers, `minecraft:recipe_serializer` - [Root placer](https://minecraftmetascript.github.io/mms/docs/reference/helpers/root_placer.md): 1 helper, `minecraft:root_placer` - [Rule block entity modifier](https://minecraftmetascript.github.io/mms/docs/reference/helpers/rule_block_entity_modifier.md): 4 helpers, `minecraft:rule_block_entity_modifier` - [Rule test](https://minecraftmetascript.github.io/mms/docs/reference/helpers/rule_test.md): 10 helpers, `minecraft:rule_test` - [Score provider](https://minecraftmetascript.github.io/mms/docs/reference/helpers/score_provider.md): 2 helpers, `minecraft:score_provider` - [Slot source](https://minecraftmetascript.github.io/mms/docs/reference/helpers/slot_source.md): 6 helpers, `minecraft:slot_source` - [Spawn condition](https://minecraftmetascript.github.io/mms/docs/reference/helpers/spawn_condition.md): 3 helpers, `minecraft:spawn_condition` - [Special item model](https://minecraftmetascript.github.io/mms/docs/reference/helpers/special_item_model.md): 13 helpers, `minecraft:special_item_model` - [Sprite source](https://minecraftmetascript.github.io/mms/docs/reference/helpers/sprite_source.md): 5 helpers, `minecraft:sprite_source` - [Structure config](https://minecraftmetascript.github.io/mms/docs/reference/helpers/structure_config.md): 19 helpers, `minecraft:structure_config` - [Structure placement](https://minecraftmetascript.github.io/mms/docs/reference/helpers/structure_placement.md): 3 helpers, `minecraft:structure_placement` - [Template pool element](https://minecraftmetascript.github.io/mms/docs/reference/helpers/template_pool_element.md): 5 helpers, `minecraft:template_pool_element` - [Template processor](https://minecraftmetascript.github.io/mms/docs/reference/helpers/template_processor.md): 11 helpers, `minecraft:template_processor` - [Test environment definition](https://minecraftmetascript.github.io/mms/docs/reference/helpers/test_environment_definition.md): 7 helpers, `minecraft:test_environment_definition` - [Test instance](https://minecraftmetascript.github.io/mms/docs/reference/helpers/test_instance.md): 2 helpers, `minecraft:test_instance` - [Tint source](https://minecraftmetascript.github.io/mms/docs/reference/helpers/tint_source.md): 8 helpers, `minecraft:tint_source` - [Tree decorator](https://minecraftmetascript.github.io/mms/docs/reference/helpers/tree_decorator.md): 11 helpers, `minecraft:tree_decorator` - [Trigger](https://minecraftmetascript.github.io/mms/docs/reference/helpers/trigger.md): 58 helpers, `minecraft:trigger` - [Trunk placer](https://minecraftmetascript.github.io/mms/docs/reference/helpers/trunk_placer.md): 10 helpers, `minecraft:trunk_placer` - [Pool alias binding](https://minecraftmetascript.github.io/mms/docs/reference/helpers/worldgen-pool_alias_binding.md): 3 helpers, `minecraft:worldgen/pool_alias_binding` # Objects Helpers for objects that are not chosen by a `type` field. Each builds the object it is named after. ## AND ``` AND(AND: [MultiPartCondition]) ``` - `AND`: list of MultiPartCondition ## AboveBottom ``` AboveBottom(above_bottom: int) ``` - `above_bottom`: int ## AboveRootPlacement ``` AboveRootPlacement(above_root_provider: BlockStateProviderRef, above_root_placement_chance: float) ``` - `above_root_provider`: BlockStateProviderRef - `above_root_placement_chance`: number 0..1 ## Absolute ``` Absolute(absolute: int) ``` - `absolute`: int ## Advancement ``` Advancement(criteria: object, parent?: advancement id, display?: value, requirements?: [[string]], rewards?: AdvancementRewards, sends_telemetry_event?: bool) ``` - `criteria`: map of string to AdvancementCriterion. If `requirements` is not defined, all defined criteria will be required. - `parent`: advancement id (optional). If this field is absent, this advancement is a root advancement. Circular references cause a loading failure. - `display`: any (depends on parent) (optional). If present, advancement will be visible in the advancement tabs. - `requirements`: list of (list of string (at least 1)) (at least 1) (optional). If all criteria are required at once, this may be omitted. Contains all of the `criteria` keys. If all of the lists each have at least one criteria met, the advancement is complete (basically AND grouping of OR groups). - `rewards`: AdvancementRewards (optional). Provided to the player when this advancement is obtained. - `sends_telemetry_event`: bool (optional). Defaults to `false`. The vanilla game client only reads this for advancements from the `minecraft` namespace. ## AdvancementRewards ``` AdvancementRewards(experience?: int, loot?: LootTableListRef, recipes?: [recipe id], function?: function id) ``` - `experience`: int (optional). XP to add. - `loot`: LootTableListRef (optional). Loot tables to give. - `recipes`: list of recipe ids (optional). Recipes to unlock. - `function`: function id (optional). Function to run as and at the player. Function tags are not allowed. ## Aquifer ``` Aquifer(barrier: DensityFunctionRef, fluid_level_floodedness: DensityFunctionRef, fluid_level_spread: DensityFunctionRef, lava: DensityFunctionRef, exclusion: DensityFunctionRef, surface_level: DensityFunctionRef) ``` - `barrier`: DensityFunctionRef - `fluid_level_floodedness`: DensityFunctionRef - `fluid_level_spread`: DensityFunctionRef - `lava`: DensityFunctionRef - `exclusion`: DensityFunctionRef - `surface_level`: DensityFunctionRef ## AssetId ``` AssetId(asset_id: texture id) ``` - `asset_id`: texture id ## Atlas ``` Atlas(sources: [SpriteSource]) ``` - `sources`: list of SpriteSource. List of sprite sources which can add or remove sprite textures to this atlas. ## AttributeEntry ``` AttributeEntry(attribute: attribute id, id: attribute_modifier id, amount: float, operation: AttributeOperation) ``` - `attribute`: attribute id. Attribute type to modify. - `id`: attribute_modifier id. The unique identifier of this attribute modifier. - `amount`: number. Change in the attribute. - `operation`: AttributeOperation. The operation used for this modifier. ## AttributeModifier ``` AttributeModifier(attribute: attribute id, id: attribute_modifier id, amount: FloatNumberProviderRef, operation: AttributeOperation, slot: EquipmentSlotGroup | [EquipmentSlotGroup]) ``` - `attribute`: attribute id. Attribute type to modify. - `id`: attribute_modifier id. The unique identifier of this attribute modifier. - `amount`: FloatNumberProviderRef - `operation`: AttributeOperation. The operation used for this modifier. - `slot`: EquipmentSlotGroup | list of EquipmentSlotGroup. If a list, one of the listed slots will be chosen randomly. ## AxisAngle ``` AxisAngle(axis: [float], angle: float) ``` - `axis`: list of number (exactly 3). Local position of the axis in [x, y, z]. - `angle`: number. Angle to rotate around the axis in radians. ## BannerPattern ``` BannerPattern(asset_id: texture id, translation_key: string) ``` - `asset_id`: texture id. Also resolves to `assets//textures/entity/shield/.png`. - `translation_key`: string. Translation key prefix per dye color (e.g. `block.minecraft.banner.custom.pattern` resolves to `block.minecraft.banner.custom.pattern.`). ## BannerPatternLayer ``` BannerPatternLayer(pattern: banner_pattern id, color: DyeColor) ``` - `pattern`: banner_pattern id - `color`: DyeColor ## BelowTop ``` BelowTop(below_top: int) ``` - `below_top`: int ## Biome ``` Biome(temperature: float, downfall: float, has_precipitation: bool, effects: BiomeEffects, carvers: CarverListRef, features: [[PlacedFeatureRef] | placed_feature id], attributes?: EnvironmentAttributeMap, temperature_modifier?: TemperatureModifier) ``` - `temperature`: number - `downfall`: number - `has_precipitation`: bool - `effects`: BiomeEffects - `carvers`: CarverListRef - `features`: list of (#placed_feature tag | list of PlacedFeatureRef) (at most 11) - `attributes`: PositionalEnvironmentAttributeMap (optional) - `temperature_modifier`: TemperatureModifier (optional) ## BiomeEffects ``` BiomeEffects(water_color: StringRGB, grass_color?: StringRGB, foliage_color?: StringRGB, dry_foliage_color?: StringRGB, grass_color_modifier?: GrassColorModifier) ``` - `water_color`: StringRGB - `grass_color`: StringRGB (optional) - `foliage_color`: StringRGB (optional) - `dry_foliage_color`: StringRGB (optional) - `grass_color_modifier`: GrassColorModifier (optional) ## Biomes ``` Biomes(biomes: [object]) ``` - `biomes`: list of { biome: biome id, parameters: ClimateParameters } ## BlockColumnLayer ``` BlockColumnLayer(height: IntProvider, provider: BlockStateProviderRef) ``` - `height`: IntProvider of int 0.. - `provider`: BlockStateProviderRef ## BlockPredicate ``` BlockPredicate(blocks?: block id | [block id], state?: BlockPredicateState, nbt?: string | value, components?: DataComponentExactPredicate, predicates?: DataComponentPredicate) ``` - `blocks`: block id | #block tag | list of block ids (optional) - `state`: BlockPredicateState (optional) - `nbt`: string | any (depends on blocks) (optional) - `components`: DataComponentExactPredicate (optional). Match exact data component values on the block entity. - `predicates`: DataComponentPredicate (optional). Test data component values on the block entity. ## BlockPredicateState ``` BlockPredicateState() ``` ## BlockTransformData ``` BlockTransformData(block_state_provider: BlockStateProviderRef, sound?: SoundEventRef, particle?: BlockTransformParticle, disallowed_faces?: [Direction], loot?: loot_table id, drop_strategy?: BlockTransformDropStrategy, transform_type?: BlockTransformType, update_from_neighbors?: bool, consume_on_use?: bool, item_damage_per_use?: int) ``` - `block_state_provider`: BlockStateProviderRef. If the provider returns no result, the next transformer will be attempted. - `sound`: SoundEventRef (optional). Defaults to not playing sound. - `particle`: BlockTransformParticle (optional). Defaults to `none`. - `disallowed_faces`: list of Direction (optional). If a disallowed face is interacted with, the next transformer will be attempted. Defaults to empty (allowing all faces). - `loot`: loot_table id (optional). The loot to drop on a successful transformation. Defaults to drop nothing. - `drop_strategy`: BlockTransformDropStrategy (optional). Where the `loot` should drop. Defaults to `from_middle`. - `transform_type`: BlockTransformType (optional). How nearby blocks are affected by the transformation. Defaults to `single_block`. - `update_from_neighbors`: bool (optional). Whether the transformed block should update based on neighboring blocks. Defaults to `true`. - `consume_on_use`: bool (optional). Only has effect on stackable items. Defaults to `true`. - `item_damage_per_use`: int 0.. (optional). Only has effect on unstackable items. Defauls to 1. ## Button ``` Button(label: Text, tooltip?: Text, width?: int, action?: ClickAction) ``` - `label`: Text - `tooltip`: Text (optional) - `width`: int 1..1024 (optional). Width of the button. Defaults to 150. - `action`: ClickAction (optional). If not present, clicking button will simply close dialog without any action. ## CanyonShape ``` CanyonShape(distance_factor: FloatProvider, thickness: FloatProvider, width_smoothness: int, horizontal_radius_factor: FloatProvider, vertical_radius_default_factor: float, vertical_radius_center_factor: float, y_scale: FloatProvider) ``` - `distance_factor`: FloatProvider of number - `thickness`: FloatProvider of number - `width_smoothness`: int 0.. - `horizontal_radius_factor`: FloatProvider of number - `vertical_radius_default_factor`: number - `vertical_radius_center_factor`: number - `y_scale`: FloatProvider of number ## CatSounds ``` CatSounds(ambient_sound: SoundEventRef, stray_ambient_sound: SoundEventRef, hiss_sound: SoundEventRef, hurt_sound: SoundEventRef, death_sound: SoundEventRef, eat_sound: SoundEventRef, beg_for_food_sound: SoundEventRef, purr_sound: SoundEventRef, purreow_sound: SoundEventRef) ``` - `ambient_sound`: SoundEventRef - `stray_ambient_sound`: SoundEventRef - `hiss_sound`: SoundEventRef - `hurt_sound`: SoundEventRef - `death_sound`: SoundEventRef - `eat_sound`: SoundEventRef - `beg_for_food_sound`: SoundEventRef - `purr_sound`: SoundEventRef - `purreow_sound`: SoundEventRef ## CatVariant ``` CatVariant(asset_id: texture id, baby_asset_id: texture id, spawn_conditions: [SpawnPrioritySelector]) ``` - `asset_id`: texture id. The cat texture to use for this variant. - `baby_asset_id`: texture id. The baby cat texture to use for this variant. - `spawn_conditions`: list of SpawnPrioritySelector. The spawn conditions for this variant. Selection process: - Conditions for all variants for the given entity type are evaluated for the spawn position - Entries with a priority lower than the maximum priority of the remaining entries are removed - A random entry is picked out of the remaining ones - If no conditions are remaining, the variant remains unchanged from the default ## ChatDecoration ``` ChatDecoration(translation_key: string, parameters: [ChatDecorationParameter], style?: TextStyle) ``` - `translation_key`: string - `parameters`: list of ChatDecorationParameter - `style`: TextStyle (optional) ## ChatType ``` ChatType(chat: ChatDecoration, narration: ChatDecoration) ``` - `chat`: ChatDecoration - `narration`: ChatDecoration ## ChickenVariant ``` ChickenVariant(asset_id: texture id, baby_asset_id: texture id, spawn_conditions: [SpawnPrioritySelector], model?: ChickenModelType) ``` - `asset_id`: texture id. The chicken texture to use for this variant. - `baby_asset_id`: texture id. The baby chicken texture to use for this variant. - `spawn_conditions`: list of SpawnPrioritySelector. The spawn conditions for this variant. Selection process: - Conditions for all variants for the given entity type are evaluated for the spawn position - Entries with a priority lower than the maximum priority of the remaining entries are removed - A random entry is picked out of the remaining ones - If no conditions are remaining, the variant remains unchanged from the default - `model`: ChickenModelType (optional) ## ClimateParameters ``` ClimateParameters(temperature: ClimateParameter, humidity: ClimateParameter, continentalness: ClimateParameter, erosion: ClimateParameter, weirdness: ClimateParameter, depth: ClimateParameter, offset: float) ``` - `temperature`: ClimateParameter - `humidity`: ClimateParameter - `continentalness`: ClimateParameter - `erosion`: ClimateParameter - `weirdness`: ClimateParameter - `depth`: ClimateParameter - `offset`: number 0..1 ## CollectionPredicate ``` CollectionPredicate(contains?: [EntityEffectsPredicate], count?: [object], size?: MinMaxBounds) ``` - `contains`: list of EntityEffectsPredicate (optional). A list of tests. For each test, there must be at least one entry whose contents match exactly. - `count`: list of { test: EntityEffectsPredicate, count: MinMaxBounds of int } (optional) - `size`: MinMaxBounds of int (optional). When set, total number of entries in the this collection. ## ColorWhenUndyed ``` ColorWhenUndyed(color_when_undyed?: RGB) ``` - `color_when_undyed`: RGB (optional). If the item is not dyed, this color is used instead. If not specified and the item is not dyed, this layer will be hidden. ## ContactDamage ``` ContactDamage(damage_type: damage_type id, amount: FloatProvider, attribute_to_source: bool) ``` - `damage_type`: damage_type id - `amount`: FloatProvider of number 0.. - `attribute_to_source`: bool. Whether the damage is attributed to the sulfur cube. ## CowSounds ``` CowSounds(ambient_sound: SoundEventRef, hurt_sound: SoundEventRef, death_sound: SoundEventRef, step_sound: SoundEventRef) ``` - `ambient_sound`: SoundEventRef - `hurt_sound`: SoundEventRef - `death_sound`: SoundEventRef - `step_sound`: SoundEventRef ## CowVariant ``` CowVariant(asset_id: texture id, baby_asset_id: texture id, spawn_conditions: [SpawnPrioritySelector], model?: CowModelType) ``` - `asset_id`: texture id. The cow texture to use for this variant. - `baby_asset_id`: texture id. The baby cow texture to use for this variant. - `spawn_conditions`: list of SpawnPrioritySelector. The spawn conditions for this variant. Selection process: - Conditions for all variants for the given entity type are evaluated for the spawn position - Entries with a priority lower than the maximum priority of the remaining entries are removed - A random entry is picked out of the remaining ones - If no conditions are remaining, the variant remains unchanged from the default - `model`: CowModelType (optional) ## CustomDataMap ``` CustomDataMap() ``` ## DamagePredicate ``` DamagePredicate(dealt?: MinMaxBounds, taken?: MinMaxBounds, blocked?: bool, source_entity?: EntityPredicate, type?: DamageSourcePredicate) ``` - `dealt`: MinMaxBounds of number (optional). Amount of incoming damage before damage reduction. - `taken`: MinMaxBounds of number (optional). Amount of incoming damage after damage reduction. - `blocked`: bool (optional). Whether the damage was successfully blocked. - `source_entity`: EntityPredicate (optional). Source of the damage (eg: a skeleton shooting an arrow or player igniting tnt). - `type`: DamageSourcePredicate (optional) ## DamageSourcePredicate ``` DamageSourcePredicate(tags?: [DamageTagPredicate], source_entity?: EntityPredicate, direct_entity?: EntityPredicate, is_direct?: bool) ``` - `tags`: list of DamageTagPredicate (optional). Damage type tags that the damage type is in. - `source_entity`: EntityPredicate (optional). Source of the damage (eg: a skeleton shooting an arrow or player igniting tnt). - `direct_entity`: EntityPredicate (optional). Direct entity responsible for the damage (eg: the arrow or tnt). - `is_direct`: bool (optional). Damage is direct when its direct and source entities are the same. ## DamageTagPredicate ``` DamageTagPredicate(id: damage_type id | [damage_type id], expected: bool) ``` - `id`: damage_type id | #damage_type tag | list of damage_type ids - `expected`: bool. Whether the damage is expected to have or not have the tag. ## DamageType ``` DamageType(message_id: string, exhaustion: float, scaling: DamageScaling, effects?: DamageEffects, death_message_type?: DeathMessageType) ``` - `message_id`: string. The message id used for deaths caused by this damage type. Is combined with the result of `death_message_type` to form a translation key. - `exhaustion`: number 0... Amount of hunger exhaustion to cause. - `scaling`: DamageScaling. Whether to scale damage with difficulty levels. - `effects`: DamageEffects (optional). Controls how damage manifests when inflicted on players. Defaults to `hurt`. - `death_message_type`: DeathMessageType (optional). Controls if special death message variants are used. Defaults to `default`. For more info see: https://minecraft.wiki/w/Damage_type#Death_messages ## DataComponentExactPredicate ``` DataComponentExactPredicate() ``` ## DataComponentPatch ``` DataComponentPatch() ``` ## DataComponentPredicate ``` DataComponentPredicate() ``` ## DebugFunctionEntry ``` DebugFunctionEntry(label: string, function: DensityFunctionRef) ``` - `label`: string - `function`: DensityFunctionRef ## DecoratedPotPattern ``` DecoratedPotPattern(asset_id: texture id) ``` - `asset_id`: texture id ## Dimension ``` Dimension(type: DimensionTypeRef, generator: ChunkGenerator) ``` - `type`: DimensionTypeRef - `generator`: ChunkGenerator ## DimensionType ``` DimensionType(has_skylight: bool, has_ceiling: bool, has_ender_dragon_fight: bool, coordinate_scale: float, ambient_light: float, logical_height: int, infiniburn: block id | [block id], min_y: int, height: int, monster_spawn_light_level: IntProvider, monster_spawn_block_light_limit: int, attributes?: EnvironmentAttributeMap, default_clock?: world_clock id, timelines?: timeline id | [timeline id], has_fixed_time?: bool, skybox?: SkyboxType, cardinal_light?: CardinalLightType) ``` - `has_skylight`: bool. Affects the weather, lighting engine and respawning rules. - `has_ceiling`: bool. Affects the weather, map items and respawning rules. - `has_ender_dragon_fight`: bool - `coordinate_scale`: number 1e-05..3e+07 - `ambient_light`: number 0..1 - `logical_height`: int 0..4064. Portals can't spawn and chorus fruit can't teleport players above this height. - `infiniburn`: block id | #block tag | list of block ids. Defining what blocks keep fire infinitely burning. - `min_y`: int -2032..2031. The minimum height in which blocks can exist. - `height`: int 16..4064. The total height in which blocks can exist. Max Y = Min Y + Height. - `monster_spawn_light_level`: IntProvider of int 0..15 - `monster_spawn_block_light_limit`: int 0..15 - `attributes`: GlobalEnvironmentAttributeMap (optional) - `default_clock`: world_clock id (optional) - `timelines`: timeline id | #timeline tag | list of timeline ids (optional) - `has_fixed_time`: bool (optional). Defaults to `false`. - `skybox`: SkyboxType (optional). Skybox type. Defaults to `overworld`. - `cardinal_light`: CardinalLightType (optional). The direction of cardinal lighting that affects blocks. ## Dimensions ``` Dimensions(dimensions: object) ``` - `dimensions`: map of dimension id to Dimension ## DistancePredicate ``` DistancePredicate(x?: MinMaxBounds, y?: MinMaxBounds, z?: MinMaxBounds, absolute?: MinMaxBounds, horizontal?: MinMaxBounds) ``` - `x`: MinMaxBounds of number (optional) - `y`: MinMaxBounds of number (optional) - `z`: MinMaxBounds of number (optional) - `absolute`: MinMaxBounds of number (optional) - `horizontal`: MinMaxBounds of number (optional) ## Dyeable ``` Dyeable(color_when_undyed?: RGB) ``` - `color_when_undyed`: RGB (optional). If the item is not dyed, this color is used instead. If not specified and the item is not dyed, this layer will be hidden. ## Enchantment ``` Enchantment(description: Text, supported_items: item id | [item id], weight: int, max_level: int, min_cost: EnchantmentCost, max_cost: EnchantmentCost, anvil_cost: int, slots: [EquipmentSlotGroup], exclusive_set?: enchantment id | [enchantment id], primary_items?: item id | [item id], effects?: EnchantmentEffectComponentMap) ``` - `description`: Text - `supported_items`: item id | #item tag | list of item ids - `weight`: int 1..1024. How commonly the Enchantment appears, compared to the total combined `weight` of all available Enchantments. - `max_level`: int 1..255. Maximum level of the enchantment. - `min_cost`: EnchantmentCost. Minimum experience cost. - `max_cost`: EnchantmentCost. Maximum experience cost. - `anvil_cost`: int 0... Halved when an Enchantment is added to a book. The effective fee is multiplied by the level of the Enchantment. - `slots`: list of EquipmentSlotGroup - `exclusive_set`: enchantment id | #enchantment tag | list of enchantment ids (optional) - `primary_items`: item id | #item tag | list of item ids (optional). Item types for which this Enchantment shows up in Enchanting Tables and on traded equipment. Must be a subset of `supported_items`. - `effects`: EnchantmentEffectComponentMap (optional) ## EnchantmentCost ``` EnchantmentCost(base: int, per_level_above_first: int) ``` - `base`: int. Base cost at level 1. - `per_level_above_first`: int. Cost increase per level above 1. ## EnchantmentEffectComponentMap ``` EnchantmentEffectComponentMap() ``` ## EndSpike ``` EndSpike(centerX: int, centerZ: int, radius: int, height: int, guarded?: bool) ``` - `centerX`: int - `centerZ`: int - `radius`: int - `height`: int - `guarded`: bool (optional) ## EntityEffectsPredicate ``` EntityEffectsPredicate() ``` ## EntitySubPredicateMap ``` EntitySubPredicateMap() ``` ## EnvironmentAttributeMap ``` EnvironmentAttributeMap() ``` ## EnvironmentAttributeTrackMap ``` EnvironmentAttributeTrackMap() ``` ## Equipment ``` Equipment(layers: Layers, trim_overrides?: [TrimOverride]) ``` - `layers`: Layers. List of layers for each model layer type. - `trim_overrides`: list of TrimOverride (optional). Replaces trim texture based on armor trim. Only the first entry that matches is applied. ## ExclusionZone ``` ExclusionZone(other_set: StructureSetRef, chunk_count: int) ``` - `other_set`: StructureSetRef - `chunk_count`: int 1..16 ## Explosion ``` Explosion(shape: FireworkShape, colors?: [int], fade_colors?: [int], has_trail?: bool, has_twinkle?: bool) ``` - `shape`: FireworkShape. The shape of the explosion. - `colors`: list of int (optional). Colors of the initial particles of the explosion, randomly selected from. Calculated as `RED << 16 | GREEN << 8 | BLUE`. Each of these fields must be between 0 and 255, inclusive. - `fade_colors`: list of int (optional). Colors of the fading particles of the explosion - `has_trail`: bool (optional). Added to a firework star via Diamond. - `has_twinkle`: bool (optional). Added to a firework star via Glowstone Dust. ## ExplosionData ``` ExplosionData(fuse: int, power: int, causes_fire: bool) ``` - `fuse`: int 1... The fuse time in ticks when ignited. When ignited by an explosion, the fuse will be a random value between `explosion_fuse / 8` and `3 * explosion_fuse / 8`. - `power`: int 0... The explosion power. - `causes_fire`: bool. Whether the explosion causes fire. ## FilterPattern ``` FilterPattern(namespace?: string, path?: string) ``` - `namespace`: string (optional) - `path`: string (optional) ## FlatGeneratorLayer ``` FlatGeneratorLayer(height: int, block: block id) ``` - `height`: int 0..4096 - `block`: block id ## FlatGeneratorPreset ``` FlatGeneratorPreset(display: item id, settings: FlatGeneratorSettings) ``` - `display`: item id - `settings`: FlatGeneratorSettings ## FlatGeneratorSettings ``` FlatGeneratorSettings(layers: [FlatGeneratorLayer], biome?: biome id, lakes?: bool, features?: bool, structure_overrides?: [structure_set id] | structure_set id) ``` - `layers`: list of FlatGeneratorLayer - `biome`: biome id (optional) - `lakes`: bool (optional) - `features`: bool (optional) - `structure_overrides`: structure_set id | #structure_set tag | list of structure_set ids (optional) ## FlatWeightedEntry ``` FlatWeightedEntry(weight: int, type: entity_type id, count: IntProvider) ``` - `weight`: int 0.. - `type`: entity_type id - `count`: IntProvider of int ## FluidPredicate ``` FluidPredicate(fluids?: fluid id | [fluid id], state?: object) ``` - `fluids`: fluid id | #fluid tag | list of fluid ids (optional) - `state`: map of string to MinMaxBounds of int | bool | string (optional) ## Font ``` Font(providers: [GlyphProvider]) ``` - `providers`: list of GlyphProvider ## FrogVariant ``` FrogVariant(asset_id: texture id, spawn_conditions: [SpawnPrioritySelector]) ``` - `asset_id`: texture id. The frog texture to use for this variant. - `spawn_conditions`: list of SpawnPrioritySelector. The spawn conditions for this variant. Selection process: - Conditions for all variants for the given entity type are evaluated for the spawn position - Entries with a priority lower than the maximum priority of the remaining entries are removed - A random entry is picked out of the remaining ones - If no conditions are remaining, the variant remains unchanged from the default ## FullBlockState ``` FullBlockState(id: block id, properties?: mcdoc:block_states[[id]]) ``` - `id`: block id - `properties`: any (depends on id) (optional) ## GeodeBlockSettings ``` GeodeBlockSettings(filling_provider: BlockStateProviderRef, inner_layer_provider: BlockStateProviderRef, alternate_inner_layer_provider: BlockStateProviderRef, middle_layer_provider: BlockStateProviderRef, outer_layer_provider: BlockStateProviderRef, inner_placements: [BlockState], cannot_replace: block id | [block id], invalid_blocks: block id | [block id]) ``` - `filling_provider`: BlockStateProviderRef - `inner_layer_provider`: BlockStateProviderRef - `alternate_inner_layer_provider`: BlockStateProviderRef - `middle_layer_provider`: BlockStateProviderRef - `outer_layer_provider`: BlockStateProviderRef - `inner_placements`: list of BlockState (at least 1) - `cannot_replace`: block id | #block tag | list of block ids. Blocks that will not be replaced by the geode. - `invalid_blocks`: block id | #block tag | list of block ids. When encountering an invalid block, feature placement is cancelled. ## GeodeCrackSettings ``` GeodeCrackSettings(generate_crack_chance?: float, base_crack_size?: float, crack_point_offset?: int) ``` - `generate_crack_chance`: number 0..1 (optional) - `base_crack_size`: number 0..5 (optional) - `crack_point_offset`: int 0..10 (optional) ## GeodeLayerSettings ``` GeodeLayerSettings(filling?: float, inner_layer?: float, middle_layer?: float, outer_layer?: float) ``` - `filling`: number 0.01..50 (optional) - `inner_layer`: number 0.01..50 (optional) - `middle_layer`: number 0.01..50 (optional) - `outer_layer`: number 0.01..50 (optional) ## Instrument ``` Instrument(sound_event: SoundEventRef, range: float, use_duration: float, description: Text, durability_damage?: int) ``` - `sound_event`: SoundEventRef - `range`: number 0..<. Maximum range in blocks that the sound can be heard - `use_duration`: number 0... Duration of use in seconds, used as item cooldown - `description`: Text - `durability_damage`: int 0.. (optional) ## InternalTarget ``` InternalTarget(width?: int, height?: int, persistent?: bool, clear_color?: RGBA) ``` - `width`: int (optional) - `height`: int (optional) - `persistent`: bool (optional). If `true`, target will be persistent across frames. Defaults to `false`. The contents of the target will be cleared when the screen is resized. - `clear_color`: RGBA (optional). Target will be filled with this color when created or cleared. Defaults to `0`. ## ItemDefinition ``` ItemDefinition(model: ItemModel, hand_animation_on_swap?: bool, oversized_in_gui?: bool, swap_animation_scale?: float) ``` - `model`: ItemModel - `hand_animation_on_swap`: bool (optional). Whether the down-and-up animation should be played in first-person view when the item stack is changed. Defaults to `true`. - `oversized_in_gui`: bool (optional). Whether the item model is allowed to be bigger than its item slot. Defaults to `false`, which clips the item model in GUI to the item slot size. The behavior of `true` is **not** officially supported. - `swap_animation_scale`: number (optional). How fast the item moves up and down when swapping items in hotbar. Defaults to 1.0 ## ItemStackOfComponent ``` ItemStackOfComponent(id: item id, components?: DataComponentPatch, count?: int) ``` - `id`: item id. ID of the item. - `components`: DataComponentPatch (optional) - `count`: int 1..99 (optional). Number of items in the stack. Defaults to `1`. ## ItemUesdOnLocationConditions ``` ItemUesdOnLocationConditions(player?: AdvancementEntityPredicate, location?: AdvancementLocationPredicate) ``` - `player`: AdvancementEntityPredicate (optional). Predicate context: Advancement Entity. - `location`: AdvancementLocationPredicate (optional). Predicate context: Advancement Location. ## JukeboxSong ``` JukeboxSong(description: Text, comparator_output: int, length_in_seconds: float, sound_event: SoundEventRef) ``` - `description`: Text. Displayed in the HUD actionbar & item tooltip. - `comparator_output`: int 0..15 - `length_in_seconds`: number 0..< - `sound_event`: SoundEventRef ## KnockbackModifiers ``` KnockbackModifiers(horizontal_power: float, vertical_power: float) ``` - `horizontal_power`: number. The horizontal power of the knockback. - `vertical_power`: number. The vertical power of the knockback. ## Lang ``` Lang() ``` ## Layer ``` Layer(texture: texture id, dyeable?: Dyeable) ``` - `texture`: texture id. Texture location for this layer, inside `entity/equipment//`. - `dyeable`: Dyeable (optional). If specified, this layer will be tinted by the color contained in the `dyed_color` component. ## Layers ``` Layers(humanoid?: [Layer], humanoid_leggings?: [Layer], humanoid_baby?: [Layer], wings?: [WingsLayer], wolf_body?: [Layer], horse_body?: [Layer], llama_body?: [Layer], happy_ghast_body?: [Layer], nautilus_saddle?: [Layer], nautilus_body?: [Layer], pig_saddle?: [Layer], strider_saddle?: [Layer], camel_husk_saddle?: [Layer], camel_saddle?: [Layer], horse_saddle?: [Layer], donkey_saddle?: [Layer], mule_saddle?: [Layer], zombie_horse_saddle?: [Layer], skeleton_horse_saddle?: [Layer]) ``` - `humanoid`: list of Layer of texture id (optional) - `humanoid_leggings`: list of Layer of texture id (optional) - `humanoid_baby`: list of Layer of texture id (optional) - `wings`: list of WingsLayer of texture id (optional) - `wolf_body`: list of Layer of texture id (optional) - `horse_body`: list of Layer of texture id (optional) - `llama_body`: list of Layer of texture id (optional) - `happy_ghast_body`: list of Layer of texture id (optional) - `nautilus_saddle`: list of Layer of texture id (optional) - `nautilus_body`: list of Layer of texture id (optional) - `pig_saddle`: list of Layer of texture id (optional) - `strider_saddle`: list of Layer of texture id (optional) - `camel_husk_saddle`: list of Layer of texture id (optional) - `camel_saddle`: list of Layer of texture id (optional) - `horse_saddle`: list of Layer of texture id (optional) - `donkey_saddle`: list of Layer of texture id (optional) - `mule_saddle`: list of Layer of texture id (optional) - `zombie_horse_saddle`: list of Layer of texture id (optional) - `skeleton_horse_saddle`: list of Layer of texture id (optional) ## Light ``` Light(light?: MinMaxBounds) ``` - `light`: MinMaxBounds of int 0..15 (optional) ## LocationPredicate ``` LocationPredicate(position?: object, biomes?: biome id | [biome id], structures?: structure id | [structure id], dimension?: dimension id, light?: object, block?: BlockPredicate, fluid?: FluidPredicate, smokey?: bool, can_see_sky?: bool) ``` - `position`: { x?: MinMaxBounds of number, y?: MinMaxBounds of number, z?: MinMaxBounds of number } (optional) - `biomes`: biome id | #biome tag | list of biome ids (optional) - `structures`: structure id | #structure tag | list of structure ids (optional) - `dimension`: dimension id (optional) - `light`: Light(…) (optional). Calculated using: `max(sky-darkening, block)`. - `block`: BlockPredicate (optional) - `fluid`: FluidPredicate (optional) - `smokey`: bool (optional). Whether the block is above (5 blocks or less) a campfire or soul campfire. - `can_see_sky`: bool (optional). Whether the location has the maximum possible level of sky light ## LootTable ``` LootTable(type?: LootContextParamSets, pools?: [LootPool], modifier?: ItemModifier, random_sequence?: random_sequence id) ``` - `type`: LootContextParamSets (optional) - `pools`: list of LootPool (optional) - `modifier`: ItemModifier (optional) - `random_sequence`: random_sequence id (optional) ## MangroveRootPlacement ``` MangroveRootPlacement(max_root_width: int, max_root_length: int, random_skew_chance: float, can_grow_through: [block id] | block id, muddy_roots_in: [block id] | block id, muddy_roots_provider: BlockStateProviderRef) ``` - `max_root_width`: int 1..12 - `max_root_length`: int 1..64 - `random_skew_chance`: number 0..1 - `can_grow_through`: block id | #block tag | list of block ids - `muddy_roots_in`: block id | #block tag | list of block ids - `muddy_roots_provider`: BlockStateProviderRef ## MobEffectPredicate ``` MobEffectPredicate(amplifier?: MinMaxBounds, duration?: MinMaxBounds, ambient?: bool, visible?: bool) ``` - `amplifier`: MinMaxBounds of int (optional) - `duration`: MinMaxBounds of int (optional) - `ambient`: bool (optional) - `visible`: bool (optional) ## Model ``` Model(parent?: model id, ambientocclusion?: bool, gui_light?: "front" | "side", textures?: object, elements?: [ModelElement], display?: object) ``` - `parent`: model id (optional) - `ambientocclusion`: bool (optional) - `gui_light`: "front" | "side" (optional) - `textures`: map of string to texture id | TextureMaterial (optional) - `elements`: list of ModelElement (optional) - `display`: map of CustomizableItemDisplayContext to { rotation?: list of number (exactly 3), translation?: list of number -80..80 (exactly 3), scale?: list of number -4..4 (exactly 3) } (optional) ## ModelElement ``` ModelElement(from: [float], to: [float], faces: object, rotation?: ModelElementRotation, shade_direction_override?: Direction, light_emission?: int) ``` - `from`: list of number -16..32 (exactly 3) - `to`: list of number -16..32 (exactly 3) - `faces`: map of Direction to object - `rotation`: ModelElementRotation (optional) - `shade_direction_override`: Direction (optional) - `light_emission`: int 0..15 (optional) ## ModelVariantBase ``` ModelVariantBase(model: ModelRef, x?: (0 | 90 | 180 | 270), y?: (0 | 90 | 180 | 270), z?: (0 | 90 | 180 | 270), uvlock?: bool) ``` - `model`: ModelRef - `x`: 0 | 90 | 180 | 270 (optional) - `y`: 0 | 90 | 180 | 270 (optional) - `z`: 0 | 90 | 180 | 270 (optional) - `uvlock`: bool (optional). If set to `true`, the textures are not rotated with the block. ## MultiNoiseBiomeSourceParameterList ``` MultiNoiseBiomeSourceParameterList(preset: MultiNoisePreset) ``` - `preset`: MultiNoisePreset ## Multipart ``` Multipart(multipart: [object]) ``` - `multipart`: list of { when?: MultiPartCondition, apply: ModelVariant } ## NoiseGeneratorSettings ``` NoiseGeneratorSettings(default_block: BlockState, default_fluid: BlockState, sea_level: int, disable_mob_generation: bool, legacy_random_source: bool, noise: NoiseSettings, noise_router: NoiseRouter, spawn_target: [SpawnTargetPoint], material_rule: MaterialRuleRef, aquifers?: Aquifer, debug_functions?: [DebugFunctionEntry]) ``` - `default_block`: BlockState - `default_fluid`: BlockState - `sea_level`: int - `disable_mob_generation`: bool. If true, mobs will not spawn during generation. - `legacy_random_source`: bool - `noise`: NoiseSettings - `noise_router`: NoiseRouter - `spawn_target`: list of SpawnTargetPoint - `material_rule`: MaterialRuleRef - `aquifers`: Aquifer (optional) - `debug_functions`: list of DebugFunctionEntry (optional) ## NoiseParameters ``` NoiseParameters(base_octave: int, base_amplitude?: float, octave_count?: int, normalize?: bool | "legacy", amplitude_modifiers?: [float]) ``` - `base_octave`: int -32..32 - `base_amplitude`: number 0..1e+06 (optional). Defaults to 1.0. - `octave_count`: int 1..32 (optional). Defaults to 1. - `normalize`: bool | "legacy" (optional). Defaults to `true`. - `amplitude_modifiers`: list of number 0..1e+06 (at most 32) (optional). When empty or not present, defaults to all 1.0. Otherwise, the size must match `octave_count`. ## NoiseRouter ``` NoiseRouter(temperature: DensityFunctionRef, vegetation: DensityFunctionRef, continents: DensityFunctionRef, erosion: DensityFunctionRef, depth: DensityFunctionRef, ridges: DensityFunctionRef, chunk_surface_level: DensityFunctionRef, final_density: DensityFunctionRef) ``` - `temperature`: DensityFunctionRef - `vegetation`: DensityFunctionRef - `continents`: DensityFunctionRef - `erosion`: DensityFunctionRef - `depth`: DensityFunctionRef - `ridges`: DensityFunctionRef - `chunk_surface_level`: DensityFunctionRef - `final_density`: DensityFunctionRef ## NoiseSettings ``` NoiseSettings(min_y: int, height: int) ``` - `min_y`: int -2048..2047. Minimum height where blocks start generating. - `height`: int 0..4096. The total height where blocks can generate. Max Y = Min Y + Height. ## OR ``` OR(OR: [MultiPartCondition]) ``` - `OR`: list of MultiPartCondition ## Option ``` Option(id: string, display?: Text, initial?: bool) ``` - `id`: string. String to send on submit. - `display`: Text (optional). Label displayed on the button. When not present, `id` will be used instead. - `initial`: bool (optional). Whether this option is the initial value. Only one option can have this field set to `true`. ## PaintingVariant ``` PaintingVariant(asset_id: texture id, width: int, height: int, title?: Text, author?: Text) ``` - `asset_id`: texture id - `width`: int 1..16. Dimension in blocks. - `height`: int 1..16. Dimension in blocks. - `title`: Text (optional) - `author`: Text (optional) ## Particle ``` Particle(textures: [texture id]) ``` - `textures`: list of texture ids ## Pause ``` Pause(pause?: bool) ``` - `pause`: bool (optional). Whether the dialog should pause the game in single-player mode. Defaults to `true`. ## PigVariant ``` PigVariant(asset_id: texture id, baby_asset_id: texture id, spawn_conditions: [SpawnPrioritySelector], model?: PigModelType) ``` - `asset_id`: texture id. The pig texture to use for this variant. - `baby_asset_id`: texture id. The baby pig texture to use for this variant. - `spawn_conditions`: list of SpawnPrioritySelector. The spawn conditions for this variant. Selection process: - Conditions for all variants for the given entity type are evaluated for the spawn position - Entries with a priority lower than the maximum priority of the remaining entries are removed - A random entry is picked out of the remaining ones - If no conditions are remaining, the variant remains unchanged from the default - `model`: PigModelType (optional) ## PlacedFeature ``` PlacedFeature(feature: ConfiguredFeatureRef, placement: [PlacementModifier]) ``` - `feature`: ConfiguredFeatureRef - `placement`: list of PlacementModifier ## PlainMessage ``` PlainMessage(contents: Text, width?: int) ``` - `contents`: Text. A multiline label. Click events in the text trigger `after_action` like any other action. - `width`: int 1..1024 (optional). Maximum width of message. Defaults to 200. ## Player ``` Player(player?: AdvancementEntityPredicate) ``` - `player`: AdvancementEntityPredicate (optional). Predicate context: Advancement Entity. ## PlayerConditions ``` PlayerConditions(player?: AdvancementEntityPredicate) ``` - `player`: AdvancementEntityPredicate (optional). Predicate context: Advancement Entity. ## Pool ``` Pool(rolls: IntNumberProviderRef, entries: [LootPoolEntry]) ``` - `rolls`: IntNumberProviderRef - `entries`: list of LootPoolEntry ## PostEffect ``` PostEffect(targets?: Targets, passes?: [Pass]) ``` - `targets`: Targets (optional) - `passes`: list of Pass (optional) ## PotionIngredient ``` PotionIngredient(item: Ingredient, potion_contents?: PotionsPredicate) ``` - `item`: Ingredient - `potion_contents`: PotionsPredicate (optional) ## PotionsPredicate ``` PotionsPredicate(potions?: PotionTypeMatch, effects?: CollectionPredicate) ``` - `potions`: PotionTypeMatch (optional) - `effects`: CollectionPredicate of EntityEffectsPredicate (optional) ## Preset ``` Preset(preset: MultiNoisePreset) ``` - `preset`: MultiNoisePreset ## ProcessorRule ``` ProcessorRule(location_predicate: RuleTest, input_predicate: RuleTest, output_state: BlockState, position_predicate?: PosRuleTest, block_entity_modifier?: BlockEntityModifier) ``` - `location_predicate`: RuleTest - `input_predicate`: RuleTest - `output_state`: BlockState - `position_predicate`: PosRuleTest (optional) - `block_entity_modifier`: BlockEntityModifier (optional) ## Processors ``` Processors(processors: [Processor]) ``` - `processors`: list of Processor ## ProfileProperty ``` ProfileProperty(name: string, value: string, signature?: string) ``` - `name`: string (0 to 64). Usually `textures`. - `value`: string (0 to 32767). Base64 encoded JSON value of the texture index. - `signature`: string (0 to 1024) (optional). Verifies the hash of the resulting texture. ## ProfilePropertyMap ``` ProfilePropertyMap() ``` ## Providers ``` Providers(providers: [GlyphProvider]) ``` - `providers`: list of GlyphProvider ## RelativeToSeaLevel ``` RelativeToSeaLevel(relative_to_sea_level: int) ``` - `relative_to_sea_level`: int ## RuinedPortalSetup ``` RuinedPortalSetup(placement: RuinedPortalPlacement, air_pocket_probability: float, mossiness: float, overgrown: bool, vines: bool, can_be_cold: bool, replace_with_blackstone: bool, weight: float) ``` - `placement`: RuinedPortalPlacement - `air_pocket_probability`: number 0..1 - `mossiness`: number 0..1 - `overgrown`: bool - `vines`: bool - `can_be_cold`: bool - `replace_with_blackstone`: bool - `weight`: number 0.. ## SoundSettings ``` SoundSettings(hit_sound: SoundEventRef, push_sound: SoundEventRef, push_sound_impulse_threshold: float, push_sound_cooldown: float) ``` - `hit_sound`: SoundEventRef - `push_sound`: SoundEventRef - `push_sound_impulse_threshold`: number. Minimum impact speed required to trigger the sound. - `push_sound_cooldown`: number. Cooldown in seconds for the sound effect. ## SoundVariant ``` SoundVariant(adult_sounds: CatSounds, baby_sounds: CatSounds) ``` - `adult_sounds`: CatSounds - `baby_sounds`: CatSounds ## Sources ``` Sources(sources: [SpriteSource]) ``` - `sources`: list of SpriteSource. List of sprite sources which can add or remove sprite textures to this atlas. ## SpawnOverride ``` SpawnOverride(bounding_box: BoundingBox, spawns: FlatWeightedList) ``` - `bounding_box`: BoundingBox - `spawns`: FlatWeightedList of SpawnerData ## SpawnPrioritySelector ``` SpawnPrioritySelector(priority: int, condition?: SpawnCondition) ``` - `priority`: int. The spawn priority to use. - `condition`: SpawnCondition (optional). The spawn condition to check. If not present, the condition always matches. ## SpawnTargetPoint ``` SpawnTargetPoint() ``` ## SplinePoint ``` SplinePoint(location: float, derivative: float, value: CubicSpline) ``` - `location`: number - `derivative`: number - `value`: CubicSpline ## StewEffect ``` StewEffect(type: mob_effect id, duration: IntNumberProviderRef) ``` - `type`: mob_effect id. The status effect of this stew effect. - `duration`: IntNumberProviderRef. The duration of this stew effect, in seconds. ## StructureSet ``` StructureSet(structures: [StructureSetElement], placement: StructurePlacement) ``` - `structures`: list of StructureSetElement - `placement`: StructurePlacement ## StructureSetElement ``` StructureSetElement(structure: structure id, weight: int) ``` - `structure`: structure id - `weight`: int 1.. ## SulfurCubeArchetype ``` SulfurCubeArchetype(items: item id | [item id], knockback_modifiers: KnockbackModifiers, attribute_modifiers: [AttributeEntry], sound_settings: SoundSettings, buoyant?: bool, explosion?: ExplosionData, contact_damage?: ContactDamage) ``` - `items`: item id | #item tag | list of item ids - `knockback_modifiers`: KnockbackModifiers - `attribute_modifiers`: list of AttributeEntry - `sound_settings`: SoundSettings - `buoyant`: bool (optional). Defaults to `false`. - `explosion`: ExplosionData (optional). When present, sulfur cube with this archetype will explode when ignited. - `contact_damage`: ContactDamage (optional) ## TargetBlock ``` TargetBlock(target: RuleTest, state: BlockState) ``` - `target`: RuleTest - `state`: BlockState ## TargetInput ``` TargetInput(target: shader_target id, sampler_name: string, use_depth_buffer?: bool, bilinear?: bool) ``` - `target`: shader_target id - `sampler_name`: string - `use_depth_buffer`: bool (optional) - `bilinear`: bool (optional) ## Targets ``` Targets() ``` ## TemplatePool ``` TemplatePool(fallback: template_pool id, elements: [WeightedElement], name?: string) ``` - `fallback`: template_pool id - `elements`: list of WeightedElement - `name`: string (optional) ## TextStyle ``` TextStyle(color?: string | TextColor, shadow_color?: RGBA, font?: font id, bold?: bool, italic?: bool, underlined?: bool, strikethrough?: bool, obfuscated?: bool, insertion?: string, click_event?: ClickEvent, hover_event?: HoverEvent) ``` - `color`: string | TextColor (optional) - `shadow_color`: RGBA (optional). Overrides the shadow properties of the text. If specified as 0, the shadow will never be displayed. - `font`: font id (optional) - `bold`: bool (optional) - `italic`: bool (optional) - `underlined`: bool (optional) - `strikethrough`: bool (optional) - `obfuscated`: bool (optional) - `insertion`: string (optional) - `click_event`: ClickEvent (optional) - `hover_event`: HoverEvent (optional) ## TextureInput ``` TextureInput(location: texture id, sampler_name: string, width: int, height: int, bilinear?: bool) ``` - `location`: texture id - `sampler_name`: string - `width`: int 1.. - `height`: int 1.. - `bilinear`: bool (optional) ## TextureMaterial ``` TextureMaterial(sprite: texture id, force_translucent?: bool) ``` - `sprite`: texture id - `force_translucent`: bool (optional). Whether the texture should be forced into the translucent render pass. Textures without any translucent pixels are not assigned to the translucent pass by default. Defaults to `false`. ## Textures ``` Textures(textures: [texture id]) ``` - `textures`: list of texture ids ## TimeMarker ``` TimeMarker(ticks: int, show_in_commands?: bool) ``` - `ticks`: int 0.. - `show_in_commands`: bool (optional). Whether the time marker shows up in command suggestions. The time marker is still available in commands even if it is not suggested. Defaults to `false`. ## TimeMarkerMap ``` TimeMarkerMap() ``` ## Timeline ``` Timeline(clock: world_clock id, period_ticks?: int, time_markers?: TimeMarkerMap, tracks?: EnvironmentAttributeTrackMap) ``` - `clock`: world_clock id. The world clock this timeline is tied to. - `period_ticks`: int 1.. (optional). When not present, the timeline will not repeat. - `time_markers`: TimeMarkerMap (optional) - `tracks`: EnvironmentAttributeTrackMap (optional) ## TradeCost ``` TradeCost(id: item id, components?: DataComponentExactPredicate, count?: IntNumberProvider) ``` - `id`: item id. ID of the item. - `components`: DataComponentExactPredicate (optional) - `count`: IntNumberProvider (optional). Defaults to `1`. ## TradeSet ``` TradeSet(trades: villager_trade id | [villager_trade id], amount: IntNumberProvider, allow_duplicates?: bool, random_sequence?: random_sequence id) ``` - `trades`: villager_trade id | #villager_trade tag | list of villager_trade ids. Possible trade generators. - `amount`: IntNumberProvider. Amount of trades to be generated. - `allow_duplicates`: bool (optional). Whether the trade set can use the same generator multiple times and generate duplicate trades. Defaults to `false`. - `random_sequence`: random_sequence id (optional) ## TransmuteResult ``` TransmuteResult(id?: item id, count?: int, components?: DataComponentPatch) ``` - `id`: item id (optional). Defaults to the input item. - `count`: int 1..99 (optional). Defaults to `1`. - `components`: DataComponentPatch (optional) ## TrialSpawnerConfig ``` TrialSpawnerConfig(spawn_range?: int, total_mobs?: float, total_mobs_added_per_player?: float, simultaneous_mobs?: float, simultaneous_mobs_added_per_player?: float, ticks_between_spawn?: int, spawn_potentials?: [SpawnPotential], loot_tables_to_eject?: WeightedList, items_to_drop_when_ominous?: loot_table id) ``` - `spawn_range`: int 1..128 (optional). Maximum distance from the spawner that en entity can spawn - `total_mobs`: number (optional). Total amount of entities that are spawned during one activation, when 1 player is nearby - `total_mobs_added_per_player`: number (optional). Number added to `total_mobs` for each additional player - `simultaneous_mobs`: number (optional). Number of entities that that can be present at once, when 1 player is nearby - `simultaneous_mobs_added_per_player`: number (optional). Number added to `simultaneous_mobs` for each additional player - `ticks_between_spawn`: int (optional). Ticks until the next spawn. - `spawn_potentials`: list of SpawnPotential (optional). Entities that can be placed. - `loot_tables_to_eject`: WeightedList of loot_table id (optional). Loot tables to use when ejecting loot. Chooses one loot table based on weight and then uses it as often as there are players nearby. - `items_to_drop_when_ominous`: loot_table id (optional). Loot table to use when summoning ominous item spawners. One roll seeded based on rough location to determine all items used during the battle. ## TrimMaterial ``` TrimMaterial(palette_id: PaletteRef, description: Text) ``` - `palette_id`: PaletteRef. Palette ID which will be used in the resource pack. - `description`: Text. Text displayed in the item tooltip. ## TrimOverride ``` TrimOverride(when: object, texture?: string, palette?: PaletteRef) ``` - `when`: { pattern?: trim_pattern id, material?: trim_material id } - `texture`: id (optional). When present, overrides the base texture provided by trim pattern. The texture is located under `trims/entity//`. - `palette`: PaletteRef (optional). When present, overrides the palette texture provided by trim material. ## TrimPattern ``` TrimPattern(asset_id: string, description: Text, decal?: bool) ``` - `asset_id`: id. ID of the pattern that will be used in the resource pack as an overlay on the armor. The texture is located under `trims/entity//`. - `description`: Text. Text displayed in the item tooltip. - `decal`: bool (optional). Whether the pattern texture will be masked based on the underlying armor. Defaults to `false`. ## UniformBlocks ``` UniformBlocks() ``` ## UniformIntProvider ``` UniformIntProvider(min_inclusive: int, max_inclusive: int) ``` - `min_inclusive`: int -16..0 - `max_inclusive`: int -16..0 ## UniformValue ``` UniformValue(type: UniformValueType, value: value, name?: string) ``` - `type`: UniformValueType - `value`: any (depends on type) - `name`: string (optional). Unused by the game, but good to set in practice. ## UnihexOverrideRange ``` UnihexOverrideRange(from: string, to: string, left: int, right: int) ``` - `from`: string. Minimum in codepoint range (inclusive). - `to`: string. Maximum in codepoint range (inclusive). - `left`: int 0..255. Position of left-most column of the glyph. - `right`: int 0..255. Position of right-most column of the glyph. ## UnstitchRegion ``` UnstitchRegion(sprite: texture id, x: float, y: float, width: float, height: float) ``` - `sprite`: texture id - `x`: number - `y`: number - `width`: number - `height`: number ## Variants ``` Variants(variants: object) ``` - `variants`: map of string to ModelVariant ## VillagerTrade ``` VillagerTrade(wants: TradeCost, gives: ItemStackTemplate, additional_wants?: TradeCost, given_item_modifier?: ItemModifierWithoutRootRef, max_uses?: IntNumberProvider, reputation_discount?: FloatNumberProvider, xp?: IntNumberProvider, merchant_predicate?: Predicate, double_trade_price_enchantments?: enchantment id | [enchantment id]) ``` - `wants`: TradeCost. Price item required by the merchant. The count is affected by various factors, including offered item, demand and player reputation. - `gives`: ItemStackTemplate. Item being offered by the merchant. - `additional_wants`: TradeCost (optional). Second item required by the merchant. The count is not affected by any factors. - `given_item_modifier`: ItemModifierWithoutRootRef (optional). Modifiers applied to the `gives` item. Does **not** support `reference` item modifier. Some modifiers can affect the price through the `additional_trade_cost` transient component. The `additional_trade_cost` component is not saved on the offered item. ID reference is not allowed here. - `max_uses`: IntNumberProvider (optional). Maximum number of uses of this trade before the villager has to restock. Defaults to `4`. - `reputation_discount`: FloatNumberProvider (optional). How much demand & reputation each affect the price, is serialized as `priceMultiplier`. Defaults to `0.0`. - `xp`: IntNumberProvider (optional). Amount to increase the merchant's XP score by that determines their trade tier. Defaults to `1`. - `merchant_predicate`: Predicate (optional). Check whether the trade should be offered by the merchant. Does **not** support the `reference` predicate. - `double_trade_price_enchantments`: enchantment id | #enchantment tag | list of enchantment ids (optional). If the offered enchanted book has the specified enchantments, the price will be affected by doubling the `additional_trade_cost` transient component. ## WaypointStyle ``` WaypointStyle(sprites: [texture id], near_distance?: int, far_distance?: int) ``` - `sprites`: list of texture ids (at least 1) - `near_distance`: int 0..6e+07 (optional). Defaults to 128. - `far_distance`: int 0..6e+07 (optional). Defaults to 322. ## WeightedElement ``` WeightedElement(weight: int, element: Element) ``` - `weight`: int 1..150 - `element`: Element ## WeightedEntry ``` WeightedEntry(weight: int, data: FloatRef) ``` - `weight`: int 0.. - `data`: FloatRef ## WingsLayer ``` WingsLayer(texture: texture id, dyeable?: Dyeable, use_player_texture?: bool) ``` - `texture`: texture id. Texture location for this layer, inside `entity/equipment//`. - `dyeable`: Dyeable (optional). If specified, this layer will be tinted by the color contained in the `dyed_color` component. - `use_player_texture`: bool (optional). Whether this layer texture should be overridden by the player's custom elytra texture. Defaults to `false`. ## WolfVariant ``` WolfVariant(assets: WolfVariantAssetInfo, baby_assets: WolfVariantAssetInfo, spawn_conditions: [SpawnPrioritySelector]) ``` - `assets`: WolfVariantAssetInfo. The texture set to use for this wolf variant. - `baby_assets`: WolfVariantAssetInfo. The baby texture set to use for this wolf variant. - `spawn_conditions`: list of SpawnPrioritySelector. The spawn conditions for this variant. Selection process: - Conditions for all variants for the given entity type are evaluated for the spawn position - Entries with a priority lower than the maximum priority of the remaining entries are removed - A random entry is picked out of the remaining ones - If no conditions are remaining, the variant remains unchanged from the default ## WolfVariantAssetInfo ``` WolfVariantAssetInfo(wild: texture id, tame: texture id, angry: texture id) ``` - `wild`: texture id - `tame`: texture id - `angry`: texture id ## WorldPreset ``` WorldPreset(dimensions: object) ``` - `dimensions`: map of dimension id to Dimension ## ZombieNautilusVariant ``` ZombieNautilusVariant(asset_id: texture id, spawn_conditions: [SpawnPrioritySelector], model?: ZombieNautilusModelType) ``` - `asset_id`: texture id. The zombie nautilus texture to use for this variant. - `spawn_conditions`: list of SpawnPrioritySelector. The spawn conditions for this variant. Selection process: - Conditions for all variants for the given entity type are evaluated for the spawn position - Entries with a priority lower than the maximum priority of the remaining entries are removed - A random entry is picked out of the remaining ones - If no conditions are remaining, the variant remains unchanged from the default - `model`: ZombieNautilusModelType (optional) # Biome source Helpers that build a `minecraft:biome_source` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Checkerboard ``` Checkerboard(biomes: [biome id] | biome id, scale?: int) ``` Makes `minecraft:checkerboard`. Biomes in a checkerboard of square tiles, repeating the list in order. - `biomes`: biome id | #biome tag | list of biome ids. The biomes, in order. - `scale`: int 0..62 (optional). Tile size: each tile is 2^(scale + 2) blocks across. From 0 to 62; defaults to 2. ## Fixed ``` Fixed(biome: biome id) ``` Makes `minecraft:fixed`. The same biome everywhere. - `biome`: biome id. The biome. ## MultiNoise ``` MultiNoise(preset?: multi_noise_biome_source_parameter_list id, biomes?: [object]) ``` Makes `minecraft:multi_noise`. Picks biomes by climate noise, as the overworld and nether do. `preset` uses vanilla's tables; otherwise list biomes with their climate parameters. - `preset`: multi_noise_biome_source_parameter_list id (optional) - `biomes`: list of { biome: biome id, parameters: ClimateParameters } (optional). Only when `preset` is left out. ## TheEnd ``` TheEnd() ``` Makes `minecraft:the_end`. The End's biomes: the central island, highlands, midlands, small islands and barrens. # Block predicate Helpers that build a `minecraft:block_predicate` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## AllOf ``` AllOf(predicates: [BlockPredicate]) ``` Makes `minecraft:all_of`. Passes when every predicate passes. - `predicates`: list of BlockPredicate ## AnyOf ``` AnyOf(predicates: [BlockPredicate]) ``` Makes `minecraft:any_of`. Passes when any predicate passes. - `predicates`: list of BlockPredicate ## HasSturdyFace ``` HasSturdyFace(direction: Direction, offset?: [int]) ``` Makes `minecraft:has_sturdy_face`. Passes when the block has a full face on one side. - `direction`: Direction. The side to check. - `offset`: list of int -16..16 (exactly 3) (optional). The block offset to check. ## HeightRange ``` HeightRange(min_inclusive: VerticalAnchor, max_inclusive: VerticalAnchor) ``` Makes `minecraft:height_range`. - `min_inclusive`: VerticalAnchor - `max_inclusive`: VerticalAnchor ## InsideWorldBounds ``` InsideWorldBounds(offset?: [int]) ``` Makes `minecraft:inside_world_bounds`. Passes when the block is inside the world's height limits. - `offset`: list of int -16..16 (exactly 3) (optional). The block offset to check. ## MatchingBiomes ``` MatchingBiomes(biomes: biome id | [biome id]) ``` Makes `minecraft:matching_biomes`. Passes when the block's biome is one of these. - `biomes`: biome id | #biome tag | list of biome ids ## MatchingBlockTag ``` MatchingBlockTag(tag: block id, offset?: [int]) ``` Makes `minecraft:matching_block_tag`. Passes when the block is in a block tag. - `tag`: block id | #block tag - `offset`: list of int -16..16 (exactly 3) (optional). The block offset to check. ## MatchingBlocks ``` MatchingBlocks(blocks: [block id] | block id, offset?: [int]) ``` Makes `minecraft:matching_blocks`. Passes when the block is one of these. - `blocks`: block id | #block tag | list of block ids. The blocks that pass. - `offset`: list of int -16..16 (exactly 3) (optional). The block offset to check. ## MatchingFluids ``` MatchingFluids(fluids: [fluid id] | fluid id, offset?: [int]) ``` Makes `minecraft:matching_fluids`. Passes when the fluid at the block is one of these. - `fluids`: fluid id | #fluid tag | list of fluid ids - `offset`: list of int -16..16 (exactly 3) (optional). The block offset to check. ## Not ``` Not(predicate: BlockPredicate) ``` Makes `minecraft:not`. Passes when `predicate` fails. - `predicate`: BlockPredicate ## Replaceable ``` Replaceable() ``` Makes `minecraft:replaceable`. Passes when the block can be replaced, as air, water and grass can. ## Solid ``` Solid() ``` Makes `minecraft:solid`. Passes when the block is solid. ## True ``` True() ``` Makes `minecraft:true`. Always passes. ## Unobstructed ``` Unobstructed(offset?: [int]) ``` Makes `minecraft:unobstructed`. Passes when no entity is in the way of the block. - `offset`: list of int (exactly 3) (optional) ## VolumeMatch ``` VolumeMatch(min: [int], max: [int], match: BlockPredicate) ``` Makes `minecraft:volume_match`. - `min`: list of int -16..16 (exactly 3) - `max`: list of int -16..16 (exactly 3) - `match`: BlockPredicate ## WouldSurvive ``` WouldSurvive(state: BlockState, offset?: [int]) ``` Makes `minecraft:would_survive`. Passes when a block would stay put here, as a sapling needs dirt below. - `state`: BlockState. The block to test. - `offset`: list of int -16..16 (exactly 3) (optional). The block offset to check. # Block state provider Helpers that build a `minecraft:block_state_provider` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## CopyProperties ``` CopyProperties(source: BlockStateProviderRef) ``` Makes `minecraft:copy_properties`. - `source`: BlockStateProviderRef ## DualNoise ``` DualNoise(seed: int, noise: NoiseParameters, scale: float, variety: InclusiveRange, slow_noise: NoiseParameters, slow_scale: float, states: [BlockState]) ``` Makes `minecraft:dual_noise`. Like `Noise`, with a second, slower noise that picks how many of `states` can appear in each area. - `seed`: int - `noise`: NoiseParameters - `scale`: number 0.. - `variety`: InclusiveRange of int 1..64 - `slow_noise`: NoiseParameters - `slow_scale`: number 0.. - `states`: list of BlockState ## Noise ``` Noise(seed: int, noise: NoiseParameters, scale: float, states: [BlockState]) ``` Makes `minecraft:noise`. Picks from `states` by a noise, so the same block appears in patches. - `seed`: int. Seeds the noise. - `noise`: NoiseParameters - `scale`: number 0... Scales x and z before sampling; smaller values give larger patches. - `states`: list of BlockState. The blocks to pick from. ## NoiseThreshold ``` NoiseThreshold(seed: int, noise: NoiseParameters, scale: float, threshold: float, high_chance: float, default_state: BlockState, low_states: [BlockState], high_states: [BlockState]) ``` Makes `minecraft:noise_threshold`. Uses `default_state` where a noise is below `threshold`, and one of `low_states` or `high_states` above it. Vanilla flower forests use it. - `seed`: int - `noise`: NoiseParameters - `scale`: number 0.. - `threshold`: number -1..1 - `high_chance`: number 0..1 - `default_state`: BlockState - `low_states`: list of BlockState - `high_states`: list of BlockState ## RandomBlock ``` RandomBlock(blocks: block id | [block id]) ``` Makes `minecraft:random_block`. Picks one of these blocks at random, each equally likely. - `blocks`: block id | #block tag | list of block ids ## RandomizedInt ``` RandomizedInt(property: string, values: IntProvider, source: BlockStateProviderRef) ``` Makes `minecraft:randomized_int`. Another provider's block, with an integer property set at random, such as a flower's `flower_amount`. - `property`: string. The property to set. - `values`: IntProvider of int. The values to pick from. - `source`: BlockStateProviderRef. The provider that picks the block. ## Rotated ``` Rotated(state: BlockStateProviderRef, direction?: Direction) ``` Makes `minecraft:rotated`. A block with an `axis` property, turned to match the direction it is placed in, as logs are. - `state`: BlockStateProviderRef - `direction`: Direction (optional) ## RuleBased ``` RuleBased(rules: [object], fallback?: BlockStateProviderRef) ``` Makes `minecraft:rule_based`. Uses the first rule whose block predicate passes at the position, or `fallback` when none does. - `rules`: list of { if_true: BlockPredicate, then: BlockStateProviderRef } - `fallback`: BlockStateProviderRef (optional) ## Simple ``` Simple(state: BlockState) ``` Makes `minecraft:simple`. Always the same block. - `state`: BlockState. The block, with optional state such as `oak_log[axis = y]`. ## Weighted ``` Weighted(entries: NonEmptyWeightedList) ``` Makes `minecraft:weighted`. Picks a block at random, by weight. - `entries`: NonEmptyWeightedList of BlockState # Carver config Helpers that build a `minecraft:carver_config` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Canyon ``` Canyon(probability: float, y: HeightProvider, vertical_rotation: FloatProvider, shape: CanyonShape) ``` Makes `minecraft:canyon`. - `probability`: number 0..1 - `y`: HeightProvider - `vertical_rotation`: FloatProvider of number - `shape`: CanyonShape ## Cave ``` Cave(probability: float, y: HeightProvider, count: IntProvider, thickness: FloatProvider, room_vertical_radius_multiplier: FloatProvider, horizontal_radius_multiplier: FloatProvider, vertical_radius_multiplier: FloatProvider, floor_level: FloatProvider, weird_thickness_bias?: bool, start_vertical_radius_multiplier?: FloatProvider) ``` Makes `minecraft:cave`. - `probability`: number 0..1 - `y`: HeightProvider - `count`: IntProvider of int 0.. - `thickness`: FloatProvider of number 0.. - `room_vertical_radius_multiplier`: FloatProvider of number - `horizontal_radius_multiplier`: FloatProvider of number - `vertical_radius_multiplier`: FloatProvider of number - `floor_level`: FloatProvider of number -1..1 - `weird_thickness_bias`: bool (optional). Defaults to `false`. - `start_vertical_radius_multiplier`: FloatProvider of number (optional). Defaults to constant 1.0 # Chunk generator Helpers that build a `minecraft:chunk_generator` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Debug ``` Debug() ``` Makes `minecraft:debug`. The debug world: every block state in a grid. ## Flat ``` Flat(settings: FlatGeneratorSettings) ``` Makes `minecraft:flat`. A superflat world: layers of blocks and one biome. - `settings`: FlatGeneratorSettings ## Noise ``` Noise(settings: NoiseGeneratorSettingsRef, biome_source: BiomeSource) ``` Makes `minecraft:noise`. Generates terrain from noise settings and density functions, and biomes from a biome source. Vanilla dimensions use it. - `settings`: NoiseGeneratorSettingsRef. The noise settings: a `NoiseSettings` declaration or a vanilla one such as `minecraft:overworld`. - `biome_source`: BiomeSource. Where biomes come from. # Click event Helpers that build a `minecraft:click_event` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## ChangePage ``` ChangePage(page: int) ``` Makes `minecraft:change_page`. - `page`: int 1... The page number to go to. ## CopyToClipboard ``` CopyToClipboard(value: string) ``` Makes `minecraft:copy_to_clipboard`. - `value`: string. The text value to copy to the clipboard. ## Custom ``` Custom(id: string, payload?: mcdoc:custom_event[[id]]) ``` Makes `minecraft:custom`. - `id`: id. ID of a custom action. Has no functionality on vanilla servers. - `payload`: any (depends on id) (optional) ## OpenUrl ``` OpenUrl(url: string) ``` Makes `minecraft:open_url`. - `url`: string ## RunCommand ``` RunCommand(command: string) ``` Makes `minecraft:run_command`. - `command`: string ## ShowDialog ``` ShowDialog(dialog: dialog id | Dialog) ``` Makes `minecraft:show_dialog`. - `dialog`: dialog id | Dialog ## SuggestCommand ``` SuggestCommand(command: string) ``` Makes `minecraft:suggest_command`. - `command`: string # Context float provider Helpers that build a `minecraft:context_float_provider` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Abs ``` Abs(input: FloatRef) ``` Makes `minecraft:abs`. - `input`: FloatRef ## Add ``` Add(inputs: AggregateOperands) ``` Makes `minecraft:add`. - `inputs`: AggregateOperands ## Avg ``` Avg(inputs: AggregateOperands) ``` Makes `minecraft:avg`. - `inputs`: AggregateOperands ## Ceil ``` Ceil(input: FloatRef) ``` Makes `minecraft:ceil`. - `input`: FloatRef ## Conditional ``` Conditional(condition: PredicateRef, on_true: FloatRef, on_false?: FloatRef) ``` Makes `minecraft:conditional`. - `condition`: PredicateRef - `on_true`: FloatRef - `on_false`: FloatRef (optional). Defaults to constant 0. ## Constant ``` Constant(value: float) ``` Makes `minecraft:constant`. - `value`: number ## Cos ``` Cos(input: FloatRef) ``` Makes `minecraft:cos`. - `input`: FloatRef ## Div ``` Div(left: FloatRef, right: FloatRef) ``` Makes `minecraft:div`. - `left`: FloatRef - `right`: FloatRef ## EnchantmentLevel ``` EnchantmentLevel(amount: LevelBasedValue) ``` Makes `minecraft:enchantment_level`. - `amount`: LevelBasedValue ## EnvironmentAttribute ``` EnvironmentAttribute(attribute: NumericalEnvironmentAttribute) ``` Makes `minecraft:environment_attribute`. - `attribute`: NumericalEnvironmentAttribute ## Floor ``` Floor(input: FloatRef) ``` Makes `minecraft:floor`. - `input`: FloatRef ## FromInt ``` FromInt(input: IntRef) ``` Makes `minecraft:from_int`. - `input`: IntRef ## Length ``` Length(inputs: AggregateOperands) ``` Makes `minecraft:length`. - `inputs`: AggregateOperands ## Max ``` Max(inputs: AggregateOperands) ``` Makes `minecraft:max`. - `inputs`: AggregateOperands ## Min ``` Min(inputs: AggregateOperands) ``` Makes `minecraft:min`. - `inputs`: AggregateOperands ## Mod ``` Mod(left: FloatRef, right: FloatRef) ``` Makes `minecraft:mod`. - `left`: FloatRef - `right`: FloatRef ## Mul ``` Mul(inputs: AggregateOperands) ``` Makes `minecraft:mul`. - `inputs`: AggregateOperands ## Negate ``` Negate(input: FloatRef) ``` Makes `minecraft:negate`. - `input`: FloatRef ## NumberDispatcher ``` NumberDispatcher(cases: [object], default?: FloatRef) ``` Makes `minecraft:number_dispatcher`. - `cases`: list of { condition: PredicateRef, value: FloatRef }. Each condition is tested in order, the first in the list that passes is used. - `default`: FloatRef (optional). Defaults to constant 0. ## Pow ``` Pow(base: FloatRef, exponent: FloatRef) ``` Makes `minecraft:pow`. - `base`: FloatRef - `exponent`: FloatRef ## Round ``` Round(input: FloatRef) ``` Makes `minecraft:round`. - `input`: FloatRef ## Sin ``` Sin(input: FloatRef) ``` Makes `minecraft:sin`. - `input`: FloatRef ## Sqrt ``` Sqrt(input: FloatRef) ``` Makes `minecraft:sqrt`. - `input`: FloatRef ## Storage ``` Storage(storage: storage id, path: string, fallback?: FloatRef) ``` Makes `minecraft:storage`. - `storage`: storage id - `path`: string - `fallback`: FloatRef (optional). Defaults to constant 0. ## Sub ``` Sub(left: FloatRef, right: FloatRef) ``` Makes `minecraft:sub`. - `left`: FloatRef - `right`: FloatRef ## Truncate ``` Truncate(input: FloatRef) ``` Makes `minecraft:truncate`. - `input`: FloatRef ## Uniform ``` Uniform(min: FloatRef, max: FloatRef) ``` Makes `minecraft:uniform`. - `min`: FloatRef - `max`: FloatRef ## WeightedList ``` WeightedList(distribution: NonEmptyWeightedList) ``` Makes `minecraft:weighted_list`. - `distribution`: NonEmptyWeightedList of FloatRef # Context int provider Helpers that build a `minecraft:context_int_provider` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Abs ``` Abs(input: IntRef) ``` Makes `minecraft:abs`. - `input`: IntRef ## Add ``` Add(inputs: AggregateOperands) ``` Makes `minecraft:add`. - `inputs`: AggregateOperands ## Avg ``` Avg(inputs: AggregateOperands) ``` Makes `minecraft:avg`. - `inputs`: AggregateOperands ## Binomial ``` Binomial(n: IntRef, p: FloatRef) ``` Makes `minecraft:binomial`. - `n`: IntRef. Number of coin flips. - `p`: FloatRef. Probability of a single coin flip succeeding. ## Conditional ``` Conditional(condition: PredicateRef, on_true: IntRef, on_false?: IntRef) ``` Makes `minecraft:conditional`. - `condition`: PredicateRef - `on_true`: IntRef - `on_false`: IntRef (optional). Defaults to constant 0. ## Constant ``` Constant(value: int) ``` Makes `minecraft:constant`. - `value`: int ## Div ``` Div(left: IntRef, right: IntRef) ``` Makes `minecraft:div`. - `left`: IntRef - `right`: IntRef ## EnvironmentAttribute ``` EnvironmentAttribute(attribute: IntegerEnvironmentAttribute) ``` Makes `minecraft:environment_attribute`. - `attribute`: IntegerEnvironmentAttribute ## FloorDiv ``` FloorDiv(left: IntRef, right: IntRef) ``` Makes `minecraft:floor_div`. - `left`: IntRef - `right`: IntRef ## FloorMod ``` FloorMod(left: IntRef, right: IntRef) ``` Makes `minecraft:floor_mod`. - `left`: IntRef - `right`: IntRef ## FromFloat ``` FromFloat(input: FloatRef) ``` Makes `minecraft:from_float`. - `input`: FloatRef ## Max ``` Max(inputs: AggregateOperands) ``` Makes `minecraft:max`. - `inputs`: AggregateOperands ## Min ``` Min(inputs: AggregateOperands) ``` Makes `minecraft:min`. - `inputs`: AggregateOperands ## Mod ``` Mod(left: IntRef, right: IntRef) ``` Makes `minecraft:mod`. - `left`: IntRef - `right`: IntRef ## Mul ``` Mul(inputs: AggregateOperands) ``` Makes `minecraft:mul`. - `inputs`: AggregateOperands ## Negate ``` Negate(input: IntRef) ``` Makes `minecraft:negate`. - `input`: IntRef ## NumberDispatcher ``` NumberDispatcher(cases: [object], default?: IntRef) ``` Makes `minecraft:number_dispatcher`. - `cases`: list of { condition: PredicateRef, value: IntRef }. Each condition is tested in order, the first in the list that passes is used. - `default`: IntRef (optional). Defaults to constant 0. ## Pow ``` Pow(base: IntRef, exponent: IntRef) ``` Makes `minecraft:pow`. - `base`: IntRef - `exponent`: IntRef ## Score ``` Score(target: ScoreProvider, score: string, fallback?: IntRef) ``` Makes `minecraft:score`. - `target`: ScoreProvider - `score`: string - `fallback`: IntRef (optional). Defaults to constant 0. ## Storage ``` Storage(storage: storage id, path: string, fallback?: IntRef) ``` Makes `minecraft:storage`. - `storage`: storage id - `path`: string - `fallback`: IntRef (optional). Defaults to constant 0. ## Sub ``` Sub(left: IntRef, right: IntRef) ``` Makes `minecraft:sub`. - `left`: IntRef - `right`: IntRef ## Uniform ``` Uniform(min: IntRef, max: IntRef) ``` Makes `minecraft:uniform`. - `min`: IntRef - `max`: IntRef ## WeightedList ``` WeightedList(distribution: NonEmptyWeightedList) ``` Makes `minecraft:weighted_list`. - `distribution`: NonEmptyWeightedList of IntRef # Density function Helpers that build a `minecraft:density_function` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Abs ``` Abs(input: DensityFunctionRef) ``` Makes `minecraft:abs`. The absolute value of `input`. Turns a noise into sharp ridges along its zero line. - `input`: DensityFunctionRef ## Add ``` Add(left: DensityFunctionRef, right: DensityFunctionRef) ``` Makes `minecraft:add`. `left + right`. Usually written with `+`. - `left`: DensityFunctionRef - `right`: DensityFunctionRef ```mms DensityFunction raised = Noise(minecraft:ridge, 1, 0) + 0.2 ``` ## Beardifier ``` Beardifier() ``` Makes `minecraft:beardifier`. Adds density around structures that adapt the terrain, such as villages and ancient cities. Vanilla adds it to `final_density`. ## BlendAlpha ``` BlendAlpha() ``` Makes `minecraft:blend_alpha`. Blending with chunks from before 1.18: 1 in new chunks, lower near old ones. ## BlendDensity ``` BlendDensity(input: DensityFunctionRef) ``` Makes `minecraft:blend_density`. Blends `input` with the terrain of chunks from before 1.18. In new chunks it is `input` unchanged. - `input`: DensityFunctionRef ## BlendOffset ``` BlendOffset() ``` Makes `minecraft:blend_offset`. Blending with chunks from before 1.18: 0 in new chunks. ## Cache ``` Cache(input: DensityFunctionRef) ``` Makes `minecraft:cache`. Computes `input` once per position, for a function used in several places. The value is unchanged. - `input`: DensityFunctionRef ## Ceil ``` Ceil(input: DensityFunctionRef, multiple?: DensityFunctionRef) ``` Makes `minecraft:ceil`. Rounds `input` up to a whole multiple of `multiple`. - `input`: DensityFunctionRef - `multiple`: DensityFunctionRef (optional). Defaults to constant 1. ## Clamp ``` Clamp(input: DensityFunctionRef, min: NoiseRange, max: NoiseRange) ``` Makes `minecraft:clamp`. Keeps `input` between `min` and `max`. - `input`: DensityFunctionRef - `min`: NoiseRange. The lowest value let through. - `max`: NoiseRange. The highest value let through. ```mms DensityFunction capped = Clamp(Noise(minecraft:ridge, 1, 1), -0.5, 0.5) ``` ## Constant ``` Constant(value: NoiseRange) ``` Makes `minecraft:constant`. The same number everywhere. A plain number does the same thing. - `value`: NoiseRange. The number. ```mms DensityFunction half = Constant(0.5) ``` ## Cube ``` Cube(input: DensityFunctionRef) ``` Makes `minecraft:cube`. `input * input * input`. Keeps the sign and flattens values near 0. - `input`: DensityFunctionRef ## DistanceToPoint ``` DistanceToPoint(point: [int], metric: DistanceMetric) ``` Makes `minecraft:distance_to_point`. - `point`: list of int (exactly 3) - `metric`: DistanceMetric ## Div ``` Div(left: DensityFunctionRef, right: DensityFunctionRef) ``` Makes `minecraft:div`. `left / right`. Usually written with `/`. - `left`: DensityFunctionRef - `right`: DensityFunctionRef ## EndOuterIslands ``` EndOuterIslands() ``` Makes `minecraft:end_outer_islands`. The End's island terrain: the main island in the middle, and scattered islands beyond 1024 blocks. ## FindTopSurface ``` FindTopSurface(density: DensityFunctionRef, upper_bound: DensityFunctionRef, lower_bound: int, cell_height: int) ``` Makes `minecraft:find_top_surface`. - `density`: DensityFunctionRef - `upper_bound`: DensityFunctionRef - `lower_bound`: int -4064..4062 - `cell_height`: int 1.. ## Floor ``` Floor(input: DensityFunctionRef, multiple?: DensityFunctionRef) ``` Makes `minecraft:floor`. Rounds `input` down to a whole multiple of `multiple`. Rounding a gradient makes terraces. - `input`: DensityFunctionRef - `multiple`: DensityFunctionRef (optional). Defaults to constant 1. ## Gradient ``` Gradient(axis: Axis, from_coordinate: value, to_coordinate: value, from_value: NoiseRange, to_value: NoiseRange, tiling?: TilingMode) ``` Makes `minecraft:gradient`. Changes linearly along one axis: `from_value` at `from_coordinate`, `to_value` at `to_coordinate`. Beyond the two coordinates it holds the end values, unless `tiling` says otherwise. Use it to make terrain solid at the bottom and air at the top. - `axis`: Axis. The axis the gradient runs along: `x`, `y` or `z`. - `from_coordinate`: any (depends on axis). Where the gradient starts, in blocks. - `to_coordinate`: any (depends on axis). Where the gradient ends, in blocks. - `from_value`: NoiseRange. The value at `from_coordinate`. - `to_value`: NoiseRange. The value at `to_coordinate`. - `tiling`: TilingMode (optional). What happens beyond the two coordinates: `clamp_to_edge` holds the end values, `repeat` starts over, `mirrored_repeat` runs back and forth. Defaults to `clamp_to_edge`. ```mms DensityFunction ground = Gradient( axis = y, from_coordinate = 0, to_coordinate = 128, from_value = 1, to_value = -1, ) ``` ## HalfNegative ``` HalfNegative(input: DensityFunctionRef) ``` Makes `minecraft:half_negative`. `input`, with negative values halved. Vanilla uses it to soften cave walls. - `input`: DensityFunctionRef ## Interpolated ``` Interpolated(input: DensityFunctionRef, cell_size_xz: int, cell_size_y: int) ``` Makes `minecraft:interpolated`. Computes `input` only at the corners of cells and blends between them. Smoother and much faster than sampling every block; vanilla wraps its terrain in it. - `input`: DensityFunctionRef. The function to interpolate. - `cell_size_xz`: int 1... Cell width, in blocks. - `cell_size_y`: int 1... Cell height, in blocks. ## IntervalSelect ``` IntervalSelect(input: DensityFunctionRef, thresholds: [NoiseRange], functions: [DensityFunctionRef]) ``` Makes `minecraft:interval_select`. Picks one of `functions` by which interval of `thresholds` the value of `input` falls in: below the first threshold picks the first function, and so on. - `input`: DensityFunctionRef - `thresholds`: list of NoiseRange (at least 1). Must have exactly one fewer element than `functions`. - `functions`: list of DensityFunctionRef (at least 2). Must have exactly one more element than `thresholds`. ## Lerp ``` Lerp(alpha: DensityFunctionRef, first: DensityFunctionRef, second: DensityFunctionRef) ``` Makes `minecraft:lerp`. Blends from `first` to `second` by `alpha`: `first` where `alpha` is 0, `second` where it is 1. - `alpha`: DensityFunctionRef. How far to blend, usually from 0 to 1. - `first`: DensityFunctionRef. The value where `alpha` is 0. - `second`: DensityFunctionRef. The value where `alpha` is 1. ## Log ``` Log(input: DensityFunctionRef) ``` Makes `minecraft:log`. The natural logarithm of `input`. - `input`: DensityFunctionRef ## Max ``` Max(left: DensityFunctionRef, right: DensityFunctionRef) ``` Makes `minecraft:max`. The larger of the two inputs. `Max(a, b)` joins two terrains. - `left`: DensityFunctionRef - `right`: DensityFunctionRef ```mms DensityFunction both = Max(Noise(minecraft:ridge, 1, 0), Noise(minecraft:jagged, 1, 0)) ``` ## Min ``` Min(left: DensityFunctionRef, right: DensityFunctionRef) ``` Makes `minecraft:min`. The smaller of the two inputs. `Min(a, b)` keeps the lower of two terrains. - `left`: DensityFunctionRef - `right`: DensityFunctionRef ## Mul ``` Mul(left: DensityFunctionRef, right: DensityFunctionRef) ``` Makes `minecraft:mul`. `left * right`. Usually written with `*`. Vanilla stops computing `right` where `left` is 0. - `left`: DensityFunctionRef - `right`: DensityFunctionRef ## Negate ``` Negate(input: DensityFunctionRef) ``` Makes `minecraft:negate`. `-input`. Usually written with a leading `-`. - `input`: DensityFunctionRef ## Noise ``` Noise(noise: NoiseParametersRef, xz_scale: float, y_scale: float, shift_x?: DensityFunctionRef, shift_y?: DensityFunctionRef, shift_z?: DensityFunctionRef) ``` Makes `minecraft:noise`. Samples a noise at the block's position, scaled per axis. The result is roughly between -1 and 1. Most terrain starts here. - `noise`: NoiseParametersRef. The noise, by id: a `Noise` declaration or a vanilla one such as `minecraft:ridge`. - `xz_scale`: number. Multiplies x and z before sampling. Below 1 stretches the noise out horizontally; above 1 squeezes it. - `y_scale`: number. Multiplies y before sampling. `0` makes the noise the same at every height (2D). - `shift_x`: DensityFunctionRef (optional). Added to x before sampling, so the noise doesn't line up with others. Vanilla uses `ShiftA`. Defaults to constant 0. - `shift_y`: DensityFunctionRef (optional). Added to y before sampling. Defaults to constant 0. - `shift_z`: DensityFunctionRef (optional). Added to z before sampling. Vanilla uses `ShiftB`. Defaults to constant 0. ```mms Noise hills { base_octave = -7, amplitude_modifiers = [1, 1] } DensityFunction land = Noise(hills, 1, 0) * 0.5 ``` ## OldBlendedNoise ``` OldBlendedNoise(xz_scale: float, y_scale: float, xz_factor: float, y_factor: float, smear_scale_multiplier: float) ``` Makes `minecraft:old_blended_noise`. The 3D terrain noise from before 1.18, which vanilla still uses as the base of overworld and nether terrain. - `xz_scale`: number - `y_scale`: number - `xz_factor`: number - `y_factor`: number - `smear_scale_multiplier`: number 1..8 ## Pow ``` Pow(base: DensityFunctionRef, exponent: DensityFunctionRef) ``` Makes `minecraft:pow`. `base` raised to the power `exponent`. - `base`: DensityFunctionRef - `exponent`: DensityFunctionRef ## QuarterNegative ``` QuarterNegative(input: DensityFunctionRef) ``` Makes `minecraft:quarter_negative`. `input`, with negative values divided by four. - `input`: DensityFunctionRef ## RangeChoice ``` RangeChoice(input: DensityFunctionRef, min_inclusive: NoiseRange, max_exclusive: NoiseRange, when_in_range: DensityFunctionRef, when_out_of_range: DensityFunctionRef) ``` Makes `minecraft:range_choice`. Picks between two functions by the value of `input`: `when_in_range` where `min_inclusive <= input < max_exclusive`, `when_out_of_range` elsewhere. Only the chosen one is computed. - `input`: DensityFunctionRef. The value to test. - `min_inclusive`: NoiseRange. The lowest value that counts as in range. - `max_exclusive`: NoiseRange. The value above the range; it counts as out of range. - `when_in_range`: DensityFunctionRef. Used where `input` is in range. - `when_out_of_range`: DensityFunctionRef. Used everywhere else. ## Reciprocal ``` Reciprocal(input: DensityFunctionRef) ``` Makes `minecraft:reciprocal`. `1 / input`. - `input`: DensityFunctionRef ## Round ``` Round(input: DensityFunctionRef, multiple?: DensityFunctionRef) ``` Makes `minecraft:round`. Rounds `input` to the nearest whole multiple of `multiple`. - `input`: DensityFunctionRef - `multiple`: DensityFunctionRef (optional). Defaults to constant 1. ## Shift ``` Shift(noise: NoiseParametersRef) ``` Makes `minecraft:shift`. Samples `noise` at a quarter of the block's x, y and z and multiplies it by 4. Used as a shift for another noise. - `noise`: NoiseParametersRef ## ShiftA ``` ShiftA(noise: NoiseParametersRef) ``` Makes `minecraft:shift_a`. Samples `noise` at a quarter of the block's x and z (y is 0) and multiplies it by 4. Vanilla uses it as `shift_x` of its climate noises. - `noise`: NoiseParametersRef ## ShiftB ``` ShiftB(noise: NoiseParametersRef) ``` Makes `minecraft:shift_b`. Like `ShiftA`, with x and z swapped. Vanilla uses it as `shift_z` of its climate noises. - `noise`: NoiseParametersRef ## Sign ``` Sign(input: DensityFunctionRef) ``` Makes `minecraft:sign`. `-1`, `0` or `1`, following the sign of `input`. - `input`: DensityFunctionRef ## Slice ``` Slice(axis: Axis, coordinate: int, input: DensityFunctionRef) ``` Makes `minecraft:slice`. - `axis`: Axis - `coordinate`: int - `input`: DensityFunctionRef ## Slide ``` Slide(input: DensityFunctionRef) ``` Makes `minecraft:slide`. - `input`: DensityFunctionRef ## Spline ``` Spline(spline: CubicSpline) ``` Makes `minecraft:spline`. Maps a value through a cubic spline: a curve through points, each with a `location`, a `value` and a `derivative`. Vanilla shapes continents, erosion and peaks into terrain height with splines. - `spline`: CubicSpline ## Sqrt ``` Sqrt(input: DensityFunctionRef) ``` Makes `minecraft:sqrt`. The square root of `input`. - `input`: DensityFunctionRef ## Square ``` Square(input: DensityFunctionRef) ``` Makes `minecraft:square`. `input * input`. Always 0 or more, and flattens values near 0. - `input`: DensityFunctionRef ## Squeeze ``` Squeeze(input: DensityFunctionRef) ``` Makes `minecraft:squeeze`. Clamps `input` to -1..1, then bends it to `x / 2 - x³ / 24`. Vanilla applies it near the end of `final_density` to smooth sharp values. - `input`: DensityFunctionRef ## Sub ``` Sub(left: DensityFunctionRef, right: DensityFunctionRef) ``` Makes `minecraft:sub`. `left - right`. Usually written with `-`. - `left`: DensityFunctionRef - `right`: DensityFunctionRef ## Truncate ``` Truncate(input: DensityFunctionRef, multiple?: DensityFunctionRef) ``` Makes `minecraft:truncate`. Rounds `input` toward zero, to a whole multiple of `multiple`. - `input`: DensityFunctionRef - `multiple`: DensityFunctionRef (optional). Defaults to constant 1. # Dialog Helpers that build a `minecraft:dialog` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Confirmation ``` Confirmation(title: Text, yes: Button, no: Button, external_title?: Text, body?: DialogBody | [DialogBody], inputs?: [InputControl], can_close_with_escape?: bool, after_action?: AfterAction, pause?: bool) ``` Makes `minecraft:confirmation`. - `title`: Text - `yes`: Button - `no`: Button. This action is also used for ESC-triggered exit. - `external_title`: Text (optional). Name to be used for a button leading to this dialog. If not present, `title` will be used instead. - `body`: DialogBody | list of DialogBody (optional) - `inputs`: list of InputControl (optional) - `can_close_with_escape`: bool (optional). Whether the dialog can be closed with ESC key. Defaults to `true`. - `after_action`: AfterAction (optional). An additional operation performed on dialog after click or submit actions. Defaults to `close`. Value `none` requires `pause` set to `false`. - `pause`: bool (optional). Whether the dialog should pause the game in single-player mode. Defaults to `true`. Only when `after_action` is left out. ## DialogList ``` DialogList(title: Text, dialogs: DialogListRef, external_title?: Text, body?: DialogBody | [DialogBody], inputs?: [InputControl], can_close_with_escape?: bool, after_action?: AfterAction, exit_action?: Button, columns?: int, button_width?: int, pause?: bool) ``` Makes `minecraft:dialog_list`. - `title`: Text - `dialogs`: DialogListRef - `external_title`: Text (optional). Name to be used for a button leading to this dialog. If not present, `title` will be used instead. - `body`: DialogBody | list of DialogBody (optional) - `inputs`: list of InputControl (optional) - `can_close_with_escape`: bool (optional). Whether the dialog can be closed with ESC key. Defaults to `true`. - `after_action`: AfterAction (optional). An additional operation performed on dialog after click or submit actions. Defaults to `close`. Value `none` requires `pause` set to `false`. - `exit_action`: Button (optional). The button in footer. The action is also used for ESC-triggered exit. - `columns`: int 1.. (optional). The number of columns. Defaults to 2. - `button_width`: int 1.. (optional). Width of buttons in the list. Defaults to 150. - `pause`: bool (optional). Whether the dialog should pause the game in single-player mode. Defaults to `true`. Only when `after_action` is left out. ## MultiAction ``` MultiAction(title: Text, actions: [Button], external_title?: Text, body?: DialogBody | [DialogBody], inputs?: [InputControl], can_close_with_escape?: bool, after_action?: AfterAction, exit_action?: Button, columns?: int, pause?: bool) ``` Makes `minecraft:multi_action`. - `title`: Text - `actions`: list of Button (at least 1) - `external_title`: Text (optional). Name to be used for a button leading to this dialog. If not present, `title` will be used instead. - `body`: DialogBody | list of DialogBody (optional) - `inputs`: list of InputControl (optional) - `can_close_with_escape`: bool (optional). Whether the dialog can be closed with ESC key. Defaults to `true`. - `after_action`: AfterAction (optional). An additional operation performed on dialog after click or submit actions. Defaults to `close`. Value `none` requires `pause` set to `false`. - `exit_action`: Button (optional). The button in footer. The action is also used for ESC-triggered exit. - `columns`: int 1.. (optional). The number of columns. Defaults to 2. - `pause`: bool (optional). Whether the dialog should pause the game in single-player mode. Defaults to `true`. Only when `after_action` is left out. ## Notice ``` Notice(title: Text, external_title?: Text, body?: DialogBody | [DialogBody], inputs?: [InputControl], can_close_with_escape?: bool, after_action?: AfterAction, action?: Button, pause?: bool) ``` Makes `minecraft:notice`. - `title`: Text - `external_title`: Text (optional). Name to be used for a button leading to this dialog. If not present, `title` will be used instead. - `body`: DialogBody | list of DialogBody (optional) - `inputs`: list of InputControl (optional) - `can_close_with_escape`: bool (optional). Whether the dialog can be closed with ESC key. Defaults to `true`. - `after_action`: AfterAction (optional). An additional operation performed on dialog after click or submit actions. Defaults to `close`. Value `none` requires `pause` set to `false`. - `action`: Button (optional). The only action in footer. Defaults to `gui.ok` label with no action or tooltip. - `pause`: bool (optional). Whether the dialog should pause the game in single-player mode. Defaults to `true`. Only when `after_action` is left out. ## ServerLinks ``` ServerLinks(title: Text, external_title?: Text, body?: DialogBody | [DialogBody], inputs?: [InputControl], can_close_with_escape?: bool, after_action?: AfterAction, exit_action?: Button, columns?: int, button_width?: int, pause?: bool) ``` Makes `minecraft:server_links`. - `title`: Text - `external_title`: Text (optional). Name to be used for a button leading to this dialog. If not present, `title` will be used instead. - `body`: DialogBody | list of DialogBody (optional) - `inputs`: list of InputControl (optional) - `can_close_with_escape`: bool (optional). Whether the dialog can be closed with ESC key. Defaults to `true`. - `after_action`: AfterAction (optional). An additional operation performed on dialog after click or submit actions. Defaults to `close`. Value `none` requires `pause` set to `false`. - `exit_action`: Button (optional). The button in footer. The action is also used for ESC-triggered exit. - `columns`: int 1.. (optional). The number of columns. Defaults to 2. - `button_width`: int 1.. (optional). Width of buttons in the list. Defaults to 150. - `pause`: bool (optional). Whether the dialog should pause the game in single-player mode. Defaults to `true`. Only when `after_action` is left out. # Dialog action Helpers that build a `minecraft:dialog_action` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## ChangePage ``` ChangePage(page: int) ``` Makes `minecraft:change_page`. - `page`: int 1... The page number to go to. ## CopyToClipboard ``` CopyToClipboard(value: string) ``` Makes `minecraft:copy_to_clipboard`. - `value`: string. The text value to copy to the clipboard. ## Custom ``` Custom(id: string, payload?: mcdoc:custom_event[[id]]) ``` Makes `minecraft:custom`. - `id`: id. ID of a custom action. Has no functionality on vanilla servers. - `payload`: any (depends on id) (optional) ## OpenUrl ``` OpenUrl(url: string) ``` Makes `minecraft:open_url`. - `url`: string ## RunCommand ``` RunCommand(command: string) ``` Makes `minecraft:run_command`. - `command`: string ## ShowDialog ``` ShowDialog(dialog: dialog id | Dialog) ``` Makes `minecraft:show_dialog`. - `dialog`: dialog id | Dialog ## SuggestCommand ``` SuggestCommand(command: string) ``` Makes `minecraft:suggest_command`. - `command`: string # Dialog body Helpers that build a `minecraft:dialog_body` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Item ``` Item(item: ItemStackTemplate, description?: PlainMessage | Text, show_decorations?: bool, show_tooltip?: bool, width?: int, height?: int) ``` Makes `minecraft:item`. - `item`: ItemStackTemplate - `description`: PlainMessage | Text (optional). The description text rendered to the right of item. - `show_decorations`: bool (optional). Whether count and damage bar are rendered over the item. Defaults to `true`. - `show_tooltip`: bool (optional). Whether item tooltip shows up when the item is hovered. Defaults to `true`. - `width`: int 1..256 (optional). Width of the item. Defaults to 16. - `height`: int 1..256 (optional). Height of the item. Defaults to 16. ## PlainMessage ``` PlainMessage(contents: Text, width?: int) ``` Makes `minecraft:plain_message`. - `contents`: Text. A multiline label. Click events in the text trigger `after_action` like any other action. - `width`: int 1..1024 (optional). Maximum width of message. Defaults to 200. # Enchantment provider Helpers that build a `minecraft:enchantment_provider` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## ByCost ``` ByCost(enchantments: EnchantmentsType, cost: IntProvider) ``` Makes `minecraft:by_cost`. - `enchantments`: EnchantmentsType - `cost`: IntProvider of int. Cost to use for the Enchanting process. ## ByCostWithDifficulty ``` ByCostWithDifficulty(enchantments: EnchantmentsType, min_cost: int, max_cost_span: int) ``` Makes `minecraft:by_cost_with_difficulty`. - `enchantments`: EnchantmentsType - `min_cost`: int 0... Positive integer representing the minimum possible cost - `max_cost_span`: int 0... Span of the cost randomization when the special factor is at its maximum. ## Single ``` Single(enchantment: enchantment id, level: IntProvider) ``` Makes `minecraft:single`. - `enchantment`: enchantment id - `level`: IntProvider of int # Feature config Helpers that build a `minecraft:feature_config` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Bamboo ``` Bamboo(probability: float) ``` Makes `minecraft:bamboo`. - `probability`: number 0..1 ## BlockBlob ``` BlockBlob(state: BlockState, can_place_on: BlockPredicate) ``` Makes `minecraft:block_blob`. - `state`: BlockState - `can_place_on`: BlockPredicate ## BlockColumn ``` BlockColumn(direction: Direction, allowed_placement: BlockPredicate, prioritize_tip: bool, layers: [BlockColumnLayer]) ``` Makes `minecraft:block_column`. - `direction`: Direction - `allowed_placement`: BlockPredicate - `prioritize_tip`: bool - `layers`: list of BlockColumnLayer ## BlockPile ``` BlockPile(state_provider: BlockStateProviderRef) ``` Makes `minecraft:block_pile`. - `state_provider`: BlockStateProviderRef ## BlueIce ``` BlueIce() ``` Makes `minecraft:blue_ice`. ## BonusChest ``` BonusChest() ``` Makes `minecraft:bonus_chest`. ## ChorusPlant ``` ChorusPlant() ``` Makes `minecraft:chorus_plant`. ## CoralClaw ``` CoralClaw(feature: PlacedFeatureRef) ``` Makes `minecraft:coral_claw`. - `feature`: PlacedFeatureRef ## CoralTree ``` CoralTree(feature: PlacedFeatureRef) ``` Makes `minecraft:coral_tree`. - `feature`: PlacedFeatureRef ## DeltaFeature ``` DeltaFeature(contents: BlockState, rim: BlockState, size: IntProvider, rim_size: IntProvider) ``` Makes `minecraft:delta_feature`. - `contents`: BlockState - `rim`: BlockState - `size`: IntProvider of int 0..16 - `rim_size`: IntProvider of int 0..16 ## Disk ``` Disk(state_provider: BlockStateProviderRef, radius: IntProvider, half_height: int, target: BlockPredicate) ``` Makes `minecraft:disk`. - `state_provider`: BlockStateProviderRef - `radius`: IntProvider of int 0..8 - `half_height`: int 0..4 - `target`: BlockPredicate ## EmeraldOre ``` EmeraldOre(state: BlockState, target: BlockState) ``` Makes `minecraft:emerald_ore`. - `state`: BlockState - `target`: BlockState ## EndGateway ``` EndGateway(exact: bool, exit?: [int]) ``` Makes `minecraft:end_gateway`. - `exact`: bool - `exit`: list of int (exactly 3) (optional) ## EndIsland ``` EndIsland() ``` Makes `minecraft:end_island`. ## EndPlatform ``` EndPlatform() ``` Makes `minecraft:end_platform`. ## EndPodium ``` EndPodium(active?: bool) ``` Makes `minecraft:end_podium`. - `active`: bool (optional). Defaults to `false`. ## EndSpike ``` EndSpike(spikes: [EndSpike], crystal_invulnerable?: bool, crystal_beam_target?: [int]) ``` Makes `minecraft:end_spike`. - `spikes`: list of EndSpike - `crystal_invulnerable`: bool (optional) - `crystal_beam_target`: list of int (exactly 3) (optional) ## FallenTree ``` FallenTree(trunk_provider: BlockStateProviderRef, log_length: IntProvider, stump_decorators: [TreeDecorator], log_decorators: [TreeDecorator]) ``` Makes `minecraft:fallen_tree`. - `trunk_provider`: BlockStateProviderRef - `log_length`: IntProvider of int 0..16 - `stump_decorators`: list of TreeDecorator - `log_decorators`: list of TreeDecorator ## FillLayer ``` FillLayer(state: BlockState, height: int) ``` Makes `minecraft:fill_layer`. - `state`: BlockState - `height`: int 0..255 ## Flower ``` Flower(feature: FeatureRef, tries?: int, xz_spread?: int, y_spread?: int) ``` Makes `minecraft:flower`. - `feature`: FeatureRef - `tries`: int 1.. (optional). How many attempts will be made to find a placement. Defaults to 128. - `xz_spread`: int 0.. (optional). Defaults to 7. - `y_spread`: int 0.. (optional). Defaults to 3. ## Fossil ``` Fossil(max_empty_corners_allowed: int, fossil_structures: [structure id], overlay_structures: [structure id], fossil_processors: ProcessorListRef, overlay_processors: ProcessorListRef) ``` Makes `minecraft:fossil`. - `max_empty_corners_allowed`: int 0..7. If more corners are exposed to air, feature placement is cancelled. - `fossil_structures`: list of structure ids - `overlay_structures`: list of structure ids - `fossil_processors`: ProcessorListRef - `overlay_processors`: ProcessorListRef ## FreezeTopLayer ``` FreezeTopLayer() ``` Makes `minecraft:freeze_top_layer`. ## Geode ``` Geode(blocks: GeodeBlockSettings, layers: GeodeLayerSettings, crack: GeodeCrackSettings, invalid_blocks_threshold: int, noise_multiplier?: float, use_potential_placements_chance?: float, use_alternate_layer0_chance?: float, placements_require_layer0_alternate?: bool, outer_wall_distance?: IntProvider, distribution_points?: IntProvider, point_offset?: IntProvider, min_gen_offset?: int, max_gen_offset?: int) ``` Makes `minecraft:geode`. - `blocks`: GeodeBlockSettings - `layers`: GeodeLayerSettings - `crack`: GeodeCrackSettings - `invalid_blocks_threshold`: int - `noise_multiplier`: number 0..1 (optional) - `use_potential_placements_chance`: number 0..1 (optional) - `use_alternate_layer0_chance`: number 0..1 (optional) - `placements_require_layer0_alternate`: bool (optional) - `outer_wall_distance`: IntProvider of int 1..20 (optional) - `distribution_points`: IntProvider of int 1..20 (optional) - `point_offset`: IntProvider of int 1..10 (optional) - `min_gen_offset`: int (optional) - `max_gen_offset`: int (optional) ## GlowLichen ``` GlowLichen(block: MultifaceBlock, search_range?: int, chance_of_spreading?: float, can_place_on_floor?: bool, can_place_on_ceiling?: bool, can_place_on_wall?: bool, can_be_placed_on?: [block id] | block id) ``` Makes `minecraft:glow_lichen`. - `block`: MultifaceBlock - `search_range`: int 1..64 (optional) - `chance_of_spreading`: number 0..1 (optional) - `can_place_on_floor`: bool (optional) - `can_place_on_ceiling`: bool (optional) - `can_place_on_wall`: bool (optional) - `can_be_placed_on`: block id | #block tag | list of block ids (optional) ## HugeBrownMushroom ``` HugeBrownMushroom(cap_provider: BlockStateProviderRef, stem_provider: BlockStateProviderRef, can_place_on: BlockPredicate, foliage_radius?: int) ``` Makes `minecraft:huge_brown_mushroom`. - `cap_provider`: BlockStateProviderRef - `stem_provider`: BlockStateProviderRef - `can_place_on`: BlockPredicate - `foliage_radius`: int (optional). Defaults to `2`. ## HugeFungus ``` HugeFungus(hat_state: BlockState, decor_state: BlockState, stem_state: BlockState, valid_base_block: BlockState, replaceable_blocks: BlockPredicate, planted?: bool) ``` Makes `minecraft:huge_fungus`. - `hat_state`: BlockState - `decor_state`: BlockState - `stem_state`: BlockState - `valid_base_block`: BlockState - `replaceable_blocks`: BlockPredicate - `planted`: bool (optional) ## HugeRedMushroom ``` HugeRedMushroom(cap_provider: BlockStateProviderRef, stem_provider: BlockStateProviderRef, can_place_on: BlockPredicate, foliage_radius?: int) ``` Makes `minecraft:huge_red_mushroom`. - `cap_provider`: BlockStateProviderRef - `stem_provider`: BlockStateProviderRef - `can_place_on`: BlockPredicate - `foliage_radius`: int (optional). Defaults to `2`. ## IcePatch ``` IcePatch(state_provider: BlockStateProviderRef, radius: IntProvider, half_height: int, target: BlockPredicate) ``` Makes `minecraft:ice_patch`. - `state_provider`: BlockStateProviderRef - `radius`: IntProvider of int 0..8 - `half_height`: int 0..4 - `target`: BlockPredicate ## Iceberg ``` Iceberg(state: BlockState) ``` Makes `minecraft:iceberg`. - `state`: BlockState ## Lake ``` Lake(fluid: BlockStateProviderRef, barrier: BlockStateProviderRef, can_place_feature: BlockPredicate, can_replace_with_air_or_fluid: BlockPredicate, can_replace_with_barrier: BlockPredicate) ``` Makes `minecraft:lake`. - `fluid`: BlockStateProviderRef - `barrier`: BlockStateProviderRef - `can_place_feature`: BlockPredicate - `can_replace_with_air_or_fluid`: BlockPredicate - `can_replace_with_barrier`: BlockPredicate ## LargeDripstone ``` LargeDripstone(replaceable_blocks: [block id] | block id, column_radius: IntProvider, height_scale: FloatProvider, max_column_radius_to_cave_height_ratio: float, stalactite_bluntness: FloatProvider, stalagmite_bluntness: FloatProvider, wind_speed: FloatProvider, min_radius_for_wind: int, min_bluntness_for_wind: float, floor_to_ceiling_search_range?: int) ``` Makes `minecraft:large_dripstone`. - `replaceable_blocks`: block id | #block tag | list of block ids - `column_radius`: IntProvider of int 0..16 - `height_scale`: FloatProvider of number 0..20 - `max_column_radius_to_cave_height_ratio`: number 0..1 - `stalactite_bluntness`: FloatProvider of number 0.1..10 - `stalagmite_bluntness`: FloatProvider of number 0.1..10 - `wind_speed`: FloatProvider of number 0..2 - `min_radius_for_wind`: int 0..100 - `min_bluntness_for_wind`: number 0..1 - `floor_to_ceiling_search_range`: int 1..512 (optional) ## MonsterRoom ``` MonsterRoom() ``` Makes `minecraft:monster_room`. ## MultifaceGrowth ``` MultifaceGrowth(block: MultifaceBlock, search_range?: int, chance_of_spreading?: float, can_place_on_floor?: bool, can_place_on_ceiling?: bool, can_place_on_wall?: bool, can_be_placed_on?: [block id] | block id) ``` Makes `minecraft:multiface_growth`. - `block`: MultifaceBlock - `search_range`: int 1..64 (optional) - `chance_of_spreading`: number 0..1 (optional) - `can_place_on_floor`: bool (optional) - `can_place_on_ceiling`: bool (optional) - `can_place_on_wall`: bool (optional) - `can_be_placed_on`: block id | #block tag | list of block ids (optional) ## NetherrackReplaceBlobs ``` NetherrackReplaceBlobs(state: BlockState, target: BlockState, radius: IntProvider) ``` Makes `minecraft:netherrack_replace_blobs`. - `state`: BlockState - `target`: BlockState - `radius`: IntProvider of int 0..12 ## NoBonemealFlower ``` NoBonemealFlower(feature: FeatureRef, tries?: int, xz_spread?: int, y_spread?: int) ``` Makes `minecraft:no_bonemeal_flower`. - `feature`: FeatureRef - `tries`: int 1.. (optional). How many attempts will be made to find a placement. Defaults to 128. - `xz_spread`: int 0.. (optional). Defaults to 7. - `y_spread`: int 0.. (optional). Defaults to 3. ## NoOp ``` NoOp() ``` Makes `minecraft:no_op`. ## NoSurfaceOre ``` NoSurfaceOre(targets: [TargetBlock], size: int, discard_chance_on_air_exposure: float) ``` Makes `minecraft:no_surface_ore`. - `targets`: list of TargetBlock - `size`: int 0..64 - `discard_chance_on_air_exposure`: number 0..1. Chance that feature placement will be discarded if the ore is exposed to air blocks. ## Ore ``` Ore(targets: [TargetBlock], size: int, discard_chance_on_air_exposure: float) ``` Makes `minecraft:ore`. - `targets`: list of TargetBlock - `size`: int 0..64 - `discard_chance_on_air_exposure`: number 0..1. Chance that feature placement will be discarded if the ore is exposed to air blocks. ## Overlay ``` Overlay(features: PlacedFeatureListRef) ``` Makes `minecraft:overlay`. - `features`: PlacedFeatureListRef. The features to generate, in order. All features are placed regardless of individual placement success. ## ProjectedRandomPatchySquare ``` ProjectedRandomPatchySquare(block: BlockStateProviderRef, project_through: BlockPredicate, size: IntProvider, max_projection_height: int) ``` Makes `minecraft:projected_random_patchy_square`. - `block`: BlockStateProviderRef - `project_through`: BlockPredicate - `size`: IntProvider of int 1..16 - `max_projection_height`: int 0.. ## RandomBooleanSelector ``` RandomBooleanSelector(feature_false: FeatureRef, feature_true: FeatureRef) ``` Makes `minecraft:random_boolean_selector`. - `feature_false`: FeatureRef - `feature_true`: FeatureRef ## RandomNeighborSpread ``` RandomNeighborSpread(block: BlockStateProviderRef, accepted_neighbors: block id | [block id], can_replace: BlockPredicate, attempts: IntProvider, xz_offset: IntProvider, y_offset: IntProvider) ``` Makes `minecraft:random_neighbor_spread`. - `block`: BlockStateProviderRef - `accepted_neighbors`: block id | #block tag | list of block ids - `can_replace`: BlockPredicate - `attempts`: IntProvider of int 1..3000 - `xz_offset`: IntProvider of int -16..16 - `y_offset`: IntProvider of int -16..16 ## RandomPatch ``` RandomPatch(feature: FeatureRef, tries?: int, xz_spread?: int, y_spread?: int) ``` Makes `minecraft:random_patch`. - `feature`: FeatureRef - `tries`: int 1.. (optional). How many attempts will be made to find a placement. Defaults to 128. - `xz_spread`: int 0.. (optional). Defaults to 7. - `y_spread`: int 0.. (optional). Defaults to 3. ## RandomSelector ``` RandomSelector(features: [object], default: FeatureRef) ``` Makes `minecraft:random_selector`. - `features`: list of { chance: number 0..1, feature: FeatureRef } - `default`: FeatureRef ## ReplaceSingleBlock ``` ReplaceSingleBlock(targets: [TargetBlock]) ``` Makes `minecraft:replace_single_block`. - `targets`: list of TargetBlock ## RootSystem ``` RootSystem(required_vertical_space_for_tree: int, level_test_distance: int, max_level_deviation: int, root_radius: int, root_placement_attempts: int, root_column_max_height: int, hanging_root_radius: int, hanging_roots_vertical_span: int, hanging_root_placement_attempts: int, allowed_vertical_water_for_tree: int, root_replaceable: block id | [block id], root_state_provider: BlockStateProviderRef, hanging_root_state_provider: BlockStateProviderRef, allowed_tree_position: BlockPredicate, feature: FeatureRef) ``` Makes `minecraft:root_system`. - `required_vertical_space_for_tree`: int 1..64 - `level_test_distance`: int 0..16 - `max_level_deviation`: int 0..64 - `root_radius`: int 1..64 - `root_placement_attempts`: int 1..256 - `root_column_max_height`: int 1..4096 - `hanging_root_radius`: int 1..64 - `hanging_roots_vertical_span`: int 1..16 - `hanging_root_placement_attempts`: int 0..256 - `allowed_vertical_water_for_tree`: int 1..64 - `root_replaceable`: block id | #block tag | list of block ids - `root_state_provider`: BlockStateProviderRef - `hanging_root_state_provider`: BlockStateProviderRef - `allowed_tree_position`: BlockPredicate - `feature`: FeatureRef ## ScatteredOre ``` ScatteredOre(targets: [TargetBlock], size: int, discard_chance_on_air_exposure: float) ``` Makes `minecraft:scattered_ore`. - `targets`: list of TargetBlock - `size`: int 0..64 - `discard_chance_on_air_exposure`: number 0..1. Chance that feature placement will be discarded if the ore is exposed to air blocks. ## SculkPatch ``` SculkPatch(charge_count: int, amount_per_charge: int, spread_attempts: int, growth_rounds: int, spread_rounds: int) ``` Makes `minecraft:sculk_patch`. - `charge_count`: int 1..32 - `amount_per_charge`: int 1..500 - `spread_attempts`: int 1..64 - `growth_rounds`: int 0..8 - `spread_rounds`: int 0..8 ## Sequence ``` Sequence(features: PlacedFeatureListRef) ``` Makes `minecraft:sequence`. - `features`: PlacedFeatureListRef. The features to generate, in order. If any feature in the list is not placed, the following features will also be skipped. ## SimpleBlock ``` SimpleBlock(to_place: BlockStateProviderRef, schedule_tick?: bool) ``` Makes `minecraft:simple_block`. - `to_place`: BlockStateProviderRef - `schedule_tick`: bool (optional). Whether to schedule a block update. Defaults to `false`. ## SimpleRandomSelector ``` SimpleRandomSelector(features: PlacedFeatureListRef) ``` Makes `minecraft:simple_random_selector`. - `features`: PlacedFeatureListRef ## SingleBlockPillar ``` SingleBlockPillar(block: BlockStateProviderRef, direction: VerticalDirection, can_replace?: BlockPredicate, chance_to_continue?: float, cap_feature?: PlacedFeatureRef) ``` Makes `minecraft:single_block_pillar`. - `block`: BlockStateProviderRef - `direction`: VerticalDirection - `can_replace`: BlockPredicate (optional). Defaults to "always true". - `chance_to_continue`: number 0..1 (optional). Defaults to 1. - `cap_feature`: PlacedFeatureRef (optional) ## Speleothem ``` Speleothem(base_block: BlockState, pointed_block: BlockState, replaceable_blocks: [block id] | block id, chance_of_taller_generation?: float, chance_of_directional_spread?: float, chance_of_spread_radius2?: float, chance_of_spread_radius3?: float) ``` Makes `minecraft:speleothem`. - `base_block`: BlockState - `pointed_block`: BlockState - `replaceable_blocks`: block id | #block tag | list of block ids - `chance_of_taller_generation`: number 0..1 (optional) - `chance_of_directional_spread`: number 0..1 (optional) - `chance_of_spread_radius2`: number 0..1 (optional) - `chance_of_spread_radius3`: number 0..1 (optional) ## SpeleothemCluster ``` SpeleothemCluster(base_block: BlockState, pointed_block: BlockState, replaceable_blocks: [block id] | block id, floor_to_ceiling_search_range: int, height: IntProvider, radius: IntProvider, max_stalagmite_stalactite_height_diff: int, height_deviation: int, speleothem_block_layer_thickness: IntProvider, density: FloatProvider, wetness: FloatProvider, chance_of_speleothem_at_max_distance_from_center: float, max_distance_from_edge_affecting_chance_of_speleothem: int, max_distance_from_center_affecting_height_bias: int) ``` Makes `minecraft:speleothem_cluster`. - `base_block`: BlockState - `pointed_block`: BlockState - `replaceable_blocks`: block id | #block tag | list of block ids - `floor_to_ceiling_search_range`: int 1..512 - `height`: IntProvider of int 0..128 - `radius`: IntProvider of int 0..128 - `max_stalagmite_stalactite_height_diff`: int 0..64. Max height difference between the stalagmite and stalactite. - `height_deviation`: int 1..64 - `speleothem_block_layer_thickness`: IntProvider of int 0..128 - `density`: FloatProvider of number 0..2 - `wetness`: FloatProvider of number 0..2 - `chance_of_speleothem_at_max_distance_from_center`: number 0..1 - `max_distance_from_edge_affecting_chance_of_speleothem`: int 1..64 - `max_distance_from_center_affecting_height_bias`: int 1..64 ## Spike ``` Spike(state: BlockState, can_place_on: BlockPredicate, can_replace: BlockPredicate) ``` Makes `minecraft:spike`. - `state`: BlockState - `can_place_on`: BlockPredicate - `can_replace`: BlockPredicate ## SpringFeature ``` SpringFeature(state: FluidState, valid_blocks: [block id] | block id, rock_count?: int, hole_count?: int, requires_block_below?: bool) ``` Makes `minecraft:spring_feature`. - `state`: FluidState - `valid_blocks`: block id | #block tag | list of block ids - `rock_count`: int (optional). Defaults to `4`. - `hole_count`: int (optional). Defaults to `1`. - `requires_block_below`: bool (optional). Defaults to `true`. ## SteppedColumnCluster ``` SteppedColumnCluster(block: BlockStateProviderRef, can_replace: BlockPredicate, continue_through: BlockPredicate, cannot_place_on: block id | [block id], column_reach: IntProvider, column_count: IntProvider, height: IntProvider, cluster_reach: IntProvider) ``` Makes `minecraft:stepped_column_cluster`. - `block`: BlockStateProviderRef - `can_replace`: BlockPredicate - `continue_through`: BlockPredicate - `cannot_place_on`: block id | #block tag | list of block ids - `column_reach`: IntProvider of int 0..3 - `column_count`: IntProvider of int 1..150 - `height`: IntProvider of int 1..10 - `cluster_reach`: IntProvider of int 0..13. The effective reach is limited by `height`. ## Template ``` Template(templates: WeightedList, processors?: ProcessorListRef) ``` Makes `minecraft:template`. - `templates`: WeightedList of TemplateEntry - `processors`: ProcessorListRef (optional) ## Tree ``` Tree(minimum_size: FeatureSize, below_trunk_provider: BlockStateProviderRef, trunk_provider: BlockStateProviderRef, foliage_provider: BlockStateProviderRef, trunk_placer: TrunkPlacer, foliage_placer: FoliagePlacer, decorators: [TreeDecorator], ignore_vines?: bool, root_placer?: RootPlacer) ``` Makes `minecraft:tree`. - `minimum_size`: FeatureSize - `below_trunk_provider`: BlockStateProviderRef - `trunk_provider`: BlockStateProviderRef - `foliage_provider`: BlockStateProviderRef - `trunk_placer`: TrunkPlacer - `foliage_placer`: FoliagePlacer - `decorators`: list of TreeDecorator - `ignore_vines`: bool (optional) - `root_placer`: RootPlacer (optional) ## UnderwaterMagma ``` UnderwaterMagma(floor_search_range: int, placement_radius_around_floor: int, placement_probability_per_valid_position: float) ``` Makes `minecraft:underwater_magma`. - `floor_search_range`: int 0..512 - `placement_radius_around_floor`: int 0..64 - `placement_probability_per_valid_position`: number 0..1 ## VegetationPatch ``` VegetationPatch(surface: CaveSurface, depth: IntProvider, vertical_range: int, extra_bottom_block_chance: float, extra_edge_column_chance: float, vegetation_chance: float, xz_radius: IntProvider, replaceable: block id | [block id], ground_state: BlockStateProviderRef, vegetation_feature: FeatureRef) ``` Makes `minecraft:vegetation_patch`. - `surface`: CaveSurface - `depth`: IntProvider of int 1..128 - `vertical_range`: int 1..256 - `extra_bottom_block_chance`: number 0..1 - `extra_edge_column_chance`: number 0..1 - `vegetation_chance`: number 0..1 - `xz_radius`: IntProvider of int - `replaceable`: block id | #block tag | list of block ids - `ground_state`: BlockStateProviderRef - `vegetation_feature`: FeatureRef ## Vines ``` Vines() ``` Makes `minecraft:vines`. ## VoidStartPlatform ``` VoidStartPlatform() ``` Makes `minecraft:void_start_platform`. ## WaterloggedVegetationPatch ``` WaterloggedVegetationPatch(surface: CaveSurface, depth: IntProvider, vertical_range: int, extra_bottom_block_chance: float, extra_edge_column_chance: float, vegetation_chance: float, xz_radius: IntProvider, replaceable: block id | [block id], ground_state: BlockStateProviderRef, vegetation_feature: FeatureRef) ``` Makes `minecraft:waterlogged_vegetation_patch`. - `surface`: CaveSurface - `depth`: IntProvider of int 1..128 - `vertical_range`: int 1..256 - `extra_bottom_block_chance`: number 0..1 - `extra_edge_column_chance`: number 0..1 - `vegetation_chance`: number 0..1 - `xz_radius`: IntProvider of int - `replaceable`: block id | #block tag | list of block ids - `ground_state`: BlockStateProviderRef - `vegetation_feature`: FeatureRef ## WeightedRandomSelector ``` WeightedRandomSelector(features: WeightedList) ``` Makes `minecraft:weighted_random_selector`. - `features`: WeightedList of PlacedFeatureRef # Feature size Helpers that build a `minecraft:feature_size` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## ThreeLayersFeatureSize ``` ThreeLayersFeatureSize(min_clipped_height?: float, limit?: int, upper_limit?: int, lower_size?: int, middle_size?: int, upper_size?: int) ``` Makes `minecraft:three_layers_feature_size`. - `min_clipped_height`: number 0..80 (optional) - `limit`: int 0..80 (optional) - `upper_limit`: int 0..80 (optional) - `lower_size`: int 0..16 (optional) - `middle_size`: int 0..16 (optional) - `upper_size`: int 0..16 (optional) ## TwoLayersFeatureSize ``` TwoLayersFeatureSize(min_clipped_height?: float, limit?: int, lower_size?: int, upper_size?: int) ``` Makes `minecraft:two_layers_feature_size`. - `min_clipped_height`: number 0..80 (optional) - `limit`: int 0..81 (optional) - `lower_size`: int 0..16 (optional) - `upper_size`: int 0..16 (optional) # Float provider Helpers that build a `minecraft:float_provider` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## ClampedNormal ``` ClampedNormal(min: float, max: float, mean: float, deviation: float) ``` Makes `minecraft:clamped_normal`. A number from a bell curve around `mean`, kept from `min` to `max`. - `min`: number 0.. - `max`: number 0.. - `mean`: number. The most likely value. - `deviation`: number. How widely values spread around `mean`. ## Constant ``` Constant(value: float) ``` Makes `minecraft:constant`. Always the same number. A plain number does the same thing. - `value`: number 0.. ## Trapezoid ``` Trapezoid(min: float, max: float, plateau: float) ``` Makes `minecraft:trapezoid`. A number from `min` to `max`, most likely in a middle band `plateau` wide. - `min`: number 0.. - `max`: number 0.. - `plateau`: number ## Uniform ``` Uniform(min_inclusive: float, max_exclusive: float) ``` Makes `minecraft:uniform`. A random number from `min_inclusive` up to (not including) `max_exclusive`. Usually written as a range, `0.5..1.5`. - `min_inclusive`: number 0.. - `max_exclusive`: number 0.. # Foliage placer Helpers that build a `minecraft:foliage_placer` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## AcaciaFoliagePlacer ``` AcaciaFoliagePlacer(radius: IntProvider, offset: IntProvider) ``` Makes `minecraft:acacia_foliage_placer`. - `radius`: IntProvider of int 0..16 - `offset`: IntProvider of int 0..16 ## BlobFoliagePlacer ``` BlobFoliagePlacer(radius: IntProvider, offset: IntProvider, height: int) ``` Makes `minecraft:blob_foliage_placer`. - `radius`: IntProvider of int 0..16 - `offset`: IntProvider of int 0..16 - `height`: int 0..16 ## BushFoliagePlacer ``` BushFoliagePlacer(radius: IntProvider, offset: IntProvider, height: int) ``` Makes `minecraft:bush_foliage_placer`. - `radius`: IntProvider of int 0..16 - `offset`: IntProvider of int 0..16 - `height`: int 0..16 ## CherryFoliagePlacer ``` CherryFoliagePlacer(radius: IntProvider, offset: IntProvider, height: IntProvider, wide_bottom_layer_hole_chance: float, corner_hole_chance: float, hanging_leaves_chance: float, hanging_leaves_extension_chance: float) ``` Makes `minecraft:cherry_foliage_placer`. - `radius`: IntProvider of int 0..16 - `offset`: IntProvider of int 0..16 - `height`: IntProvider of int 4..16 - `wide_bottom_layer_hole_chance`: number 0..1 - `corner_hole_chance`: number 0..1 - `hanging_leaves_chance`: number 0..1 - `hanging_leaves_extension_chance`: number 0..1 ## DarkOakFoliagePlacer ``` DarkOakFoliagePlacer(radius: IntProvider, offset: IntProvider) ``` Makes `minecraft:dark_oak_foliage_placer`. - `radius`: IntProvider of int 0..16 - `offset`: IntProvider of int 0..16 ## FancyFoliagePlacer ``` FancyFoliagePlacer(radius: IntProvider, offset: IntProvider, height: int) ``` Makes `minecraft:fancy_foliage_placer`. - `radius`: IntProvider of int 0..16 - `offset`: IntProvider of int 0..16 - `height`: int 0..16 ## JungleFoliagePlacer ``` JungleFoliagePlacer(radius: IntProvider, offset: IntProvider, height: int) ``` Makes `minecraft:jungle_foliage_placer`. - `radius`: IntProvider of int 0..16 - `offset`: IntProvider of int 0..16 - `height`: int 0..16 ## MegaPineFoliagePlacer ``` MegaPineFoliagePlacer(radius: IntProvider, offset: IntProvider, crown_height: IntProvider) ``` Makes `minecraft:mega_pine_foliage_placer`. - `radius`: IntProvider of int 0..16 - `offset`: IntProvider of int 0..16 - `crown_height`: IntProvider of int 0..24 ## PineFoliagePlacer ``` PineFoliagePlacer(radius: IntProvider, offset: IntProvider, height: IntProvider) ``` Makes `minecraft:pine_foliage_placer`. - `radius`: IntProvider of int 0..16 - `offset`: IntProvider of int 0..16 - `height`: IntProvider of int 0..24 ## PoplarFoliagePlacer ``` PoplarFoliagePlacer(radius: IntProvider, offset: IntProvider, height: IntProvider, side_hole_chance: float) ``` Makes `minecraft:poplar_foliage_placer`. - `radius`: IntProvider of int 0..16 - `offset`: IntProvider of int 0..16 - `height`: IntProvider of int 5..16 - `side_hole_chance`: number 0..1 ## RandomSpreadFoliagePlacer ``` RandomSpreadFoliagePlacer(radius: IntProvider, offset: IntProvider, foliage_height: IntProvider, leaf_placement_attempts: int) ``` Makes `minecraft:random_spread_foliage_placer`. - `radius`: IntProvider of int 0..16 - `offset`: IntProvider of int 0..16 - `foliage_height`: IntProvider of int 1..512 - `leaf_placement_attempts`: int 0..256 ## SpruceFoliagePlacer ``` SpruceFoliagePlacer(radius: IntProvider, offset: IntProvider, trunk_height: IntProvider) ``` Makes `minecraft:spruce_foliage_placer`. - `radius`: IntProvider of int 0..16 - `offset`: IntProvider of int 0..16 - `trunk_height`: IntProvider of int 0..24 # Glyph provider Helpers that build a `minecraft:glyph_provider` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Bitmap ``` Bitmap(file: string, ascent: int, chars: [string], height?: int, filter?: object) ``` Makes `minecraft:bitmap`. - `file`: string - `ascent`: int - `chars`: list of string (at least 1) (at least 1) - `height`: int (optional) - `filter`: map of FontOption to bool (optional) ## Reference ``` Reference(id: font id, filter?: object) ``` Makes `minecraft:reference`. - `id`: font id - `filter`: map of FontOption to bool (optional) ## Space ``` Space(advances: object, filter?: object) ``` Makes `minecraft:space`. - `advances`: map of string (exactly 1) to number - `filter`: map of FontOption to bool (optional) ## Ttf ``` Ttf(file: string, size?: float, oversample?: float, shift?: [float], skip?: string | [string], filter?: object) ``` Makes `minecraft:ttf`. - `file`: string - `size`: number (optional) - `oversample`: number (optional) - `shift`: list of number (exactly 2) (optional) - `skip`: string | list of string (optional) - `filter`: map of FontOption to bool (optional) ## Unihex ``` Unihex(hex_file: string, size_overrides?: [UnihexOverrideRange], filter?: object) ``` Makes `minecraft:unihex`. - `hex_file`: string. ZIP archive containing one or more *.hex files (files in archive with different extensions are ignored). - `size_overrides`: list of UnihexOverrideRange (optional). List of ranges to override the size of. - `filter`: map of FontOption to bool (optional) # Height provider Helpers that build a `minecraft:height_provider` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## BiasedToBottom ``` BiasedToBottom(min_inclusive: VerticalAnchor, max_inclusive: VerticalAnchor, inner?: int) ``` Makes `minecraft:biased_to_bottom`. A random height from `min_inclusive` to `max_inclusive`, with low heights more likely. - `min_inclusive`: VerticalAnchor - `max_inclusive`: VerticalAnchor - `inner`: int 1.. (optional) ## Constant ``` Constant(value: VerticalAnchor) ``` Makes `minecraft:constant`. Always the same height. - `value`: VerticalAnchor ## Trapezoid ``` Trapezoid(min_inclusive: VerticalAnchor, max_inclusive: VerticalAnchor, plateau?: int) ``` Makes `minecraft:trapezoid`. A random height from `min_inclusive` to `max_inclusive`, most likely in the middle. Vanilla ores that peak at one depth use it. - `min_inclusive`: VerticalAnchor - `max_inclusive`: VerticalAnchor - `plateau`: int (optional). Width of the most likely band in the middle. Defaults to 0, a triangle. ## Uniform ``` Uniform(min_inclusive: VerticalAnchor, max_inclusive: VerticalAnchor) ``` Makes `minecraft:uniform`. A random height from `min_inclusive` to `max_inclusive`, each equally likely. - `min_inclusive`: VerticalAnchor - `max_inclusive`: VerticalAnchor ```mms PlacedFeature low_iron { feature = minecraft:ore_iron placement = [Count(10), InSquare(), HeightRange(Uniform(AboveBottom(0), Absolute(64)))] } ``` ## VeryBiasedToBottom ``` VeryBiasedToBottom(min_inclusive: VerticalAnchor, max_inclusive: VerticalAnchor, inner?: int) ``` Makes `minecraft:very_biased_to_bottom`. Like `BiasedToBottom`, with low heights even more likely. - `min_inclusive`: VerticalAnchor - `max_inclusive`: VerticalAnchor - `inner`: int 1.. (optional) ## WeightedList ``` WeightedList(distribution: NonEmptyWeightedList) ``` Makes `minecraft:weighted_list`. Picks one of several height providers by weight. - `distribution`: NonEmptyWeightedList of HeightProvider # Hover event Helpers that build a `minecraft:hover_event` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## ShowEntity ``` ShowEntity(id: entity_type id, uuid: [int] | string, name?: Text) ``` Makes `minecraft:show_entity`. - `id`: entity_type id - `uuid`: string | list of int (exactly 4) - `name`: Text (optional) ## ShowItem ``` ShowItem(id: item id, components?: DataComponentPatch, count?: int) ``` Makes `minecraft:show_item`. - `id`: item id. ID of the item. - `components`: DataComponentPatch (optional) - `count`: int 1..99 (optional). Number of items in the stack. Defaults to `1`. ## ShowText ``` ShowText(value: Text) ``` Makes `minecraft:show_text`. - `value`: Text # Input control Helpers that build a `minecraft:input_control` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Boolean ``` Boolean(key: string | any, label: Text, initial?: bool, on_true?: string, on_false?: string) ``` Makes `minecraft:boolean`. - `key`: string (at least 1) | any. The input key, which is used to build macro command and generate custom action payload. - `label`: Text. Label displayed to the right of control. - `initial`: bool (optional). Initial value of the control. Defaults to `false` (unchecked). - `on_true`: string (optional). String to send when the control is checked. Defaults to `"true"`. - `on_false`: string (optional). String to send when the control is unchecked. Defaults to `"false"`. ## NumberRange ``` NumberRange(key: string | any, label: Text, start: float, end: float, width?: int, label_format?: string, step?: float, initial?: float) ``` Makes `minecraft:number_range`. - `key`: string (at least 1) | any. The input key, which is used to build macro command and generate custom action payload. - `label`: Text. Label displayed on the slider. - `start`: number. Start value, inclusive. - `end`: number. End value, inclusive. - `width`: int 1..1024 (optional). Defaults to 200. - `label_format`: string (optional). The translation to be used for building label. `%1$s` is replaced by `label`; `%2$s` is replaced by current value of the slider. Defaults to `options.generic_value`. - `step`: number 0..< (optional). Step size of the input. If not present, any value from range is allowed. - `initial`: number (optional). Initial value of the slider. Rounded down nearest step. Defaults to the middle of the range. ## SingleOption ``` SingleOption(key: string | any, label: Text, options: [Option | string], width?: int, label_visible?: bool) ``` Makes `minecraft:single_option`. - `key`: string (at least 1) | any. The input key, which is used to build macro command and generate custom action payload. - `label`: Text. Label displayed on the button. - `options`: list of (Option | string) (at least 1) - `width`: int 1..1024 (optional). Defaults to 200. - `label_visible`: bool (optional). Defaults to `true`. ## Text ``` Text(key: string | any, label: Text, width?: int, label_visible?: bool, initial?: string, max_length?: int, multiline?: object) ``` Makes `minecraft:text`. - `key`: string (at least 1) | any. The input key, which is used to build macro command and generate custom action payload. - `label`: Text. Label displayed to the left of control. - `width`: int 1..1024 (optional). Defaults to 200. - `label_visible`: bool (optional). Defaults to `true`. - `initial`: string (optional). Initial contents of the text input. Defaults to `""` (empty string). - `max_length`: int 1.. (optional). Maximum length of input Defaults to 32. - `multiline`: { max_lines?: int 1.., height?: int 1..512 } (optional). If present, allows users to input multiple lines. # Int provider Helpers that build a `minecraft:int_provider` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## BiasedToBottom ``` BiasedToBottom(min_inclusive: int, max_inclusive: int) ``` Makes `minecraft:biased_to_bottom`. A random whole number from `min_inclusive` to `max_inclusive`, with low values more likely. - `min_inclusive`: int - `max_inclusive`: int ## Clamped ``` Clamped(min_inclusive: int, max_inclusive: int, source: IntProvider) ``` Makes `minecraft:clamped`. Another provider's value, kept from `min_inclusive` to `max_inclusive`. - `min_inclusive`: int - `max_inclusive`: int - `source`: IntProvider of int. The provider to clamp. ## ClampedNormal ``` ClampedNormal(min_inclusive: int, max_inclusive: int, mean: float, deviation: float) ``` Makes `minecraft:clamped_normal`. A whole number from a bell curve around `mean`, kept from `min_inclusive` to `max_inclusive`. - `min_inclusive`: int - `max_inclusive`: int - `mean`: number. The most likely value. - `deviation`: number. How widely values spread around `mean`. ## Constant ``` Constant(value: int) ``` Makes `minecraft:constant`. Always the same whole number. A plain number does the same thing. - `value`: int ## Trapezoid ``` Trapezoid(min: int, max: int, plateau: int) ``` Makes `minecraft:trapezoid`. A whole number from `min` to `max`, most likely in a middle band `plateau` wide and less likely toward the ends. - `min`: int - `max`: int - `plateau`: int. Width of the most likely band in the middle. `0` gives a triangle. ## Uniform ``` Uniform(min_inclusive: int, max_inclusive: int) ``` Makes `minecraft:uniform`. A random whole number from `min_inclusive` to `max_inclusive`, each equally likely. Usually written as a range, `2..5`. - `min_inclusive`: int. The smallest value. - `max_inclusive`: int. The largest value. ```mms PlacedFeature some_iron { feature = minecraft:ore_iron, placement = [Count(Uniform(2, 5)), InSquare()] } ``` ## VeryBiasedToBottom ``` VeryBiasedToBottom(min_inclusive: int, max_inclusive: int) ``` Makes `minecraft:very_biased_to_bottom`. Like `BiasedToBottom`, with low values even more likely. - `min_inclusive`: int - `max_inclusive`: int ## WeightedList ``` WeightedList(distribution: NonEmptyWeightedList) ``` Makes `minecraft:weighted_list`. Picks one of several providers by weight. - `distribution`: NonEmptyWeightedList of IntProvider of int # Item model Helpers that build a `minecraft:item_model` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Composite ``` Composite(models: [ItemModel], transformation?: Transformation) ``` Makes `minecraft:composite`. - `models`: list of ItemModel - `transformation`: Transformation (optional) ## Condition ``` Condition(property: ConditionalPropertyType, on_true: ItemModel, on_false: ItemModel, transformation?: Transformation) ``` Makes `minecraft:condition`. - `property`: ConditionalPropertyType - `on_true`: ItemModel - `on_false`: ItemModel - `transformation`: Transformation (optional) ## Empty ``` Empty() ``` Makes `minecraft:empty`. ## Model ``` Model(model: ModelRef, tints?: [ModelTint], transformation?: Transformation) ``` Makes `minecraft:model`. - `model`: ModelRef - `tints`: list of ModelTint (optional) - `transformation`: Transformation (optional) ## RangeDispatch ``` RangeDispatch(property: NumericPropertyType, entries: [object], scale?: float, fallback?: ItemModel, transformation?: Transformation) ``` Makes `minecraft:range_dispatch`. - `property`: NumericPropertyType - `entries`: list of { threshold: number, model: ItemModel }. List of ranges. Will select last entry with threshold less or equal to value. Order does not matter, list will be sorted by threshold in ascending order. - `scale`: number (optional). Factor to multiply the property value with. Defaults to 1. - `fallback`: ItemModel (optional). Item model to render if no entries were less or equal to the value. - `transformation`: Transformation (optional) ## Select ``` Select(property: SelectPropertyType, fallback?: ItemModel, transformation?: Transformation) ``` Makes `minecraft:select`. - `property`: SelectPropertyType - `fallback`: ItemModel (optional). Item model to render if none of the cases matched the value. - `transformation`: Transformation (optional) ## Special ``` Special(model: object, base: ModelRef, transformation?: Transformation) ``` Makes `minecraft:special`. - `model`: special_item_model. Renders a special hardcoded model. - `base`: ModelRef. Base model, providing transformations, particle texture and GUI light. - `transformation`: Transformation (optional) # Level based value Helpers that build a `minecraft:level_based_value` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Clamped ``` Clamped(value: LevelBasedValue, min: float, max: float) ``` Makes `minecraft:clamped`. - `value`: LevelBasedValue - `min`: number - `max`: number ## Exponent ``` Exponent(base: LevelBasedValue, power: LevelBasedValue) ``` Makes `minecraft:exponent`. - `base`: LevelBasedValue - `power`: LevelBasedValue ## Fraction ``` Fraction(numerator: LevelBasedValue, denominator: LevelBasedValue) ``` Makes `minecraft:fraction`. - `numerator`: LevelBasedValue - `denominator`: LevelBasedValue ## LevelsSquared ``` LevelsSquared(added: float) ``` Makes `minecraft:levels_squared`. - `added`: number. Added to the result so that the result becomes `square(level) + added`. ## Linear ``` Linear(base: float, per_level_above_first: float) ``` Makes `minecraft:linear`. - `base`: number. Base value at level 1. - `per_level_above_first`: number. Value increase per level above 1. ## Lookup ``` Lookup(values: [LevelBasedValue], fallback: LevelBasedValue) ``` Makes `minecraft:lookup`. - `values`: list of LevelBasedValue (at least 1). Indexed by `level - 1` to apply, if present - `fallback`: LevelBasedValue. Applied if the level is greater than the size of `values`. # List operation Helpers that build a `minecraft:list_operation` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Append ``` Append(values: [FloatNumberProviderRef]) ``` Makes `minecraft:append`. - `values`: list of FloatNumberProviderRef ## Insert ``` Insert(values: [FloatNumberProviderRef], offset?: int) ``` Makes `minecraft:insert`. - `values`: list of FloatNumberProviderRef - `offset`: int 0.. (optional). The offset in the list to insert into. Defaults to 0. ## ReplaceAll ``` ReplaceAll(values: [FloatNumberProviderRef]) ``` Makes `minecraft:replace_all`. - `values`: list of FloatNumberProviderRef ## ReplaceSection ``` ReplaceSection(values: [FloatNumberProviderRef], offset?: int, size?: int) ``` Makes `minecraft:replace_section`. - `values`: list of FloatNumberProviderRef - `offset`: int 0.. (optional). The offset of the section to replace. Defaults to 0. - `size`: int 0.. (optional). The size of the section to replace. Defaults to size of the new list. # Loot condition Helpers that build a `minecraft:loot_condition` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## AllOf ``` AllOf(terms: PredicateListRef) ``` Makes `minecraft:all_of`. Passes when every condition passes. Usually written with `&&`. - `terms`: PredicateListRef. Passes when all of these conditions pass. ## AnyOf ``` AnyOf(terms: PredicateListRef) ``` Makes `minecraft:any_of`. Passes when any condition passes. Usually written with `||`. - `terms`: PredicateListRef. Passes when any of these conditions pass. ## DamageSourceProperties ``` DamageSourceProperties(predicate: DamageSourcePredicate) ``` Makes `minecraft:damage_source_properties`. Passes when the damage that killed the entity matches a damage source predicate. - `predicate`: DamageSourcePredicate ## EnchantmentActiveCheck ``` EnchantmentActiveCheck(active: bool) ``` Makes `minecraft:enchantment_active_check`. Inside an enchantment's effects, passes when the enchantment is active (`true`) or inactive (`false`). - `active`: bool ## EntityProperties ``` EntityProperties(entity: EntityTarget, predicate: EntityPredicate) ``` Makes `minecraft:entity_properties`. Passes when an entity matches an entity predicate. - `entity`: EntityTarget. Which entity to check: `this` (the entity that died, or the player that opened or broke something), `attacker`, `direct_attacker` or `attacking_player`. - `predicate`: EntityPredicate. What the entity must be. ## EntityScores ``` EntityScores(entity: EntityTarget, scores: object) ``` Makes `minecraft:entity_scores`. Passes when an entity's scoreboard scores are in the given ranges. - `entity`: EntityTarget. Which entity to check: `this` (the entity that died, or the player that opened or broke something), `attacker`, `direct_attacker` or `attacking_player`. - `scores`: map of string to IntRange. A map from objective name to a range of scores. ## EnvironmentAttributeCheck ``` EnvironmentAttributeCheck(attribute: environment_attribute id, value: any) ``` Makes `minecraft:environment_attribute_check`. - `attribute`: environment_attribute id - `value`: any (depends on attribute) ## FloatValueCheck ``` FloatValueCheck(value: FloatNumberProviderRef, test: FloatRange) ``` Makes `minecraft:float_value_check`. Passes when a number is in a range. - `value`: FloatNumberProviderRef - `test`: FloatRange. Passes when `value` is within the test range. ## IntValueCheck ``` IntValueCheck(value: IntNumberProviderRef, test: IntRange) ``` Makes `minecraft:int_value_check`. Passes when a whole number is in a range. - `value`: IntNumberProviderRef - `test`: IntRange. Passes when `value` is within the test range. ## Inverted ``` Inverted(term: PredicateRef) ``` Makes `minecraft:inverted`. Passes when `term` fails. Usually written with `!`. - `term`: PredicateRef. The condition to invert. ## KilledByPlayer ``` KilledByPlayer(inverse?: bool) ``` Makes `minecraft:killed_by_player`. Passes when a player killed the entity. - `inverse`: bool (optional). `true` to pass when no player killed it instead. ## LocationCheck ``` LocationCheck(predicate: LocationPredicate, offsetX?: int, offsetY?: int, offsetZ?: int) ``` Makes `minecraft:location_check`. Passes when the position, shifted by the offsets, matches a location predicate: biome, structure, light, block and more. - offsetX: Blocks added to x before checking. - offsetY: Blocks added to y before checking. - offsetZ: Blocks added to z before checking. - `predicate`: LocationPredicate. What the location must be. - `offsetX`: int (optional) - `offsetY`: int (optional) - `offsetZ`: int (optional) ## MatchBlock ``` MatchBlock(blocks?: block id | [block id], state?: BlockPredicateState, nbt?: string | value, components?: DataComponentExactPredicate, predicates?: DataComponentPredicate) ``` Makes `minecraft:match_block`. Passes when the block, such as the one being broken, matches. - `blocks`: block id | #block tag | list of block ids (optional). The blocks or block tag that pass. - `state`: BlockPredicateState (optional). Block states the block must have, such as `age = "7"`. - `nbt`: string | any (depends on blocks) (optional) - `components`: DataComponentExactPredicate (optional). Match exact data component values on the block entity. - `predicates`: DataComponentPredicate (optional). Test data component values on the block entity. ## MatchTool ``` MatchTool(predicate: ItemPredicate) ``` Makes `minecraft:match_tool`. Passes when the tool used, such as the pickaxe that broke a block, matches an item predicate. - `predicate`: ItemPredicate. What the tool must be. ## RandomChance ``` RandomChance(chance: FloatNumberProviderRef) ``` Makes `minecraft:random_chance`. Passes at random, with probability `chance`. - `chance`: FloatNumberProviderRef. Accepts a value between `0` & `1` (inclusive). ```mms Predicate coin_flip = RandomChance(0.5) ``` ## RandomChanceWithEnchantedBonus ``` RandomChanceWithEnchantedBonus(unenchanted_chance: float, enchanted_chance: LevelBasedValue, enchantment: enchantment id) ``` Makes `minecraft:random_chance_with_enchanted_bonus`. Passes at random, with a higher chance when the attacker's weapon has an enchantment, as looting does for rare drops. - `unenchanted_chance`: number 0..1. The chance without the enchantment, from 0 to 1. - `enchanted_chance`: LevelBasedValue. The chance by enchantment level. - `enchantment`: enchantment id. The enchantment that raises the chance. ## SurvivesExplosion ``` SurvivesExplosion() ``` Makes `minecraft:survives_explosion`. Passes with a chance of 1 divided by the explosion's radius, and always when there was no explosion. Vanilla block drops use it so explosions destroy some items. ## TableBonus ``` TableBonus(enchantment: enchantment id, chances: [float]) ``` Makes `minecraft:table_bonus`. Passes at random, with the chance picked by the level of an enchantment on the tool. Vanilla uses it for saplings and flint. - `enchantment`: enchantment id. The enchantment whose level picks the chance. - `chances`: list of number 0..1. Probabilities for each enchantment level ## TimeCheck ``` TimeCheck(clock: world_clock id, value: IntRange, period?: int) ``` Makes `minecraft:time_check`. Passes when a world clock's time is in a range. - `clock`: world_clock id. The world clock to check. - `value`: IntRange. Check the current game tick. - `period`: int (optional). Game tick supplied to `value` check gets modulo-divided by this. For example, if set to 24000, `value` operates on a time period of days. ```mms Predicate night = TimeCheck(clock = overworld, value = 13000..23000, period = 24000) ``` ## WeatherCheck ``` WeatherCheck(raining?: bool, thundering?: bool) ``` Makes `minecraft:weather_check`. Passes when the weather matches. Leave out what doesn't matter. - `raining`: bool (optional). `true` to require rain, `false` to require no rain. - `thundering`: bool (optional). `true` to require a thunderstorm, `false` to require none. ```mms Predicate storm = WeatherCheck(thundering = true) ``` # Loot function Helpers that build a `minecraft:loot_function` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## ApplyBonus ``` ApplyBonus(enchantment: enchantment id, formula: ApplyBonusFormula, condition?: PredicateRef) ``` Makes `minecraft:apply_bonus`. Raises the count by the level of an enchantment on the tool, as fortune does for ores. - `enchantment`: enchantment id. The enchantment whose level raises the count. - `formula`: ApplyBonusFormula. How the level changes the count: `ore_drops`, `uniform_bonus_count` or `binomial_with_bonus_count`. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## CopyComponents ``` CopyComponents(source: BlockEntityTarget | EntityTarget | ItemStackTarget, include?: [data_component_type id], exclude?: [data_component_type id], condition?: PredicateRef) ``` Makes `minecraft:copy_components`. Copies data components from a block entity, entity or item onto the item. - `source`: BlockEntityTarget | EntityTarget | ItemStackTarget - `include`: list of data_component_type ids (optional). If omitted, all components present are included - `exclude`: list of data_component_type ids (optional). Defaults to none. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## CopyCustomData ``` CopyCustomData(source: NbtProvider, ops: [object], condition?: PredicateRef) ``` Makes `minecraft:copy_custom_data`. Copies NBT from an entity, block entity or storage into the item's `custom_data`. - `source`: NbtProvider - `ops`: list of { source: string, target: string, op: CopyNbtStrategy } - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## CopyName ``` CopyName(source: EntityTarget | BlockEntityTarget, condition?: PredicateRef) ``` Makes `minecraft:copy_name`. Copies the custom name of an entity or block entity onto the item. - `source`: EntityTarget | BlockEntityTarget - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## CopyState ``` CopyState(block: block id, properties: [value], condition?: PredicateRef) ``` Makes `minecraft:copy_state`. Copies block state properties of the broken block onto the item. - `block`: block id - `properties`: list of any - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## Discard ``` Discard(condition?: PredicateRef) ``` Makes `minecraft:discard`. Removes the item. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## EnchantRandomly ``` EnchantRandomly(options?: enchantment id | [enchantment id], only_compatible?: bool, include_additional_cost_component?: bool, condition?: PredicateRef) ``` Makes `minecraft:enchant_randomly`. Adds one random enchantment. - `options`: enchantment id | #enchantment tag | list of enchantment ids (optional). The allowed enchantments. If omitted, all enchantments applicable to the item are possible. - `only_compatible`: bool (optional). Whether to only enchant with item-compatible enchantments. Defaults to `true`. Note: Books are considered compatible with all Enchantments. - `include_additional_cost_component`: bool (optional). Whether to add `additional_trade_cost` component to the enchanted item. Additional cost value is determined by the enchantment level, with the formula `2 + random(0, 5 + level * 10) + 3 * level`. Defaults to `false`. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## EnchantWithLevels ``` EnchantWithLevels(levels: IntNumberProviderRef, options?: enchantment id | [enchantment id], include_additional_cost_component?: bool, condition?: PredicateRef) ``` Makes `minecraft:enchant_with_levels`. Enchants the item as an enchanting table would at this many levels. - `levels`: IntNumberProviderRef. The levels to enchant this item with. - `options`: enchantment id | #enchantment tag | list of enchantment ids (optional). The allowed enchantments. If omitted, all enchantments applicable to the item are possible. - `include_additional_cost_component`: bool (optional). Whether to add `additional_trade_cost` component to the enchanted item. Additional cost value is equal to the level cost determined by `levels`. Defaults to `false`. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## EnchantedCountIncrease ``` EnchantedCountIncrease(count: FloatNumberProviderRef, enchantment: enchantment id, limit?: int, condition?: PredicateRef) ``` Makes `minecraft:enchanted_count_increase`. Adds to the count by the level of an enchantment on the attacker's weapon, as looting does. - `count`: FloatNumberProviderRef. Rounded *after* the number was multiplied by the looting level. - `enchantment`: enchantment id. Enchantment that increases yields. - `limit`: int (optional). Limits the count of the item to a range. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## ExplorationMap ``` ExplorationMap(destination: structure id | [structure id], decoration?: map_decoration_type id, zoom?: int, search_radius?: int, skip_existing_chunks?: bool, condition?: PredicateRef) ``` Makes `minecraft:exploration_map`. Turns an empty map into an explorer map that points to the nearest structure of a kind. - `destination`: structure id | #structure tag | list of structure ids. Generated structure to locate. Accepts any of the structure types used by the `/locate` command. - `decoration`: map_decoration_type id (optional). The icon used to mark the destination on the map. - `zoom`: int (optional). Defaults to 2. - `search_radius`: int (optional). The size, in chunks, of the area to search for structures. The area checked is square, not circular. Radius `0` causes only the current chunk to be searched, radius `1` causes the current chunk and eight adjacent chunks to be searched, and so on. Defaults to `50`. - `skip_existing_chunks`: bool (optional). Whether to not search in chunks that have already been generated. Defaults to `true`. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## ExplosionDecay ``` ExplosionDecay(condition?: PredicateRef) ``` Makes `minecraft:explosion_decay`. Removes some of the stack when an explosion caused the drop, as vanilla blocks do. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## FillPlayerHead ``` FillPlayerHead(entity: EntityTarget, condition?: PredicateRef) ``` Makes `minecraft:fill_player_head`. Makes a player head show an entity's skin. - `entity`: EntityTarget. `this` to use the entity that died or the player that gained the advancement, opened the container, or broke the block. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## Filtered ``` Filtered(item_filter: ItemPredicate, on_pass?: ItemModifier, on_fail?: ItemModifier, condition?: PredicateRef) ``` Makes `minecraft:filtered`. Applies `on_pass` to items that match `item_filter` and `on_fail` to those that don't. - `item_filter`: ItemPredicate. Item predicate to select items to modify. - `on_pass`: ItemModifier (optional). Loot function to apply to the item when `item_filter` passes. - `on_fail`: ItemModifier (optional). Loot function to apply to the item when `item_filter` fails. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## FurnaceSmelt ``` FurnaceSmelt(condition?: PredicateRef) ``` Makes `minecraft:furnace_smelt`. Replaces the item with what smelting it in a furnace gives, as vanilla does for mobs killed by fire. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## LimitCount ``` LimitCount(limit: object, condition?: PredicateRef) ``` Makes `minecraft:limit_count`. Keeps the count within a range. - `limit`: { min?: IntNumberProviderRef, max?: IntNumberProviderRef }. Limits the count of the item to a range. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## ModifyContents ``` ModifyContents(component: ContainerComponents, modifier: ItemModifier, condition?: PredicateRef) ``` Makes `minecraft:modify_contents`. Applies an item modifier to every item inside a container item. - `component`: ContainerComponents. Describes target component's items to modify. - `modifier`: ItemModifier. Applied to every item inside container. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## Sequence ``` Sequence(functions: ItemModifier, condition?: PredicateRef) ``` Makes `minecraft:sequence`. Applies several item modifiers in order. - `functions`: ItemModifier. List of functions to apply to this item. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## SetAttributes ``` SetAttributes(modifiers: [AttributeModifier], replace?: bool, condition?: PredicateRef) ``` Makes `minecraft:set_attributes`. Adds attribute modifiers, such as attack damage, to the item. - `modifiers`: list of AttributeModifier. List of attribute modifiers to apply to this item. - `replace`: bool (optional). Whether to replace existing attributes (otherwise append to existing). Defaults to `true`. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## SetBannerPattern ``` SetBannerPattern(patterns: [BannerPatternLayer], append: bool, condition?: PredicateRef) ``` Makes `minecraft:set_banner_pattern`. - `patterns`: list of BannerPatternLayer. List of banner pattern layers. - `append`: bool. Whether to add to the banner pattern list. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## SetBookCover ``` SetBookCover(title?: Filterable, author?: string, generation?: int, condition?: PredicateRef) ``` Makes `minecraft:set_book_cover`. - `title`: Filterable of string (0 to 32) (optional). If omitted, the original title is kept (or an empty string is used if there was no component) - `author`: string (optional). If omitted, the original author is kept (or an empty string is used if there was no component) - `generation`: int 0..3 (optional). If omitted, the original generation is kept (or 0 is used if there was no component) - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## SetComponents ``` SetComponents(components: DataComponentPatch, condition?: PredicateRef) ``` Makes `minecraft:set_components`. Sets data components on the item, such as `max_stack_size` or `rarity`. - `components`: DataComponentPatch. The components to set. A key starting with `!` removes that component. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## SetContents ``` SetContents(component: ContainerComponents, entries: [LootPoolEntry], condition?: PredicateRef) ``` Makes `minecraft:set_contents`. Fills a container item, such as a shulker box or bundle, with entries. - `component`: ContainerComponents. Describes target component to be filled with items. - `entries`: list of LootPoolEntry - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## SetCount ``` SetCount(count: IntNumberProviderRef, add?: bool, condition?: PredicateRef) ``` Makes `minecraft:set_count`. Sets the stack size, or adds to it with `add`. - `count`: IntNumberProviderRef. The count: a number, or a range such as `1..3` for a random count. - `add`: bool (optional). Whether to add to the existing count. Defaults to `false`. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ```mms ItemModifier few = SetCount(1..3) ``` ## SetCustomData ``` SetCustomData(tag: CustomData, condition?: PredicateRef) ``` Makes `minecraft:set_custom_data`. Sets the item's `custom_data` component. - `tag`: CustomData - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## SetCustomModelData ``` SetCustomModelData(floats?: object, flags?: object, strings?: object, colors?: object, condition?: PredicateRef) ``` Makes `minecraft:set_custom_model_data`. - `floats`: list_operation (optional) - `flags`: list_operation (optional) - `strings`: list_operation (optional) - `colors`: list_operation (optional) - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## SetDamage ``` SetDamage(damage: FloatNumberProviderRef, add?: bool, condition?: PredicateRef) ``` Makes `minecraft:set_damage`. Sets how damaged a tool or armour piece is. - `damage`: FloatNumberProviderRef. Decimal percentage. Can be negative when used in combination with `add`. Accepts a value between `-1` & `1` (inclusive). - `add`: bool (optional). Whether to add to the existing damage of the item. Defaults to `false`. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## SetEnchantments ``` SetEnchantments(enchantments: object, add?: bool, condition?: PredicateRef) ``` Makes `minecraft:set_enchantments`. Sets enchantment levels on the item. - `enchantments`: map of enchantment id to IntNumberProviderRef. A map of enchantments to levels. Setting an enchantment to `0` removes it from the item. - `add`: bool (optional). Whether to add to the level of each enchantment. Defaults to `false`. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## SetFireworkExplosion ``` SetFireworkExplosion(shape?: FireworkShape, colors?: [int], fade_colors?: [int], trail?: bool, twinkle?: bool, condition?: PredicateRef) ``` Makes `minecraft:set_firework_explosion`. - `shape`: FireworkShape (optional). If omitted, the original shape is kept (or `small_ball` is used if there was no component). - `colors`: list of int (optional). If omitted, the original colors are kept (or `[]` is used if there was no component). Calculated as `RED << 16 | GREEN << 8 | BLUE`. Each of these fields must be between 0 and 255, inclusive. - `fade_colors`: list of int (optional). If omitted, the original fade colors are kept (or `[]` is used if there was no component). Calculated as `RED << 16 | GREEN << 8 | BLUE`. Each of these fields must be between 0 and 255, inclusive. - `trail`: bool (optional). If omitted, the original `has_trail` value is kept (or `false` is used if there was no component). - `twinkle`: bool (optional). If omitted, the original `has_twinkle` value is kept (or `false` is used if there was no component). - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## SetFireworks ``` SetFireworks(flight_duration?: int, explosions?: object, condition?: PredicateRef) ``` Makes `minecraft:set_fireworks`. - `flight_duration`: int 0..255 (optional). If omitted, the flight duration of the item is left untouched - or set to 0 if the component did not exist before. - `explosions`: list_operation (optional) - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## SetInstrument ``` SetInstrument(options: instrument id | [instrument id], condition?: PredicateRef) ``` Makes `minecraft:set_instrument`. - `options`: instrument id | #instrument tag | list of instrument ids. Sets the instrument tag for a goat horn. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## SetItem ``` SetItem(item: item id, condition?: PredicateRef) ``` Makes `minecraft:set_item`. Changes the item to another one, keeping count and components. - `item`: item id. The new item. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## SetLootTable ``` SetLootTable(loot_table_id: loot_table id, seed?: int, condition?: PredicateRef) ``` Makes `minecraft:set_loot_table`. Sets the loot table a container item, such as a chest, rolls when placed and opened. - `loot_table_id`: loot_table id. The loot table to set to the container block item. - `seed`: int (optional). The container seed to use. Defaults to a random seed. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## SetLore ``` SetLore(lore: [Text], mode: ListOperationMode, entity?: EntityTarget, condition?: PredicateRef) ``` Makes `minecraft:set_lore`. Sets or changes the item's lore lines. - `lore`: list of Text. The lore lines, as text components. - `mode`: ListOperationMode. Determines how the existing list should be modified. - `entity`: EntityTarget (optional). The entity used to resolve the text components. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## SetName ``` SetName(name: Text, entity?: EntityTarget, target?: SetNameTarget, condition?: PredicateRef) ``` Makes `minecraft:set_name`. Sets the item's name. - `name`: Text. The name, as a text component. - `entity`: EntityTarget (optional). Specifies the entity to act as the target `@s` in the JSON text component. - `target`: SetNameTarget (optional). Which name component to set. Defaults to `custom_name`. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## SetOminousBottleAmplifier ``` SetOminousBottleAmplifier(amplifier: IntNumberProviderRef, condition?: PredicateRef) ``` Makes `minecraft:set_ominous_bottle_amplifier`. - `amplifier`: IntNumberProviderRef - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## SetPotion ``` SetPotion(id: potion id, condition?: PredicateRef) ``` Makes `minecraft:set_potion`. Sets the potion of a potion, splash potion, lingering potion or tipped arrow. - `id`: potion id. The potion identifier. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## SetRandomDyes ``` SetRandomDyes(number_of_dyes: IntNumberProviderRef, condition?: PredicateRef) ``` Makes `minecraft:set_random_dyes`. - `number_of_dyes`: IntNumberProviderRef. Applies specified number of random dyes to the item. For example, one possible outcome of `"number_of_dyes": 2` is `#2C3065`, which is the combination of a blue dye and a black dye. The same dye color can be selected multiple times. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## SetRandomPotion ``` SetRandomPotion(options?: potion id | [potion id], condition?: PredicateRef) ``` Makes `minecraft:set_random_potion`. - `options`: potion id | #potion tag | list of potion ids (optional). Possible potions to select from. Defaults to all potions. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## SetStewEffect ``` SetStewEffect(effects?: [StewEffect], condition?: PredicateRef) ``` Makes `minecraft:set_stew_effect`. - `effects`: list of StewEffect (optional). Sets the status effects for suspicious stew. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## SetWritableBookPages ``` SetWritableBookPages(pages: [Filterable], mode: ListOperationMode, condition?: PredicateRef) ``` Makes `minecraft:set_writable_book_pages`. - `pages`: list of Filterable of string. Sets the pages of a book and quill. - `mode`: ListOperationMode. Determines how the existing list should be modified. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## SetWrittenBookPages ``` SetWrittenBookPages(pages: [Filterable], mode: ListOperationMode, condition?: PredicateRef) ``` Makes `minecraft:set_written_book_pages`. - `pages`: list of Filterable of Text. Sets the pages of a written book. - `mode`: ListOperationMode. Determines how the existing list should be modified. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. ## ToggleTooltips ``` ToggleTooltips(toggles: object, condition?: PredicateRef) ``` Makes `minecraft:toggle_tooltips`. Shows or hides tooltip parts of the item, such as enchantments or attribute modifiers. - `toggles`: map of data_component_type id to bool. Toggles which tooltips are shown. - `condition`: PredicateRef (optional). Conditions that must all pass for the function to apply. Combine several with `&&` and `||`. # Loot pool entry Helpers that build a `minecraft:loot_pool_entry` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Alternatives ``` Alternatives(children: [LootPoolEntry], modifier?: ItemModifier, condition?: PredicateRef) ``` Makes `minecraft:alternatives`. Uses the first child whose conditions pass, and ignores the rest. - `children`: list of LootPoolEntry (at least 1). The entries to try, in order. - `modifier`: ItemModifier (optional). Item modifiers (loot functions) applied to the items this entry gives. - `condition`: PredicateRef (optional). Conditions that must all pass for the entry to be used. Combine several with `&&` and `||`. ## Dynamic ``` Dynamic(name: DynamicDrops, weight?: int, quality?: int, modifier?: ItemModifier, condition?: PredicateRef) ``` Makes `minecraft:dynamic`. Drops a block's own contents: `contents` for a shulker box's items, `sherds` for a decorated pot's sherds. - `name`: DynamicDrops. Which contents to drop. - `weight`: int 1.. (optional). How likely this entry is to be picked against the other entries of the pool, relative to their weights. Defaults to 1. - `quality`: int (optional). Changes `weight` by the luck of the player: the weight becomes `weight + quality * luck`. Defaults to 0. - `modifier`: ItemModifier (optional). Item modifiers (loot functions) applied to the items this entry gives. - `condition`: PredicateRef (optional). Conditions that must all pass for the entry to be used. Combine several with `&&` and `||`. ## Empty ``` Empty(weight?: int, quality?: int, modifier?: ItemModifier, condition?: PredicateRef) ``` Makes `minecraft:empty`. Gives nothing. Give it a weight to make a pool sometimes drop nothing. - `weight`: int 1.. (optional). How likely this entry is to be picked against the other entries of the pool, relative to their weights. Defaults to 1. - `quality`: int (optional). Changes `weight` by the luck of the player: the weight becomes `weight + quality * luck`. Defaults to 0. - `modifier`: ItemModifier (optional). Item modifiers (loot functions) applied to the items this entry gives. - `condition`: PredicateRef (optional). Conditions that must all pass for the entry to be used. Combine several with `&&` and `||`. ```mms LootTable maybe { pools = [Pool(1, [Item(name = diamond), Empty().Weight(4)])] } ``` ## Group ``` Group(children: [LootPoolEntry], modifier?: ItemModifier, condition?: PredicateRef) ``` Makes `minecraft:group`. Uses every child whose conditions pass. - `children`: list of LootPoolEntry (at least 1). The entries to use. - `modifier`: ItemModifier (optional). Item modifiers (loot functions) applied to the items this entry gives. - `condition`: PredicateRef (optional). Conditions that must all pass for the entry to be used. Combine several with `&&` and `||`. ## Item ``` Item(name: item id, weight?: int, quality?: int, modifier?: ItemModifier, condition?: PredicateRef) ``` Makes `minecraft:item`. Gives one item. A plain item id where an entry is expected does the same thing. - `name`: item id. The item. - `weight`: int 1.. (optional). How likely this entry is to be picked against the other entries of the pool, relative to their weights. Defaults to 1. - `quality`: int (optional). Changes `weight` by the luck of the player: the weight becomes `weight + quality * luck`. Defaults to 0. - `modifier`: ItemModifier (optional). Item modifiers (loot functions) applied to the items this entry gives. - `condition`: PredicateRef (optional). Conditions that must all pass for the entry to be used. Combine several with `&&` and `||`. ```mms LootTable gems { pools = [Pool(1, [Item(name = diamond).Weight(1), Item(name = emerald).Weight(3)])] } ``` ## LootTable ``` LootTable(value: LootTableListRef, expand?: bool, weight?: int, quality?: int, modifier?: ItemModifier, condition?: PredicateRef) ``` Makes `minecraft:loot_table`. Rolls another loot table and gives what it drops. - `value`: LootTableListRef. The loot table, by id, or a table written inline. - `expand`: bool (optional). If `true`, each of the loot tables becomes an independent entry in the pool with the same `weight` and `quality`. If `false`, drops all loot tables. Defaults to `false`. - `weight`: int 1.. (optional). How likely this entry is to be picked against the other entries of the pool, relative to their weights. Defaults to 1. - `quality`: int (optional). Changes `weight` by the luck of the player: the weight becomes `weight + quality * luck`. Defaults to 0. - `modifier`: ItemModifier (optional). Item modifiers (loot functions) applied to the items this entry gives. - `condition`: PredicateRef (optional). Conditions that must all pass for the entry to be used. Combine several with `&&` and `||`. ## Sequence ``` Sequence(children: [LootPoolEntry], modifier?: ItemModifier, condition?: PredicateRef) ``` Makes `minecraft:sequence`. Uses children in order until one's conditions fail. - `children`: list of LootPoolEntry (at least 1). The entries to use, in order. - `modifier`: ItemModifier (optional). Item modifiers (loot functions) applied to the items this entry gives. - `condition`: PredicateRef (optional). Conditions that must all pass for the entry to be used. Combine several with `&&` and `||`. ## Slots ``` Slots(slot_source: SlotSource, weight?: int, quality?: int, modifier?: ItemModifier, condition?: PredicateRef) ``` Makes `minecraft:slots`. Gives items taken from slots of an entity or container, picked by a slot source. - `slot_source`: SlotSource - `weight`: int 1.. (optional). How likely this entry is to be picked against the other entries of the pool, relative to their weights. Defaults to 1. - `quality`: int (optional). Changes `weight` by the luck of the player: the weight becomes `weight + quality * luck`. Defaults to 0. - `modifier`: ItemModifier (optional). Item modifiers (loot functions) applied to the items this entry gives. - `condition`: PredicateRef (optional). Conditions that must all pass for the entry to be used. Combine several with `&&` and `||`. ## Tag ``` Tag(items: ItemListRef, expand?: bool, weight?: int, quality?: int, modifier?: ItemModifier, condition?: PredicateRef) ``` Makes `minecraft:tag`. Gives items from an item tag: all of them, or with `expand`, one picked at random. A `#tag` where an entry is expected does the same thing. - `items`: ItemListRef. The item tag. - `expand`: bool (optional). If `true`, each of the items becomes an independent entry in the pool with the same `weight` and `quality`. If `false`, drops all items in the tag. Defaults to `false`. - `weight`: int 1.. (optional). How likely this entry is to be picked against the other entries of the pool, relative to their weights. Defaults to 1. - `quality`: int (optional). Changes `weight` by the luck of the player: the weight becomes `weight + quality * luck`. Defaults to 0. - `modifier`: ItemModifier (optional). Item modifiers (loot functions) applied to the items this entry gives. - `condition`: PredicateRef (optional). Conditions that must all pass for the entry to be used. Combine several with `&&` and `||`. # Material condition Helpers that build a `minecraft:material_condition` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## AboveSurface ``` AboveSurface() ``` Makes `minecraft:above_preliminary_surface`. True above the preliminary surface: the rough terrain height worked out from the noise before caves are carved. Vanilla wraps its whole surface layer in it so cave floors deep underground don't get grass. ```mms SurfaceRule top = If(AboveSurface() && StoneDepth(Floor)) { Block(grass_block) } ``` ## AboveWater ``` AboveWater(offset: int = 0, surface_depth_multiplier: int = 0, add_stone_depth: bool = false) ``` Makes `minecraft:water`. True for blocks at or above the water surface over them, shifted by `offset`, and also where there is no water above at all. Vanilla uses it so grass doesn't grow under lakes and oceans. - `offset`: int (default `0`). Blocks added to the water height before comparing. `-1` also passes one block below the water. - `surface_depth_multiplier`: int -20..20 (default `0`). Multiplies the surface depth noise and adds it to the water height, for an uneven shoreline. From -20 to 20. - `add_stone_depth`: bool (default `false`). Adds the block's depth below the surface to its Y before comparing. ```mms SurfaceRule dry_grass = If(AboveWater()) { Block(grass_block) } ``` ## Biome ``` Biome(biome_is: [biome id] | biome id) ``` Makes `minecraft:biome`. True when the block's biome is one of these. Takes any number of biomes. - `biome_is`: biome id | #biome tag | list of biome ids. The biomes, by id. ```mms SurfaceRule desert_sand = If(Biome(desert, beach)) { Block(sand) } ``` ## Hole ``` Hole() ``` Makes `minecraft:hole`. True where the surface depth noise is zero or less: spots where the surface layer is missing. Vanilla badlands leave these as plain terracotta. ```mms SurfaceRule bands = If(!Hole()) { Block(orange_terracotta) } ``` ## NoiseThreshold ``` NoiseThreshold(noise: noise id, min_threshold: float, max_threshold: float, is_3d?: bool) ``` Makes `minecraft:noise_threshold`. True where a noise, sampled at the block's x and z, lies between `min_threshold` and `max_threshold`. Use it for patches such as coarse dirt in savannas. - `noise`: noise id. The noise to sample, by id (a `Noise` declaration or a vanilla one such as `surface`). - `min_threshold`: number. Lowest noise value that passes. Written as `.Min(x)`. - `max_threshold`: number. Highest noise value that passes. Written as `.Max(x)`. - `is_3d`: bool (optional). Defaults to `false`. ```mms SurfaceRule patches = If(NoiseThreshold(surface).Min(0.2).Max(1)) { Block(coarse_dirt) } ``` ## Not ``` Not(invert: MaterialConditionRef) ``` Makes `minecraft:not`. True when `invert` is false. Usually written with `!`, as in `!Hole()`. - `invert`: MaterialConditionRef. The condition to invert. ## Steep ``` Steep() ``` Makes `minecraft:steep`. True on steep slopes, where the terrain height jumps by four or more blocks between neighbouring columns. Vanilla puts stone on steep mountainsides with it. ```mms SurfaceRule cliffs = If(Steep()) { Block(stone) } ``` ## StoneDepth ``` StoneDepth(surface_type: CaveSurface, offset: int = 0, add_surface_depth: bool = false, secondary_depth_range: int = 0) ``` Makes `minecraft:stone_depth`. True for blocks close to a surface: just under the ground's top (`Floor`) or just above a cave roof's underside (`Ceiling`). Vanilla puts grass on the first block and dirt a few blocks deeper with it. - `surface_type`: CaveSurface. Which surface depth is counted from: `floor` counts down from the top of the ground, `ceiling` counts up from the underside of an overhang or cave roof. - `offset`: int (default `0`). Extra depth that still passes. With `0` only the surface block itself passes; with `2` the top three blocks do. - `add_surface_depth`: bool (default `false`). Adds the surface depth to `offset`: a noise of a few blocks that varies across the world, so the layer has an uneven bottom like vanilla dirt. - `secondary_depth_range`: int (default `0`). Adds a second noise, from 0 up to this many blocks, to the depth. Vanilla uses it for patchy layers such as badlands terracotta. ```mms SurfaceRule grass = If(StoneDepth(Floor)) { Block(grass_block) } SurfaceRule dirt = If(StoneDepth(Floor).Add()) { Block(dirt) } ``` ## Temperature ``` Temperature() ``` Makes `minecraft:temperature`. True where the biome is cold enough at this height for snow to fall. ```mms SurfaceRule snowy = If(Temperature()) { Block(snow_block) } ``` ## VerticalGradient ``` VerticalGradient(random_name: string, true_at_and_below: VerticalAnchor, false_at_and_above: VerticalAnchor) ``` Makes `minecraft:vertical_gradient`. True at and below `true_at_and_below`, false at and above `false_at_and_above`, and true at random in between, less often the higher the block. Vanilla makes the bedrock floor and the deepslate transition with it. - `random_name`: string. Seeds the randomness. Give each gradient its own name, such as `"bedrock_floor"`, so they don't line up. - `true_at_and_below`: VerticalAnchor. The height where the condition is always true, and below. - `false_at_and_above`: VerticalAnchor. The height where the condition is always false, and above. ```mms SurfaceRule bedrock = If(VerticalGradient("bedrock_floor", AboveBottom(0), AboveBottom(5))) { Block(bedrock) } ``` ## YAbove ``` YAbove(anchor: VerticalAnchor, surface_depth_multiplier: int = 0, add_stone_depth: bool = false) ``` Makes `minecraft:y_above`. True for blocks at or above a height. The height can shift with the surface depth noise for an uneven edge. - `anchor`: VerticalAnchor. The height, as a number (absolute Y) or an anchor such as `AboveBottom(5)`. - `surface_depth_multiplier`: int -20..20 (default `0`). Multiplies the surface depth noise and adds it to the height. From -20 to 20. Written as `.Mul(x)`. - `add_stone_depth`: bool (default `false`). Adds the block's depth below the surface to its Y before comparing. Written as `.Add()`. ```mms SurfaceRule peaks = If(YAbove(200)) { Block(snow_block) } ``` # Material rule Helpers that build a `minecraft:material_rule` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Bandlands ``` Bandlands() ``` Makes `minecraft:bandlands`. Places the striped terracotta of badlands, with the colour picked by height. ```mms SurfaceRule stripes = If(YAbove(63)) { Bandlands() } ``` ## Block ``` Block(result_state: BlockState) ``` Makes `minecraft:block`. Places one block. Writing just a block id where a rule is expected does the same thing. - `result_state`: BlockState. The block, with optional state such as `oak_log[axis = y]`. ```mms SurfaceRule floor = Block(stone) ``` ## Condition ``` Condition(if_true: MaterialConditionRef, then_run: MaterialRuleRef) ``` Makes `minecraft:condition`. Runs `then_run` only where `if_true` passes. Usually written `If(condition) { rules }`. - `if_true`: MaterialConditionRef. The condition to test. - `then_run`: MaterialRuleRef. The rule to run when it passes. ```mms SurfaceRule grass = If(StoneDepth(Floor)) { Block(grass_block) } ``` ## OreVein ``` OreVein(ore_block: BlockState, raw_ore_block: BlockState, filler_block: BlockState, raw_ore_chance: float, density: DensityFunctionRef, richness: DensityFunctionRef, filler_gap: DensityFunctionRef) ``` Makes `minecraft:ore_vein`. - `ore_block`: BlockState - `raw_ore_block`: BlockState - `filler_block`: BlockState - `raw_ore_chance`: number 0..1 - `density`: DensityFunctionRef - `richness`: DensityFunctionRef - `filler_gap`: DensityFunctionRef ## Sequence ``` Sequence(sequence: [MaterialRuleRef]) ``` Makes `minecraft:sequence`. Tries each rule in order and stops at the first one that places a block. A list `[a, b]`, or several rules in an `If { }` body, makes the same thing. - `sequence`: list of MaterialRuleRef. The rules, in order. ```mms SurfaceRule top = [ If(StoneDepth(Floor)) { Block(grass_block) }, Block(dirt), ] ``` # Nbt provider Helpers that build a `minecraft:nbt_provider` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Context ``` Context(target: NbtContextTarget) ``` Makes `minecraft:context`. - `target`: NbtContextTarget ## Storage ``` Storage(source: storage id) ``` Makes `minecraft:storage`. - `source`: storage id # Placement modifier Helpers that build a `minecraft:placement_modifier` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Biome ``` Biome() ``` Makes `minecraft:biome`. Drops positions whose biome doesn't list this feature. Vanilla ends most placements with it. ## BlockPredicateFilter ``` BlockPredicateFilter(predicate: BlockPredicate) ``` Makes `minecraft:block_predicate_filter`. Keeps positions where a block predicate passes, such as `Solid()` or `MatchingBlocks(air)`. - `predicate`: BlockPredicate ## Count ``` Count(count: IntProvider) ``` Makes `minecraft:count`. Repeats each position `count` times. Follow it with `InSquare()` to spread the copies over the chunk. - `count`: IntProvider of int 0..4096. How many: a number, or a range such as `2..5`. ```mms PlacedFeature trees { feature = minecraft:oak, placement = [Count(3), InSquare(), Heightmap(WORLD_SURFACE_WG), Biome()] } ``` ## CountOnEveryLayer ``` CountOnEveryLayer(count: IntProvider) ``` Makes `minecraft:count_on_every_layer`. Places `count` positions on each layer of the terrain, from the top down, so features appear under overhangs too. Vanilla nether forests use it. - `count`: IntProvider of int 0..256 ## Cuboid ``` Cuboid(xz_size: IntProvider, y_size: IntProvider, include_interior?: bool, include_edges?: bool) ``` Makes `minecraft:cuboid`. - `xz_size`: IntProvider of int 1..16 - `y_size`: IntProvider of int 1..16 - `include_interior`: bool (optional). Defaults to `true`. - `include_edges`: bool (optional). Defaults to `true`. ## EnvironmentScan ``` EnvironmentScan(direction_of_search: VerticalDirection, max_steps: int, target_condition: BlockPredicate, allowed_search_condition?: BlockPredicate) ``` Makes `minecraft:environment_scan`. Moves each position up or down, at most `max_steps` blocks, until `target_condition` passes. Drops it if nothing is found. - `direction_of_search`: VerticalDirection. `up` or `down`. - `max_steps`: int 1..32. How far to search, in blocks. - `target_condition`: BlockPredicate. The block predicate to search for. - `allowed_search_condition`: BlockPredicate (optional). The scan stops if a block on the way fails this. ## FixedPlacement ``` FixedPlacement(positions: [[int]]) ``` Makes `minecraft:fixed_placement`. Replaces each position with a fixed list of positions. - `positions`: list of (list of int (exactly 3)). Fixed list of block positions to place the feature at. ## HeightRange ``` HeightRange(height: HeightProvider) ``` Makes `minecraft:height_range`. Sets each position's Y to a height picked by a height provider. - `height`: HeightProvider. The height, such as `Uniform(AboveBottom(0), Absolute(64))`. ## Heightmap ``` Heightmap(heightmap: HeightmapType) ``` Makes `minecraft:heightmap`. Moves each position up or down onto the surface of a heightmap, such as `WORLD_SURFACE_WG` for the top block or `OCEAN_FLOOR_WG` for the sea floor. - `heightmap`: HeightmapType. Which surface to use. ## InSquare ``` InSquare() ``` Makes `minecraft:in_square`. Moves each position to a random x and z within its chunk. ## NoiseBasedCount ``` NoiseBasedCount(noise_to_count_ratio: int, noise_factor: float, noise_offset?: float) ``` Makes `minecraft:noise_based_count`. Repeats each position a number of times that follows a noise, so features cluster in some areas. The count is `ceil((noise + noise_offset) * noise_to_count_ratio)`. - `noise_to_count_ratio`: int. Multiplies the noise to get the count. - `noise_factor`: number. Divides x and z before sampling; larger values give larger clusters. - `noise_offset`: number (optional) ## NoiseThresholdCount ``` NoiseThresholdCount(noise_level: float, below_noise: int, above_noise: int) ``` Makes `minecraft:noise_threshold_count`. Repeats each position `below_noise` times where a noise is below `noise_level`, and `above_noise` times where it is above. - `noise_level`: number - `below_noise`: int - `above_noise`: int ## Offset ``` Offset(x: IntProvider, y: IntProvider, z: IntProvider) ``` Makes `minecraft:offset`. Moves each position by the given number of blocks. - `x`: IntProvider of int -16..16 - `y`: IntProvider of int -16..16 - `z`: IntProvider of int -16..16 ## RandomChance ``` RandomChance(chance: float) ``` Makes `minecraft:random_chance`. Keeps each position with probability `chance`, from 0 to 1. - `chance`: number 0..1 ## RandomlySelected ``` RandomlySelected(placements: [PlacementModifier]) ``` Makes `minecraft:randomly_selected`. - `placements`: list of PlacementModifier (at least 1) ## RarityFilter ``` RarityFilter(chance: int) ``` Makes `minecraft:rarity_filter`. Keeps each position with a chance of 1 in `chance`. - `chance`: int 0... Keep one position in this many, on average. ```mms PlacedFeature rare_rocks { feature = minecraft:forest_rock, placement = [RarityFilter(16), InSquare(), Heightmap(MOTION_BLOCKING), Biome()] } ``` ## SurfaceRelativeThresholdFilter ``` SurfaceRelativeThresholdFilter(heightmap: HeightmapType, min_inclusive?: int, max_inclusive?: int) ``` Makes `minecraft:surface_relative_threshold_filter`. Keeps positions whose Y, measured from a heightmap's surface, is from `min_inclusive` to `max_inclusive`. - `heightmap`: HeightmapType - `min_inclusive`: int (optional) - `max_inclusive`: int (optional) ## SurfaceWaterDepthFilter ``` SurfaceWaterDepthFilter(max_water_depth: int) ``` Makes `minecraft:surface_water_depth_filter`. Keeps positions where the water above the surface is at most `max_water_depth` blocks deep. - `max_water_depth`: int # Pos rule test Helpers that build a `minecraft:pos_rule_test` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## AlwaysTrue ``` AlwaysTrue() ``` Makes `minecraft:always_true`. ## AxisAlignedLinearPos ``` AxisAlignedLinearPos(axis?: Axis, min_dist?: int, max_dist?: int, min_chance?: float, max_chance?: float) ``` Makes `minecraft:axis_aligned_linear_pos`. - `axis`: Axis (optional). Defaults to `y`. - `min_dist`: int 0..255 (optional) - `max_dist`: int 0..255 (optional) - `min_chance`: number 0..1 (optional) - `max_chance`: number 0..1 (optional) ## LinearPos ``` LinearPos(min_dist?: int, max_dist?: int, min_chance?: float, max_chance?: float) ``` Makes `minecraft:linear_pos`. - `min_dist`: int 0..255 (optional) - `max_dist`: int 0..255 (optional) - `min_chance`: number 0..1 (optional) - `max_chance`: number 0..1 (optional) # Recipe serializer Helpers that build a `minecraft:recipe_serializer` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Blasting ``` Blasting(ingredient: Ingredient, result: ItemStackTemplate, cookingtime: int, show_notification?: bool, group?: string, category?: CookingBookCategory, experience?: float) ``` Makes `minecraft:blasting`. - `ingredient`: Ingredient - `result`: ItemStackTemplate - `cookingtime`: int. Hint: The "Normal" value for this is `200`. - `show_notification`: bool (optional). Determines if a notification is shown when unlocking this recipe. Defaults to `true`. - `group`: string (optional). Identifier to group multiple recipes in the recipe book. - `category`: CookingBookCategory (optional). Identifier for the category this goes in the recipe book. - `experience`: number (optional) ## Brewing ``` Brewing(input: PotionIngredient, reagent: PotionIngredient, output: ItemStackTemplate) ``` Makes `minecraft:brewing`. - `input`: PotionIngredient. The original potion. - `reagent`: PotionIngredient. The ingredient. - `output`: ItemStackTemplate ## CampfireCooking ``` CampfireCooking(ingredient: Ingredient, result: ItemStackTemplate, cookingtime: int, show_notification?: bool, group?: string, category?: CookingBookCategory, experience?: float) ``` Makes `minecraft:campfire_cooking`. - `ingredient`: Ingredient - `result`: ItemStackTemplate - `cookingtime`: int. Hint: The "Normal" value for this is `200`. - `show_notification`: bool (optional). Determines if a notification is shown when unlocking this recipe. Defaults to `true`. - `group`: string (optional). Identifier to group multiple recipes in the recipe book. - `category`: CookingBookCategory (optional). Identifier for the category this goes in the recipe book. - `experience`: number (optional) ## CraftingDecoratedPot ``` CraftingDecoratedPot(back: Ingredient, left: Ingredient, right: Ingredient, front: Ingredient, result: ItemStackTemplate) ``` Makes `minecraft:crafting_decorated_pot`. - `back`: Ingredient - `left`: Ingredient - `right`: Ingredient - `front`: Ingredient - `result`: ItemStackTemplate. The `pot_decorations` component will store the 4 ingredients. ## CraftingDye ``` CraftingDye(target: Ingredient, dye: Ingredient, result: ItemStackTemplate, show_notification?: bool, group?: string, category?: CraftingBookCategory) ``` Makes `minecraft:crafting_dye`. - `target`: Ingredient. The item to be dyed. Its `dyed_color` component will be dyed. The other components are copied. - `dye`: Ingredient. The items to provide dye color. Colors are provided by the `dye` component. Multiple dyes can be used at the same time. - `result`: ItemStackTemplate - `show_notification`: bool (optional). Determines if a notification is shown when unlocking this recipe. Defaults to `true`. - `group`: string (optional). Identifier to group multiple recipes in the recipe book. - `category`: CraftingBookCategory (optional). Identifier for the category this goes in the recipe book. ## CraftingImbue ``` CraftingImbue(source: Ingredient, material: Ingredient, result: ItemStackTemplate, show_notification?: bool, group?: string, category?: CraftingBookCategory) ``` Makes `minecraft:crafting_imbue`. - `source`: Ingredient. The item to provide potion effect. Its `potion_contents` component will be copied. This item is placed at the center grid. - `material`: Ingredient. Additional ingredients. 8 `material` items are required to surroud the `source` item. - `result`: ItemStackTemplate - `show_notification`: bool (optional). Determines if a notification is shown when unlocking this recipe. Defaults to `true`. - `group`: string (optional). Identifier to group multiple recipes in the recipe book. - `category`: CraftingBookCategory (optional). Identifier for the category this goes in the recipe book. ## CraftingSpecialBannerduplicate ``` CraftingSpecialBannerduplicate(banner: Ingredient, result: ItemStackTemplate) ``` Makes `minecraft:crafting_special_bannerduplicate`. - `banner`: Ingredient. The banner item. The item type is required to be `BannerItem`. Exactly 2 banners of the same color are required. The one with patterns is viewed as "source". Its components will be copied. The other is viewed as "target". It is required to have no patterns. The source banner will be kept in the crafting grid. - `result`: ItemStackTemplate ## CraftingSpecialBookcloning ``` CraftingSpecialBookcloning(source: Ingredient, material: Ingredient, result: ItemStackTemplate, allowed_generations?: MinMaxBounds) ``` Makes `minecraft:crafting_special_bookcloning`. - `source`: Ingredient. The book item. Its `written_book_contents` component will be copied, with `generation` value increased by 1. The other components are copied as-is. The book will be kept in the crafting grid. - `material`: Ingredient. Additional ingredients. Multiple materials can be used at the same time. The number of materials beyond the first one will be added to the result count. - `result`: ItemStackTemplate - `allowed_generations`: MinMaxBounds of int 0..2 (optional). Limits the generation of the `source` item that can be copied. Defaults to allow generation 0 and 1 (original and first copy). ## CraftingSpecialFireworkRocket ``` CraftingSpecialFireworkRocket(shell: Ingredient, fuel: Ingredient, star: Ingredient, result: ItemStackTemplate) ``` Makes `minecraft:crafting_special_firework_rocket`. - `shell`: Ingredient. Additional ingredient. Exactly 1 additional ingredient is required. - `fuel`: Ingredient. The fuel ingredient. The count of fuel ingredients controls the `flight_duration` field. Only 1 ~ 3 fuels are allowed. - `star`: Ingredient. The firework star ingredient. Provides explosion data by the `firework_explosion` component. Any count of stars (including 0) are allowed. - `result`: ItemStackTemplate. The `fireworks` component is controlled by `fuel` and `star`. ## CraftingSpecialFireworkStar ``` CraftingSpecialFireworkStar(trail: Ingredient, twinkle: Ingredient, fuel: Ingredient, dye: Ingredient, shapes: object, result: ItemStackTemplate) ``` Makes `minecraft:crafting_special_firework_star`. - `trail`: Ingredient. If this ingredient is provided, the result will have `has_trail` field set. - `twinkle`: Ingredient. If this ingredient is provided, the result will have `has_twinkle` field set. - `fuel`: Ingredient. Additional ingredient. Exactly 1 additional ingredient is required. - `dye`: Ingredient. The items to provide explosion color. Colors are provided by the `dye` component. Multiple dyes can be used at the same time. - `shapes`: map of FireworkShape to Ingredient. If one of the ingredients is provided, the result will have the corresponding `shape` value. If no shape ingredient is provided, the shape will be `small_ball`. - `result`: ItemStackTemplate. The `firework_explosion` component is controlled by the ingredients. ## CraftingSpecialFireworkStarFade ``` CraftingSpecialFireworkStarFade(target: Ingredient, dye: Ingredient, result: ItemStackTemplate) ``` Makes `minecraft:crafting_special_firework_star_fade`. - `target`: Ingredient. The firework star item. The fade effect of its `firework_explosion` will be changed. The other components are copied. - `dye`: Ingredient. The items to provide fade color. Colors are provided by the `dye` component. Multiple dyes can be used at the same time. - `result`: ItemStackTemplate ## CraftingSpecialMapextending ``` CraftingSpecialMapextending(map: Ingredient, material: Ingredient, result: ItemStackTemplate) ``` Makes `minecraft:crafting_special_mapextending`. - `map`: Ingredient. The map item. The `map_id` component is used to determine the resulting item. The other components are copied. This item is placed at the center grid. The source map will be kept in the crafting grid. - `material`: Ingredient. Additional ingredients. 8 `material` items are required to surroud the `map` item. - `result`: ItemStackTemplate. The previewing result will have `map_post_processing` transient component. The crafted result will have a new `map_id` component, which shows the extended version of the original map. ## CraftingSpecialRepairitem ``` CraftingSpecialRepairitem() ``` Makes `minecraft:crafting_special_repairitem`. ## CraftingSpecialShielddecoration ``` CraftingSpecialShielddecoration(target: Ingredient, banner: Ingredient, result: ItemStackTemplate) ``` Makes `minecraft:crafting_special_shielddecoration`. - `target`: Ingredient. The item to be decorated. It is required to have no patterns. Its components, except `base_color` and `banner_patterns`, are copied. - `banner`: Ingredient. The banner item. The item type is required to be `BannerItem`. Determines the `base_color` component of the resulting item. - `result`: ItemStackTemplate ## CraftingTransmute ``` CraftingTransmute(input: Ingredient, material: Ingredient, result: TransmuteResult | item id, show_notification?: bool, group?: string, category?: CraftingBookCategory, material_count?: MinMaxBounds, add_material_count_to_result?: bool) ``` Makes `minecraft:crafting_transmute`. - `input`: Ingredient. The ingredient that will transfer its data components to the result item. - `material`: Ingredient. An additional ingredient. - `result`: TransmuteResult | item id. The result item that will be merged with the input ingredient. - `show_notification`: bool (optional). Determines if a notification is shown when unlocking this recipe. Defaults to `true`. - `group`: string (optional). Identifier to group multiple recipes in the recipe book. - `category`: CraftingBookCategory (optional). Identifier for the category this goes in the recipe book. - `material_count`: MinMaxBounds of int 1..8 (optional). The allowed count of material. Defaults to `1`. - `add_material_count_to_result`: bool (optional). When true, the number of materials will be added to the result count. Defaults to `false`. ## Shaped ``` Shaped(pattern: [string], key: object, result: ItemStackTemplate) ``` Makes `minecraft:crafting_shaped`. - `pattern`: list of string (1 to 3) (1 to 3) - `key`: map of string to Ingredient - `result`: ItemStackTemplate ## Shapeless ``` Shapeless(ingredients: [Ingredient], result: ItemStackTemplate) ``` Makes `minecraft:crafting_shapeless`. - `ingredients`: list of Ingredient (1 to 9) - `result`: ItemStackTemplate ## Smelting ``` Smelting(ingredient: Ingredient, result: ItemStackTemplate, cookingtime: int, show_notification?: bool, group?: string, category?: CookingBookCategory, experience?: float) ``` Makes `minecraft:smelting`. - `ingredient`: Ingredient - `result`: ItemStackTemplate - `cookingtime`: int. Hint: The "Normal" value for this is `200`. - `show_notification`: bool (optional). Determines if a notification is shown when unlocking this recipe. Defaults to `true`. - `group`: string (optional). Identifier to group multiple recipes in the recipe book. - `category`: CookingBookCategory (optional). Identifier for the category this goes in the recipe book. - `experience`: number (optional) ## SmithingTransform ``` SmithingTransform(base: Ingredient, result: ItemStackTemplate, show_notification?: bool, addition?: Ingredient, template?: Ingredient) ``` Makes `minecraft:smithing_transform`. - `base`: Ingredient. Ingredient specifying an item to be transformed. - `result`: ItemStackTemplate. Resulting transformed item. - `show_notification`: bool (optional). Determines if a notification is shown when unlocking this recipe. Defaults to `true`. - `addition`: Ingredient (optional). Material that will be used. - `template`: Ingredient (optional). Template item that will be used for the pattern. ## SmithingTrim ``` SmithingTrim(base: Ingredient, addition: Ingredient, template: Ingredient, pattern: trim_pattern id, show_notification?: bool) ``` Makes `minecraft:smithing_trim`. - `base`: Ingredient. Ingredient specifying an item to be trimmed. - `addition`: Ingredient. Material that will be used. - `template`: Ingredient. Template item that will be used for the pattern. - `pattern`: trim_pattern id. The trim pattern to apply to the result item. - `show_notification`: bool (optional). Determines if a notification is shown when unlocking this recipe. Defaults to `true`. ## Smoking ``` Smoking(ingredient: Ingredient, result: ItemStackTemplate, cookingtime: int, show_notification?: bool, group?: string, category?: CookingBookCategory, experience?: float) ``` Makes `minecraft:smoking`. - `ingredient`: Ingredient - `result`: ItemStackTemplate - `cookingtime`: int. Hint: The "Normal" value for this is `200`. - `show_notification`: bool (optional). Determines if a notification is shown when unlocking this recipe. Defaults to `true`. - `group`: string (optional). Identifier to group multiple recipes in the recipe book. - `category`: CookingBookCategory (optional). Identifier for the category this goes in the recipe book. - `experience`: number (optional) ## Stonecutting ``` Stonecutting(ingredient: Ingredient, result: ItemStackTemplate, show_notification?: bool) ``` Makes `minecraft:stonecutting`. - `ingredient`: Ingredient - `result`: ItemStackTemplate - `show_notification`: bool (optional). Determines if a notification is shown when unlocking this recipe. Defaults to `true`. # Root placer Helpers that build a `minecraft:root_placer` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## MangroveRootPlacer ``` MangroveRootPlacer(root_provider: BlockStateProviderRef, trunk_offset_y: IntProvider, mangrove_root_placement: MangroveRootPlacement, above_root_placement?: AboveRootPlacement) ``` Makes `minecraft:mangrove_root_placer`. - `root_provider`: BlockStateProviderRef - `trunk_offset_y`: IntProvider of int - `mangrove_root_placement`: MangroveRootPlacement - `above_root_placement`: AboveRootPlacement (optional) # Rule block entity modifier Helpers that build a `minecraft:rule_block_entity_modifier` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## AppendLoot ``` AppendLoot(loot_table: loot_table id) ``` Makes `minecraft:append_loot`. - `loot_table`: loot_table id ## AppendStatic ``` AppendStatic(data: object) ``` Makes `minecraft:append_static`. - `data`: object ## Clear ``` Clear() ``` Makes `minecraft:clear`. ## Passthrough ``` Passthrough() ``` Makes `minecraft:passthrough`. # Rule test Helpers that build a `minecraft:rule_test` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## AllOf ``` AllOf(rules: [RuleTest]) ``` Makes `minecraft:all_of`. - `rules`: list of RuleTest ## AlwaysTrue ``` AlwaysTrue() ``` Makes `minecraft:always_true`. Always passes. ## AnyOf ``` AnyOf(rules: [RuleTest]) ``` Makes `minecraft:any_of`. - `rules`: list of RuleTest ## BlockMatch ``` BlockMatch(block: block id) ``` Makes `minecraft:block_match`. Passes when the block is this block. - `block`: block id ## BlockstateMatch ``` BlockstateMatch(block_state: BlockState) ``` Makes `minecraft:blockstate_match`. Passes when the block is exactly this block state. - `block_state`: BlockState ## HeightMatch ``` HeightMatch(min_inclusive: int, max_inclusive: int) ``` Makes `minecraft:height_match`. - `min_inclusive`: int - `max_inclusive`: int ## Not ``` Not(rule: RuleTest) ``` Makes `minecraft:not`. - `rule`: RuleTest ## RandomBlockMatch ``` RandomBlockMatch(block: block id, probability: float) ``` Makes `minecraft:random_block_match`. Passes when the block is this block, with probability `probability`. - `block`: block id - `probability`: number 0..1 ## RandomBlockstateMatch ``` RandomBlockstateMatch(block_state: BlockState, probability: float) ``` Makes `minecraft:random_blockstate_match`. Passes when the block is exactly this block state, with probability `probability`. - `block_state`: BlockState - `probability`: number 0..1 ## TagMatch ``` TagMatch(tag: block id) ``` Makes `minecraft:tag_match`. Passes when the block is in this block tag. Vanilla ores test `#stone_ore_replaceables` this way. - `tag`: block id | #block tag # Score provider Helpers that build a `minecraft:score_provider` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Context ``` Context(target: EntityTarget) ``` Makes `minecraft:context`. - `target`: EntityTarget ## Fixed ``` Fixed(name: string) ``` Makes `minecraft:fixed`. - `name`: string # Slot source Helpers that build a `minecraft:slot_source` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Contents ``` Contents(slot_source: SlotSource, component: ContainerComponents) ``` Makes `minecraft:contents`. - `slot_source`: SlotSource. The slots to search. - `component`: ContainerComponents. If an item targeted by `slot_source` has this container component, selects all items inside. ## Empty ``` Empty() ``` Makes `minecraft:empty`. ## Filtered ``` Filtered(slot_source: SlotSource, item_filter: ItemPredicate) ``` Makes `minecraft:filtered`. - `slot_source`: SlotSource - `item_filter`: ItemPredicate ## Group ``` Group(terms: SlotSource) ``` Makes `minecraft:group`. - `terms`: SlotSource ## LimitSlots ``` LimitSlots(slot_source: SlotSource, limit: int) ``` Makes `minecraft:limit_slots`. - `slot_source`: SlotSource - `limit`: int 1.. ## SlotRange ``` SlotRange(slots: string, source?: EntityTarget | BlockEntityTarget | "container") ``` Makes `minecraft:slot_range`. - `slots`: string - `source`: EntityTarget | BlockEntityTarget | "container" (optional). Defaults to `container`. # Spawn condition Helpers that build a `minecraft:spawn_condition` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Biome ``` Biome(biomes: biome id | [biome id]) ``` Makes `minecraft:biome`. - `biomes`: biome id | #biome tag | list of biome ids. Checks if the entity is spawning in specific biomes. ## MoonBrightness ``` MoonBrightness(range: MinMaxBounds) ``` Makes `minecraft:moon_brightness`. - `range`: MinMaxBounds of number. Checks if the current moon brightness is within a certain range. ## Structure ``` Structure(structures: structure id | [structure id]) ``` Makes `minecraft:structure`. - `structures`: structure id | #structure tag | list of structure ids. Checks if the entity is spawning in specific structures. # Special item model Helpers that build a `minecraft:special_item_model` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Banner ``` Banner(color: DyeColor, attachment?: BannerAttachment) ``` Makes `minecraft:banner`. - `color`: DyeColor - `attachment`: BannerAttachment (optional). Defaults to `ground`. ## Bell ``` Bell() ``` Makes `minecraft:bell`. ## Book ``` Book(open_angle: float, page1: float, page2: float) ``` Makes `minecraft:book`. - `open_angle`: number. Angle in degrees between book cover and book centerline. `0.0` for closed, `90.0` for open flat. - `page1`: number. The position of the first page inside the book. `0.0` for leftmost, `1.0` for rightmost. - `page2`: number. The position of the second page inside the book. `0.0` for leftmost, `1.0` for rightmost. ## Chest ``` Chest(texture: texture id, openness?: float, chest_type?: ChestType) ``` Makes `minecraft:chest`. - `texture`: texture id - `openness`: number 0..1 (optional). Defaults to `0`. - `chest_type`: ChestType (optional). Defaults to `single`. ## Conduit ``` Conduit() ``` Makes `minecraft:conduit`. ## CopperGolemStatue ``` CopperGolemStatue(pose: CopperGolemStatuePose, texture: string) ``` Makes `minecraft:copper_golem_statue`. - `pose`: CopperGolemStatuePose - `texture`: string ## DecoratedPot ``` DecoratedPot() ``` Makes `minecraft:decorated_pot`. ## EndCube ``` EndCube(effect: EndCubeEffectType) ``` Makes `minecraft:end_cube`. - `effect`: EndCubeEffectType ## Head ``` Head(kind: HeadType, texture?: texture id, animation?: float) ``` Makes `minecraft:head`. - `kind`: HeadType - `texture`: texture id (optional). Texture to use instead of the texture from `kind`. - `animation`: number (optional). Controls the animation time for piglin and dragon heads. Defaults to `0`. ## PlayerHead ``` PlayerHead() ``` Makes `minecraft:player_head`. ## Shield ``` Shield() ``` Makes `minecraft:shield`. ## ShulkerBox ``` ShulkerBox(texture: texture id, openness?: float) ``` Makes `minecraft:shulker_box`. - `texture`: texture id - `openness`: number 0..1 (optional) ## Trident ``` Trident() ``` Makes `minecraft:trident`. # Sprite source Helpers that build a `minecraft:sprite_source` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Directory ``` Directory(source: string, prefix: string) ``` Makes `minecraft:directory`. - `source`: string. Directory of texture locations to include, relative to the `textures` folder, not including the trailing `/`. - `prefix`: string. The sprite name prefix, usually ending with `/`. ## Filter ``` Filter(pattern: FilterPattern) ``` Makes `minecraft:filter`. - `pattern`: FilterPattern. Pattern to remove sprite identifiers already in the atlas. The order of sprite sources is important. ## PalettedPermutations ``` PalettedPermutations(textures: [texture id], palette_key: PaletteTexture, permutations: object, separator?: string) ``` Makes `minecraft:paletted_permutations`. - `textures`: list of texture ids - `palette_key`: PaletteTexture - `permutations`: map of string to PaletteTexture - `separator`: string (optional). Value to use when joining the texture and permutation names to produce the sprite name. Defaults to `_`. ## Single ``` Single(resource: texture id, sprite?: texture id) ``` Makes `minecraft:single`. - `resource`: texture id. A single texture location of the source. - `sprite`: texture id (optional). The identifier of the sprite that can referenced. If not specified, matches `resource`. ## Unstitch ``` Unstitch(resource: texture id, regions: [UnstitchRegion], divisor_x?: float, divisor_y?: float) ``` Makes `minecraft:unstitch`. - `resource`: texture id - `regions`: list of UnstitchRegion - `divisor_x`: number (optional). If set to the resource width, regions will use pixel coordinates. - `divisor_y`: number (optional). If set to the resource height, regions will use pixel coordinates. # Structure config Helpers that build a `minecraft:structure_config` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## BastionRemnant ``` BastionRemnant(biomes: [biome id] | biome id, step: DecorationStep, spawn_overrides: object, start_pool: template_pool id, size: int, start_height: HeightProvider, max_distance_from_center: value, use_expansion_hack: bool, terrain_adaptation?: TerrainAdaptation, start_jigsaw_name?: string, project_start_to_heightmap?: HeightmapType, pool_aliases?: [PoolAlias], dimension_padding?: int | object, liquid_settings?: LiquidSettings) ``` Makes `minecraft:bastion_remnant`. - `biomes`: biome id | #biome tag | list of biome ids - `step`: DecorationStep. The step when the structure generates. - `spawn_overrides`: map of MobCategory to SpawnOverride - `start_pool`: template_pool id - `size`: int 1..20 - `start_height`: HeightProvider - `max_distance_from_center`: any (depends on terrain_adaptation) - `use_expansion_hack`: bool - `terrain_adaptation`: TerrainAdaptation (optional) - `start_jigsaw_name`: id (optional) - `project_start_to_heightmap`: HeightmapType (optional) - `pool_aliases`: list of PoolAlias (optional) - `dimension_padding`: int 0.. | { bottom?: int 0.., top?: int 0.. } (optional) - `liquid_settings`: LiquidSettings (optional) ## BuriedTreasure ``` BuriedTreasure(biomes: [biome id] | biome id, step: DecorationStep, spawn_overrides: object, terrain_adaptation?: TerrainAdaptation) ``` Makes `minecraft:buried_treasure`. - `biomes`: biome id | #biome tag | list of biome ids - `step`: DecorationStep. The step when the structure generates. - `spawn_overrides`: map of MobCategory to SpawnOverride - `terrain_adaptation`: TerrainAdaptation (optional) ## DesertPyramid ``` DesertPyramid(biomes: [biome id] | biome id, step: DecorationStep, spawn_overrides: object, terrain_adaptation?: TerrainAdaptation) ``` Makes `minecraft:desert_pyramid`. - `biomes`: biome id | #biome tag | list of biome ids - `step`: DecorationStep. The step when the structure generates. - `spawn_overrides`: map of MobCategory to SpawnOverride - `terrain_adaptation`: TerrainAdaptation (optional) ## EndCity ``` EndCity(biomes: [biome id] | biome id, step: DecorationStep, spawn_overrides: object, terrain_adaptation?: TerrainAdaptation) ``` Makes `minecraft:end_city`. - `biomes`: biome id | #biome tag | list of biome ids - `step`: DecorationStep. The step when the structure generates. - `spawn_overrides`: map of MobCategory to SpawnOverride - `terrain_adaptation`: TerrainAdaptation (optional) ## Fortress ``` Fortress(biomes: [biome id] | biome id, step: DecorationStep, spawn_overrides: object, terrain_adaptation?: TerrainAdaptation) ``` Makes `minecraft:fortress`. - `biomes`: biome id | #biome tag | list of biome ids - `step`: DecorationStep. The step when the structure generates. - `spawn_overrides`: map of MobCategory to SpawnOverride - `terrain_adaptation`: TerrainAdaptation (optional) ## Igloo ``` Igloo(biomes: [biome id] | biome id, step: DecorationStep, spawn_overrides: object, terrain_adaptation?: TerrainAdaptation) ``` Makes `minecraft:igloo`. - `biomes`: biome id | #biome tag | list of biome ids - `step`: DecorationStep. The step when the structure generates. - `spawn_overrides`: map of MobCategory to SpawnOverride - `terrain_adaptation`: TerrainAdaptation (optional) ## Jigsaw ``` Jigsaw(biomes: [biome id] | biome id, step: DecorationStep, spawn_overrides: object, start_pool: template_pool id, size: int, start_height: HeightProvider, max_distance_from_center: value, use_expansion_hack: bool, terrain_adaptation?: TerrainAdaptation, start_jigsaw_name?: string, project_start_to_heightmap?: HeightmapType, pool_aliases?: [PoolAlias], dimension_padding?: int | object, liquid_settings?: LiquidSettings) ``` Makes `minecraft:jigsaw`. - `biomes`: biome id | #biome tag | list of biome ids - `step`: DecorationStep. The step when the structure generates. - `spawn_overrides`: map of MobCategory to SpawnOverride - `start_pool`: template_pool id - `size`: int 1..20 - `start_height`: HeightProvider - `max_distance_from_center`: any (depends on terrain_adaptation) - `use_expansion_hack`: bool - `terrain_adaptation`: TerrainAdaptation (optional) - `start_jigsaw_name`: id (optional) - `project_start_to_heightmap`: HeightmapType (optional) - `pool_aliases`: list of PoolAlias (optional) - `dimension_padding`: int 0.. | { bottom?: int 0.., top?: int 0.. } (optional) - `liquid_settings`: LiquidSettings (optional) ## JungleTemple ``` JungleTemple(biomes: [biome id] | biome id, step: DecorationStep, spawn_overrides: object, terrain_adaptation?: TerrainAdaptation) ``` Makes `minecraft:jungle_temple`. - `biomes`: biome id | #biome tag | list of biome ids - `step`: DecorationStep. The step when the structure generates. - `spawn_overrides`: map of MobCategory to SpawnOverride - `terrain_adaptation`: TerrainAdaptation (optional) ## Mineshaft ``` Mineshaft(biomes: [biome id] | biome id, step: DecorationStep, spawn_overrides: object, mineshaft_type: MineshaftType, terrain_adaptation?: TerrainAdaptation) ``` Makes `minecraft:mineshaft`. - `biomes`: biome id | #biome tag | list of biome ids - `step`: DecorationStep. The step when the structure generates. - `spawn_overrides`: map of MobCategory to SpawnOverride - `mineshaft_type`: MineshaftType - `terrain_adaptation`: TerrainAdaptation (optional) ## NetherFossil ``` NetherFossil(biomes: [biome id] | biome id, step: DecorationStep, spawn_overrides: object, height: HeightProvider, terrain_adaptation?: TerrainAdaptation) ``` Makes `minecraft:nether_fossil`. - `biomes`: biome id | #biome tag | list of biome ids - `step`: DecorationStep. The step when the structure generates. - `spawn_overrides`: map of MobCategory to SpawnOverride - `height`: HeightProvider - `terrain_adaptation`: TerrainAdaptation (optional) ## OceanMonument ``` OceanMonument(biomes: [biome id] | biome id, step: DecorationStep, spawn_overrides: object, terrain_adaptation?: TerrainAdaptation) ``` Makes `minecraft:ocean_monument`. - `biomes`: biome id | #biome tag | list of biome ids - `step`: DecorationStep. The step when the structure generates. - `spawn_overrides`: map of MobCategory to SpawnOverride - `terrain_adaptation`: TerrainAdaptation (optional) ## OceanRuin ``` OceanRuin(biomes: [biome id] | biome id, step: DecorationStep, spawn_overrides: object, biome_temp: BiomeTemperature, large_probability: float, cluster_probability: float, terrain_adaptation?: TerrainAdaptation) ``` Makes `minecraft:ocean_ruin`. - `biomes`: biome id | #biome tag | list of biome ids - `step`: DecorationStep. The step when the structure generates. - `spawn_overrides`: map of MobCategory to SpawnOverride - `biome_temp`: BiomeTemperature - `large_probability`: number 0..1 - `cluster_probability`: number 0..1 - `terrain_adaptation`: TerrainAdaptation (optional) ## PillagerOutpost ``` PillagerOutpost(biomes: [biome id] | biome id, step: DecorationStep, spawn_overrides: object, start_pool: template_pool id, size: int, start_height: HeightProvider, max_distance_from_center: value, use_expansion_hack: bool, terrain_adaptation?: TerrainAdaptation, start_jigsaw_name?: string, project_start_to_heightmap?: HeightmapType, pool_aliases?: [PoolAlias], dimension_padding?: int | object, liquid_settings?: LiquidSettings) ``` Makes `minecraft:pillager_outpost`. - `biomes`: biome id | #biome tag | list of biome ids - `step`: DecorationStep. The step when the structure generates. - `spawn_overrides`: map of MobCategory to SpawnOverride - `start_pool`: template_pool id - `size`: int 1..20 - `start_height`: HeightProvider - `max_distance_from_center`: any (depends on terrain_adaptation) - `use_expansion_hack`: bool - `terrain_adaptation`: TerrainAdaptation (optional) - `start_jigsaw_name`: id (optional) - `project_start_to_heightmap`: HeightmapType (optional) - `pool_aliases`: list of PoolAlias (optional) - `dimension_padding`: int 0.. | { bottom?: int 0.., top?: int 0.. } (optional) - `liquid_settings`: LiquidSettings (optional) ## RuinedPortal ``` RuinedPortal(biomes: [biome id] | biome id, step: DecorationStep, spawn_overrides: object, setups: [RuinedPortalSetup], terrain_adaptation?: TerrainAdaptation) ``` Makes `minecraft:ruined_portal`. - `biomes`: biome id | #biome tag | list of biome ids - `step`: DecorationStep. The step when the structure generates. - `spawn_overrides`: map of MobCategory to SpawnOverride - `setups`: list of RuinedPortalSetup - `terrain_adaptation`: TerrainAdaptation (optional) ## Shipwreck ``` Shipwreck(biomes: [biome id] | biome id, step: DecorationStep, spawn_overrides: object, terrain_adaptation?: TerrainAdaptation, is_beached?: bool) ``` Makes `minecraft:shipwreck`. - `biomes`: biome id | #biome tag | list of biome ids - `step`: DecorationStep. The step when the structure generates. - `spawn_overrides`: map of MobCategory to SpawnOverride - `terrain_adaptation`: TerrainAdaptation (optional) - `is_beached`: bool (optional) ## Stronghold ``` Stronghold(biomes: [biome id] | biome id, step: DecorationStep, spawn_overrides: object, terrain_adaptation?: TerrainAdaptation) ``` Makes `minecraft:stronghold`. - `biomes`: biome id | #biome tag | list of biome ids - `step`: DecorationStep. The step when the structure generates. - `spawn_overrides`: map of MobCategory to SpawnOverride - `terrain_adaptation`: TerrainAdaptation (optional) ## SwampHut ``` SwampHut(biomes: [biome id] | biome id, step: DecorationStep, spawn_overrides: object, terrain_adaptation?: TerrainAdaptation) ``` Makes `minecraft:swamp_hut`. - `biomes`: biome id | #biome tag | list of biome ids - `step`: DecorationStep. The step when the structure generates. - `spawn_overrides`: map of MobCategory to SpawnOverride - `terrain_adaptation`: TerrainAdaptation (optional) ## Village ``` Village(biomes: [biome id] | biome id, step: DecorationStep, spawn_overrides: object, start_pool: template_pool id, size: int, start_height: HeightProvider, max_distance_from_center: value, use_expansion_hack: bool, terrain_adaptation?: TerrainAdaptation, start_jigsaw_name?: string, project_start_to_heightmap?: HeightmapType, pool_aliases?: [PoolAlias], dimension_padding?: int | object, liquid_settings?: LiquidSettings) ``` Makes `minecraft:village`. - `biomes`: biome id | #biome tag | list of biome ids - `step`: DecorationStep. The step when the structure generates. - `spawn_overrides`: map of MobCategory to SpawnOverride - `start_pool`: template_pool id - `size`: int 1..20 - `start_height`: HeightProvider - `max_distance_from_center`: any (depends on terrain_adaptation) - `use_expansion_hack`: bool - `terrain_adaptation`: TerrainAdaptation (optional) - `start_jigsaw_name`: id (optional) - `project_start_to_heightmap`: HeightmapType (optional) - `pool_aliases`: list of PoolAlias (optional) - `dimension_padding`: int 0.. | { bottom?: int 0.., top?: int 0.. } (optional) - `liquid_settings`: LiquidSettings (optional) ## WoodlandMansion ``` WoodlandMansion(biomes: [biome id] | biome id, step: DecorationStep, spawn_overrides: object, terrain_adaptation?: TerrainAdaptation) ``` Makes `minecraft:woodland_mansion`. - `biomes`: biome id | #biome tag | list of biome ids - `step`: DecorationStep. The step when the structure generates. - `spawn_overrides`: map of MobCategory to SpawnOverride - `terrain_adaptation`: TerrainAdaptation (optional) # Structure placement Helpers that build a `minecraft:structure_placement` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## ConcentricRings ``` ConcentricRings(salt: int, distance: int, spread: int, count: int, preferred_biomes: [biome id] | biome id, frequency_reduction_method?: FrequencyReductionMethod, frequency?: float, exclusion_zone?: ExclusionZone, locate_offset?: [int]) ``` Makes `minecraft:concentric_rings`. - `salt`: int 0.. - `distance`: int 0..1023 - `spread`: int 0..1023 - `count`: int 1..4095 - `preferred_biomes`: biome id | #biome tag | list of biome ids - `frequency_reduction_method`: FrequencyReductionMethod (optional) - `frequency`: number 0..1 (optional) - `exclusion_zone`: ExclusionZone (optional) - `locate_offset`: list of int -16..16 (exactly 3) (optional) ## DimensionOrigin ``` DimensionOrigin() ``` Makes `minecraft:dimension_origin`. ## RandomSpread ``` RandomSpread(salt: int, spacing: int, separation: int, frequency_reduction_method?: FrequencyReductionMethod, frequency?: float, exclusion_zone?: ExclusionZone, locate_offset?: [int], spread_type?: SpreadType) ``` Makes `minecraft:random_spread`. - `salt`: int 0.. - `spacing`: int 0..4096. Average distance in chunks between two structures of this type. - `separation`: int 0..4096. Minimum distance in chunks between two structures of this type. - `frequency_reduction_method`: FrequencyReductionMethod (optional) - `frequency`: number 0..1 (optional) - `exclusion_zone`: ExclusionZone (optional) - `locate_offset`: list of int -16..16 (exactly 3) (optional) - `spread_type`: SpreadType (optional) # Template pool element Helpers that build a `minecraft:template_pool_element` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## EmptyPoolElement ``` EmptyPoolElement() ``` Makes `minecraft:empty_pool_element`. ## FeaturePoolElement ``` FeaturePoolElement(projection: Projection, feature: PlacedFeatureRef) ``` Makes `minecraft:feature_pool_element`. - `projection`: Projection - `feature`: PlacedFeatureRef ## LegacySinglePoolElement ``` LegacySinglePoolElement(projection: Projection, location: structure id, processors: ProcessorListRef, override_liquid_settings?: LiquidSettings) ``` Makes `minecraft:legacy_single_pool_element`. - `projection`: Projection - `location`: structure id - `processors`: ProcessorListRef - `override_liquid_settings`: LiquidSettings (optional) ## ListPoolElement ``` ListPoolElement(projection: Projection, elements: [Element]) ``` Makes `minecraft:list_pool_element`. - `projection`: Projection - `elements`: list of Element ## SinglePoolElement ``` SinglePoolElement(projection: Projection, location: structure id, processors: ProcessorListRef, override_liquid_settings?: LiquidSettings) ``` Makes `minecraft:single_pool_element`. - `projection`: Projection - `location`: structure id - `processors`: ProcessorListRef - `override_liquid_settings`: LiquidSettings (optional) # Template processor Helpers that build a `minecraft:template_processor` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## BlackstoneReplace ``` BlackstoneReplace() ``` Makes `minecraft:blackstone_replace`. ## BlockAge ``` BlockAge(mossiness: float) ``` Makes `minecraft:block_age`. - `mossiness`: number ## BlockIgnore ``` BlockIgnore(blocks: [BlockState]) ``` Makes `minecraft:block_ignore`. - `blocks`: list of BlockState ## BlockRot ``` BlockRot(integrity: float, rottable_blocks?: [block id] | block id) ``` Makes `minecraft:block_rot`. - `integrity`: number 0..1 - `rottable_blocks`: block id | #block tag | list of block ids (optional) ## Capped ``` Capped(delegate: Processor, limit: IntProvider) ``` Makes `minecraft:capped`. - `delegate`: Processor - `limit`: IntProvider of int 0.. ## Gravity ``` Gravity(heightmap: HeightmapType, offset: int) ``` Makes `minecraft:gravity`. - `heightmap`: HeightmapType - `offset`: int ## JigsawReplacement ``` JigsawReplacement() ``` Makes `minecraft:jigsaw_replacement`. ## LavaSubmergedBlock ``` LavaSubmergedBlock() ``` Makes `minecraft:lava_submerged_block`. ## Nop ``` Nop() ``` Makes `minecraft:nop`. ## ProtectedBlocks ``` ProtectedBlocks(value: block id | [block id]) ``` Makes `minecraft:protected_blocks`. - `value`: block id | #block tag | list of block ids ## Rule ``` Rule(rules: [ProcessorRule]) ``` Makes `minecraft:rule`. - `rules`: list of ProcessorRule # Test environment definition Helpers that build a `minecraft:test_environment_definition` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## AllOf ``` AllOf(definitions: [TestEnvironment]) ``` Makes `minecraft:all_of`. - `definitions`: list of TestEnvironment ## ClockTime ``` ClockTime(clock: world_clock id, time: int) ``` Makes `minecraft:clock_time`. - `clock`: world_clock id - `time`: int 0.. ## Difficulty ``` Difficulty(difficulty: Difficulty) ``` Makes `minecraft:difficulty`. - `difficulty`: Difficulty ## Function ``` Function(setup?: function id, teardown?: function id) ``` Makes `minecraft:function`. - `setup`: function id (optional) - `teardown`: function id (optional) ## GameRules ``` GameRules(rules: object) ``` Makes `minecraft:game_rules`. - `rules`: map of game_rule id to any ## TimelineAttributes ``` TimelineAttributes(timelines: [timeline id]) ``` Makes `minecraft:timeline_attributes`. - `timelines`: list of timeline ids ## Weather ``` Weather(weather: Weather) ``` Makes `minecraft:weather`. - `weather`: Weather # Test instance Helpers that build a `minecraft:test_instance` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## BlockBased ``` BlockBased(environment: test_environment id | TestEnvironment, structure: structure id, max_ticks: int, dimension?: dimension id, setup_ticks?: int, required?: bool, rotation?: Rotation, manual_only?: bool, max_attempts?: int, required_successes?: int, sky_access?: bool, padding?: int) ``` Makes `minecraft:block_based`. - `environment`: test_environment id | TestEnvironment. The test environment to run this test as part of. - `structure`: structure id. Structure NBT file to use for the test. - `max_ticks`: int 1... Maximum number of ticks allowed to pass before the test is considered timed out. - `dimension`: dimension id (optional). Defaults to overworld. - `setup_ticks`: int 0.. (optional). Ticks to wait after placing the structure before starting the test. Defaults to `0`. - `required`: bool (optional). Whether the test is considered required to pass for the full test suite to pass. Defaults to `true`. - `rotation`: Rotation (optional). Rotation to apply to the test structure. Defaults to `none`. - `manual_only`: bool (optional). If `true`, test is not included as part of automated test runs. Defaults to `false`. - `max_attempts`: int 1.. (optional). Number of attempts to run the test. Defaults to `1`. - `required_successes`: int 1.. (optional). Number of attempts that must succeed for the test to be considered successful. Defaults to `1`. - `sky_access`: bool (optional). Whether the test needs clear access to the sky. Defaults to `false`. If `false`, test is enclosed in barrier blocks. If `true`, the top is left open. - `padding`: int 0..128 (optional). Additional padding in blocks placed around the structure. Defaults to `0`. ## Function ``` Function(environment: test_environment id | TestEnvironment, structure: structure id, max_ticks: int, function: test_function id, dimension?: dimension id, setup_ticks?: int, required?: bool, rotation?: Rotation, manual_only?: bool, max_attempts?: int, required_successes?: int, sky_access?: bool, padding?: int) ``` Makes `minecraft:function`. - `environment`: test_environment id | TestEnvironment. The test environment to run this test as part of. - `structure`: structure id. Structure NBT file to use for the test. - `max_ticks`: int 1... Maximum number of ticks allowed to pass before the test is considered timed out. - `function`: test_function id. Test function (Java code) to run. - `dimension`: dimension id (optional). Defaults to overworld. - `setup_ticks`: int 0.. (optional). Ticks to wait after placing the structure before starting the test. Defaults to `0`. - `required`: bool (optional). Whether the test is considered required to pass for the full test suite to pass. Defaults to `true`. - `rotation`: Rotation (optional). Rotation to apply to the test structure. Defaults to `none`. - `manual_only`: bool (optional). If `true`, test is not included as part of automated test runs. Defaults to `false`. - `max_attempts`: int 1.. (optional). Number of attempts to run the test. Defaults to `1`. - `required_successes`: int 1.. (optional). Number of attempts that must succeed for the test to be considered successful. Defaults to `1`. - `sky_access`: bool (optional). Whether the test needs clear access to the sky. Defaults to `false`. If `false`, test is enclosed in barrier blocks. If `true`, the top is left open. - `padding`: int 0..128 (optional). Additional padding in blocks placed around the structure. Defaults to `0`. # Tint source Helpers that build a `minecraft:tint_source` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Constant ``` Constant(value: RGB) ``` Makes `minecraft:constant`. - `value`: RGB. Constant tint color to apply. ## CustomModelData ``` CustomModelData(default: RGB, index?: int) ``` Makes `minecraft:custom_model_data`. - `default`: RGB. Tint to apply when the `custom_model_data` component is not present, or when it doesn't have a color in the specified index. - `index`: int 0.. (optional). The index of the `colors` list in the `custom_model_data` component. Defaults to 0. ## Dye ``` Dye(default: ActuallyTranslucentRGB) ``` Makes `minecraft:dye`. - `default`: ActuallyTranslucentRGB. Tint to apply when the `dyed_color` component is not present. ## Firework ``` Firework(default: ActuallyTranslucentRGB) ``` Makes `minecraft:firework`. - `default`: ActuallyTranslucentRGB. Tint to apply when the `firework_explosion` component is not present. ## Grass ``` Grass(temperature: float, downfall: float) ``` Makes `minecraft:grass`. - `temperature`: number 0..1 - `downfall`: number 0..1 ## MapColor ``` MapColor(default: RGB) ``` Makes `minecraft:map_color`. - `default`: RGB. Tint to apply when the `map_color` component is not present. ## Potion ``` Potion(default: RGB) ``` Makes `minecraft:potion`. - `default`: RGB. Tint to apply when the `potion_contents` component is not present, or it has no effects and no `custom_color` is set. ## Team ``` Team(default: RGB) ``` Makes `minecraft:team`. - `default`: RGB. Tint to apply when there is no context entity, entity is not in a team or the team has no color. # Tree decorator Helpers that build a `minecraft:tree_decorator` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## AlterGround ``` AlterGround(provider: BlockStateProviderRef) ``` Makes `minecraft:alter_ground`. - `provider`: BlockStateProviderRef ## AttachedToLeaves ``` AttachedToLeaves(probability: float, exclusion_radius_xz: int, exclusion_radius_y: int, required_empty_blocks: int, block_provider: BlockStateProviderRef, directions: [Direction]) ``` Makes `minecraft:attached_to_leaves`. - `probability`: number 0..1 - `exclusion_radius_xz`: int 0..16 - `exclusion_radius_y`: int 0..16 - `required_empty_blocks`: int 1..16 - `block_provider`: BlockStateProviderRef - `directions`: list of Direction (at least 1) ## AttachedToLogs ``` AttachedToLogs(probability: float, block_provider: BlockStateProviderRef, directions: [Direction]) ``` Makes `minecraft:attached_to_logs`. - `probability`: number 0..1 - `block_provider`: BlockStateProviderRef - `directions`: list of Direction (at least 1) ## Beehive ``` Beehive(probability: float) ``` Makes `minecraft:beehive`. - `probability`: number 0..1 ## Cocoa ``` Cocoa(probability: float) ``` Makes `minecraft:cocoa`. - `probability`: number 0..1 ## CreakingHeart ``` CreakingHeart(probability: float) ``` Makes `minecraft:creaking_heart`. - `probability`: number 0..1 ## LeaveVine ``` LeaveVine(probability: float) ``` Makes `minecraft:leave_vine`. - `probability`: number 0..1 ## PaleMoss ``` PaleMoss(leaves_probability: float, trunk_probability: float, ground_probability: float) ``` Makes `minecraft:pale_moss`. - `leaves_probability`: number 0..1 - `trunk_probability`: number 0..1 - `ground_probability`: number 0..1 ## PlaceOnGround ``` PlaceOnGround(block_state_provider: BlockStateProviderRef, tries?: int, radius?: int, height?: int) ``` Makes `minecraft:place_on_ground`. - `block_state_provider`: BlockStateProviderRef. The block to place on the ground. - `tries`: int 1.. (optional). Defaults to `128`. - `radius`: int 0.. (optional). Defaults to `2`. - `height`: int 0.. (optional). Defaults to `1`. ## ShelfMushroom ``` ShelfMushroom(probability: float) ``` Makes `minecraft:shelf_mushroom`. - `probability`: number 0..1 ## TrunkVine ``` TrunkVine() ``` Makes `minecraft:trunk_vine`. # Trigger Helpers that build a `minecraft:trigger` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## AllayDropItemOnBlock ``` AllayDropItemOnBlock(conditions?: ItemUesdOnLocationConditions) ``` Makes `minecraft:allay_drop_item_on_block`. - `conditions`: ItemUesdOnLocationConditions (optional) ## AnyBlockUse ``` AnyBlockUse(conditions?: object) ``` Makes `minecraft:any_block_use`. - `conditions`: { player?: AdvancementEntityPredicate, location?: AdvancementLocationPredicate } (optional) ## AvoidVibration ``` AvoidVibration(conditions?: PlayerConditions) ``` Makes `minecraft:avoid_vibration`. - `conditions`: PlayerConditions (optional) ## BeeNestDestroyed ``` BeeNestDestroyed(conditions?: object) ``` Makes `minecraft:bee_nest_destroyed`. - `conditions`: object (optional) ## BredAnimals ``` BredAnimals(conditions?: object) ``` Makes `minecraft:bred_animals`. - `conditions`: { player?: AdvancementEntityPredicate, parent?: AdvancementEntityPredicate, partner?: AdvancementEntityPredicate, child?: AdvancementEntityPredicate } (optional) ## BrewedPotion ``` BrewedPotion(conditions?: object) ``` Makes `minecraft:brewed_potion`. - `conditions`: { player?: AdvancementEntityPredicate, potion?: PotionsPredicate } (optional) ## ChangedDimension ``` ChangedDimension(conditions?: object) ``` Makes `minecraft:changed_dimension`. - `conditions`: { player?: AdvancementEntityPredicate, from?: dimension id, to?: dimension id } (optional) ## ChanneledLightning ``` ChanneledLightning(conditions?: object) ``` Makes `minecraft:channeled_lightning`. - `conditions`: { player?: AdvancementEntityPredicate, victims?: list of AdvancementEntityPredicate } (optional) ## ConstructBeacon ``` ConstructBeacon(conditions?: object) ``` Makes `minecraft:construct_beacon`. - `conditions`: { player?: AdvancementEntityPredicate, level?: MinMaxBounds of int } (optional) ## ConsumeItem ``` ConsumeItem(conditions?: object) ``` Makes `minecraft:consume_item`. - `conditions`: { player?: AdvancementEntityPredicate, item?: ItemPredicate } (optional) ## CrafterRecipeCrafted ``` CrafterRecipeCrafted(conditions: object) ``` Makes `minecraft:crafter_recipe_crafted`. - `conditions`: { player?: AdvancementEntityPredicate, recipes: RecipeListRef, ingredients?: list of ItemPredicate (1 to 9) } ## CuredZombieVillager ``` CuredZombieVillager(conditions?: object) ``` Makes `minecraft:cured_zombie_villager`. - `conditions`: { player?: AdvancementEntityPredicate, zombie?: AdvancementEntityPredicate, villager?: AdvancementEntityPredicate } (optional) ## DefaultBlockUse ``` DefaultBlockUse(conditions?: object) ``` Makes `minecraft:default_block_use`. - `conditions`: { player?: AdvancementEntityPredicate, location?: AdvancementLocationPredicate } (optional) ## EffectsChanged ``` EffectsChanged(conditions?: object) ``` Makes `minecraft:effects_changed`. - `conditions`: { player?: AdvancementEntityPredicate, effects?: EntityEffectsPredicate, source?: AdvancementEntityPredicate } (optional) ## EnchantedItem ``` EnchantedItem(conditions?: object) ``` Makes `minecraft:enchanted_item`. - `conditions`: { player?: AdvancementEntityPredicate, item?: ItemPredicate, levels?: MinMaxBounds of int } (optional) ## EnterBlock ``` EnterBlock(conditions?: object) ``` Makes `minecraft:enter_block`. - `conditions`: { player?: AdvancementEntityPredicate, blocks?: BlockListRef, state?: any (depends on blocks) } (optional) ## EntityHurtPlayer ``` EntityHurtPlayer(conditions?: object) ``` Makes `minecraft:entity_hurt_player`. - `conditions`: { player?: AdvancementEntityPredicate, damage?: DamagePredicate } (optional) ## EntityKilledPlayer ``` EntityKilledPlayer(conditions?: object) ``` Makes `minecraft:entity_killed_player`. - `conditions`: { player?: AdvancementEntityPredicate, entity?: AdvancementEntityPredicate, killing_blow?: DamageSourcePredicate } (optional) ## FallAfterExplosion ``` FallAfterExplosion(conditions?: object) ``` Makes `minecraft:fall_after_explosion`. - `conditions`: { player?: AdvancementEntityPredicate, start_position?: LocationPredicate, distance?: DistancePredicate, cause?: AdvancementEntityPredicate } (optional) ## FallFromHeight ``` FallFromHeight(conditions?: object) ``` Makes `minecraft:fall_from_height`. - `conditions`: { player?: AdvancementEntityPredicate, start_position?: LocationPredicate, distance?: DistancePredicate } (optional) ## FilledBucket ``` FilledBucket(conditions?: object) ``` Makes `minecraft:filled_bucket`. - `conditions`: { player?: AdvancementEntityPredicate, item?: ItemPredicate } (optional) ## FishingRodHooked ``` FishingRodHooked(conditions?: object) ``` Makes `minecraft:fishing_rod_hooked`. - `conditions`: { player?: AdvancementEntityPredicate, entity?: AdvancementEntityPredicate, item?: ItemPredicate, rod?: ItemPredicate } (optional) ## HeroOfTheVillage ``` HeroOfTheVillage(conditions?: PlayerConditions) ``` Makes `minecraft:hero_of_the_village`. - `conditions`: PlayerConditions (optional) ## Impossible ``` Impossible(conditions?: object) ``` Makes `minecraft:impossible`. - `conditions`: object (optional) ## InventoryChanged ``` InventoryChanged(conditions?: object) ``` Makes `minecraft:inventory_changed`. - `conditions`: { player?: AdvancementEntityPredicate, slots?: { empty?: MinMaxBounds of int, occupied?: MinMaxBounds of int, full?: MinMaxBounds of int }, items?: list of ItemPredicate } (optional) ## ItemDurabilityChanged ``` ItemDurabilityChanged(conditions?: object) ``` Makes `minecraft:item_durability_changed`. - `conditions`: { player?: AdvancementEntityPredicate, delta?: MinMaxBounds of int, durability?: MinMaxBounds of int, item?: ItemPredicate } (optional) ## ItemUsedOnBlock ``` ItemUsedOnBlock(conditions?: ItemUesdOnLocationConditions) ``` Makes `minecraft:item_used_on_block`. - `conditions`: ItemUesdOnLocationConditions (optional) ## KillMobNearSculkCatalyst ``` KillMobNearSculkCatalyst(conditions?: object) ``` Makes `minecraft:kill_mob_near_sculk_catalyst`. - `conditions`: { player?: AdvancementEntityPredicate, entity?: AdvancementEntityPredicate, killing_blow?: DamageSourcePredicate } (optional) ## KilledByArrow ``` KilledByArrow(conditions?: object) ``` Makes `minecraft:killed_by_arrow`. - `conditions`: { player?: AdvancementEntityPredicate, unique_entity_types?: MinMaxBounds of int, fired_from_weapon?: ItemPredicate, victims?: list of AdvancementEntityPredicate } (optional) ## Levitation ``` Levitation(conditions?: object) ``` Makes `minecraft:levitation`. - `conditions`: { player?: AdvancementEntityPredicate, distance?: DistancePredicate, duration?: MinMaxBounds of int } (optional) ## LightningStrike ``` LightningStrike(conditions?: object) ``` Makes `minecraft:lightning_strike`. - `conditions`: { player?: AdvancementEntityPredicate, lightning?: AdvancementEntityPredicate, bystander?: AdvancementEntityPredicate } (optional) ## Location ``` Location(conditions?: PlayerConditions) ``` Makes `minecraft:location`. - `conditions`: PlayerConditions (optional) ## NetherTravel ``` NetherTravel(conditions?: object) ``` Makes `minecraft:nether_travel`. - `conditions`: { player?: AdvancementEntityPredicate, start_position?: LocationPredicate, distance?: DistancePredicate } (optional) ## PlacedBlock ``` PlacedBlock(conditions?: ItemUesdOnLocationConditions) ``` Makes `minecraft:placed_block`. - `conditions`: ItemUesdOnLocationConditions (optional) ## PlayerGeneratesContainerLoot ``` PlayerGeneratesContainerLoot(conditions: object) ``` Makes `minecraft:player_generates_container_loot`. - `conditions`: { player?: AdvancementEntityPredicate, loot_tables: LootTableListRef } ## PlayerHurtEntity ``` PlayerHurtEntity(conditions?: object) ``` Makes `minecraft:player_hurt_entity`. - `conditions`: { player?: AdvancementEntityPredicate, damage?: DamagePredicate, entity?: AdvancementEntityPredicate } (optional) ## PlayerInteractedWithEntity ``` PlayerInteractedWithEntity(conditions?: object) ``` Makes `minecraft:player_interacted_with_entity`. - `conditions`: { player?: AdvancementEntityPredicate, item?: ItemPredicate, entity?: AdvancementEntityPredicate } (optional) ## PlayerKilledEntity ``` PlayerKilledEntity(conditions?: object) ``` Makes `minecraft:player_killed_entity`. - `conditions`: { player?: AdvancementEntityPredicate, entity?: AdvancementEntityPredicate, killing_blow?: DamageSourcePredicate } (optional) ## PlayerShearedEquipment ``` PlayerShearedEquipment(conditions?: object) ``` Makes `minecraft:player_sheared_equipment`. - `conditions`: { player?: AdvancementEntityPredicate, item?: ItemPredicate, entity?: AdvancementEntityPredicate } (optional) ## RecipeCrafted ``` RecipeCrafted(conditions: object) ``` Makes `minecraft:recipe_crafted`. - `conditions`: { player?: AdvancementEntityPredicate, recipes: RecipeListRef, ingredients?: list of ItemPredicate (1 to 9) } ## RecipeUnlocked ``` RecipeUnlocked(conditions: object) ``` Makes `minecraft:recipe_unlocked`. - `conditions`: { player?: AdvancementEntityPredicate, recipes: RecipeListRef } ## RideEntityInLava ``` RideEntityInLava(conditions?: object) ``` Makes `minecraft:ride_entity_in_lava`. - `conditions`: { player?: AdvancementEntityPredicate, start_position?: LocationPredicate, distance?: DistancePredicate } (optional) ## ShotCrossbow ``` ShotCrossbow(conditions?: object) ``` Makes `minecraft:shot_crossbow`. - `conditions`: { player?: AdvancementEntityPredicate, item?: ItemPredicate } (optional) ## SleptInBed ``` SleptInBed(conditions?: PlayerConditions) ``` Makes `minecraft:slept_in_bed`. - `conditions`: PlayerConditions (optional) ## SlideDownBlock ``` SlideDownBlock(conditions?: object) ``` Makes `minecraft:slide_down_block`. - `conditions`: { player?: AdvancementEntityPredicate, blocks?: BlockListRef, state?: any (depends on blocks) } (optional) ## SpearMobs ``` SpearMobs(conditions?: object) ``` Makes `minecraft:spear_mobs`. - `conditions`: { player?: AdvancementEntityPredicate, count?: int 1.. } (optional) ## StartedRiding ``` StartedRiding(conditions?: PlayerConditions) ``` Makes `minecraft:started_riding`. - `conditions`: PlayerConditions (optional) ## SummonedEntity ``` SummonedEntity(conditions?: object) ``` Makes `minecraft:summoned_entity`. - `conditions`: { player?: AdvancementEntityPredicate, entity?: AdvancementEntityPredicate } (optional) ## TameAnimal ``` TameAnimal(conditions?: object) ``` Makes `minecraft:tame_animal`. - `conditions`: { player?: AdvancementEntityPredicate, entity?: AdvancementEntityPredicate } (optional) ## TargetHit ``` TargetHit(conditions?: object) ``` Makes `minecraft:target_hit`. - `conditions`: { player?: AdvancementEntityPredicate, projectile?: AdvancementEntityPredicate, signal_strength?: MinMaxBounds of int } (optional) ## ThrownItemPickedUpByEntity ``` ThrownItemPickedUpByEntity(conditions?: object) ``` Makes `minecraft:thrown_item_picked_up_by_entity`. - `conditions`: { player?: AdvancementEntityPredicate, item?: ItemPredicate, entity?: AdvancementEntityPredicate } (optional) ## ThrownItemPickedUpByPlayer ``` ThrownItemPickedUpByPlayer(conditions?: object) ``` Makes `minecraft:thrown_item_picked_up_by_player`. - `conditions`: { player?: AdvancementEntityPredicate, item?: ItemPredicate, entity?: AdvancementEntityPredicate } (optional) ## Tick ``` Tick(conditions?: PlayerConditions) ``` Makes `minecraft:tick`. - `conditions`: PlayerConditions (optional) ## UsedEnderEye ``` UsedEnderEye(conditions?: object) ``` Makes `minecraft:used_ender_eye`. - `conditions`: { player?: AdvancementEntityPredicate, distance?: MinMaxBounds of number } (optional) ## UsedTotem ``` UsedTotem(conditions?: object) ``` Makes `minecraft:used_totem`. - `conditions`: { player?: AdvancementEntityPredicate, item?: ItemPredicate } (optional) ## UsingItem ``` UsingItem(conditions?: object) ``` Makes `minecraft:using_item`. - `conditions`: { player?: AdvancementEntityPredicate, item?: ItemPredicate } (optional) ## VillagerTrade ``` VillagerTrade(conditions?: object) ``` Makes `minecraft:villager_trade`. - `conditions`: { player?: AdvancementEntityPredicate, villager?: AdvancementEntityPredicate, item?: ItemPredicate } (optional) ## VoluntaryExile ``` VoluntaryExile(conditions?: PlayerConditions) ``` Makes `minecraft:voluntary_exile`. - `conditions`: PlayerConditions (optional) # Trunk placer Helpers that build a `minecraft:trunk_placer` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## BendingTrunkPlacer ``` BendingTrunkPlacer(base_height: int, height_rand_a: int, height_rand_b: int, bend_length: IntProvider, min_height_for_leaves?: int) ``` Makes `minecraft:bending_trunk_placer`. - `base_height`: int 0..32 - `height_rand_a`: int 0..24 - `height_rand_b`: int 0..24 - `bend_length`: IntProvider of int 1..64 - `min_height_for_leaves`: int 1.. (optional) ## CherryTrunkPlacer ``` CherryTrunkPlacer(base_height: int, height_rand_a: int, height_rand_b: int, branch_count: IntProvider, branch_horizontal_length: IntProvider, branch_start_offset_from_top: UniformIntProvider, branch_end_offset_from_top: IntProvider) ``` Makes `minecraft:cherry_trunk_placer`. - `base_height`: int 0..32 - `height_rand_a`: int 0..24 - `height_rand_b`: int 0..24 - `branch_count`: IntProvider of int 1..3 - `branch_horizontal_length`: IntProvider of int 2..16 - `branch_start_offset_from_top`: UniformIntProvider of int -16..0 - `branch_end_offset_from_top`: IntProvider of int -16..16 ## DarkOakTrunkPlacer ``` DarkOakTrunkPlacer(base_height: int, height_rand_a: int, height_rand_b: int) ``` Makes `minecraft:dark_oak_trunk_placer`. - `base_height`: int 0..32 - `height_rand_a`: int 0..24 - `height_rand_b`: int 0..24 ## FancyTrunkPlacer ``` FancyTrunkPlacer(base_height: int, height_rand_a: int, height_rand_b: int) ``` Makes `minecraft:fancy_trunk_placer`. - `base_height`: int 0..32 - `height_rand_a`: int 0..24 - `height_rand_b`: int 0..24 ## ForkingTrunkPlacer ``` ForkingTrunkPlacer(base_height: int, height_rand_a: int, height_rand_b: int) ``` Makes `minecraft:forking_trunk_placer`. - `base_height`: int 0..32 - `height_rand_a`: int 0..24 - `height_rand_b`: int 0..24 ## GiantTrunkPlacer ``` GiantTrunkPlacer(base_height: int, height_rand_a: int, height_rand_b: int) ``` Makes `minecraft:giant_trunk_placer`. - `base_height`: int 0..32 - `height_rand_a`: int 0..24 - `height_rand_b`: int 0..24 ## MegaJungleTrunkPlacer ``` MegaJungleTrunkPlacer(base_height: int, height_rand_a: int, height_rand_b: int) ``` Makes `minecraft:mega_jungle_trunk_placer`. - `base_height`: int 0..32 - `height_rand_a`: int 0..24 - `height_rand_b`: int 0..24 ## PoplarTrunkPlacer ``` PoplarTrunkPlacer(base_height: int, height_rand_a: int, height_rand_b: int, trunk_height_above_branches: IntProvider, branch_amount: IntProvider) ``` Makes `minecraft:poplar_trunk_placer`. - `base_height`: int 0..32 - `height_rand_a`: int 0..24 - `height_rand_b`: int 0..24 - `trunk_height_above_branches`: IntProvider of int 0..8 - `branch_amount`: IntProvider of int 1..4 ## StraightTrunkPlacer ``` StraightTrunkPlacer(base_height: int, height_rand_a: int, height_rand_b: int) ``` Makes `minecraft:straight_trunk_placer`. - `base_height`: int 0..32 - `height_rand_a`: int 0..24 - `height_rand_b`: int 0..24 ## UpwardsBranchingTrunkPlacer ``` UpwardsBranchingTrunkPlacer(base_height: int, height_rand_a: int, height_rand_b: int, extra_branch_steps: IntProvider, extra_branch_length: IntProvider, place_branch_per_log_probability: float, can_grow_through: [block id] | block id) ``` Makes `minecraft:upwards_branching_trunk_placer`. - `base_height`: int 0..32 - `height_rand_a`: int 0..24 - `height_rand_b`: int 0..24 - `extra_branch_steps`: IntProvider of int 1.. - `extra_branch_length`: IntProvider of int 0.. - `place_branch_per_log_probability`: number 0..1 - `can_grow_through`: block id | #block tag | list of block ids # Pool alias binding Helpers that build a `minecraft:worldgen/pool_alias_binding` object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. ## Direct ``` Direct(alias: string, target: template_pool id) ``` Makes `minecraft:direct`. - `alias`: id - `target`: template_pool id ## Random ``` Random(alias: string, targets: NonEmptyWeightedList) ``` Makes `minecraft:random`. - `alias`: id - `targets`: NonEmptyWeightedList of template_pool id ## RandomGroup ``` RandomGroup(groups: NonEmptyWeightedList) ``` Makes `minecraft:random_group`. - `groups`: NonEmptyWeightedList of list of PoolAlias # Types Every type from the game's schema that MMS code can name, such as `ClimateParameter` in `const c: ClimateParameter = [-1, 1]`, one page per part of the schema. - [World generation](https://minecraftmetascript.github.io/mms/docs/reference/types/worldgen.md): 398 types - [Loot and predicates](https://minecraftmetascript.github.io/mms/docs/reference/types/loot.md): 160 types - [Advancements](https://minecraftmetascript.github.io/mms/docs/reference/types/advancement.md): 121 types - [Enchantments](https://minecraftmetascript.github.io/mms/docs/reference/types/enchantment.md): 72 types - [Recipes](https://minecraftmetascript.github.io/mms/docs/reference/types/recipe.md): 35 types - [Item components](https://minecraftmetascript.github.io/mms/docs/reference/types/component.md): 94 types - [Items](https://minecraftmetascript.github.io/mms/docs/reference/types/item.md): 39 types - [Entity data](https://minecraftmetascript.github.io/mms/docs/reference/types/entity.md): 195 types - [Block entity data](https://minecraftmetascript.github.io/mms/docs/reference/types/block.md): 68 types - [Dialogs](https://minecraftmetascript.github.io/mms/docs/reference/types/dialog.md): 24 types - [Mob variants](https://minecraftmetascript.github.io/mms/docs/reference/types/variants.md): 22 types - [Resource pack](https://minecraftmetascript.github.io/mms/docs/reference/types/assets.md): 98 types - [Shared](https://minecraftmetascript.github.io/mms/docs/reference/types/util.md): 176 types - [Other data](https://minecraftmetascript.github.io/mms/docs/reference/types/data.md): 87 types # World generation types Named types from this part of the game's schema: enums, aliases and records, with values that fit. - `ARGBColorAttribute`: a record with fields - `value`: StringARGB - `modifier`: TranslucentColorAttributeModifier - `attribute_track`: { ease?: EasingType, modifier?: ColorModifierType, keyframes: list of { ticks: int 0.., value: any } (at least 1) } - For example `{ value = 0, modifier = { … }, attribute_track = { … } }` - `AboveRootPlacement`: a record with fields - `above_root_provider`: BlockStateProviderRef - `above_root_placement_chance`: number 0..1 - For example `{ above_root_provider = CopyProperties(…), above_root_placement_chance = 0 }` - `AlterGroundTreeDecorator`: a record with fields - `provider`: BlockStateProviderRef - For example `{ provider = CopyProperties(…) }` - `AmbientParticle`: a record with fields - `particle`: Particle - `probability`: number 0..1 - For example `{ particle = AngryVillager(…), probability = 0 }` - `AmbientSounds`: a record with fields - `loop`: SoundEventRef (optional) - `mood`: MoodSound (optional) - `additions`: BiomeSoundAdditions | list of BiomeSoundAdditions (optional) - For example `{}` - `AppendLoot`: a record with fields - `loot_table`: loot_table id - For example `{ loot_table = archaeology/desert_pyramid }` - `AppendStatic`: a record with fields - `data`: object - For example `{ data = {} }` - `Aquifer`: a record with fields - `barrier`: DensityFunctionRef - `fluid_level_floodedness`: DensityFunctionRef - `fluid_level_spread`: DensityFunctionRef - `lava`: DensityFunctionRef - `exclusion`: DensityFunctionRef - `surface_level`: DensityFunctionRef - For example `{ barrier = end/base_3d_noise, fluid_level_floodedness = end/base_3d_noise, fluid_level_spread = end/base_3d_noise, lava = end/base_3d_noise, … }` - `AttachedToLeavesTreeDecorator`: a record with fields - `probability`: number 0..1 - `exclusion_radius_xz`: int 0..16 - `exclusion_radius_y`: int 0..16 - `required_empty_blocks`: int 1..16 - `block_provider`: BlockStateProviderRef - `directions`: list of Direction (at least 1) - For example `{ probability = 0, exclusion_radius_xz = 0, exclusion_radius_y = 0, required_empty_blocks = 1, … }` - `AttachedToLogsTreeDecorator`: a record with fields - `probability`: number 0..1 - `block_provider`: BlockStateProviderRef - `directions`: list of Direction (at least 1) - For example `{ probability = 0, block_provider = CopyProperties(…), directions = [down] }` - `AxisAlignedLinearPos`: a record with fields - `axis`: Axis (optional). Defaults to `y`. - Also has the fields of `LinearPos` - For example `{}` - `BackgroundMusic`: a record with fields - `default`: BiomeMusic (optional). Default music to play - `underwater`: BiomeMusic (optional). Overrides default music when underwater - `creative`: BiomeMusic (optional). Overrides default music when in creative mode - For example `{}` - `BaseNoiseProvider`: a record with fields - `seed`: int - `noise`: NoiseParameters - `scale`: number 0.. - For example `{ seed = 0, noise = { … }, scale = 0 }` - `BedRule`: a record with fields - `can_sleep`: BedRuleType - `can_set_spawn`: BedRuleType - `destroy_on_use`: bool (optional) - `destroy_on_leave`: bool (optional) - `error_message`: Text (optional) - For example `{ can_sleep = always, can_set_spawn = always }` - `BedRuleType`: one of `"always"`, `"when_dark"`, `"never"` - For example `always` - `BeehiveTreeDecorator`: a record with fields - `probability`: number 0..1 - For example `{ probability = 0 }` - `BelowHeightmapPredicate`: a record with fields - `heightmap`: HeightmapType - For example `{ heightmap = MOTION_BLOCKING }` - `BendingTrunkPlacer`: a record with fields - `bend_length`: IntProvider of int 1..64 - `min_height_for_leaves`: int 1.. (optional) - For example `{ bend_length = 1 }` - `BiomeCategory`: one of `"beach"`, `"desert"`, `"extreme_hills"`, `"forest"`, `"icy"`, `"jungle"`, `"mesa"`, `"mountain"`, `"mushroom"`, `"nether"`, `"none"`, `"ocean"`, `"plains"`, `"river"`, `"savanna"`, `"swamp"`, `"taiga"`, `"the_end"`, `"underground"` - For example `beach` - `BiomeCondition`: a record with fields - `biome_is`: biome id | #biome tag | list of biome ids - For example `{ biome_is = [badlands] }` - `BiomeEffects`: a record with fields - `water_color`: StringRGB - `grass_color`: StringRGB (optional) - `foliage_color`: StringRGB (optional) - `dry_foliage_color`: StringRGB (optional) - `grass_color_modifier`: GrassColorModifier (optional) - For example `{ water_color = 0 }` - `BiomeMusic`: a record with fields - `sound`: SoundEventRef - `min_delay`: int 0.. - `max_delay`: int 0.. - `replace_current_music`: bool (optional). Defaults to `false`. - For example `{ sound = ambient.basalt_deltas.additions, min_delay = 0, max_delay = 0 }` - `BiomeNoiseEntry`: a record with fields - `biome`: biome id - `parameters`: ClimateParameters - For example `{ biome = badlands, parameters = { … } }` - `BiomeParticle`: a record with fields - `options`: Particle - `probability`: number 0..1 - For example `{ options = AngryVillager(…), probability = 0 }` - `BiomeSoundAdditions`: a record with fields - `sound`: SoundEventRef - `tick_chance`: number 0..1 - For example `{ sound = ambient.basalt_deltas.additions, tick_chance = 0 }` - `BiomeSource`: biome_source - For example `Checkerboard(…)` - `BiomeTemperature`: one of `"cold"`, `"warm"` - For example `cold` - `BlendToGray`: a record with fields - `brightness`: number 0..1. The gray color is `brightness * (0.3 * r + 0.59 * g + 0.11 * b)`. - `factor`: number 0..1. The factor to mix with. - For example `{ brightness = 0, factor = 0 }` - `BlockAge`: a record with fields - `mossiness`: number - For example `{ mossiness = 0 }` - `BlockBlobConfig`: a record with fields - `state`: BlockState - `can_place_on`: BlockPredicate - For example `{ state = acacia_button, can_place_on = AllOf(…) }` - `BlockColumnConfig`: a record with fields - `direction`: Direction - `allowed_placement`: BlockPredicate - `prioritize_tip`: bool - `layers`: list of BlockColumnLayer - For example `{ direction = down, allowed_placement = AllOf(…), prioritize_tip = true, layers = [{ … }], … }` - `BlockColumnLayer`: a record with fields - `height`: IntProvider of int 0.. - `provider`: BlockStateProviderRef - For example `{ height = 0, provider = CopyProperties(…) }` - `BlockEntityModifier`: rule_block_entity_modifier - For example `AppendLoot(…)` - `BlockIgnore`: a record with fields - `blocks`: list of BlockState - For example `{ blocks = [acacia_button] }` - `BlockMatch`: a record with fields - `block`: block id - For example `{ block = acacia_button }` - `BlockPileConfig`: a record with fields - `state_provider`: BlockStateProviderRef - For example `{ state_provider = CopyProperties(…) }` - `BlockPlacer`: block_placer object - For example `ColumnPlacer(…)` - `BlockPredicateFilter`: a record with fields - `predicate`: BlockPredicate - For example `{ predicate = AllOf(…) }` - `BlockRot`: a record with fields - `integrity`: number 0..1 - `rottable_blocks`: block id | #block tag | list of block ids (optional) - For example `{ integrity = 0 }` - `BlockRule`: a record with fields - `result_state`: BlockState - For example `{ result_state = acacia_button }` - `BlockStateMatch`: a record with fields - `block_state`: BlockState - For example `{ block_state = acacia_button }` - `BlockStateProvider`: TypedBlockStateProvider | FullBlockState - For example `CopyProperties(…)`, `{ id = acacia_button }` - `BlockStateProviderRef`: BlockStateProvider | block_state_provider id - For example `CopyProperties(…)`, `cave_vines_body` - `BlockStateRuleProviderEntry`: a record with fields - `if_true`: BlockPredicate - `then`: BlockStateProviderRef - For example `{ if_true = AllOf(…), then = CopyProperties(…) }` - `BooleanAttribute`: a record with fields - `value`: bool - `modifier`: BooleanAttributeModifier - `attribute_track`: { ease?: EasingType, modifier?: BooleanModifierType, keyframes: list of { ticks: int 0.., value: bool } (at least 1) } - For example `{ value = true, modifier = { … }, attribute_track = { … } }` - `BooleanAttributeModifier`: a record with fields - `modifier`: BooleanModifierType - `argument`: bool - For example `{ modifier = override, argument = true }` - `BooleanModifierType`: one of `"override"`, `"and"`, `"nand"`, `"or"`, `"nor"`, `"xor"`, `"xnor"` - For example `override` - `BottomBiasHeightProvider`: a record with fields - `inner`: int 1.. (optional) - Also has the fields of `UniformHeightProvider` - For example `{ min_inclusive = { … }, max_inclusive = { … } }` - `BoundingBox`: one of `"piece"`, `"full"` - For example `piece` - `BuriedTreasure`: object - For example `{}` - `CanyonConfig`: a record with fields - `vertical_rotation`: FloatProvider of number - `shape`: CanyonShape - Also has the fields of `CarverConfigBase` - For example `{ probability = 0, y = BiasedToBottom(…), vertical_rotation = 0, shape = { … }, … }` - `CanyonShape`: a record with fields - `distance_factor`: FloatProvider of number - `thickness`: FloatProvider of number - `width_smoothness`: int 0.. - `horizontal_radius_factor`: FloatProvider of number - `vertical_radius_default_factor`: number - `vertical_radius_center_factor`: number - `y_scale`: FloatProvider of number - For example `{ distance_factor = 0, thickness = 0, width_smoothness = 0, horizontal_radius_factor = 0, … }` - `Capped`: a record with fields - `delegate`: Processor - `limit`: IntProvider of int 0.. - For example `{ delegate = BlackstoneReplace(…), limit = 0 }` - `CardinalLightType`: one of `"default"`, `"nether"` - For example `default` - `CarveStep`: one of `"air"`, `"liquid"` - For example `air` - `CarverConfigBase`: a record with fields - `probability`: number 0..1 - `y`: HeightProvider - For example `{ probability = 0, y = BiasedToBottom(…) }` - `CarverDebugSettings`: a record with fields - `debug_mode`: bool (optional) - `air_state`: BlockState - `water_state`: BlockState - `lava_state`: BlockState - `barrier_state`: BlockState - For example `{ air_state = acacia_button, water_state = acacia_button, lava_state = acacia_button, barrier_state = acacia_button, … }` - `CarverListRef`: ConfiguredCarver | carver id | #carver tag | list of (carver id | ConfiguredCarver) - For example `Canyon(…)`, `canyon`, `[canyon]` - `CarverRef`: ConfiguredCarver | carver id - For example `Canyon(…)`, `canyon` - `CarvingMaskConfig`: a record with fields - `step`: CarveStep - For example `{ step = air }` - `CarvingMaskModifier`: a record with fields - `step`: CarveStep - For example `{ step = air }` - `CaveConfig`: a record with fields - `count`: IntProvider of int 0.. - `thickness`: FloatProvider of number 0.. - `weird_thickness_bias`: bool (optional). Defaults to `false`. - `room_vertical_radius_multiplier`: FloatProvider of number - `horizontal_radius_multiplier`: FloatProvider of number - `vertical_radius_multiplier`: FloatProvider of number - `start_vertical_radius_multiplier`: FloatProvider of number (optional). Defaults to constant 1.0 - `floor_level`: FloatProvider of number -1..1 - Also has the fields of `CarverConfigBase` - For example `{ probability = 0, y = BiasedToBottom(…), count = 0, thickness = 0, … }` - `CaveSurface`: one of `"floor"`, `"ceiling"` - For example `floor` - `ChanceConfig`: a record with fields - `chance`: int 0.. - For example `{ chance = 0 }` - `Checkerboard`: a record with fields - `scale`: int 0..62 (optional) - `biomes`: biome id | #biome tag | list of biome ids - For example `{ biomes = [badlands] }` - `CherryFoliagePlacer`: a record with fields - `height`: IntProvider of int 4..16 - `wide_bottom_layer_hole_chance`: number 0..1 - `corner_hole_chance`: number 0..1 - `hanging_leaves_chance`: number 0..1 - `hanging_leaves_extension_chance`: number 0..1 - For example `{ height = 4, wide_bottom_layer_hole_chance = 0, corner_hole_chance = 0, hanging_leaves_chance = 0, … }` - `CherryTrunkPlacer`: a record with fields - `branch_count`: IntProvider of int 1..3 - `branch_horizontal_length`: IntProvider of int 2..16 - `branch_start_offset_from_top`: UniformIntProvider of int -16..0 - `branch_end_offset_from_top`: IntProvider of int -16..16 - For example `{ branch_count = 1, branch_horizontal_length = 2, branch_start_offset_from_top = { … }, branch_end_offset_from_top = 0, … }` - `ChunkGenerator`: chunk_generator - For example `Debug()` - `Clamp`: a record with fields - `input`: DensityFunctionRef - `min`: NoiseRange - `max`: NoiseRange - For example `{ input = end/base_3d_noise, min = 0, max = 0 }` - `ClampedIntProvider`: a record with fields - `min_inclusive`: T - `max_inclusive`: T - `source`: IntProvider of int - For example `{ min_inclusive = …, max_inclusive = …, source = 0 }` - `ClampedNormalIntProvider`: a record with fields - `min_inclusive`: T - `max_inclusive`: T - `mean`: number - `deviation`: number - For example `{ min_inclusive = …, max_inclusive = …, mean = 0, deviation = 0, … }` - `ClimateParameter`: number -2..2 | list of number -2..2 (exactly 2) - For example `0`, `[-2, 2]` - `ClimateParameters`: a record with fields - `temperature`: ClimateParameter - `humidity`: ClimateParameter - `continentalness`: ClimateParameter - `erosion`: ClimateParameter - `weirdness`: ClimateParameter - `depth`: ClimateParameter - `offset`: number 0..1 - For example `{ temperature = 0, humidity = 0, continentalness = 0, erosion = 0, … }` - `CocoaTreeDecorator`: a record with fields - `probability`: number 0..1 - For example `{ probability = 0 }` - `ColorAttributeModifier`: a record with fields - `modifier`: ColorModifierType - `argument`: any (depends on modifier) - For example `{ modifier = override, argument = … }` - `ColorModifierType`: one of `"override"`, `"add"`, `"subtract"`, `"multiply"`, `"alpha_blend"`, `"blend_to_gray"` - For example `override` - `ColumnPlacer`: a record with fields - `size`: IntProvider of int 0.. - For example `{ size = 0 }` - `ColumnsConfig`: a record with fields - `block`: BlockStateProviderRef - `can_replace`: BlockPredicate - `continue_through`: BlockPredicate - `cannot_place_on`: block id | #block tag | list of block ids - `column_reach`: IntProvider of int 0..3 - `column_count`: IntProvider of int 1..150 - `height`: IntProvider of int 1..10 - `cluster_reach`: IntProvider of int 0..13. The effective reach is limited by `height`. - For example `{ block = CopyProperties(…), can_replace = AllOf(…), continue_through = AllOf(…), cannot_place_on = acacia_button, … }` - `CombiningPredicate`: a record with fields - `predicates`: list of BlockPredicate - For example `{ predicates = [AllOf(…)] }` - `CompositeMatch`: a record with fields - `rules`: list of RuleTest - For example `{ rules = [AllOf(…)] }` - `ConcentricRingsPlacement`: a record with fields - `distance`: int 0..1023 - `spread`: int 0..1023 - `count`: int 1..4095 - `preferred_biomes`: biome id | #biome tag | list of biome ids - Also has the fields of `SpreadingPlacementBase` - For example `{ salt = 0, distance = 0, spread = 0, count = 1, … }` - `ConditionRule`: a record with fields - `if_true`: MaterialConditionRef - `then_run`: MaterialRuleRef - For example `{ if_true = deep_under_floor, then_run = bedrock_floor }` - `ConfiguredCarver`: carver_config - For example `Canyon(…)` - `ConfiguredDecorator`: a record with fields - `type`: decorator id - `config`: any (depends on type) - For example `{ type = …, config = … }` - `ConfiguredFeature`: feature_config - For example `Bamboo(…)` - `ConfiguredFeatureRef`: feature id | ConfiguredFeature - For example `acacia`, `Bamboo(…)` - `ConfiguredSurfaceBuilder`: a record with fields - `type`: surface_builder id - `config`: { top_material: BlockState, under_material: BlockState, underwater_material: BlockState } - For example `{ type = …, config = { … } }` - `ConfiguredSurfaceBuilderRef`: configured_surface_builder id | ConfiguredSurfaceBuilder - For example `{ type = …, config = { … } }` - `Constant`: a record with fields - `value`: NoiseRange - For example `{ value = 0 }` - `ConstantHeightProvider`: a record with fields - `value`: VerticalAnchor - For example `{ value = { … } }` - `ConstantIntProvider`: a record with fields - `value`: T - For example `{ value = … }` - `CopyPropertiesProvider`: a record with fields - `source`: BlockStateProviderRef - For example `{ source = CopyProperties(…) }` - `CoralConfig`: a record with fields - `feature`: PlacedFeatureRef - For example `{ feature = { … } }` - `CornersToCheck`: one of `"top"`, `"bottom"`, `"all"` - For example `top` - `CountConfig`: a record with fields - `count`: IntProvider of int 0..256 - For example `{ count = 0 }` - `CountExtraConfig`: a record with fields - `count`: int 0.. - `extra_count`: int 0.. - `extra_chance`: number 0..1 - For example `{ count = 0, extra_count = 0, extra_chance = 0 }` - `CountModifier`: a record with fields - `count`: IntProvider of int 0..4096 - For example `{ count = 0 }` - `CountNoiseBiasedConfig`: a record with fields - `noise_to_count_ratio`: int - `noise_factor`: number - `noise_offset`: number (optional) - For example `{ noise_to_count_ratio = 0, noise_factor = 0 }` - `CountNoiseConfig`: a record with fields - `noise_level`: number - `below_noise`: int - `above_noise`: int - For example `{ noise_level = 0, below_noise = 0, above_noise = 0 }` - `CountOnEveryLayerModifier`: a record with fields - `count`: IntProvider of int 0..256 - For example `{ count = 0 }` - `CreakingHeartTreeDecorator`: a record with fields - `probability`: number 0..1 - For example `{ probability = 0 }` - `CrevasseConfig`: a record with fields - `max_width`: int 2..8 - `max_length`: int 4..16 - `min_footprint`: int 1..32 - `cursor_surface_search_range`: int 1.. - `column_surface_search_range`: int 1.. - `twistiness`: number 0..16 - `tapering`: number 0..1 - `turn_factor`: number 0..1 - `carve_depth`: IntProvider of int 1.. - `fill_depth`: IntProvider of int 1.. - `surface_block`: BlockStateProviderRef - `fill_block`: BlockStateProviderRef - `carvable_blocks`: BlockPredicate - `acceptable_barrier`: BlockPredicate - For example `{ max_width = 2, max_length = 4, min_footprint = 1, cursor_surface_search_range = 1, … }` - `CubicSpline`: number | { coordinate: DensityFunctionRef, points: list of SplinePoint } - For example `0`, `{ coordinate = end/base_3d_noise, points = [{ … }] }` - `CuboidModifier`: a record with fields - `xz_size`: IntProvider of int 1..16 - `y_size`: IntProvider of int 1..16 - `include_interior`: bool (optional). Defaults to `true`. - `include_edges`: bool (optional). Defaults to `true`. - For example `{ xz_size = 1, y_size = 1 }` - `DebugFunctionEntry`: a record with fields - `label`: string - `function`: DensityFunctionRef - For example `{ label = "text", function = end/base_3d_noise }` - `DecoratedConfig`: a record with fields - `decorator`: ConfiguredDecorator - `feature`: FeatureRef - For example `{ decorator = { … }, feature = { … } }` - `DecorationStep`: one of `"raw_generation"`, `"lakes"`, `"local_modifications"`, `"underground_structures"`, `"surface_structures"`, `"strongholds"`, `"underground_ores"`, `"underground_decoration"`, `"fluid_springs"`, `"vegetal_decoration"`, `"top_layer_modification"` - For example `raw_generation` - `DeltaConfig`: a record with fields - `contents`: BlockState - `rim`: BlockState - `size`: IntProvider of int 0..16 - `rim_size`: IntProvider of int 0..16 - For example `{ contents = acacia_button, rim = acacia_button, size = 0, rim_size = 0, … }` - `DensityFunction`: NoiseRange | density_function - For example `0`, `Abs(…)` - `DensityFunctionRef`: density_function id | DensityFunction - For example `end/base_3d_noise`, `0` - `DensityPredicate`: a record with fields - `density_function`: density_function id - `acceptable_density`: InclusiveRange of number - `padding`: int 0..8 (optional). Defaults to 0. - `corners`: CornersToCheck (optional). Defaults to `all`. - `required_corners`: int 1..8 - For example `{ density_function = end/base_3d_noise, acceptable_density = 0, required_corners = 1 }` - `DepthAverageConfig`: a record with fields - `baseline`: int - `spread`: int - For example `{ baseline = 0, spread = 0 }` - `DimensionPaddingConfig`: a record with fields - `bottom`: int 0.. (optional) - `top`: int 0.. (optional) - For example `{}` - `DimensionTypeEffects`: one of `"overworld"`, `"the_nether"`, `"the_end"` - For example `overworld` - `DimensionTypeRef`: dimension_type id - For example `overworld` - `DirectMultiNoise`: a record with fields - `biomes`: list of { biome: biome id, parameters: ClimateParameters } - For example `{ biomes = [{ … }] }` - `DirectPoolAlias`: a record with fields - `alias`: id - `target`: template_pool id - For example `{ alias = "text", target = abandoned_camp/camp/bamboo_jungle }` - `DiscreteAttribute`: a record with fields - `value`: T - `modifier`: OverrideModifier of T - `attribute_track`: { ease?: EasingType, modifier?: "override", keyframes: list of { ticks: int 0.., value: T } (at least 1) } - For example `{ value = …, modifier = { … }, attribute_track = { … } }` - `DiskConfig`: a record with fields - `state_provider`: BlockStateProviderRef - `radius`: IntProvider of int 0..8 - `half_height`: int 0..4 - `target`: BlockPredicate - For example `{ state_provider = cave_vines_body, radius = 0, half_height = 0, target = AllOf(…), … }` - `DistanceMetric`: one of - `"euclidean"`: `sqrt(dx^2 + dy^2 + dz^2)` - `"euclidean_squared"`: `dx^2 + dy^2 + dz^2` - `"manhattan"`: `abs(dx) + abs(dy) + abs(dz)` - `"chebyshev"`: `max(abs(dx), abs(dy), abs(dz))` - For example `euclidean` - `DistanceToPoint`: a record with fields - `point`: list of int (exactly 3) - `metric`: DistanceMetric - For example `{ point = [0, 0, 0], metric = euclidean }` - `DomainWarp`: a record with fields - `input`: DensityFunctionRef - `offset_x`: DensityFunctionRef (optional). Defaults to constant 0. At least one of the offsets must be specified. - `offset_y`: DensityFunctionRef (optional). Defaults to constant 0. At least one of the offsets must be specified. - `offset_z`: DensityFunctionRef (optional). Defaults to constant 0. At least one of the offsets must be specified. - For example `{ input = end/base_3d_noise }` - `DualNoiseProvider`: a record with fields - `variety`: InclusiveRange of int 1..64 - `slow_noise`: NoiseParameters - `slow_scale`: number 0.. - `states`: list of BlockState - Also has the fields of `BaseNoiseProvider` - For example `{ seed = 0, noise = { … }, scale = 0, variety = 1, … }` - `Element`: template_pool_element - For example `EmptyPoolElement()` - `ElementBase`: a record with fields - `projection`: Projection - For example `{ projection = rigid }` - `EmeraldOreConfig`: a record with fields - `state`: BlockState - `target`: BlockState - For example `{ state = acacia_button, target = acacia_button }` - `EndGatewayConfig`: a record with fields - `exact`: bool - `exit`: list of int (exactly 3) (optional) - For example `{ exact = true }` - `EndPodiumConfig`: a record with fields - `active`: bool (optional). Defaults to `false`. - For example `{}` - `EndSpike`: a record with fields - `centerX`: int - `centerZ`: int - `radius`: int - `height`: int - `guarded`: bool (optional) - For example `{ centerX = 0, centerZ = 0, radius = 0, height = 0, … }` - `EndSpikeConfig`: a record with fields - `spikes`: list of EndSpike - `crystal_invulnerable`: bool (optional) - `crystal_beam_target`: list of int (exactly 3) (optional) - For example `{ spikes = [{ … }] }` - `EnvironmentAttributeMap`: a record with fields - `[K]`: any (optional) - For example `{}` - `EnvironmentScanModifier`: a record with fields - `direction_of_search`: VerticalDirection - `max_steps`: int 1..32 - `target_condition`: BlockPredicate - `allowed_search_condition`: BlockPredicate (optional) - For example `{ direction_of_search = down, max_steps = 1, target_condition = AllOf(…) }` - `ExclusionZone`: a record with fields - `other_set`: StructureSetRef - `chunk_count`: int 1..16 - For example `{ other_set = abandoned_camp, chunk_count = 1 }` - `FallenTreeConfig`: a record with fields - `trunk_provider`: BlockStateProviderRef - `log_length`: IntProvider of int 0..16 - `stump_decorators`: list of TreeDecorator - `log_decorators`: list of TreeDecorator - For example `{ trunk_provider = CopyProperties(…), log_length = 0, stump_decorators = [AlterGround(…)], log_decorators = [AlterGround(…)], … }` - `FeatureElement`: a record with fields - `feature`: PlacedFeatureRef - Also has the fields of `ElementBase` - For example `{ projection = rigid, feature = { … } }` - `FeatureRef`: PlacedFeatureRef - For example `{ … }` - `FeatureSize`: feature_size - For example `ThreeLayersFeatureSize()` - `FillLayerConfig`: a record with fields - `state`: BlockState - `height`: int 0..255 - For example `{ state = acacia_button, height = 0 }` - `FindTopSurface`: a record with fields - `density`: DensityFunctionRef - `upper_bound`: DensityFunctionRef - `lower_bound`: int -4064..4062 - `cell_height`: int 1.. - For example `{ density = end/base_3d_noise, upper_bound = end/base_3d_noise, lower_bound = 0, cell_height = 1, … }` - `Fixed`: a record with fields - `biome`: biome id - For example `{ biome = badlands }` - `FixedPlacementModifier`: a record with fields - `positions`: list of (list of int (exactly 3)). Fixed list of block positions to place the feature at. - For example `{ positions = [[0, 0, 0]] }` - `Flat`: a record with fields - `settings`: FlatGeneratorSettings - For example `{ settings = { … } }` - `FlatGeneratorLayer`: a record with fields - `height`: int 0..4096 - `block`: block id - For example `{ height = 0, block = acacia_button }` - `FlatGeneratorPreset`: a record with fields - `display`: item id - `settings`: FlatGeneratorSettings - For example `{ display = abandoned_camp_map, settings = { … } }` - `FlatGeneratorSettings`: a record with fields - `biome`: biome id (optional) - `lakes`: bool (optional) - `features`: bool (optional) - `layers`: list of FlatGeneratorLayer - `structure_overrides`: structure_set id | #structure_set tag | list of structure_set ids (optional) - For example `{ layers = [{ … }] }` - `FloatAttribute`: a record with fields - `value`: T - `modifier`: FloatAttributeModifier of T - `attribute_track`: { ease?: EasingType, modifier?: FloatModifierType, keyframes: list of { ticks: int 0.., value: any of T } (at least 1) } - For example `{ value = …, modifier = { … }, attribute_track = { … } }` - `FloatAttributeModifier`: a record with fields - `modifier`: FloatModifierType - `argument`: any (depends on modifier) of T - For example `{ modifier = override, argument = … }` - `FloatModifierType`: one of `"override"`, `"add"`, `"subtract"`, `"multiply"`, `"minimum"`, `"maximum"`, `"alpha_blend"` - For example `override` - `FloatProvider`: T | float_provider - For example `ClampedNormal(…)` - `FloatWithAlpha`: a record with fields - `value`: number - `alpha`: number 0..1 (optional). Defaults to 1.0 - For example `{ value = 0 }` - `FoliagePlacer`: foliage_placer - For example `AcaciaFoliagePlacer(…)` - `ForestRockConfig`: a record with fields - `state`: BlockState - For example `{ state = acacia_button }` - `FossilConfig`: a record with fields - `max_empty_corners_allowed`: int 0..7. If more corners are exposed to air, feature placement is cancelled. - `fossil_structures`: list of structure ids - `overlay_structures`: list of structure ids - `fossil_processors`: ProcessorListRef - `overlay_processors`: ProcessorListRef - For example `{ max_empty_corners_allowed = 0, fossil_structures = [abandoned_camp/camp/bamboo_jungle/campsite_bamboo_jungle_1], overlay_structures = [abandoned_camp/camp/bamboo_jungle/campsite_bamboo_jungle_1], fossil_processors = ancient_city_generic_degradation, … }` - `FrequencyReductionMethod`: one of `"default"`, `"legacy_type_1"`, `"legacy_type_2"`, `"legacy_type_3"` - For example `default` - `GeodeBlockSettings`: a record with fields - `filling_provider`: BlockStateProviderRef - `inner_layer_provider`: BlockStateProviderRef - `alternate_inner_layer_provider`: BlockStateProviderRef - `middle_layer_provider`: BlockStateProviderRef - `outer_layer_provider`: BlockStateProviderRef - `inner_placements`: list of BlockState (at least 1) - `cannot_replace`: block id | #block tag | list of block ids. Blocks that will not be replaced by the geode. - `invalid_blocks`: block id | #block tag | list of block ids. When encountering an invalid block, feature placement is cancelled. - For example `{ filling_provider = CopyProperties(…), inner_layer_provider = CopyProperties(…), alternate_inner_layer_provider = CopyProperties(…), middle_layer_provider = CopyProperties(…), … }` - `GeodeConfig`: a record with fields - `blocks`: GeodeBlockSettings - `layers`: GeodeLayerSettings - `crack`: GeodeCrackSettings - `noise_multiplier`: number 0..1 (optional) - `use_potential_placements_chance`: number 0..1 (optional) - `use_alternate_layer0_chance`: number 0..1 (optional) - `placements_require_layer0_alternate`: bool (optional) - `outer_wall_distance`: IntProvider of int 1..20 (optional) - `distribution_points`: IntProvider of int 1..20 (optional) - `point_offset`: IntProvider of int 1..10 (optional) - `min_gen_offset`: int (optional) - `max_gen_offset`: int (optional) - `invalid_blocks_threshold`: int - For example `{ blocks = { … }, layers = {}, crack = {}, invalid_blocks_threshold = 0, … }` - `GeodeCrackSettings`: a record with fields - `generate_crack_chance`: number 0..1 (optional) - `base_crack_size`: number 0..5 (optional) - `crack_point_offset`: int 0..10 (optional) - For example `{}` - `GeodeLayerSettings`: a record with fields - `filling`: number 0.01..50 (optional) - `inner_layer`: number 0.01..50 (optional) - `middle_layer`: number 0.01..50 (optional) - `outer_layer`: number 0.01..50 (optional) - For example `{}` - `GlobalEnvironmentAttributeMap`: a record with fields - `[environment_attribute id]`: any (optional) - For example `{}` - `Gradient`: a record with fields - `axis`: Axis - `tiling`: TilingMode (optional). Defaults to `clamp_to_edge`. - `from_coordinate`: any (depends on axis) - `to_coordinate`: any (depends on axis) - `from_value`: NoiseRange - `to_value`: NoiseRange - For example `{ axis = x, from_coordinate = …, to_coordinate = …, from_value = 0, … }` - `GrassColorModifier`: one of - `"none"` - `"dark_forest"`: Grass color will be average of the base color and `#28340a`. - `"swamp"`: Grass color will be either `#4c763c` or `#6a7039`, depending on block position. The base color is ignored. - For example `none` - `Gravity`: a record with fields - `heightmap`: HeightmapType - `offset`: int - For example `{ heightmap = MOTION_BLOCKING, offset = 0 }` - `GrowingPlantConfig`: a record with fields - `direction`: Direction - `allow_water`: bool - `height_distribution`: WeightedList of IntProvider of int - `body_provider`: BlockStateProviderRef - `head_provider`: BlockStateProviderRef - For example `{ direction = down, allow_water = true, height_distribution = [{ … }], body_provider = CopyProperties(…), … }` - `HasSturdyFacePredicate`: a record with fields - `direction`: Direction - Also has the fields of `PredicateOffset` - For example `{ direction = down }` - `HeightFoliagePlacer`: a record with fields - `height`: int 0..16 - For example `{ height = 0 }` - `HeightMatch`: a record with fields - `min_inclusive`: int - `max_inclusive`: int - For example `{ min_inclusive = 0, max_inclusive = 0 }` - `HeightProvider`: height_provider | VerticalAnchor - For example `BiasedToBottom(…)`, `{ … }` - `HeightRangeModifier`: a record with fields - `height`: HeightProvider - For example `{ height = BiasedToBottom(…) }` - `HeightRangePredicate`: a record with fields - `min_inclusive`: VerticalAnchor - `max_inclusive`: VerticalAnchor - For example `{ min_inclusive = { … }, max_inclusive = { … } }` - `HeightmapConfig`: a record with fields - `heightmap`: HeightmapType - For example `{ heightmap = MOTION_BLOCKING }` - `HeightmapModifier`: a record with fields - `heightmap`: HeightmapType - For example `{ heightmap = MOTION_BLOCKING }` - `HeightmapType`: one of `"MOTION_BLOCKING"`, `"MOTION_BLOCKING_NO_LEAVES"`, `"OCEAN_FLOOR"`, `"OCEAN_FLOOR_WG"`, `"WORLD_SURFACE"`, `"WORLD_SURFACE_WG"` - For example `MOTION_BLOCKING` - `HugeFungusConfig`: a record with fields - `hat_state`: BlockState - `decor_state`: BlockState - `stem_state`: BlockState - `valid_base_block`: BlockState - `planted`: bool (optional) - `replaceable_blocks`: BlockPredicate - For example `{ hat_state = acacia_button, decor_state = acacia_button, stem_state = acacia_button, valid_base_block = acacia_button, … }` - `HugeMushroomConfig`: a record with fields - `cap_provider`: BlockStateProviderRef - `stem_provider`: BlockStateProviderRef - `foliage_radius`: int (optional). Defaults to `2`. - `can_place_on`: BlockPredicate - For example `{ cap_provider = CopyProperties(…), stem_provider = CopyProperties(…), can_place_on = AllOf(…) }` - `IcebergConfig`: a record with fields - `state`: BlockState - For example `{ state = acacia_button }` - `InsideWorldBoundsPredicate`: object - Also has the fields of `PredicateOffset` - For example `{}` - `IntProvider`: T | int_provider - For example `BiasedToBottom(…)` - `IntegerEnvironmentAttribute`: string - `Interpolated`: a record with fields - `cell_size_xz`: int 1.. - `cell_size_y`: int 1.. - Also has the fields of `OneArgument` - For example `{ input = end/base_3d_noise, cell_size_xz = 1, cell_size_y = 1 }` - `InvertedMatch`: a record with fields - `rule`: RuleTest - For example `{ rule = AllOf(…) }` - `InvervalSelect`: a record with fields - `input`: DensityFunctionRef - `thresholds`: list of NoiseRange (at least 1). Must have exactly one fewer element than `functions`. - `functions`: list of DensityFunctionRef (at least 2). Must have exactly one more element than `thresholds`. - For example `{ input = end/base_3d_noise, thresholds = [0], functions = [end/base_3d_noise] }` - `JigsawDistanceLimits`: a record with fields - `horizontal`: T - `vertical`: int 1..4064 (optional). Defaults to 4064 - For example `{ horizontal = … }` - `LakeConfig`: a record with fields - `fluid`: BlockStateProviderRef - `barrier`: BlockStateProviderRef - `can_place_feature`: BlockPredicate - `can_replace_with_air_or_fluid`: BlockPredicate - `can_replace_with_barrier`: BlockPredicate - For example `{ fluid = CopyProperties(…), barrier = CopyProperties(…), can_place_feature = AllOf(…), can_replace_with_air_or_fluid = AllOf(…), … }` - `LargeSpeleothemConfig`: a record with fields - `replaceable_blocks`: block id | #block tag | list of block ids - `floor_to_ceiling_search_range`: int 1..512 (optional) - `column_radius`: IntProvider of int 0..16 - `height_scale`: FloatProvider of number 0..20 - `max_column_radius_to_cave_height_ratio`: number 0..1 - `stalactite_bluntness`: FloatProvider of number 0.1..10 - `stalagmite_bluntness`: FloatProvider of number 0.1..10 - `wind_speed`: FloatProvider of number 0..2 - `min_radius_for_wind`: int 0..100 - `min_bluntness_for_wind`: number 0..1 - For example `{ replaceable_blocks = [acacia_button], column_radius = 0, height_scale = 0, max_column_radius_to_cave_height_ratio = 0, … }` - `LeaveVineTreeDecorator`: a record with fields - `probability`: number 0..1 - For example `{ probability = 0 }` - `LenientStringARGB`: StringARGB - For example `0` - `Lerp`: a record with fields - `alpha`: DensityFunctionRef - `first`: DensityFunctionRef - `second`: DensityFunctionRef - For example `{ alpha = end/base_3d_noise, first = end/base_3d_noise, second = end/base_3d_noise }` - `LinearPos`: a record with fields - `min_dist`: int 0..255 (optional) - `max_dist`: int 0..255 (optional) - `min_chance`: number 0..1 (optional) - `max_chance`: number 0..1 (optional) - For example `{}` - `LiquidSettings`: one of `"apply_waterlogging"`, `"ignore_waterlogging"` - For example `apply_waterlogging` - `ListAttribute`: a record with fields - `value`: list of E - `modifier`: ListModifier of E - `attribute_track`: { ease?: EasingType, modifier?: ListModifierType, keyframes: list of { ticks: int 0.., value: list of E } (at least 1) } - For example `{ value = …, modifier = { … }, attribute_track = { … } }` - `ListElement`: a record with fields - `elements`: list of Element - Also has the fields of `ElementBase` - For example `{ projection = rigid, elements = [EmptyPoolElement(…)] }` - `ListModifier`: a record with fields - `modifier`: ListModifierType - `argument`: list of E - For example `{ modifier = override, argument = … }` - `ListModifierType`: one of `"override"`, `"append"` - For example `override` - `MangroveRootPlacement`: a record with fields - `max_root_width`: int 1..12 - `max_root_length`: int 1..64 - `random_skew_chance`: number 0..1 - `can_grow_through`: block id | #block tag | list of block ids - `muddy_roots_in`: block id | #block tag | list of block ids - `muddy_roots_provider`: BlockStateProviderRef - For example `{ max_root_width = 1, max_root_length = 1, random_skew_chance = 0, can_grow_through = [acacia_button], … }` - `MangroveRootPlacer`: a record with fields - `mangrove_root_placement`: MangroveRootPlacement - For example `{ mangrove_root_placement = { … } }` - `MatchingBiomesPredicate`: a record with fields - `biomes`: biome id | #biome tag | list of biome ids - For example `{ biomes = badlands }` - `MatchingBlockTagPredicate`: a record with fields - `tag`: block id | #block tag - Also has the fields of `PredicateOffset` - For example `{ tag = acacia_button }` - `MatchingBlocksPredicate`: a record with fields - `blocks`: block id | #block tag | list of block ids - Also has the fields of `PredicateOffset` - For example `{ blocks = [acacia_button] }` - `MatchingFluidsPredicate`: a record with fields - `fluids`: fluid id | #fluid tag | list of fluid ids - Also has the fields of `PredicateOffset` - For example `{ fluids = [empty] }` - `MaterialCondition`: material_condition - For example `AboveSurface()` - `MaterialConditionRef`: material_condition id | MaterialCondition - For example `deep_under_floor`, `AboveSurface()` - `MaterialRule`: material_rule - For example `Bandlands()` - `MaterialRuleRef`: material_rule id | MaterialRule - For example `bedrock_floor`, `Bandlands()` - `MegaPineFoliagePlacer`: a record with fields - `crown_height`: IntProvider of int 0..24 - For example `{ crown_height = 0 }` - `MergeableAttribute`: a record with fields - `value`: T - `modifier`: MergeableModifier of T - `attribute_track`: { ease?: EasingType, modifier?: MergeableModifierType, keyframes: list of { ticks: int 0.., value: T } (at least 1) } - For example `{ value = …, modifier = { … }, attribute_track = { … } }` - `MergeableModifier`: a record with fields - `modifier`: MergeableModifierType - `argument`: T - For example `{ modifier = override, argument = … }` - `MergeableModifierType`: one of `"override"`, `"overlay"` - For example `override` - `Mineshaft`: a record with fields - `mineshaft_type`: MineshaftType - For example `{ mineshaft_type = normal }` - `MineshaftType`: one of `"normal"`, `"mesa"` - For example `normal` - `MobCategory`: one of `"monster"`, `"creature"`, `"ambient"`, `"axolotls"`, `"underground_water_creature"`, `"water_creature"`, `"water_ambient"`, `"misc"` - For example `monster` - `MobSpawnCost`: a record with fields - `energy_budget`: number - `charge`: number - For example `{ energy_budget = 0, charge = 0 }` - `ModernNetherVegetationConfig`: a record with fields - `spread_width`: int 1.. - `spread_height`: int 1.. - For example `{ spread_width = 1, spread_height = 1 }` - `ModernPatchConfig`: a record with fields - `xz_spread`: int 0.. (optional). Defaults to 7. - `y_spread`: int 0.. (optional). Defaults to 3. - `feature`: FeatureRef - For example `{ feature = { … } }` - `MoodSound`: a record with fields - `sound`: SoundEventRef - `tick_delay`: int - `block_search_extent`: int - `offset`: number - For example `{ sound = ambient.basalt_deltas.additions, tick_delay = 0, block_search_extent = 0, offset = 0, … }` - `MultiNoise`: multi_noise_biome_source object - For example `Nether()` - `MultiNoiseBase`: object - For example `{}` - `MultiNoisePreset`: one of `"nether"`, `"overworld"` - For example `nether` - `MultifaceBlock`: one of `"glow_lichen"`, `"sculk_vein"` - For example `glow_lichen` - `MultifaceGrowthConfig`: a record with fields - `block`: MultifaceBlock - `search_range`: int 1..64 (optional) - `chance_of_spreading`: number 0..1 (optional) - `can_place_on_floor`: bool (optional) - `can_place_on_ceiling`: bool (optional) - `can_place_on_wall`: bool (optional) - `can_be_placed_on`: block id | #block tag | list of block ids (optional) - For example `{ block = glow_lichen }` - `NaturalMobSpawns`: a record with fields - `spawns_by_category`: SpawnerDataMap - `spawn_costs`: map of entity id to MobSpawnCost - For example `{ spawns_by_category = {}, spawn_costs = {} }` - `NetherForestVegetationConfig`: a record with fields - `state_provider`: BlockStateProviderRef - `spread_width`: int 1.. - `spread_height`: int 1.. - For example `{ state_provider = CopyProperties(…), spread_width = 1, spread_height = 1 }` - `NetherFossil`: a record with fields - `height`: HeightProvider - For example `{ height = BiasedToBottom(…) }` - `NetherrackReplaceBlobsConfig`: a record with fields - `state`: BlockState - `target`: BlockState - `radius`: IntProvider of int 0..12 - For example `{ state = acacia_button, target = acacia_button, radius = 0 }` - `NoiseBasedCountModifier`: a record with fields - `noise_to_count_ratio`: int - `noise_factor`: number - `noise_offset`: number (optional) - For example `{ noise_to_count_ratio = 0, noise_factor = 0 }` - `NoiseGeneratorFlags`: a record with fields - `aquifers_enabled`: bool - `ore_veins_enabled`: bool - For example `{ aquifers_enabled = true, ore_veins_enabled = true }` - `NoiseGeneratorSettings`: a record with fields - `default_block`: BlockState - `default_fluid`: BlockState - `sea_level`: int - `disable_mob_generation`: bool. If true, mobs will not spawn during generation. - `aquifers`: Aquifer (optional) - `legacy_random_source`: bool - `noise`: NoiseSettings - `noise_router`: NoiseRouter - `spawn_target`: list of SpawnTargetPoint - `material_rule`: MaterialRuleRef - `debug_functions`: list of DebugFunctionEntry (optional) - For example `{ default_block = acacia_button, default_fluid = acacia_button, sea_level = 0, disable_mob_generation = true, … }` - `NoiseGeneratorSettingsRef`: noise_settings id | object - For example `amplified`, `{ name = amplified, default_block = acacia_button, default_fluid = acacia_button, sea_level = 0, … }` - `NoiseParameters`: a record with fields - `base_octave`: int -32..32 - `base_amplitude`: number 0..1e+06 (optional). Defaults to 1.0. - `octave_count`: int 1..32 (optional). Defaults to 1. - `normalize`: bool | "legacy" (optional). Defaults to `true`. - `amplitude_modifiers`: list of number 0..1e+06 (at most 32) (optional). When empty or not present, defaults to all 1.0. Otherwise, the size must match `octave_count`. - For example `{ base_octave = 0 }` - `NoiseParametersRef`: noise id | NoiseParameters - For example `aquifer_barrier`, `{ base_octave = 0 }` - `NoiseProvider`: a record with fields - `states`: list of BlockState - Also has the fields of `BaseNoiseProvider` - For example `{ seed = 0, noise = { … }, scale = 0, states = [acacia_button], … }` - `NoiseRange`: number -1e+06..1e+06 - For example `0` - `NoiseRouter`: a record with fields - `temperature`: DensityFunctionRef - `vegetation`: DensityFunctionRef - `continents`: DensityFunctionRef - `erosion`: DensityFunctionRef - `depth`: DensityFunctionRef - `ridges`: DensityFunctionRef - `chunk_surface_level`: DensityFunctionRef - `final_density`: DensityFunctionRef - For example `{ temperature = end/base_3d_noise, vegetation = end/base_3d_noise, continents = end/base_3d_noise, erosion = end/base_3d_noise, … }` - `NoiseSamplingSettings`: a record with fields - `xz_scale`: number 0.001..1000 - `y_scale`: number 0.001..1000 - `xz_factor`: number 0.001..1000 - `y_factor`: number 0.001..1000 - For example `{ xz_scale = 0.001, y_scale = 0.001, xz_factor = 0.001, y_factor = 0.001, … }` - `NoiseSlideSettings`: a record with fields - `target`: number. The target density. Positive values add terrain and negative values remove terrain. - `size`: int 0..256. Defines a range of 'Size * Size vertical * 4' blocks where the existing density and target are interpolated. - `offset`: int. Defines an range of 'Offset * Size vertical * 4' blocks where the density is set to the target. - For example `{ target = 0, size = 0, offset = 0 }` - `NoiseThresholdCondition`: a record with fields - `noise`: noise id - `min_threshold`: number - `max_threshold`: number - `is_3d`: bool (optional). Defaults to `false`. - For example `{ noise = aquifer_barrier, min_threshold = 0, max_threshold = 0 }` - `NoiseThresholdCountModifier`: a record with fields - `noise_level`: number - `below_noise`: int - `above_noise`: int - For example `{ noise_level = 0, below_noise = 0, above_noise = 0 }` - `NoiseThresholdProvider`: a record with fields - `threshold`: number -1..1 - `high_chance`: number 0..1 - `default_state`: BlockState - `low_states`: list of BlockState - `high_states`: list of BlockState - Also has the fields of `BaseNoiseProvider` - For example `{ seed = 0, noise = { … }, scale = 0, threshold = 0, … }` - `NotCondition`: a record with fields - `invert`: MaterialConditionRef - For example `{ invert = deep_under_floor }` - `NotPredicate`: a record with fields - `predicate`: BlockPredicate - For example `{ predicate = AllOf(…) }` - `NumericalEnvironmentAttribute`: one of `"visual/cloud_height"`, `"visual/fog_start_distance"`, `"visual/moon_angle"`, `"visual/star_angle"`, `"visual/sun_angle"`, `"visual/water_fog_start_distance"`, `"visual/cloud_fog_end_distance"`, `"visual/fog_end_distance"`, `"visual/sky_fog_end_distance"`, `"visual/water_fog_end_distance"`, `"visual/sky_light_factor"`, `"visual/star_brightness"`, `"audio/music_volume"`, `"gameplay/cat_waking_up_gift_chance"`, `"gameplay/creature_world_gen_spawn_probability"`, `"gameplay/surface_slime_spawn_chance"`, `"gameplay/turtle_egg_hatch_chance"`, `"gameplay/sky_light_level"` - For example `visual/cloud_height` - `OceanRuin`: a record with fields - `biome_temp`: BiomeTemperature - `large_probability`: number 0..1 - `cluster_probability`: number 0..1 - For example `{ biome_temp = cold, large_probability = 0, cluster_probability = 0 }` - `OffsetModifier`: a record with fields - `x`: IntProvider of int -16..16 - `y`: IntProvider of int -16..16 - `z`: IntProvider of int -16..16 - For example `{ x = 0, y = 0, z = 0 }` - `OldBlendedNoise`: a record with fields - `xz_scale`: number - `y_scale`: number - `xz_factor`: number - `y_factor`: number - `smear_scale_multiplier`: number 1..8 - For example `{ xz_scale = 0, y_scale = 0, xz_factor = 0, y_factor = 0, … }` - `OldPatchConfig`: a record with fields - `can_replace`: bool (optional) - `project`: bool (optional) - `need_water`: bool (optional) - `xspread`: int 0.. (optional) - `yspread`: int 0.. (optional) - `zspread`: int 0.. (optional) - `state_provider`: BlockStateProviderRef - `block_placer`: BlockPlacer - `whitelist`: list of BlockState - `blacklist`: list of BlockState - For example `{ state_provider = CopyProperties(…), block_placer = ColumnPlacer(…), whitelist = [acacia_button], blacklist = [acacia_button], … }` - `OldRangeConfig`: a record with fields - `maximum`: int - `bottom_offset`: int - `top_offset`: int - For example `{ maximum = 0, bottom_offset = 0, top_offset = 0 }` - `OldSimpleBlockConfig`: a record with fields - `place_on`: list of BlockState - `place_in`: list of BlockState - `place_under`: list of BlockState - For example `{ place_on = [acacia_button], place_in = [acacia_button], place_under = [acacia_button] }` - `OneArgument`: a record with fields - `input`: DensityFunctionRef - For example `{ input = end/base_3d_noise }` - `OptionalSimpleBlockConfig`: a record with fields - `place_on`: list of BlockState (optional) - `place_in`: list of BlockState (optional) - `place_under`: list of BlockState (optional) - For example `{}` - `OreConfig`: a record with fields - `targets`: list of TargetBlock - `size`: int 0..64 - `discard_chance_on_air_exposure`: number 0..1. Chance that feature placement will be discarded if the ore is exposed to air blocks. - For example `{ targets = [{ … }], size = 0, discard_chance_on_air_exposure = 0 }` - `OreVeinifier`: a record with fields - `ore_block`: BlockState - `raw_ore_block`: BlockState - `filler_block`: BlockState - `raw_ore_chance`: number 0..1 - `density`: DensityFunctionRef - `richness`: DensityFunctionRef - `filler_gap`: DensityFunctionRef - For example `{ ore_block = acacia_button, raw_ore_block = acacia_button, filler_block = acacia_button, raw_ore_chance = 0, … }` - `OverlayConfig`: a record with fields - `features`: PlacedFeatureListRef. The features to generate, in order. All features are placed regardless of individual placement success. - For example `{ features = { … } }` - `OverrideModifier`: a record with fields - `modifier`: "override" - `argument`: T - For example `{ modifier = override, argument = … }` - `PaleMossTreeDecorator`: a record with fields - `leaves_probability`: number 0..1 - `trunk_probability`: number 0..1 - `ground_probability`: number 0..1 - For example `{ leaves_probability = 0, trunk_probability = 0, ground_probability = 0 }` - `PineFoliagePlacer`: a record with fields - `height`: IntProvider of int 0..24 - For example `{ height = 0 }` - `PlaceOnGroundTreeDecorator`: a record with fields - `tries`: int 1.. (optional). Defaults to `128`. - `radius`: int 0.. (optional). Defaults to `2`. - `height`: int 0.. (optional). Defaults to `1`. - `block_state_provider`: BlockStateProviderRef. The block to place on the ground. - For example `{ block_state_provider = CopyProperties(…) }` - `PlacedFeatureListRef`: PlacedFeature | placed_feature id | #placed_feature tag | list of (placed_feature id | PlacedFeature) (at least 1) - For example `{ feature = acacia, placement = [Biome(…)] }`, `acacia`, `[acacia]` - `PlacedFeatureRef`: PlacedFeature | placed_feature id - For example `{ feature = acacia, placement = [Biome(…)] }`, `acacia` - `PlacementModifier`: placement_modifier - For example `Biome()` - `PoolAlias`: pool_alias_binding - For example `Direct(…)` - `PoplarFoliagePlacer`: a record with fields - `height`: IntProvider of int 5..16 - `side_hole_chance`: number 0..1 - For example `{ height = 5, side_hole_chance = 0 }` - `PoplarTrunkPlacer`: a record with fields - `trunk_height_above_branches`: IntProvider of int 0..8 - `branch_amount`: IntProvider of int 1..4 - For example `{ trunk_height_above_branches = 0, branch_amount = 1 }` - `PosRuleTest`: pos_rule_test - For example `AlwaysTrue()` - `PositionalEnvironmentAttribute`: environment_attribute id - For example `audio/ambient_sounds` - `PositionalEnvironmentAttributeMap`: a record with fields - `[PositionalEnvironmentAttribute]`: any (optional) - For example `{}` - `Pow`: a record with fields - `base`: DensityFunctionRef - `exponent`: DensityFunctionRef - For example `{ base = end/base_3d_noise, exponent = end/base_3d_noise }` - `Precipitation`: one of `"none"`, `"rain"`, `"snow"` - For example `none` - `PredicateOffset`: a record with fields - `offset`: list of int -16..16 (exactly 3) (optional). The block offset to check. - For example `{}` - `ProbabilityConfig`: a record with fields - `probability`: number 0..1 - For example `{ probability = 0 }` - `Processor`: template_processor - For example `BlackstoneReplace()` - `ProcessorList`: Processors(…) | list of Processor - For example `[BlackstoneReplace(…)]`, `{ processors = [BlackstoneReplace(…)] }` - `ProcessorListObject`: a record with fields - `processors`: list of Processor - For example `{ processors = [BlackstoneReplace(…)] }` - `ProcessorListRef`: processor_list id | ProcessorList - For example `ancient_city_generic_degradation`, `[BlackstoneReplace(…)]` - `ProcessorRule`: a record with fields - `position_predicate`: PosRuleTest (optional) - `location_predicate`: RuleTest - `input_predicate`: RuleTest - `output_state`: BlockState - `block_entity_modifier`: BlockEntityModifier (optional) - For example `{ location_predicate = AllOf(…), input_predicate = AllOf(…), output_state = acacia_button }` - `ProjectedSquareConfig`: a record with fields - `block`: BlockStateProviderRef - `project_through`: BlockPredicate - `size`: IntProvider of int 1..16 - `max_projection_height`: int 0.. - For example `{ block = CopyProperties(…), project_through = AllOf(…), size = 1, max_projection_height = 0, … }` - `Projection`: one of `"rigid"`, `"terrain_matching"` - For example `rigid` - `ProtectedBlocks`: a record with fields - `value`: block id | #block tag | list of block ids - For example `{ value = acacia_button }` - `RGBColorAttribute`: a record with fields - `value`: StringRGB - `modifier`: ColorAttributeModifier - `attribute_track`: { ease?: EasingType, modifier?: ColorModifierType, keyframes: list of { ticks: int 0.., value: any } (at least 1) } - For example `{ value = 0, modifier = { … }, attribute_track = { … } }` - `RandomBlockMatch`: a record with fields - `block`: block id - `probability`: number 0..1 - For example `{ block = acacia_button, probability = 0 }` - `RandomBlockStateMatch`: a record with fields - `block_state`: BlockState - `probability`: number 0..1 - For example `{ block_state = acacia_button, probability = 0 }` - `RandomBlockStateProvider`: a record with fields - `blocks`: block id | #block tag | list of block ids - For example `{ blocks = acacia_button }` - `RandomBooleanSelector`: a record with fields - `feature_false`: FeatureRef - `feature_true`: FeatureRef - For example `{ feature_false = { … }, feature_true = { … } }` - `RandomChanceModifier`: a record with fields - `chance`: number 0..1 - For example `{ chance = 0 }` - `RandomFeatureEntry`: a record with fields - `chance`: number 0..1 - `feature`: FeatureRef - For example `{ chance = 0, feature = { … } }` - `RandomGroupPoolAlias`: a record with fields - `groups`: NonEmptyWeightedList of list of PoolAlias - For example `{ groups = [{ … }] }` - `RandomNeighborSpreadConfig`: a record with fields - `block`: BlockStateProviderRef - `accepted_neighbors`: block id | #block tag | list of block ids - `can_replace`: BlockPredicate - `attempts`: IntProvider of int 1..3000 - `xz_offset`: IntProvider of int -16..16 - `y_offset`: IntProvider of int -16..16 - For example `{ block = CopyProperties(…), accepted_neighbors = acacia_button, can_replace = AllOf(…), attempts = 1, … }` - `RandomOffsetModifier`: a record with fields - `xz_spread`: IntProvider of int -16..16 - `y_spread`: IntProvider of int -16..16 - For example `{ xz_spread = 0, y_spread = 0 }` - `RandomPatchConfig`: a record with fields - `tries`: int 1.. (optional). How many attempts will be made to find a placement. Defaults to 128. - `xz_spread`: int 0.. (optional). Defaults to 7. - `y_spread`: int 0.. (optional). Defaults to 3. - `feature`: FeatureRef - For example `{ feature = { … } }` - `RandomPoolAlias`: a record with fields - `alias`: id - `targets`: NonEmptyWeightedList of template_pool id - For example `{ alias = "text", targets = [{ … }] }` - `RandomSelector`: a record with fields - `features`: list of { chance: number 0..1, feature: FeatureRef } - `default`: FeatureRef - For example `{ features = [{ … }], default = { … } }` - `RandomSpreadFoliagePlacer`: a record with fields - `foliage_height`: IntProvider of int 1..512 - `leaf_placement_attempts`: int 0..256 - For example `{ foliage_height = 1, leaf_placement_attempts = 0 }` - `RandomSpreadPlacement`: a record with fields - `spacing`: int 0..4096. Average distance in chunks between two structures of this type. - `separation`: int 0..4096. Minimum distance in chunks between two structures of this type. - `spread_type`: SpreadType (optional) - Also has the fields of `SpreadingPlacementBase` - For example `{ salt = 0, spacing = 0, separation = 0 }` - `RandomizedIntStateProvider`: a record with fields - `property`: string - `values`: IntProvider of int - `source`: BlockStateProviderRef - For example `{ property = "text", values = 0, source = CopyProperties(…) }` - `RandomlySelectedModifier`: a record with fields - `placements`: list of PlacementModifier (at least 1) - For example `{ placements = [Biome(…)] }` - `RangeChoice`: a record with fields - `input`: DensityFunctionRef - `min_inclusive`: NoiseRange - `max_exclusive`: NoiseRange - `when_in_range`: DensityFunctionRef - `when_out_of_range`: DensityFunctionRef - For example `{ input = end/base_3d_noise, min_inclusive = 0, max_exclusive = 0, when_in_range = end/base_3d_noise, … }` - `RangeConfig`: a record with fields - `height`: HeightProvider - For example `{ height = BiasedToBottom(…) }` - `RarityFilter`: a record with fields - `chance`: int 0.. - For example `{ chance = 0 }` - `RarityType`: one of `"type_1"`, `"type_2"` - For example `type_1` - `ReplaceSingleBlockConfig`: a record with fields - `targets`: list of TargetBlock - For example `{ targets = [{ … }] }` - `RootPlacer`: root_placer - For example `MangroveRootPlacer(…)` - `RootSystemConfig`: a record with fields - `required_vertical_space_for_tree`: int 1..64 - `level_test_distance`: int 0..16 - `max_level_deviation`: int 0..64 - `root_radius`: int 1..64 - `root_placement_attempts`: int 1..256 - `root_column_max_height`: int 1..4096 - `hanging_root_radius`: int 1..64 - `hanging_roots_vertical_span`: int 1..16 - `hanging_root_placement_attempts`: int 0..256 - `allowed_vertical_water_for_tree`: int 1..64 - `root_replaceable`: block id | #block tag | list of block ids - `root_state_provider`: BlockStateProviderRef - `hanging_root_state_provider`: BlockStateProviderRef - `allowed_tree_position`: BlockPredicate - `feature`: FeatureRef - For example `{ required_vertical_space_for_tree = 1, level_test_distance = 0, max_level_deviation = 0, root_radius = 1, … }` - `RotatedStateProvider`: a record with fields - `state`: BlockStateProviderRef - `direction`: Direction (optional) - For example `{ state = cave_vines_body }` - `Round`: a record with fields - `input`: DensityFunctionRef - `multiple`: DensityFunctionRef (optional). Defaults to constant 1. - For example `{ input = end/base_3d_noise }` - `RuinedPortal`: a record with fields - `setups`: list of RuinedPortalSetup - For example `{ setups = [{ … }] }` - `RuinedPortalPlacement`: one of `"on_land_surface"`, `"partly_buried"`, `"on_ocean_floor"`, `"in_mountain"`, `"underground"`, `"in_nether"` - For example `on_land_surface` - `RuinedPortalSetup`: a record with fields - `placement`: RuinedPortalPlacement - `air_pocket_probability`: number 0..1 - `mossiness`: number 0..1 - `overgrown`: bool - `vines`: bool - `can_be_cold`: bool - `replace_with_blackstone`: bool - `weight`: number 0.. - For example `{ placement = on_land_surface, air_pocket_probability = 0, mossiness = 0, overgrown = true, … }` - `RuinedPortalType`: one of `"standard"`, `"desert"`, `"jungle"`, `"mountain"`, `"nether"`, `"ocean"`, `"swamp"` - For example `standard` - `Rule`: a record with fields - `rules`: list of ProcessorRule - For example `{ rules = [{ … }] }` - `RuleBasedBlockStateProvider`: a record with fields - `fallback`: BlockStateProviderRef (optional) - `rules`: list of { if_true: BlockPredicate, then: BlockStateProviderRef } - For example `{ rules = [{ … }] }` - `RuleTest`: rule_test - For example `AllOf(…)` - `SculkPatchConfig`: a record with fields - `charge_count`: int 1..32 - `amount_per_charge`: int 1..500 - `spread_attempts`: int 1..64 - `growth_rounds`: int 0..8 - `spread_rounds`: int 0..8 - For example `{ charge_count = 1, amount_per_charge = 1, spread_attempts = 1, growth_rounds = 0, … }` - `SeaPickleConfig`: a record with fields - `count`: IntProvider of int 0..256 - For example `{ count = 0 }` - `SequenceConfig`: a record with fields - `features`: PlacedFeatureListRef. The features to generate, in order. If any feature in the list is not placed, the following features will also be skipped. - For example `{ features = { … } }` - `SequenceRule`: a record with fields - `sequence`: list of MaterialRuleRef - For example `{ sequence = [bedrock_floor] }` - `ShelfMushroomTreeDecorator`: a record with fields - `probability`: number 0..1 - For example `{ probability = 0 }` - `Shift`: a record with fields - `noise`: NoiseParametersRef - For example `{ noise = aquifer_barrier }` - `ShiftedNoise`: a record with fields - `noise`: NoiseParametersRef - `xz_scale`: number - `y_scale`: number - `shift_x`: DensityFunctionRef (optional). Defaults to constant 0. - `shift_y`: DensityFunctionRef (optional). Defaults to constant 0. - `shift_z`: DensityFunctionRef (optional). Defaults to constant 0. - For example `{ noise = aquifer_barrier, xz_scale = 0, y_scale = 0, shift_x = end/base_3d_noise, … }` - `Shipwreck`: a record with fields - `is_beached`: bool (optional) - For example `{}` - `SimpleBlockConfig`: a record with fields - `to_place`: BlockStateProviderRef - `schedule_tick`: bool (optional). Whether to schedule a block update. Defaults to `false`. - For example `{ to_place = cave_vines_body }` - `SimpleRandomSelectorConfig`: a record with fields - `features`: PlacedFeatureListRef - For example `{ features = { … } }` - `SimpleStateProvider`: a record with fields - `state`: BlockState - For example `{ state = acacia_button }` - `SingleBlockPillarConfig`: a record with fields - `block`: BlockStateProviderRef - `can_replace`: BlockPredicate (optional). Defaults to "always true". - `direction`: VerticalDirection - `chance_to_continue`: number 0..1 (optional). Defaults to 1. - `cap_feature`: PlacedFeatureRef (optional) - For example `{ block = CopyProperties(…), direction = down }` - `SingleElement`: a record with fields - `location`: structure id - `processors`: ProcessorListRef - `override_liquid_settings`: LiquidSettings (optional) - Also has the fields of `ElementBase` - For example `{ projection = rigid, location = abandoned_camp/camp/bamboo_jungle/campsite_bamboo_jungle_1, processors = ancient_city_generic_degradation }` - `SkyboxType`: one of `"none"`, `"overworld"`, `"end"` - For example `none` - `Slice`: a record with fields - `axis`: Axis - `coordinate`: int - `input`: DensityFunctionRef - For example `{ axis = x, coordinate = 0, input = end/base_3d_noise }` - `SmallDripstoneConfig`: a record with fields - `max_placements`: int 0..100 (optional) - `empty_space_search_radius`: int 0..20 (optional) - `max_offset_from_origin`: int 0..20 (optional) - `chance_of_taller_dripstone`: number 0..1 (optional) - For example `{}` - `SpawnOverride`: a record with fields - `bounding_box`: BoundingBox - `spawns`: FlatWeightedList of SpawnerData - For example `{ bounding_box = piece, spawns = [{ … }] }` - `SpawnTargetPoint`: a record with fields - `[density_function id]`: ClimateParameter (optional) - For example `{}` - `SpawnerData`: a record with fields - `type`: entity_type id - `count`: IntProvider of int - For example `{ type = acacia_boat, count = 0 }` - `SpawnerDataMap`: a record with fields - `[MobCategory]`: FlatWeightedList of SpawnerData (optional) - For example `{}` - `SpeleothemBaseBlockTransformer`: one of `"none"`, `"set_attached"` - For example `none` - `SpeleothemClusterConfig`: a record with fields - `base_block`: BlockState - `pointed_block`: BlockState - `replaceable_blocks`: block id | #block tag | list of block ids - `floor_to_ceiling_search_range`: int 1..512 - `height`: IntProvider of int 0..128 - `radius`: IntProvider of int 0..128 - `max_stalagmite_stalactite_height_diff`: int 0..64. Max height difference between the stalagmite and stalactite. - `height_deviation`: int 1..64 - `speleothem_block_layer_thickness`: IntProvider of int 0..128 - `density`: FloatProvider of number 0..2 - `wetness`: FloatProvider of number 0..2 - `chance_of_speleothem_at_max_distance_from_center`: number 0..1 - `max_distance_from_edge_affecting_chance_of_speleothem`: int 1..64 - `max_distance_from_center_affecting_height_bias`: int 1..64 - For example `{ base_block = acacia_button, pointed_block = acacia_button, replaceable_blocks = [acacia_button], floor_to_ceiling_search_range = 1, … }` - `SpeleothemClusterPlacementMode`: one of `"floor_and_ceiling"`, `"floor_only"`, `"ceiling_only"` - For example `floor_and_ceiling` - `SpeleothemClusterPlacementOptions`: a record with fields - `placement_mode`: SpeleothemClusterPlacementMode - `base_block_transformer`: SpeleothemBaseBlockTransformer - `allow_water_placement`: bool - For example `{ placement_mode = floor_and_ceiling, base_block_transformer = none, allow_water_placement = true }` - `SpeleothemConfig`: a record with fields - `base_block`: BlockState - `pointed_block`: BlockState - `replaceable_blocks`: block id | #block tag | list of block ids - `chance_of_taller_generation`: number 0..1 (optional) - `chance_of_directional_spread`: number 0..1 (optional) - `chance_of_spread_radius2`: number 0..1 (optional) - `chance_of_spread_radius3`: number 0..1 (optional) - For example `{ base_block = acacia_button, pointed_block = acacia_button, replaceable_blocks = [acacia_button] }` - `SpikeConfig`: a record with fields - `state`: BlockState - `can_place_on`: BlockPredicate - `can_replace`: BlockPredicate - For example `{ state = acacia_button, can_place_on = AllOf(…), can_replace = AllOf(…) }` - `Spline`: a record with fields - `spline`: CubicSpline - For example `{ spline = 0 }` - `SplinePoint`: a record with fields - `location`: number - `derivative`: number - `value`: CubicSpline - For example `{ location = 0, derivative = 0, value = 0 }` - `SplineType`: one of `"offset"`, `"factor"`, `"jaggedness"` - For example `offset` - `SpreadType`: one of `"linear"`, `"triangular"` - For example `linear` - `SpreadingPlacementBase`: a record with fields - `salt`: int 0.. - `frequency_reduction_method`: FrequencyReductionMethod (optional) - `frequency`: number 0..1 (optional) - `exclusion_zone`: ExclusionZone (optional) - `locate_offset`: list of int -16..16 (exactly 3) (optional) - For example `{ salt = 0 }` - `SpringConfig`: a record with fields - `state`: FluidState - `rock_count`: int (optional). Defaults to `4`. - `hole_count`: int (optional). Defaults to `1`. - `requires_block_below`: bool (optional). Defaults to `true`. - `valid_blocks`: block id | #block tag | list of block ids - For example `{ state = empty, valid_blocks = [acacia_button] }` - `SprucePineFoliagePlacer`: a record with fields - `trunk_height`: IntProvider of int 0..24 - For example `{ trunk_height = 0 }` - `StoneDepthCondition`: a record with fields - `offset`: int - `surface_type`: CaveSurface - `add_surface_depth`: bool - `secondary_depth_range`: int - For example `{ offset = 0, surface_type = floor, add_surface_depth = true, secondary_depth_range = 0, … }` - `StructurePlacement`: structure_placement - For example `ConcentricRings(…)` - `StructureRef`: structure id | Structure - For example `abandoned_camp_bamboo_jungle`, `BastionRemnant(…)` - `StructureSetElement`: a record with fields - `structure`: structure id - `weight`: int 1.. - For example `{ structure = abandoned_camp_bamboo_jungle, weight = 1 }` - `StructureSetRef`: structure_set id | StructureSet - For example `abandoned_camp`, `{ structures = [{ … }], placement = ConcentricRings(…) }` - `StructureSettings`: a record with fields - `stronghold`: ConcentricRingsPlacement (optional) - `structures`: map of structure_feature id to RandomSpreadPlacement - For example `{ structures = {} }` - `SurfaceRelativeThresholdFilter`: a record with fields - `heightmap`: HeightmapType - `min_inclusive`: int (optional) - `max_inclusive`: int (optional) - For example `{ heightmap = MOTION_BLOCKING }` - `SurfaceWaterDepthFilter`: a record with fields - `max_water_depth`: int - For example `{ max_water_depth = 0 }` - `TagMatch`: a record with fields - `tag`: block id | #block tag - For example `{ tag = acacia_button }` - `TargetBlock`: a record with fields - `target`: RuleTest - `state`: BlockState - For example `{ target = AllOf(…), state = acacia_button }` - `TemperatureModifier`: one of `"none"`, `"frozen"` - For example `none` - `TemplateConfig`: a record with fields - `templates`: WeightedList of TemplateEntry - `processors`: ProcessorListRef (optional) - For example `{ templates = [{ … }] }` - `TemplateEntry`: a record with fields - `id`: structure id. The structure template to place. - `rotations`: list of Rotation (optional). Rotations to choose from and apply to this template, centered around the origin. If not specified, defaults to all allowed rotations. - For example `{ id = abandoned_camp/camp/bamboo_jungle/campsite_bamboo_jungle_1 }` - `TerrainAdaptation`: one of `"none"`, `"beard_thin"`, `"beard_box"`, `"bury"`, `"encapsulate"` - For example `none` - `TerrainCoordinate`: one of `"continents"`, `"erosion"`, `"weirdness"`, `"ridges"` - For example `continents` - `TerrainShaper`: a record with fields - `offset`: CubicSpline - `factor`: CubicSpline - `jaggedness`: CubicSpline - For example `{ offset = 0, factor = 0, jaggedness = 0 }` - `TerrainShaperSpline`: a record with fields - `spline`: SplineType - `min_value`: NoiseRange - `max_value`: NoiseRange - `continentalness`: DensityFunctionRef - `erosion`: DensityFunctionRef - `weirdness`: DensityFunctionRef - For example `{ spline = offset, min_value = 0, max_value = 0, continentalness = end/base_3d_noise, … }` - `TheEnd`: object - For example `{}` - `ThreeLayersFeatureSize`: a record with fields - `min_clipped_height`: number 0..80 (optional) - `limit`: int 0..80 (optional) - `upper_limit`: int 0..80 (optional) - `lower_size`: int 0..16 (optional) - `middle_size`: int 0..16 (optional) - `upper_size`: int 0..16 (optional) - For example `{}` - `TilingMode`: one of `"clamp_to_edge"`, `"repeat"`, `"mirrored_repeat"` - For example `clamp_to_edge` - `TranslucentColorAttributeModifier`: a record with fields - `modifier`: ColorModifierType - `argument`: any (depends on modifier) - For example `{ modifier = override, argument = … }` - `TrapezoidHeightProvider`: a record with fields - `plateau`: int (optional) - Also has the fields of `UniformHeightProvider` - For example `{ min_inclusive = { … }, max_inclusive = { … } }` - `TreeConfig`: a record with fields - `ignore_vines`: bool (optional) - `minimum_size`: FeatureSize - `below_trunk_provider`: BlockStateProviderRef - `trunk_provider`: BlockStateProviderRef - `foliage_provider`: BlockStateProviderRef - `root_placer`: RootPlacer (optional) - `trunk_placer`: TrunkPlacer - `foliage_placer`: FoliagePlacer - `decorators`: list of TreeDecorator - For example `{ minimum_size = ThreeLayersFeatureSize(…), below_trunk_provider = CopyProperties(…), trunk_provider = CopyProperties(…), foliage_provider = CopyProperties(…), … }` - `TreeDecorator`: tree_decorator - For example `AlterGround(…)` - `TriState`: bool | "default" - For example `true`, `default` - `TrickyTrialsStructureConfig`: a record with fields - `dimension_padding`: int 0.. | { bottom?: int 0.., top?: int 0.. } (optional) - `liquid_settings`: LiquidSettings (optional) - For example `{}` - `TrunkPlacer`: trunk_placer - For example `BendingTrunkPlacer(…)` - `TwistingVinesConfig`: a record with fields - `spread_width`: int 1.. - `spread_height`: int 1.. - `max_height`: int 1.. - For example `{ spread_width = 1, spread_height = 1, max_height = 1 }` - `TwoArguments`: a record with fields - `left`: DensityFunctionRef - `right`: DensityFunctionRef - For example `{ left = end/base_3d_noise, right = end/base_3d_noise }` - `TwoLayersFeatureSize`: a record with fields - `min_clipped_height`: number 0..80 (optional) - `limit`: int 0..81 (optional) - `lower_size`: int 0..16 (optional) - `upper_size`: int 0..16 (optional) - For example `{}` - `TypedBlockStateProvider`: block_state_provider - For example `CopyProperties(…)` - `UnderwaterMagmaConfig`: a record with fields - `floor_search_range`: int 0..512 - `placement_radius_around_floor`: int 0..64 - `placement_probability_per_valid_position`: number 0..1 - For example `{ floor_search_range = 0, placement_radius_around_floor = 0, placement_probability_per_valid_position = 0 }` - `UniformHeightProvider`: a record with fields - `min_inclusive`: VerticalAnchor - `max_inclusive`: VerticalAnchor - For example `{ min_inclusive = { … }, max_inclusive = { … } }` - `UniformInt`: Base | { base: Base, spread: Spread } - For example `{ base = …, spread = … }` - `UniformIntProvider`: a record with fields - `min_inclusive`: T - `max_inclusive`: T - For example `{ min_inclusive = …, max_inclusive = … }` - `UnobstructedPredicate`: a record with fields - `offset`: list of int (exactly 3) (optional) - For example `{}` - `Upscale`: a record with fields - `input`: DensityFunctionRef - `x`: UpscaleAxis - `y`: UpscaleAxis - `z`: UpscaleAxis - For example `{ input = end/base_3d_noise, x = { … }, y = { … }, z = { … }, … }` - `UpscaleAxis`: a record with fields - `mode`: UpscaleMode - `cell_size`: int 1..64 - For example `{ mode = nearest_neighbor, cell_size = 1 }` - `UpscaleMode`: one of `"nearest_neighbor"`, `"interpolate_linear"`, `"interpolate_cosine"`, `"interpolate_cubic"`, `"b_spline_cubic"` - For example `nearest_neighbor` - `UpwardsBranchingTrunkPlacer`: a record with fields - `extra_branch_steps`: IntProvider of int 1.. - `extra_branch_length`: IntProvider of int 0.. - `place_branch_per_log_probability`: number 0..1 - `can_grow_through`: block id | #block tag | list of block ids - For example `{ extra_branch_steps = 1, extra_branch_length = 0, place_branch_per_log_probability = 0, can_grow_through = [acacia_button], … }` - `VanillaLayered`: a record with fields - `seed`: int - `large_biomes`: bool (optional) - `legacy_biome_init_layer`: bool (optional) - For example `{ seed = 0 }` - `VegetationPatchConfig`: a record with fields - `surface`: CaveSurface - `depth`: IntProvider of int 1..128 - `vertical_range`: int 1..256 - `extra_bottom_block_chance`: number 0..1 - `extra_edge_column_chance`: number 0..1 - `vegetation_chance`: number 0..1 - `xz_radius`: IntProvider of int - `replaceable`: block id | #block tag | list of block ids - `ground_state`: BlockStateProviderRef - `vegetation_feature`: FeatureRef - For example `{ surface = floor, depth = 1, vertical_range = 1, extra_bottom_block_chance = 0, … }` - `VerticalAnchor`: Absolute(…) | AboveBottom(…) | BelowTop(…) | RelativeToSeaLevel(…) - For example `{ absolute = 0 }`, `{ above_bottom = 0 }`, `{ below_top = 0 }`, `{ relative_to_sea_level = 0 }` - `VerticalGradientCondition`: a record with fields - `random_name`: string - `true_at_and_below`: VerticalAnchor - `false_at_and_above`: VerticalAnchor - For example `{ random_name = "text", true_at_and_below = { … }, false_at_and_above = { … } }` - `VolumeMatchPredicate`: a record with fields - `min`: list of int -16..16 (exactly 3) - `max`: list of int -16..16 (exactly 3) - `match`: BlockPredicate - For example `{ min = [0, 0, 0], max = [0, 0, 0], match = AllOf(…) }` - `WaterCondition`: a record with fields - `offset`: int - `surface_depth_multiplier`: int -20..20 - `add_stone_depth`: bool - For example `{ offset = 0, surface_depth_multiplier = 0, add_stone_depth = true }` - `WaterDepthThresholdConfig`: a record with fields - `max_water_depth`: int - For example `{ max_water_depth = 0 }` - `WeightListHeightProvider`: a record with fields - `distribution`: NonEmptyWeightedList of HeightProvider - For example `{ distribution = [{ … }] }` - `WeightedBlockStateProvider`: a record with fields - `entries`: NonEmptyWeightedList of BlockState - For example `{ entries = [{ … }] }` - `WeightedElement`: a record with fields - `weight`: int 1..150 - `element`: Element - For example `{ weight = 1, element = EmptyPoolElement(…) }` - `WeightedRandomFeatureConfig`: a record with fields - `features`: WeightedList of PlacedFeatureRef - For example `{ features = [{ … }] }` - `WeirdScaledSampler`: a record with fields - `rarity_value_mapper`: RarityType - `noise`: NoiseParametersRef - `input`: DensityFunctionRef - For example `{ rarity_value_mapper = type_1, noise = aquifer_barrier, input = end/base_3d_noise }` - `WildUpdateStructureConfig`: a record with fields - `start_height`: HeightProvider - `start_jigsaw_name`: id (optional) - `project_start_to_heightmap`: HeightmapType (optional) - `max_distance_from_center`: any (depends on terrain_adaptation) - `use_expansion_hack`: bool - For example `{ start_height = BiasedToBottom(…), max_distance_from_center = …, use_expansion_hack = true }` - `WouldSurvivePredicate`: a record with fields - `state`: BlockState - Also has the fields of `PredicateOffset` - For example `{ state = acacia_button }` - `YAboveCondition`: a record with fields - `anchor`: VerticalAnchor - `surface_depth_multiplier`: int -20..20 - `add_stone_depth`: bool - For example `{ anchor = { … }, surface_depth_multiplier = 0, add_stone_depth = true }` - `YClampedGradient`: a record with fields - `from_y`: int -4064..4062 - `to_y`: int -4064..4062 - `from_value`: NoiseRange - `to_value`: NoiseRange - For example `{ from_y = 0, to_y = 0, from_value = 0, to_value = 0, … }` # Loot and predicates types Named types from this part of the game's schema: enums, aliases and records, with values that fit. - `AggregateOperands`: ContextFloatProvider | context_float_provider id | #context_float_provider tag | list of FloatRef (at least 1) - For example `0`, `brewing/speed_default`, `[brewing/speed_default]` - `AggregateOperands`: ContextIntProvider | context_int_provider id | #context_int_provider tag | list of IntRef (at least 1) - For example `0`, `brewing/uses_default`, `[brewing/uses_default]` - `AggregateProvider`: a record with fields - `inputs`: S - For example `{ inputs = … }` - `AllOf`: a record with fields - `terms`: PredicateListRef. Passes when all of these conditions pass. - For example `{ terms = AllOf(…) }` - `Alternative`: a record with fields - `terms`: list of LootCondition - For example `{ terms = [AllOf(…)] }` - `AnyOf`: a record with fields - `terms`: PredicateListRef. Passes when any of these conditions pass. - For example `{ terms = AllOf(…) }` - `ApplyBonus`: apply_bonus_formula object - For example `BinomialWithBonusCount(…)` - `ApplyBonusFormula`: one of `"ore_drops"`, `"uniform_bonus_count"`, `"binomial_with_bonus_count"` - For example `ore_drops` - `BannerPatternLayer`: a record with fields - `pattern`: banner_pattern id - `color`: DyeColor - For example `{ pattern = base, color = white }` - `BinaryProvider`: a record with fields - `left`: T - `right`: T - For example `{ left = …, right = … }` - `BinomialDistributionGenerator`: a record with fields - `n`: IntRef. Number of coin flips. - `p`: FloatRef. Probability of a single coin flip succeeding. - For example `{ n = brewing/uses_default, p = brewing/speed_default }` - `BinomialNumberProvider`: a record with fields - `n`: LegacyNumberProvider - `p`: LegacyNumberProvider - For example `{ n = 0, p = 0 }` - `BinomialWithBonusCountFormula`: a record with fields - `parameters`: { extra: int, probability: number 0..1 } - For example `{ parameters = { … } }` - `BlockEntityTarget`: "block_entity" - For example `block_entity` - `BlockStateProperty`: a record with fields - `block`: block id - `properties`: any (depends on block) (optional) - For example `{ block = acacia_button }` - `CompositePoolEntry`: a record with fields - `children`: list of LootPoolEntry (at least 1) - Also has the fields of `LootPoolEntryBase` - For example `{ children = [Alternatives(…)] }` - `ConditionalProvider`: a record with fields - `condition`: PredicateRef - `on_true`: T - `on_false`: T (optional). Defaults to constant 0. - For example `{ condition = AllOf(…), on_true = … }` - `Conditions`: a record with fields - `condition`: PredicateRef (optional) - For example `{}` - `ConstantNumberProvider`: a record with fields - `value`: number - For example `{ value = 0 }` - `ConstantValue`: a record with fields - `value`: V - For example `{ value = … }` - `ContainerComponents`: one of `"container"`, `"bundle_contents"`, `"charged_projectiles"` - For example `container` - `ContentsSlotSource`: a record with fields - `slot_source`: SlotSource. The slots to search. - `component`: ContainerComponents. If an item targeted by `slot_source` has this container component, selects all items inside. - For example `{ slot_source = Contents(…), component = container }` - `ContextFloatProvider`: number | context_float_provider - For example `0`, `Abs(…)` - `ContextIntProvider`: int | context_int_provider - For example `0`, `Abs(…)` - `CopyComponents`: a record with fields - `source`: BlockEntityTarget | EntityTarget | ItemStackTarget - `include`: list of data_component_type ids (optional). If omitted, all components present are included - `exclude`: list of data_component_type ids (optional). Defaults to none. - Also has the fields of `Conditions` - For example `{ source = block_entity }` - `CopyName`: a record with fields - `source`: EntityTarget | BlockEntityTarget - Also has the fields of `Conditions` - For example `{ source = this }` - `CopyNameSource`: one of `"this"`, `"attacking_entity"`, `"last_damage_player"`, `"block_entity"` - For example `this` - `CopyNbt`: a record with fields - `source`: NbtProvider - `ops`: list of { source: string, target: string, op: CopyNbtStrategy } - Also has the fields of `Conditions` - For example `{ source = this, ops = [{ … }] }` - `CopyNbtOperation`: a record with fields - `source`: string - `target`: string - `op`: CopyNbtStrategy - For example `{ source = "text", target = "text", op = replace }` - `CopyNbtStrategy`: one of - `"replace"`: Replace any existing contents of the target. - `"append"`: Append to a list. - `"merge"`: Merge into a compound tag. - For example `replace` - `CopyState`: a record with fields - `block`: block id - `properties`: list of any - Also has the fields of `Conditions` - For example `{ block = acacia_button, properties = … }` - `CustomModelDataColors`: list_operation - For example `Append(…)` - `CustomModelDataFlags`: list_operation - For example `Append(…)` - `CustomModelDataFloats`: list_operation - For example `Append(…)` - `CustomModelDataStrings`: list_operation - For example `Append(…)` - `DamageSourceProperties`: a record with fields - `predicate`: DamageSourcePredicate - For example `{ predicate = {} }` - `DataStorageProvider`: a record with fields - `storage`: storage id - `path`: string - `fallback`: T (optional). Defaults to constant 0. - For example `{ storage = …, path = "text" }` - `DispatcherProvider`: a record with fields - `cases`: list of { condition: PredicateRef, value: T }. Each condition is tested in order, the first in the list that passes is used. - `default`: T (optional). Defaults to constant 0. - For example `{ cases = [{ … }] }` - `DistributionProvider`: a record with fields - `distribution`: NonEmptyWeightedList of T - For example `{ distribution = [{ … }] }` - `DynamicDrops`: one of - `"contents"`: Drops the items in a shulker box. - `"sherds"`: Drops the sherds of a decorated pot. - For example `contents` - `DynamicPoolEntry`: a record with fields - `name`: DynamicDrops - Also has the fields of `SingletonPoolEntry` - For example `{ name = contents }` - `EnchantRandomly`: a record with fields - `options`: enchantment id | #enchantment tag | list of enchantment ids (optional). The allowed enchantments. If omitted, all enchantments applicable to the item are possible. - `only_compatible`: bool (optional). Whether to only enchant with item-compatible enchantments. Defaults to `true`. Note: Books are considered compatible with all Enchantments. - `include_additional_cost_component`: bool (optional). Whether to add `additional_trade_cost` component to the enchanted item. Additional cost value is determined by the enchantment level, with the formula `2 + random(0, 5 + level * 10) + 3 * level`. Defaults to `false`. - Also has the fields of `Conditions` - For example `{}` - `EnchantWithLevels`: a record with fields - `levels`: IntNumberProviderRef. The levels to enchant this item with. - `options`: enchantment id | #enchantment tag | list of enchantment ids (optional). The allowed enchantments. If omitted, all enchantments applicable to the item are possible. - `include_additional_cost_component`: bool (optional). Whether to add `additional_trade_cost` component to the enchanted item. Additional cost value is equal to the level cost determined by `levels`. Defaults to `false`. - Also has the fields of `Conditions` - For example `{ levels = … }` - `EnchantedCountBase`: a record with fields - `count`: FloatNumberProviderRef. Rounded *after* the number was multiplied by the looting level. - `limit`: int (optional). Limits the count of the item to a range. - For example `{ count = … }` - `EnchantedCountIncrease`: a record with fields - `enchantment`: enchantment id. Enchantment that increases yields. - Also has the fields of `EnchantedCountBase`, `Conditions` - For example `{ count = …, enchantment = aqua_affinity }` - `EnchantmentActiveCheck`: a record with fields - `active`: bool - For example `{ active = true }` - `EnchantmentLevelProvider`: a record with fields - `amount`: LevelBasedValue - For example `{ amount = 0 }` - `EntityProperties`: a record with fields - `entity`: EntityTarget - `predicate`: EntityPredicate - For example `{ entity = this, predicate = {} }` - `EntityScores`: a record with fields - `entity`: EntityTarget - `scores`: map of string to IntRange - For example `{ entity = this, scores = {} }` - `EntityTarget`: one of `"this"`, `"attacker"`, `"direct_attacker"`, `"attacking_player"`, `"target_entity"`, `"interacting_entity"` - For example `this` - `EnvironmentAttributeCheck`: a record with fields - `attribute`: environment_attribute id - `value`: any (depends on attribute) - For example `{ attribute = audio/ambient_sounds, value = … }` - `EnvironmentAttributeNumberProvider`: a record with fields - `attribute`: NumericalEnvironmentAttribute - For example `{ attribute = visual/cloud_height }` - `EnvironmentAttributeProvider`: a record with fields - `attribute`: A - For example `{ attribute = … }` - `ExplorationMap`: a record with fields - `destination`: structure id | #structure tag | list of structure ids. Generated structure to locate. Accepts any of the structure types used by the `/locate` command. - `decoration`: map_decoration_type id (optional). The icon used to mark the destination on the map. - `zoom`: int (optional). Defaults to 2. - `search_radius`: int (optional). The size, in chunks, of the area to search for structures. The area checked is square, not circular. Radius `0` causes only the current chunk to be searched, radius `1` causes the current chunk and eight adjacent chunks to be searched, and so on. Defaults to `50`. - `skip_existing_chunks`: bool (optional). Whether to not search in chunks that have already been generated. Defaults to `true`. - Also has the fields of `Conditions` - For example `{ destination = abandoned_camp_bamboo_jungle }` - `FillPlayerHead`: a record with fields - `entity`: EntityTarget. `this` to use the entity that died or the player that gained the advancement, opened the container, or broke the block. - Also has the fields of `Conditions` - For example `{ entity = this }` - `FilterSlotSource`: a record with fields - `slot_source`: SlotSource - `item_filter`: ItemPredicate - For example `{ slot_source = Contents(…), item_filter = {} }` - `Filtered`: a record with fields - `item_filter`: ItemPredicate. Item predicate to select items to modify. - `on_pass`: ItemModifier (optional). Loot function to apply to the item when `item_filter` passes. - `on_fail`: ItemModifier (optional). Loot function to apply to the item when `item_filter` fails. - Also has the fields of `Conditions` - For example `{ item_filter = {} }` - `FireworkExplosions`: list_operation - For example `Append(…)` - `FloatNumberProvider`: ContextFloatProvider - For example `0` - `FloatNumberProviderRef`: FloatRef - For example `brewing/speed_default` - `FloatRange`: FloatNumberProviderRef | { min?: FloatNumberProviderRef, max?: FloatNumberProviderRef } - For example `brewing/speed_default`, `{}` - `FloatRef`: context_float_provider id | ContextFloatProvider - For example `brewing/speed_default`, `0` - `FloatValueCheck`: a record with fields - `value`: FloatNumberProviderRef - `test`: FloatRange. Passes when `value` is within the test range. - For example `{ value = brewing/speed_default, test = {} }` - `GroupSlotSource`: a record with fields - `terms`: SlotSource - For example `{ terms = Contents(…) }` - `InsertListOperation`: a record with fields - `offset`: int 0.. (optional). The offset in the list to insert into. Defaults to 0. - For example `{}` - `IntNumberProvider`: ContextIntProvider - For example `0` - `IntNumberProviderRef`: IntRef - For example `brewing/uses_default` - `IntRange`: IntNumberProviderRef | { min?: IntNumberProviderRef, max?: IntNumberProviderRef } - For example `brewing/uses_default`, `{}` - `IntRef`: context_int_provider id | ContextIntProvider - For example `brewing/uses_default`, `0` - `IntegerValueCheck`: a record with fields - `value`: IntNumberProviderRef - `test`: IntRange. Passes when `value` is within the test range. - For example `{ value = brewing/uses_default, test = {} }` - `Inverted`: a record with fields - `term`: PredicateRef - For example `{ term = AllOf(…) }` - `ItemModifier`: LootFunction | item_modifier id | #item_modifier tag | list of (item_modifier id | LootFunction) - For example `ApplyBonus(…)`, `[ApplyBonus(…)]` - `ItemModifierArgument`: ItemModifier - For example `ApplyBonus(…)`, `[ApplyBonus(…)]` - `ItemModifierRoot`: LootFunction - For example `ApplyBonus(…)` - `ItemModifierWithoutRootRef`: LootFunction | list of ItemModifierWithoutRootRef - For example `ApplyBonus(…)`, `[ApplyBonus(…)]` - `ItemPoolEntry`: a record with fields - `name`: item id - Also has the fields of `SingletonPoolEntry` - For example `{ name = abandoned_camp_map }` - `ItemStackTarget`: "tool" - For example `tool` - `KilledByPlayer`: a record with fields - `inverse`: bool (optional) - For example `{}` - `LegacyExplorationMapDestination`: one of `"pillager_outpost"`, `"mineshaft"`, `"manshion"`, `"jungle_pyramid"`, `"desert_pyramid"`, `"igloo"`, `"ruined_portal"`, `"shipwreck"`, `"swamp_hut"`, `"stronghold"`, `"monument"`, `"ocean_ruin"`, `"fortress"`, `"endcity"`, `"buried_treasure"`, `"village"`, `"nether_fossil"`, `"bastion_remnent"` - For example `pillager_outpost` - `LegacyNumberProvider`: LegacyNumberProvider - For example `0`, `Binomial(…)` - `LegacyNumberProvider`: number | number_provider object - For example `0`, `Binomial(…)` - `LimitCount`: a record with fields - `limit`: { min?: IntNumberProviderRef, max?: IntNumberProviderRef }. Limits the count of the item to a range. - Also has the fields of `Conditions` - For example `{ limit = {} }` - `LimitCountSlotSource`: a record with fields - `slot_source`: SlotSource - `limit`: int 1.. - For example `{ slot_source = Contents(…), limit = 1 }` - `ListOperation`: list_operation - For example `Append()` - `ListOperationMode`: one of `"append"`, `"insert"`, `"replace_all"`, `"replace_section"` - For example `append` - `LocationCheck`: a record with fields - `offsetX`: int (optional) - `offsetY`: int (optional) - `offsetZ`: int (optional) - `predicate`: LocationPredicate - For example `{ predicate = {} }` - `LootCondition`: loot_condition - For example `AllOf(…)` - `LootConditionType`: one of `"alternative"`, `"block_state_property"`, `"damage_source_properties"`, `"entity_properties"`, `"entity_scores"`, `"inverted"`, `"killed_by_player"`, `"location_check"`, `"match_tool"`, `"random_chance"`, `"random_chance_with_looting"`, `"reference"`, `"survives_explosion"`, `"table_bonus"`, `"time_check"`, `"weather_check"` - For example `alternative` - `LootContextParamSets`: one of `"empty"`, `"chest"`, `"command"`, `"selector"`, `"fishing"`, `"entity"`, `"gift"`, `"barter"`, `"advancement_reward"`, `"advancement_entity"`, `"advancement_location"`, `"generic"`, `"block"`, `"block_use"`, `"equipment"`, `"archaeology"`, `"vault"`, `"shearing"`, `"enchanted_damage"`, `"enchanted_item"`, `"enchanted_location"`, `"enchanted_entity"`, `"hit_block"`, `"block_interact"`, `"entity_interact"`, `"villager_trade"`, `"command_slot_source"`, `"container_process"`, `"command_compute_default"`, `"command_compute_position"`, `"command_compute_entity"` - For example `empty` - `LootEntryType`: one of `"alternatives"`, `"dynamic"`, `"empty"`, `"group"`, `"item"`, `"loot_table"`, `"sequence"`, `"tag"` - For example `alternatives` - `LootFunction`: loot_function - For example `ApplyBonus(…)` - `LootFunctionType`: one of `"apply_bonus"`, `"copy_name"`, `"copy_nbt"`, `"copy_state"`, `"enchant_randomly"`, `"enchant_with_levels"`, `"explosion_decay"`, `"exploration_map"`, `"fill_player_head"`, `"furnace_smelt"`, `"limit_count"`, `"looting_enchant"`, `"set_attributes"`, `"set_contents"`, `"set_count"`, `"set_damage"`, `"set_loot_table"`, `"set_lore"`, `"set_name"`, `"set_nbt"`, `"set_stew_effect"` - For example `apply_bonus` - `LootPool`: a record with fields - `rolls`: IntNumberProviderRef - `bonus_rolls`: FloatNumberProviderRef (optional) - `entries`: list of LootPoolEntry - `modifier`: ItemModifier (optional) - `condition`: PredicateRef (optional) - For example `{ rolls = …, entries = [Alternatives(…)] }` - `LootPoolEntry`: loot_pool_entry - For example `Alternatives(…)` - `LootPoolEntryBase`: a record with fields - `modifier`: ItemModifier (optional) - `condition`: PredicateRef (optional) - For example `{}` - `LootTableListRef`: LootTable | loot_table id | #loot_table tag | list of (loot_table id | LootTable) - For example `{}`, `archaeology/desert_pyramid`, `[archaeology/desert_pyramid]` - `LootTablePoolEntry`: a record with fields - `value`: LootTableListRef - `expand`: bool (optional). If `true`, each of the loot tables becomes an independent entry in the pool with the same `weight` and `quality`. If `false`, drops all loot tables. Defaults to `false`. - Also has the fields of `SingletonPoolEntry` - For example `{ value = {} }` - `LootTableRef`: LootTable | loot_table id - For example `{}`, `archaeology/desert_pyramid` - `LootingEnchant`: object - Also has the fields of `EnchantedCountBase`, `Conditions` - For example `{ count = … }` - `MapDecoration`: one of `"mansion"`, `"monument"`, `"player"`, `"frame"`, `"red_marker"`, `"blue_marker"`, `"target_x"`, `"target_point"`, `"player_off_map"`, `"player_off_limits"`, `"red_x"`, `"banner_white"`, `"banner_orange"`, `"banner_magenta"`, `"banner_light_blue"`, `"banner_yellow"`, `"banner_lime"`, `"banner_pink"`, `"banner_gray"`, `"banner_light_gray"`, `"banner_cyan"`, `"banner_purple"`, `"banner_blue"`, `"banner_brown"`, `"banner_green"`, `"banner_red"`, `"banner_black"` - For example `mansion` - `MatchTool`: a record with fields - `predicate`: ItemPredicate - For example `{ predicate = {} }` - `ModifyContents`: a record with fields - `component`: ContainerComponents. Describes target component's items to modify. - `modifier`: ItemModifier. Applied to every item inside container. - Also has the fields of `Conditions` - For example `{ component = container, modifier = ApplyBonus(…) }` - `PowerProvider`: a record with fields - `base`: T - `exponent`: T - For example `{ base = …, exponent = … }` - `Predicate`: LootCondition - For example `AllOf(…)` - `PredicateListRef`: LootCondition | predicate id | #predicate tag | list of (predicate id | LootCondition) - For example `AllOf(…)`, `block/fast_cooking`, `[block/fast_cooking]` - `PredicateRef`: Predicate | predicate id - For example `AllOf(…)`, `block/fast_cooking` - `RandomChance`: a record with fields - `chance`: FloatNumberProviderRef. Accepts a value between `0` & `1` (inclusive). - For example `{ chance = … }` - `RandomChanceWithEnchantedBonus`: a record with fields - `unenchanted_chance`: number 0..1 - `enchanted_chance`: LevelBasedValue - `enchantment`: enchantment id - For example `{ unenchanted_chance = 0, enchanted_chance = 0, enchantment = aqua_affinity }` - `RandomChanceWithLooting`: a record with fields - `chance`: number 0..1 - `looting_multiplier`: number. Looting adjustment to the base success rate. Formula is `chance + (looting_level * looting_multiplier)` . - For example `{ chance = 0, looting_multiplier = 0 }` - `RandomProvider`: a record with fields - `min`: T - `max`: T - For example `{ min = …, max = … }` - `RangeSlotSource`: a record with fields - `source`: EntityTarget | BlockEntityTarget | "container" (optional). Defaults to `container`. - `slots`: string - For example `{ slots = "text" }` - `Reference`: a record with fields - `name`: item_modifier id. Item modifier to reference. - Also has the fields of `Conditions` - For example `{ name = … }` - `ReplaceSectionListOperation`: a record with fields - `offset`: int 0.. (optional). The offset of the section to replace. Defaults to 0. - `size`: int 0.. (optional). The size of the section to replace. Defaults to size of the new list. - For example `{}` - `ScoreNumberProvider`: a record with fields - `target`: ScoreProvider - `score`: string - `scale`: number (optional) - For example `{ target = this, score = "text" }` - `ScoreboardValue`: a record with fields - `target`: ScoreProvider - `score`: string - `fallback`: IntRef (optional). Defaults to constant 0. - For example `{ target = this, score = "text" }` - `Sequence`: a record with fields - `functions`: ItemModifier. List of functions to apply to this item. - Also has the fields of `Conditions` - For example `{ functions = ApplyBonus(…) }` - `SetAttributes`: a record with fields - `modifiers`: list of AttributeModifier. List of attribute modifiers to apply to this item. - `replace`: bool (optional). Whether to replace existing attributes (otherwise append to existing). Defaults to `true`. - Also has the fields of `Conditions` - For example `{ modifiers = [{ … }] }` - `SetBannerPattern`: a record with fields - `patterns`: list of BannerPatternLayer. List of banner pattern layers. - `append`: bool. Whether to add to the banner pattern list. - Also has the fields of `Conditions` - For example `{ patterns = [{ … }], append = true }` - `SetBookCover`: a record with fields - `title`: Filterable of string (0 to 32) (optional). If omitted, the original title is kept (or an empty string is used if there was no component) - `author`: string (optional). If omitted, the original author is kept (or an empty string is used if there was no component) - `generation`: int 0..3 (optional). If omitted, the original generation is kept (or 0 is used if there was no component) - Also has the fields of `Conditions` - For example `{}` - `SetComponents`: a record with fields - `components`: DataComponentPatch - Also has the fields of `Conditions` - For example `{ components = {} }` - `SetContents`: a record with fields - `component`: ContainerComponents. Describes target component to be filled with items. - `entries`: list of LootPoolEntry - Also has the fields of `Conditions` - For example `{ component = container, entries = [Alternatives(…)] }` - `SetCount`: a record with fields - `count`: IntNumberProviderRef - `add`: bool (optional). Whether to add to the existing count. Defaults to `false`. - Also has the fields of `Conditions` - For example `{ count = … }` - `SetCustomData`: a record with fields - `tag`: CustomData - Also has the fields of `Conditions` - For example `{ tag = {} }` - `SetCustomModelData`: a record with fields - `floats`: list_operation (optional) - `flags`: list_operation (optional) - `strings`: list_operation (optional) - `colors`: list_operation (optional) - Also has the fields of `Conditions` - For example `{}` - `SetDamage`: a record with fields - `damage`: FloatNumberProviderRef. Decimal percentage. Can be negative when used in combination with `add`. Accepts a value between `-1` & `1` (inclusive). - `add`: bool (optional). Whether to add to the existing damage of the item. Defaults to `false`. - Also has the fields of `Conditions` - For example `{ damage = … }` - `SetEnchantments`: a record with fields - `enchantments`: map of enchantment id to IntNumberProviderRef. A map of enchantments to levels. Setting an enchantment to `0` removes it from the item. - `add`: bool (optional). Whether to add to the level of each enchantment. Defaults to `false`. - Also has the fields of `Conditions` - For example `{ enchantments = {} }` - `SetFireworkExplosion`: a record with fields - `shape`: FireworkShape (optional). If omitted, the original shape is kept (or `small_ball` is used if there was no component). - `colors`: list of int (optional). If omitted, the original colors are kept (or `[]` is used if there was no component). Calculated as `RED << 16 | GREEN << 8 | BLUE`. Each of these fields must be between 0 and 255, inclusive. - `fade_colors`: list of int (optional). If omitted, the original fade colors are kept (or `[]` is used if there was no component). Calculated as `RED << 16 | GREEN << 8 | BLUE`. Each of these fields must be between 0 and 255, inclusive. - `trail`: bool (optional). If omitted, the original `has_trail` value is kept (or `false` is used if there was no component). - `twinkle`: bool (optional). If omitted, the original `has_twinkle` value is kept (or `false` is used if there was no component). - Also has the fields of `Conditions` - For example `{}` - `SetFireworks`: a record with fields - `flight_duration`: int 0..255 (optional). If omitted, the flight duration of the item is left untouched - or set to 0 if the component did not exist before. - `explosions`: list_operation (optional) - Also has the fields of `Conditions` - For example `{}` - `SetInstrument`: a record with fields - `options`: instrument id | #instrument tag | list of instrument ids. Sets the instrument tag for a goat horn. - Also has the fields of `Conditions` - For example `{ options = admire_goat_horn }` - `SetItem`: a record with fields - `item`: item id - Also has the fields of `Conditions` - For example `{ item = abandoned_camp_map }` - `SetLootTable`: a record with fields - `loot_table_id`: loot_table id. The loot table to set to the container block item. - `seed`: int (optional). The container seed to use. Defaults to a random seed. - Also has the fields of `Conditions` - For example `{ loot_table_id = archaeology/desert_pyramid }` - `SetLore`: list_operation - For example `Append(…)` - `SetName`: a record with fields - `entity`: EntityTarget (optional). Specifies the entity to act as the target `@s` in the JSON text component. - `name`: Text - `target`: SetNameTarget (optional). Which name component to set. Defaults to `custom_name`. - Also has the fields of `Conditions` - For example `{ name = "text" }` - `SetNameTarget`: one of `"item_name"`, `"custom_name"` - For example `item_name` - `SetNbt`: a record with fields - `tag`: string - Also has the fields of `Conditions` - For example `{ tag = "text" }` - `SetOminousBottleAmplifier`: a record with fields - `amplifier`: IntNumberProviderRef - Also has the fields of `Conditions` - For example `{ amplifier = brewing/uses_default }` - `SetPotion`: a record with fields - `id`: potion id. The potion identifier. - Also has the fields of `Conditions` - For example `{ id = awkward }` - `SetRandomDyes`: a record with fields - `number_of_dyes`: IntNumberProviderRef. Applies specified number of random dyes to the item. For example, one possible outcome of `"number_of_dyes": 2` is `#2C3065`, which is the combination of a blue dye and a black dye. The same dye color can be selected multiple times. - Also has the fields of `Conditions` - For example `{ number_of_dyes = brewing/uses_default }` - `SetRandomPotion`: a record with fields - `options`: potion id | #potion tag | list of potion ids (optional). Possible potions to select from. Defaults to all potions. - Also has the fields of `Conditions` - For example `{}` - `SetStewEffect`: a record with fields - `effects`: list of StewEffect (optional). Sets the status effects for suspicious stew. - Also has the fields of `Conditions` - For example `{}` - `SetWriteableBookPages`: list_operation - For example `Append(…)` - `SetWrittenBookPages`: list_operation - For example `Append(…)` - `SingleProvider`: a record with fields - `input`: T - For example `{ input = … }` - `SingletonPoolEntry`: a record with fields - `weight`: int 1.. (optional) - `quality`: int (optional) - Also has the fields of `LootPoolEntryBase` - For example `{}` - `SlotSource`: TypedSlotSource | slot_source id | #slot_source tag | list of (slot_source id | TypedSlotSource) - For example `Contents(…)`, `[Contents(…)]` - `SlotSourceArgument`: SlotSource - For example `Contents(…)`, `[Contents(…)]` - `SlotsPoolEntry`: a record with fields - `slot_source`: SlotSource - Also has the fields of `SingletonPoolEntry` - For example `{ slot_source = Contents(…) }` - `StewEffect`: a record with fields - `type`: mob_effect id. The status effect of this stew effect. - `duration`: IntNumberProviderRef. The duration of this stew effect, in seconds. - For example `{ type = absorption, duration = … }` - `StorageNumberProvider`: a record with fields - `storage`: storage id - `path`: string - For example `{ storage = …, path = "text" }` - `SumNumberProvider`: a record with fields - `summands`: list of LegacyNumberProvider - For example `{ summands = [0] }` - `TableBonus`: a record with fields - `enchantment`: enchantment id - `chances`: list of number 0..1. Probabilities for each enchantment level - For example `{ enchantment = aqua_affinity, chances = [0] }` - `TagPoolEntry`: a record with fields - `items`: ItemListRef - `expand`: bool (optional). If `true`, each of the items becomes an independent entry in the pool with the same `weight` and `quality`. If `false`, drops all items in the tag. Defaults to `false`. - Also has the fields of `SingletonPoolEntry` - For example `{ items = abandoned_camp_map }` - `TimeCheck`: a record with fields - `clock`: world_clock id. The world clock to check. - `value`: IntRange. Check the current game tick. - `period`: int (optional). Game tick supplied to `value` check gets modulo-divided by this. For example, if set to 24000, `value` operates on a time period of days. - For example `{ clock = overworld, value = {} }` - `ToggleTooltips`: a record with fields - `toggles`: map of data_component_type id to bool. Toggles which tooltips are shown. - Also has the fields of `Conditions` - For example `{ toggles = {} }` - `ToggleableDataComponent`: one of `"attribute_modifiers"`, `"can_break"`, `"can_place_on"`, `"dyed_color"`, `"enchantments"`, `"jukebox_playable"`, `"stored_enchantments"`, `"trim"`, `"unbreakable"` - For example `attribute_modifiers` - `TypedSlotSource`: slot_source - For example `Contents(…)` - `UniformBonusFormula`: a record with fields - `parameters`: { bonusMultiplier: int } - For example `{ parameters = { … } }` - `UniformNumberProvider`: a record with fields - `min`: LegacyNumberProvider - `max`: LegacyNumberProvider - For example `{ min = 0, max = 0 }` - `ValueCheck`: a record with fields - `value`: LegacyNumberProvider. Clamps to an integer. - `range`: IntRange. Passes when `value` is within this range. - For example `{ value = 0, range = {} }` - `WeatherCheck`: a record with fields - `raining`: bool (optional) - `thundering`: bool (optional) - For example `{}` # Advancements types Named types from this part of the game's schema: enums, aliases and records, with values that fit. - `AdvancementCriteriaMap`: a record with fields - `[string]`: AdvancementCriterion (optional) - For example `{}` - `AdvancementCriterion`: trigger - For example `AllayDropItemOnBlock()` - `AdvancementDisplay`: a record with fields - `icon`: ItemStackTemplate - `title`: Text - `description`: Text - `frame`: AdvancementFrame (optional). Controls the advancement tile frame. Defaults to `task`. - `show_toast`: bool (optional). Whether to show the toast pop up after completing this advancement. Defaults to `true`. - `announce_to_chat`: bool (optional). Whether to announce in the chat when this advancement has been completed. Defaults to `true`. - `hidden`: bool (optional). Whether or not to hide this advancement and all its children from the advancement screen, until this advancement have been completed. Has no effect on root advancements themselves, but still affects all their children. Defaults to `false`. - For example `{ icon = { … }, title = "text", description = "text" }` - `AdvancementEntityPredicate`: PredicateRef - For example `AllOf(…)` - `AdvancementFrame`: one of - `"task"`: Normal border. - `"challenge"`: Fancy spiked border (used for the kill all mobs advancement). - `"goal"`: Rounded border (used for the full beacon advancement). - For example `task` - `AdvancementIcon`: a record with fields - `item`: item id - `nbt`: string (optional) - For example `{ item = abandoned_camp_map }` - `AdvancementLocationPredicate`: PredicateRef - For example `AllOf(…)` - `AdvancementRewards`: a record with fields - `experience`: int (optional). XP to add. - `loot`: LootTableListRef (optional). Loot tables to give. - `recipes`: list of recipe ids (optional). Recipes to unlock. - `function`: function id (optional). Function to run as and at the player. Function tags are not allowed. - For example `{}` - `AllOptional`: a record with fields - `conditions`: C (optional) - For example `{}` - `AnyBlockInteractionTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, location?: AdvancementLocationPredicate } (optional) - For example `{}` - `AxolotlPredicate`: a record with fields - `variant`: AxolotlVariant - For example `{ variant = lucy }` - `BeeNestDestroyedTrigger`: a record with fields - `conditions`: object (optional) - For example `{}` - `BlockPredicate`: a record with fields - `blocks`: block id | #block tag | list of block ids (optional) - `state`: BlockPredicateState (optional) - `nbt`: string | any (depends on blocks) (optional) - `components`: DataComponentExactPredicate (optional). Match exact data component values on the block entity. - `predicates`: DataComponentPredicate (optional). Test data component values on the block entity. - For example `{}` - `BlockPredicateState`: a record with fields - `[any]`: MinMaxBounds (optional) - For example `{}` - `BlockStateConditions`: a record with fields - `blocks`: BlockListRef (optional) - `state`: any (depends on blocks) (optional) - For example `{}` - `BoatPredicate`: a record with fields - `variant`: BoatType - For example `{ variant = oak }` - `BredAnimalsTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, parent?: AdvancementEntityPredicate, partner?: AdvancementEntityPredicate, child?: AdvancementEntityPredicate } (optional) - For example `{}` - `BrewedPotionTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, potion?: PotionsPredicate } (optional) - For example `{}` - `CatPredicate`: a record with fields - `variant`: cat_variant id | #cat_variant tag | list of cat_variant ids - For example `{ variant = all_black }` - `ChangeDimensionTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, from?: dimension id, to?: dimension id } (optional) - For example `{}` - `ChanneledLightningTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, victims?: list of AdvancementEntityPredicate } (optional) - For example `{}` - `ConstructBeaconTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, level?: MinMaxBounds of int } (optional) - For example `{}` - `ConsumeItemTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, item?: ItemPredicate } (optional) - For example `{}` - `CuredZombieVillagerTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, zombie?: AdvancementEntityPredicate, villager?: AdvancementEntityPredicate } (optional) - For example `{}` - `DamagePredicate`: a record with fields - `dealt`: MinMaxBounds of number (optional). Amount of incoming damage before damage reduction. - `taken`: MinMaxBounds of number (optional). Amount of incoming damage after damage reduction. - `blocked`: bool (optional). Whether the damage was successfully blocked. - `source_entity`: EntityPredicate (optional). Source of the damage (eg: a skeleton shooting an arrow or player igniting tnt). - `type`: DamageSourcePredicate (optional) - For example `{}` - `DamageSourceFlags`: a record with fields - `is_explosion`: bool (optional) - `is_fire`: bool (optional) - `is_magic`: bool (optional) - `is_projectile`: bool (optional) - `is_lightning`: bool (optional) - `bypasses_armor`: bool (optional) - `bypasses_invulnerability`: bool (optional) - `bypasses_magic`: bool (optional) - For example `{}` - `DamageSourcePredicate`: a record with fields - `tags`: list of DamageTagPredicate (optional). Damage type tags that the damage type is in. - `source_entity`: EntityPredicate (optional). Source of the damage (eg: a skeleton shooting an arrow or player igniting tnt). - `direct_entity`: EntityPredicate (optional). Direct entity responsible for the damage (eg: the arrow or tnt). - `is_direct`: bool (optional). Damage is direct when its direct and source entities are the same. - For example `{}` - `DamageTagPredicate`: a record with fields - `id`: damage_type id | #damage_type tag | list of damage_type ids - `expected`: bool. Whether the damage is expected to have or not have the tag. - For example `{ id = arrow, expected = true }` - `DefaultBlockInteractionTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, location?: AdvancementLocationPredicate } (optional) - For example `{}` - `DistancePredicate`: a record with fields - `x`: MinMaxBounds of number (optional) - `y`: MinMaxBounds of number (optional) - `z`: MinMaxBounds of number (optional) - `absolute`: MinMaxBounds of number (optional) - `horizontal`: MinMaxBounds of number (optional) - For example `{}` - `DistanceTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, start_position?: LocationPredicate, distance?: DistancePredicate } (optional) - For example `{}` - `EffectsChangedTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, effects?: EntityEffectsPredicate, source?: AdvancementEntityPredicate } (optional) - For example `{}` - `EnchantedItemTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, item?: ItemPredicate, levels?: MinMaxBounds of int } (optional) - For example `{}` - `EnchantmentPredicate`: a record with fields - `enchantments`: enchantment id | #enchantment tag | list of enchantment ids (optional) - `levels`: MinMaxBounds of int (optional) - For example `{}` - `EnterBlockTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, blocks?: BlockListRef, state?: any (depends on blocks) } (optional) - For example `{}` - `EntityEffectsPredicate`: a record with fields - `[mob_effect id]`: MobEffectPredicate (optional) - For example `{}` - `EntityEquipmentPredicate`: a record with fields - `[EquipmentPredicateSlot]`: ItemPredicate (optional) - For example `{}` - `EntityFlagsPredicate`: a record with fields - `is_on_fire`: bool (optional) - `is_sneaking`: bool (optional) - `is_sprinting`: bool (optional) - `is_swimming`: bool (optional) - `is_baby`: bool (optional) - `is_on_ground`: bool (optional) - `is_flying`: bool (optional) - `is_in_water`: bool (optional) - `is_fall_flying`: bool (optional) - For example `{}` - `EntityHurtPlayerTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, damage?: DamagePredicate } (optional) - For example `{}` - `EntityPredicate`: EntitySubPredicateMap - For example `{}` - `EntitySlotsPredicate`: a record with fields - `[string]`: ItemPredicate (optional) - For example `{}` - `EntitySubPredicate`: entity_sub_predicate object - For example `Components()` - `EntitySubPredicateMap`: a record with fields - `[entity_sub_predicate_type id]`: any (optional) - For example `{}` - `EntityTagPredicate`: a record with fields - `any_of`: list of string (optional). Must have at least one of the listed tags. - `all_of`: list of string (optional). Must have all the listed tags. - `none_of`: list of string (optional). Must have none of the listed tags. - For example `{}` - `EntityTypePredicate`: entity_type id | #entity_type tag | list of entity_type ids - For example `acacia_boat`, `[acacia_boat]` - `EquipmentPredicateSlot`: one of `"mainhand"`, `"offhand"`, `"head"`, `"chest"`, `"legs"`, `"feet"`, `"body"` - For example `mainhand` - `FallAfterExplosionTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, start_position?: LocationPredicate, distance?: DistancePredicate, cause?: AdvancementEntityPredicate } (optional) - For example `{}` - `FilledBucketTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, item?: ItemPredicate } (optional) - For example `{}` - `FishingHookPredicate`: a record with fields - `in_open_water`: bool (optional) - For example `{}` - `FishingRodHookedTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, entity?: AdvancementEntityPredicate, item?: ItemPredicate, rod?: ItemPredicate } (optional) - For example `{}` - `FluidPredicate`: a record with fields - `fluids`: fluid id | #fluid tag | list of fluid ids (optional) - `state`: map of string to MinMaxBounds of int | bool | string (optional) - For example `{}` - `FluidPredicateState`: a record with fields - `[string]`: MinMaxBounds of int | bool | string (optional) - For example `{}` - `FoodPredicate`: a record with fields - `level`: MinMaxBounds of int (optional) - `saturation`: MinMaxBounds of number (optional) - For example `{}` - `FoxPredicate`: a record with fields - `variant`: FoxType - For example `{ variant = red }` - `FrogPredicate`: a record with fields - `variant`: frog_variant id | #frog_variant tag | list of frog_variant ids - For example `{ variant = cold }` - `GameMode`: one of `"survival"`, `"creative"`, `"adventure"`, `"spectator"` - For example `survival` - `HorsePredicate`: a record with fields - `variant`: HorseVariant - For example `{ variant = white }` - `ImpossibleTrigger`: a record with fields - `conditions`: object (optional) - For example `{}` - `InputPredicate`: a record with fields - `forward`: bool (optional) - `backward`: bool (optional) - `left`: bool (optional) - `right`: bool (optional) - `jump`: bool (optional) - `sneak`: bool (optional) - `sprint`: bool (optional) - For example `{}` - `InventoryChangeTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, slots?: { empty?: MinMaxBounds of int, occupied?: MinMaxBounds of int, full?: MinMaxBounds of int }, items?: list of ItemPredicate } (optional) - For example `{}` - `InventoryChangedSlots`: a record with fields - `empty`: MinMaxBounds of int (optional). Amount of empty slots. - `occupied`: MinMaxBounds of int (optional). Amount of occupied slots. - `full`: MinMaxBounds of int (optional). Amount of slots that are a full stack. - For example `{}` - `ItemDurabilityTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, delta?: MinMaxBounds of int, durability?: MinMaxBounds of int, item?: ItemPredicate } (optional) - For example `{}` - `ItemPredicate`: { items?: item id | #item tag | list of item ids, count?: MinMaxBounds of int, components?: DataComponentExactPredicate, predicates?: DataComponentPredicate } - For example `{}` - `ItemUesdOnLocationConditions`: a record with fields - `location`: AdvancementLocationPredicate (optional). Predicate context: Advancement Location. - Also has the fields of `PlayerConditions` - For example `{}` - `ItemUsedOnLocationTrigger`: a record with fields - `conditions`: ItemUesdOnLocationConditions (optional) - For example `{}` - `KilledByArrowTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, unique_entity_types?: MinMaxBounds of int, fired_from_weapon?: ItemPredicate, victims?: list of AdvancementEntityPredicate } (optional) - For example `{}` - `KilledTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, entity?: AdvancementEntityPredicate, killing_blow?: DamageSourcePredicate } (optional) - For example `{}` - `LevitationTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, distance?: DistancePredicate, duration?: MinMaxBounds of int } (optional) - For example `{}` - `LightningBoltPredicate`: a record with fields - `blocks_set_on_fire`: MinMaxBounds of int (optional) - `entity_struck`: EntityPredicate (optional) - For example `{}` - `LightningStrikeTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, lightning?: AdvancementEntityPredicate, bystander?: AdvancementEntityPredicate } (optional) - For example `{}` - `LlamaPredicate`: a record with fields - `variant`: LlamaVariant - For example `{ variant = creamy }` - `LocationPredicate`: a record with fields - `position`: { x?: MinMaxBounds of number, y?: MinMaxBounds of number, z?: MinMaxBounds of number } (optional) - `biomes`: biome id | #biome tag | list of biome ids (optional) - `structures`: structure id | #structure tag | list of structure ids (optional) - `dimension`: dimension id (optional) - `light`: Light(…) (optional). Calculated using: `max(sky-darkening, block)`. - `block`: BlockPredicate (optional) - `fluid`: FluidPredicate (optional) - `smokey`: bool (optional). Whether the block is above (5 blocks or less) a campfire or soul campfire. - `can_see_sky`: bool (optional). Whether the location has the maximum possible level of sky light - For example `{}` - `LocationPredicateLight`: a record with fields - `light`: MinMaxBounds of int 0..15 (optional) - For example `{}` - `LocationPredicatePosition`: a record with fields - `x`: MinMaxBounds of number (optional) - `y`: MinMaxBounds of number (optional) - `z`: MinMaxBounds of number (optional) - For example `{}` - `LocationTrigger`: a record with fields - `conditions`: PlayerConditions (optional) - For example `{}` - `LootTableTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, loot_tables: LootTableListRef } - For example `{ conditions = { … } }` - `MobEffectPredicate`: a record with fields - `amplifier`: MinMaxBounds of int (optional) - `duration`: MinMaxBounds of int (optional) - `ambient`: bool (optional) - `visible`: bool (optional) - For example `{}` - `MooshroomPredicate`: a record with fields - `variant`: MooshroomType - For example `{ variant = red }` - `MovementPredicate`: a record with fields - `x`: MinMaxBounds of number (optional) - `y`: MinMaxBounds of number (optional) - `z`: MinMaxBounds of number (optional) - `speed`: MinMaxBounds of number (optional) - `horizontal_speed`: MinMaxBounds of number (optional) - `vertical_speed`: MinMaxBounds of number (optional) - `fall_distance`: MinMaxBounds of number (optional) - For example `{}` - `NetherTravelTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, start_position?: LocationPredicate, distance?: DistancePredicate } (optional) - For example `{}` - `OldEntityPredicate`: a record with fields - `type`: EntityTypePredicate (optional) - `type_specific`: EntitySubPredicate (optional) - `team`: string (optional) - `nbt`: string | any (depends on type) (optional) - `location`: LocationPredicate (optional) - `distance`: DistancePredicate (optional) - `flags`: EntityFlagsPredicate (optional) - `equipment`: EntityEquipmentPredicate (optional) - `vehicle`: EntityPredicate (optional) - `passenger`: EntityPredicate (optional) - `stepping_on`: LocationPredicate (optional) - `targeted_entity`: EntityPredicate (optional). Entity that a mob's AI/aggro is targeting. - `effects`: EntityEffectsPredicate (optional) - `slots`: EntitySlotsPredicate (optional) - `movement`: MovementPredicate (optional) - `periodic_tick`: int 1.. (optional). True every `n` ticks of an entity's lifetime. - `movement_affected_by`: LocationPredicate (optional). Whether the block at most 0.5 blocks below the entity is present which can affect its movement. - `components`: DataComponentExactPredicate (optional). Match exact data component values on the entity. - `predicates`: DataComponentPredicate (optional). Test data component values on the entity. - For example `{}` - `PaintingPredicate`: a record with fields - `variant`: painting_variant id | #painting_variant tag | list of painting_variant ids - For example `{ variant = alban }` - `ParitalRequired`: a record with fields - `conditions`: C - For example `{ conditions = … }` - `ParrotPredicate`: a record with fields - `variant`: ParrotVariant - For example `{ variant = red_blue }` - `PickedUpItemTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, item?: ItemPredicate, entity?: AdvancementEntityPredicate } (optional) - For example `{}` - `PlacedBlockConditions`: a record with fields - `item`: ItemPredicate (optional). Item that was used to place the block before the item was consumed. - `location`: LocationPredicate (optional). Predicate context: Advancement Location. - Also has the fields of `PlayerConditions`, `BlockStateConditions` - For example `{}` - `PlacedBlockTrigger`: a record with fields - `conditions`: ItemUesdOnLocationConditions (optional) - For example `{}` - `PlayerAdvancementCriteria`: a record with fields - `[string]`: bool (optional) - For example `{}` - `PlayerAdvancements`: a record with fields - `[advancement id]`: bool | map of string to bool (optional) - For example `{}` - `PlayerConditions`: a record with fields - `player`: AdvancementEntityPredicate (optional). Predicate context: Advancement Entity. - For example `{}` - `PlayerHurtEntityTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, damage?: DamagePredicate, entity?: AdvancementEntityPredicate } (optional) - For example `{}` - `PlayerInteractTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, item?: ItemPredicate, entity?: AdvancementEntityPredicate } (optional) - For example `{}` - `PlayerPredicate`: a record with fields - `advancements`: map of advancement id to bool | map of string to bool (optional) - `gamemode`: list of GameMode (optional) - `level`: MinMaxBounds of int (optional). Experience/XP level. - `recipes`: map of recipe id to bool (optional) - `stats`: list of StatisticPredicate (optional) - `looking_at`: EntityPredicate (optional) - `input`: object (optional). Checks the movement keys of the player. - `food`: { level?: MinMaxBounds of int, saturation?: MinMaxBounds of number } (optional) - For example `{}` - `PlayerRecipes`: a record with fields - `[recipe id]`: bool (optional) - For example `{}` - `PlayerTrigger`: a record with fields - `conditions`: PlayerConditions (optional) - For example `{}` - `PostComponentsItemPredicate`: a record with fields - `items`: item id | #item tag | list of item ids (optional) - `count`: MinMaxBounds of int (optional) - `components`: DataComponentExactPredicate (optional) - `predicates`: DataComponentPredicate (optional) - For example `{}` - `RabbitPredicate`: a record with fields - `variant`: RabbitVariant - For example `{ variant = brown }` - `RaiderPredicate`: a record with fields - `has_raid`: bool (optional) - `is_captain`: bool (optional) - For example `{}` - `RecipeCraftedTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, recipes: RecipeListRef, ingredients?: list of ItemPredicate (1 to 9) } - For example `{ conditions = { … } }` - `RecipeUnlockedTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, recipes: RecipeListRef } - For example `{ conditions = { … } }` - `RootAdvancementDisplay`: a record with fields - `background`: texture id. Used for the advancement tab. - Also has the fields of `AdvancementDisplay` - For example `{ icon = { … }, title = "text", description = "text", background = block/acacia_door_bottom, … }` - `SalmonPredicate`: a record with fields - `variant`: SalmonVariant (optional) - For example `{}` - `SalmonVariant`: one of `"small"`, `"medium"`, `"large"` - For example `small` - `SheepPredicate`: a record with fields - `sheared`: bool (optional) - For example `{}` - `ShotCrossbowTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, item?: ItemPredicate } (optional) - For example `{}` - `SlideDownBlockTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, blocks?: BlockListRef, state?: any (depends on blocks) } (optional) - For example `{}` - `SlimePredicate`: a record with fields - `size`: MinMaxBounds of int (optional) - For example `{}` - `SpearMobsTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, count?: int 1.. } (optional) - For example `{}` - `StartRidingTrigger`: a record with fields - `conditions`: PlayerConditions (optional) - For example `{}` - `StatisticPredicate`: a record with fields - `type`: stat_type id - `stat`: any (depends on type) - `value`: MinMaxBounds of int - For example `{ type = broken, stat = …, value = 0 }` - `SummonedEntityTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, entity?: AdvancementEntityPredicate } (optional) - For example `{}` - `TameAnimalTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, entity?: AdvancementEntityPredicate } (optional) - For example `{}` - `TargetBlockTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, projectile?: AdvancementEntityPredicate, signal_strength?: MinMaxBounds of int } (optional) - For example `{}` - `TradeTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, villager?: AdvancementEntityPredicate, item?: ItemPredicate } (optional) - For example `{}` - `Trigger`: one of `"allay_drop_item_on_block"`, `"avoid_vibration"`, `"bee_nest_destroyed"`, `"bred_animals"`, `"brewed_potion"`, `"changed_dimension"`, `"channeled_lightning"`, `"construct_beacon"`, `"consume_item"`, `"cured_zombie_villager"`, `"effects_changed"`, `"enchanted_item"`, `"enter_block"`, `"entity_hurt_player"`, `"entity_killed_player"`, `"fall_from_height"`, `"filled_bucket"`, `"fishing_rod_hooked"`, `"hero_of_the_village"`, `"impossible"`, `"inventory_changed"`, `"item_durability_changed"`, `"item_used_on_block"`, `"kill_mob_near_sculk_catalyst"`, `"killed_by_crossbow"`, `"levitation"`, `"lightning_strike"`, `"location"`, `"nether_travel"`, `"placed_block"`, `"player_generates_container_loot"`, `"player_hurt_entity"`, `"player_interacted_with_entity"`, `"player_killed_entity"`, `"recipe_crafted"`, `"recipe_unlocked"`, `"ride_entity_in_lava"`, `"shot_crossbow"`, `"slept_in_bed"`, `"slide_down_block"`, `"started_riding"`, `"summoned_entity"`, `"tame_animal"`, `"target_hit"`, `"thrown_item_picked_up_by_entity"`, `"thrown_item_picked_up_by_player"`, `"tick"`, `"used_ender_eye"`, `"used_totem"`, `"using_item"`, `"villager_trade"`, `"voluntary_exile"` - For example `allay_drop_item_on_block` - `TropicalFishPredicate`: a record with fields - `variant`: TropicalFishPattern - For example `{ variant = kob }` - `UsedEnderEyeTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, distance?: MinMaxBounds of number } (optional) - For example `{}` - `UsedTotemTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, item?: ItemPredicate } (optional) - For example `{}` - `UsingItemTrigger`: a record with fields - `conditions`: { player?: AdvancementEntityPredicate, item?: ItemPredicate } (optional) - For example `{}` - `VillagerPredicate`: a record with fields - `variant`: villager_type id - For example `{ variant = desert }` - `WolfPredicate`: a record with fields - `variant`: wolf_variant id | #wolf_variant tag | list of wolf_variant ids - For example `{ variant = ashen }` # Enchantments types Named types from this part of the game's schema: enums, aliases and records, with values that fit. - `AddEffectValue`: a record with fields - `value`: LevelBasedValue - For example `{ value = 0 }` - `AllOfEffectValue`: a record with fields - `effects`: list of ValueEffect (at least 1) - For example `{ effects = [Add(…)] }` - `AllOfEntityEffect`: a record with fields - `effects`: list of EntityEffect (at least 1) - For example `{ effects = [AllOf(…)] }` - `AllOfLocationBasedEffect`: a record with fields - `effects`: list of LocationBasedEffect (at least 1) - For example `{ effects = [AllOf(…)] }` - `AmmoUseEnchantmentEffect`: a record with fields - `requirements`: Predicate (optional). Predicate context: Item Parameters. - `effect`: ValueEffect. Amount of ammunition being used up. `0` has a side effect of applying `intangible_projectile` component to the projectile item. - For example `{ effect = Add(…) }` - `ApplyExhaustionEntityEffect`: a record with fields - `amount`: LevelBasedValue. The amount of exhaustion to apply to player. - For example `{ amount = 0 }` - `ApplyImpulseEntityEffect`: a record with fields - `direction`: list of number (exactly 3). Impulse direction in local coordinates (the same used by `tp @s ^ ^ ^`). `[left, upward, forward]` - `coordinate_scale`: list of number (exactly 3). The multipler to apply to the computed impulse direction. `[x, y, z]` - `magnitude`: LevelBasedValue. The scale of the impulse. - For example `{ direction = [0, 0, 0], coordinate_scale = [0, 0, 0], magnitude = 0 }` - `ApplyMobEffectEntityEffect`: a record with fields - `to_apply`: mob_effect id | #mob_effect tag | list of mob_effect ids. If multiple mob effects are specified, a random effect is selected. - `min_duration`: LevelBasedValue - `max_duration`: LevelBasedValue - `min_amplifier`: LevelBasedValue - `max_amplifier`: LevelBasedValue - For example `{ to_apply = absorption, min_duration = 0, max_duration = 0, min_amplifier = 0, … }` - `ArmorEffectivenessEnchantmentEffect`: a record with fields - `requirements`: Predicate (optional). Predicate context: Damage Parameters. - `effect`: ValueEffect. Determines armor effectiveness; `0.0` for no effect, `1.0` for full effect. - For example `{ effect = Add(…) }` - `AttackTarget`: one of `"attacker"`, `"damaging_entity"`, `"victim"` - For example `attacker` - `AttributeEffect`: a record with fields - `attribute`: attribute id - `id`: attribute_modifier id. Used when equipping and unequipping the item to identify which modifier to add or remove from the entity. Postfixed with the slot name when the enchanted item is equipped. - `amount`: LevelBasedValue. Change in the attribute. - `operation`: AttributeOperation. The attribute operation to use. - For example `{ attribute = air_drag_modifier, id = …, amount = 0, operation = add_value, … }` - `BlockExperienceEnchantmentEffect`: a record with fields - `requirements`: Predicate (optional). Predicate context: Item Parameters. - `effect`: ValueEffect. Amount of experience awarded. - For example `{ effect = Add(…) }` - `BlockInteraction`: one of - `"none"`: No item drops or special behavior. - `"block"`: Drops items as if a block caused the explosion; `block_explosion_drop_decay` game rule applies. - `"mob"`: Drops items as if a mob caused the explosion; `mob_explosion_drop_decay` game rule applies. - `"tnt"`: Drops items as if TNT caused the explosion; `tnt_explosion_drop_decay` game rule applies. - `"trigger"`: Triggers redstone-activated blocks. - For example `none` - `ByCostEnchantmentProvider`: a record with fields - `enchantments`: EnchantmentsType - `cost`: IntProvider of int. Cost to use for the Enchanting process. - For example `{ enchantments = aqua_affinity, cost = 0 }` - `ByCostWithDifficultyEnchantmentProvider`: a record with fields - `enchantments`: EnchantmentsType - `min_cost`: int 0... Positive integer representing the minimum possible cost - `max_cost_span`: int 0... Span of the cost randomization when the special factor is at its maximum. - For example `{ enchantments = aqua_affinity, min_cost = 0, max_cost_span = 0 }` - `ChangeItemDamageEffect`: a record with fields - `amount`: LevelBasedValue. Damage to apply to the enchanted item. Negative values will repair the item. The change is not applied to items held by players in creative mode. - For example `{ amount = 0 }` - `ClampedLevelValue`: a record with fields - `value`: LevelBasedValue - `min`: number - `max`: number - For example `{ value = 0, min = 0, max = 0 }` - `CrossbowChargeSoundsEnchantmentEffect`: a record with fields - `start`: SoundEventRef (optional). Start of charging. - `mid`: SoundEventRef (optional). Middle of charging. - `end`: SoundEventRef (optional). End of charging. - For example `{}` - `DamageEnchantmentEffect`: a record with fields - `requirements`: Predicate (optional). Predicate context: Damage Parameters. - `effect`: ValueEffect. Damage dealt by the weapon. - For example `{ effect = Add(…) }` - `DamageEntityEffect`: a record with fields - `damage_type`: damage_type id - `min_damage`: LevelBasedValue. Amount of damage is randomized within the given min/max span. - `max_damage`: LevelBasedValue - For example `{ damage_type = arrow, min_damage = 0, max_damage = 0 }` - `DamageImmunityEnchantmentEffect`: a record with fields - `requirements`: Predicate (optional). Predicate context: Damage Parameters. - `effect`: object. Dummy value; this is a boolean effect. - For example `{ effect = {} }` - `DamageItemEffect`: a record with fields - `amount`: LevelBasedValue. Damage to apply to the enchanted item. The damage is not applied to items held by players in creative mode. - For example `{ amount = 0 }` - `DamageProtectionEnchantmentEffect`: a record with fields - `requirements`: Predicate (optional). Predicate context: Damage Parameters. - `effect`: ValueEffect. Damage reduction factor. Provides `factor * 4%` of damage reduction, capped at 80%. - For example `{ effect = Add(…) }` - `EnchantmentCost`: a record with fields - `base`: int. Base cost at level 1. - `per_level_above_first`: int. Cost increase per level above 1. - For example `{ base = 0, per_level_above_first = 0 }` - `EnchantmentEffectComponentMap`: a record with fields - `[enchantment_effect_component_type id]`: any (optional) - For example `{}` - `EnchantmentsType`: enchantment id | #enchantment tag | list of enchantment ids (at least 1) - For example `aqua_affinity`, `[aqua_affinity]` - `EntityEffect`: entity_effect object - For example `AllOf(…)` - `EquipmentDropsEnchantmentEffect`: a record with fields - `requirements`: Predicate (optional). Predicate context: Damage Parameters. - `effect`: ValueEffect. Chance between `0.0` and `1.0` of an equipped piece dropping. If the drop chance on mob is 0, the chance will not be affected by this effect. - `enchanted`: "attacker" | "victim". Which subject needs to be enchanted for the effect to apply. - For example `{ effect = Add(…), enchanted = attacker }` - `ExplodeEntityEffect`: a record with fields - `attribute_to_user`: bool (optional). Whether the explosion should be attributed to the user of the enchanted tool. - `damage_type`: damage_type id (optional). If omitted, no damage is dealt by the explosion. - `immune_blocks`: block id | #block tag | list of block ids (optional). List of Blocks or hash-prefixed Block Tag specifying which blocks fully block the explosion. - `knockback_multiplier`: LevelBasedValue (optional). If omitted, constant value `1` is applied. - `offset`: list of number (exactly 3) (optional). Relative coordinates to offset the explosion by. Defaults to `[0, 0, 0]`. - `radius`: LevelBasedValue - `create_fire`: bool (optional). Whether fire is placed within the explosion radius. - `block_interaction`: BlockInteraction. Whether the explosion has special effects on blocks. - `sound`: SoundEventRef - `small_particle`: Particle - `large_particle`: Particle - `block_particles`: FlatWeightedList of ExplosionParticleInfo (optional) - For example `{ radius = 0, block_interaction = none, sound = ambient.basalt_deltas.additions, small_particle = AngryVillager(…), … }` - `ExplosionParticleInfo`: a record with fields - `particle`: Particle - `scaling`: number (optional). Defaults to 1.0. Scaling of the distance between the center of the explosion and the block - `speed`: number (optional). Defaults to 1.0. Scaling of the speed of the particle - For example `{ particle = AngryVillager(…) }` - `ExponentLevelValue`: a record with fields - `base`: LevelBasedValue - `power`: LevelBasedValue - For example `{ base = 0, power = 0 }` - `ExponentialEffectValue`: a record with fields - `base`: LevelBasedValue - `exponent`: LevelBasedValue - For example `{ base = 0, exponent = 0 }` - `FishingLuckBonusEnchantmentEffect`: a record with fields - `requirements`: Predicate (optional). Predicate context: Entity Parameters. `this` is the player fishing. - `effect`: ValueEffect. Amount of luck being added. - For example `{ effect = Add(…) }` - `FishingTimeReductionEnchantmentEffect`: a record with fields - `requirements`: Predicate (optional). Predicate context: Entity Parameters. `this` is the player fishing. - `effect`: ValueEffect. Time reduction in seconds (higher values mean less time until a fish bites). - For example `{ effect = Add(…) }` - `FractionLevelValue`: a record with fields - `numerator`: LevelBasedValue - `denominator`: LevelBasedValue - For example `{ numerator = 0, denominator = 0 }` - `HitBlockEnchantmentEffect`: a record with fields - `requirements`: Predicate (optional). Predicate context: Entity Parameters. `this` is the entity hitting the Block, unless during a projectile attack, then, `this` is the projectile. - `effect`: EntityEffect. On the entity hitting the Block - For example `{ effect = AllOf(…) }` - `IgniteEntityEffect`: a record with fields - `duration`: LevelBasedValue. Seconds the fire should last. - For example `{ duration = 0 }` - `ItemDamageEnchantmentEffect`: a record with fields - `requirements`: Predicate (optional). Predicate context: Item Parameters. - `effect`: ValueEffect. Amount of damage being dealt to the item. - For example `{ effect = Add(…) }` - `KnockbackEnchantmentEffect`: a record with fields - `requirements`: Predicate (optional). Predicate context: Damage Parameters. - `effect`: ValueEffect. Amount of knockback being applied. - For example `{ effect = Add(…) }` - `LevelBasedValue`: LevelBasedValue - For example `0`, `Clamped(…)` - `LevelBasedValue`: number | LevelBasedValueMap - For example `0`, `Clamped(…)` - `LevelBasedValueMap`: level_based_value - For example `Clamped(…)` - `LinearLevelValue`: a record with fields - `base`: number. Base value at level 1. - `per_level_above_first`: number. Value increase per level above 1. - For example `{ base = 0, per_level_above_first = 0 }` - `LocationBasedEffect`: location_based_effect object - For example `AllOf(…)` - `LocationChangedEnchantmentEffect`: a record with fields - `requirements`: Predicate (optional). Predicate context: Location Parameters. - `effect`: LocationBasedEffect. On the entity changing location. - For example `{ effect = AllOf(…) }` - `LookupLevelValue`: a record with fields - `values`: list of LevelBasedValue (at least 1). Indexed by `level - 1` to apply, if present - `fallback`: LevelBasedValue. Applied if the level is greater than the size of `values`. - For example `{ values = [0], fallback = 0 }` - `MobExperienceEnchantmentEffect`: a record with fields - `requirements`: Predicate (optional). Predicate context: Entity Parameters. `this` is the killed mob. - `effect`: ValueEffect. Amount of experience awarded. - For example `{ effect = Add(…) }` - `MultiplyEffectValue`: a record with fields - `factor`: LevelBasedValue. Level-Based Value determining the factor to multiply in - For example `{ factor = 0 }` - `ParticlePosition`: a record with fields - `type`: ParticlePositionType - `offset`: number (optional). Defaults to 0. - `scale`: any (depends on type) (optional). Defaults to 1. - For example `{ type = entity_position }` - `ParticlePositionType`: one of `"entity_position"`, `"in_bounding_box"` - For example `entity_position` - `ParticleVelocity`: a record with fields - `base`: number (optional). Defaults to 0. - `movement_scale`: number (optional). Scale factor applied to the given axis (`1` adds the velocity of the entity to the spawned particles). Defaults to 0. - For example `{}` - `PlaySoundEntityEffect`: a record with fields - `sound`: SoundEventRef | list of SoundEventRef (1 to 255) - `volume`: FloatProvider of number 1e-05..10 - `pitch`: FloatProvider of number 1e-05..2 - For example `{ sound = ambient.basalt_deltas.additions, volume = 0.00001, pitch = 0.00001 }` - `PostAttackEnchantmentEffect`: a record with fields - `requirements`: Predicate (optional). Predicate context: Damage Parameters. - `effect`: EntityEffect. Examples: - A Fire Aspect Enchant would specify that when the attacker is enchanted, the `ignite` effect is applied, and the affected party is the victim. - Thorns would specify that when the victim is enchanted, the `damage_entity` effect is applied, and the affected party is the attacker. - `enchanted`: AttackTarget. When set to `attacker`, this effect only works on enchanted weapon, regardless of the `slots` field. - `affected`: AttackTarget - For example `{ effect = AllOf(…), enchanted = attacker, affected = attacker }` - `PostPiercingAttackEnchantmentEffect`: a record with fields - `requirements`: Predicate (optional). Predicate context: Damage Parameters. - `effect`: EntityEffect. The effect to apply on attacker. - For example `{ effect = AllOf(…) }` - `ProjectileCountEnchantmentEffect`: a record with fields - `requirements`: Predicate (optional). Predicate context: Entity Parameters. `this` is the entity drawing the weapon. - `effect`: ValueEffect. Amount of projectiles being loaded/drawn. All projectile items except the first one will have `intangible_projectile` component applied. - For example `{ effect = Add(…) }` - `ProjectilePiercingEnchantmentEffect`: a record with fields - `requirements`: Predicate (optional). Predicate context: Item Parameters. Tool is the ammunition item. - `effect`: ValueEffect. Amount of entities the projectile will pierce through before despawning. - For example `{ effect = Add(…) }` - `ProjectileSpawnedEnchantmentEffect`: a record with fields - `requirements`: Predicate (optional). Predicate context: Entity Parameters. `this` is the newly spawned projectile. - `effect`: EntityEffect. On the newly spawned projectile. - For example `{ effect = AllOf(…) }` - `ProjectileSpreadEnchantmentEffect`: a record with fields - `requirements`: Predicate (optional). Predicate context: Entity Parameters. `this` is the entity shooting the projectile. - `effect`: ValueEffect. Maximum spread of projectiles measured in degrees from the aim line. - For example `{ effect = Add(…) }` - `ReduceBinomialEffectValue`: a record with fields - `chance`: LevelBasedValue. Chance that an input value is dropped by 1. The span is 0 to 1, with 0 being no chance to drop an input value and 1 dropping all input values. - For example `{ chance = 0 }` - `RepairWithXpEnchantmentEffect`: a record with fields - `requirements`: Predicate (optional). Predicate context: Item Parameters. - `effect`: ValueEffect. Amount of durability increase per experience point, `mending` uses 2x. - For example `{ effect = Add(…) }` - `ReplaceBlockEntityEffect`: a record with fields - `block_state`: BlockStateProviderRef - `offset`: list of int (exactly 3) (optional). Relative coordinates to offset the placed block by. Defaults to `[0, 0, 0]`. - `predicate`: BlockPredicate (optional). If omitted, all block types are replaced. - `trigger_game_event`: game_event id (optional). Defaults to no game event dispatched. - For example `{ block_state = CopyProperties(…) }` - `ReplaceDiskEntityEffect`: a record with fields - `radius`: LevelBasedValue - `height`: LevelBasedValue - Also has the fields of `ReplaceBlockEntityEffect` - For example `{ block_state = CopyProperties(…), radius = 0, height = 0 }` - `RunFunctionEntityEffect`: a record with fields - `function`: function id - For example `{ function = … }` - `SetBlockPropertiesEntityEffect`: a record with fields - `properties`: any - `offset`: list of int (exactly 3) (optional). Relative coordinates to offset the block by. Defaults to `[0, 0, 0]`. - `trigger_game_event`: game_event id (optional). Defaults to no game event dispatched. - For example `{ properties = … }` - `SetEffectValue`: a record with fields - `value`: LevelBasedValue - For example `{ value = 0 }` - `SmashDamagePerBlockFallenEnchantmentEffect`: a record with fields - `requirements`: Predicate (optional). Predicate context: Damage Parameters. - `effect`: ValueEffect. Amount of damage dealt per block fallen. - For example `{ effect = Add(…) }` - `SpawnParticlesEntityEffect`: a record with fields - `particle`: Particle - `horizontal_position`: ParticlePosition - `vertical_position`: ParticlePosition - `horizontal_velocity`: ParticleVelocity - `vertical_velocity`: ParticleVelocity - `speed`: number (optional) - For example `{ particle = AngryVillager(…), horizontal_position = { … }, vertical_position = { … }, horizontal_velocity = {}, … }` - `SquaredLevelValue`: a record with fields - `added`: number. Added to the result so that the result becomes `square(level) + added`. - For example `{ added = 0 }` - `SummonEntityEffect`: a record with fields - `entity`: entity_type id | #entity_type tag | list of entity_type ids. If multiple entity types are specified, a random entity type is selected. - `join_team`: bool (optional). Whether the summoned entity should join the team of the owner of the Enchanted Item. - For example `{ entity = acacia_boat }` - `TickEnchantmentEffect`: a record with fields - `requirements`: Predicate (optional). Predicate context: Entity Parameters. `this` is the entity with the Enchanted Item. - `effect`: EntityEffect. On every tick. Performance recommendation: don't use with `run_function` unless necessary. - For example `{ effect = AllOf(…) }` - `TridentReturnAccelerationEnchantmentEffect`: a record with fields - `requirements`: Predicate (optional). Predicate context: Entity Parameters. `this` is the trident entity. - `effect`: ValueEffect. Amount of acceleration applied to the returning trident. - For example `{ effect = Add(…) }` - `ValueEffect`: value_effect object - For example `Add(…)` # Recipes types Named types from this part of the game's schema: enums, aliases and records, with values that fit. - `Brewing`: a record with fields - `input`: PotionIngredient. The original potion. - `reagent`: PotionIngredient. The ingredient. - `output`: ItemStackTemplate - For example `{ input = { … }, reagent = { … }, output = { … } }` - `CookingBookCategory`: one of `"food"`, `"blocks"`, `"misc"` - For example `food` - `CookingBookInfo`: a record with fields - `group`: string (optional). Identifier to group multiple recipes in the recipe book. - `category`: CookingBookCategory (optional). Identifier for the category this goes in the recipe book. - For example `{}` - `CraftingBookCategory`: one of `"building"`, `"redstone"`, `"equipment"`, `"misc"` - For example `building` - `CraftingBookInfo`: a record with fields - `group`: string (optional). Identifier to group multiple recipes in the recipe book. - `category`: CraftingBookCategory (optional). Identifier for the category this goes in the recipe book. - For example `{}` - `CraftingDecoratedPot`: a record with fields - `back`: Ingredient - `left`: Ingredient - `right`: Ingredient - `front`: Ingredient - `result`: ItemStackTemplate. The `pot_decorations` component will store the 4 ingredients. - For example `{ back = [abandoned_camp_map], left = [abandoned_camp_map], right = [abandoned_camp_map], front = [abandoned_camp_map], … }` - `CraftingDye`: a record with fields - `target`: Ingredient. The item to be dyed. Its `dyed_color` component will be dyed. The other components are copied. - `dye`: Ingredient. The items to provide dye color. Colors are provided by the `dye` component. Multiple dyes can be used at the same time. - `result`: ItemStackTemplate - Also has the fields of `NotificationInfo`, `CraftingBookInfo` - For example `{ target = [abandoned_camp_map], dye = [abandoned_camp_map], result = { … } }` - `CraftingImbue`: a record with fields - `source`: Ingredient. The item to provide potion effect. Its `potion_contents` component will be copied. This item is placed at the center grid. - `material`: Ingredient. Additional ingredients. 8 `material` items are required to surroud the `source` item. - `result`: ItemStackTemplate - Also has the fields of `NotificationInfo`, `CraftingBookInfo` - For example `{ source = [abandoned_camp_map], material = [abandoned_camp_map], result = { … } }` - `CraftingIngredients`: a record with fields - `[string]`: Ingredient (optional) - For example `{}` - `CraftingShaped`: a record with fields - `pattern`: list of string (1 to 3) (1 to 3) - `key`: map of string to Ingredient - `result`: ItemStackTemplate - Also has the fields of `NotificationInfo`, `CraftingBookInfo` - For example `{ pattern = ["text"], key = {}, result = { … } }` - `CraftingShapeless`: a record with fields - `ingredients`: list of Ingredient (1 to 9) - `result`: ItemStackTemplate - Also has the fields of `NotificationInfo`, `CraftingBookInfo` - For example `{ ingredients = [abandoned_camp_map], result = { … } }` - `CraftingSpecialBannerDuplicate`: a record with fields - `banner`: Ingredient. The banner item. The item type is required to be `BannerItem`. Exactly 2 banners of the same color are required. The one with patterns is viewed as "source". Its components will be copied. The other is viewed as "target". It is required to have no patterns. The source banner will be kept in the crafting grid. - `result`: ItemStackTemplate - For example `{ banner = [abandoned_camp_map], result = { … } }` - `CraftingSpecialBookCloning`: a record with fields - `source`: Ingredient. The book item. Its `written_book_contents` component will be copied, with `generation` value increased by 1. The other components are copied as-is. The book will be kept in the crafting grid. - `material`: Ingredient. Additional ingredients. Multiple materials can be used at the same time. The number of materials beyond the first one will be added to the result count. - `allowed_generations`: MinMaxBounds of int 0..2 (optional). Limits the generation of the `source` item that can be copied. Defaults to allow generation 0 and 1 (original and first copy). - `result`: ItemStackTemplate - For example `{ source = [abandoned_camp_map], material = [abandoned_camp_map], result = { … } }` - `CraftingSpecialFireworkRocket`: a record with fields - `shell`: Ingredient. Additional ingredient. Exactly 1 additional ingredient is required. - `fuel`: Ingredient. The fuel ingredient. The count of fuel ingredients controls the `flight_duration` field. Only 1 ~ 3 fuels are allowed. - `star`: Ingredient. The firework star ingredient. Provides explosion data by the `firework_explosion` component. Any count of stars (including 0) are allowed. - `result`: ItemStackTemplate. The `fireworks` component is controlled by `fuel` and `star`. - For example `{ shell = [abandoned_camp_map], fuel = [abandoned_camp_map], star = [abandoned_camp_map], result = { … }, … }` - `CraftingSpecialFireworkStar`: a record with fields - `trail`: Ingredient. If this ingredient is provided, the result will have `has_trail` field set. - `twinkle`: Ingredient. If this ingredient is provided, the result will have `has_twinkle` field set. - `fuel`: Ingredient. Additional ingredient. Exactly 1 additional ingredient is required. - `dye`: Ingredient. The items to provide explosion color. Colors are provided by the `dye` component. Multiple dyes can be used at the same time. - `shapes`: map of FireworkShape to Ingredient. If one of the ingredients is provided, the result will have the corresponding `shape` value. If no shape ingredient is provided, the shape will be `small_ball`. - `result`: ItemStackTemplate. The `firework_explosion` component is controlled by the ingredients. - For example `{ trail = [abandoned_camp_map], twinkle = [abandoned_camp_map], fuel = [abandoned_camp_map], dye = [abandoned_camp_map], … }` - `CraftingSpecialFireworkStarFade`: a record with fields - `target`: Ingredient. The firework star item. The fade effect of its `firework_explosion` will be changed. The other components are copied. - `dye`: Ingredient. The items to provide fade color. Colors are provided by the `dye` component. Multiple dyes can be used at the same time. - `result`: ItemStackTemplate - For example `{ target = [abandoned_camp_map], dye = [abandoned_camp_map], result = { … } }` - `CraftingSpecialMapExtending`: a record with fields - `map`: Ingredient. The map item. The `map_id` component is used to determine the resulting item. The other components are copied. This item is placed at the center grid. The source map will be kept in the crafting grid. - `material`: Ingredient. Additional ingredients. 8 `material` items are required to surroud the `map` item. - `result`: ItemStackTemplate. The previewing result will have `map_post_processing` transient component. The crafted result will have a new `map_id` component, which shows the extended version of the original map. - For example `{ map = [abandoned_camp_map], material = [abandoned_camp_map], result = { … } }` - `CraftingSpecialShieldDecoration`: a record with fields - `target`: Ingredient. The item to be decorated. It is required to have no patterns. Its components, except `base_color` and `banner_patterns`, are copied. - `banner`: Ingredient. The banner item. The item type is required to be `BannerItem`. Determines the `base_color` component of the resulting item. - `result`: ItemStackTemplate - For example `{ target = [abandoned_camp_map], banner = [abandoned_camp_map], result = { … } }` - `CraftingTransmute`: a record with fields - `input`: Ingredient. The ingredient that will transfer its data components to the result item. - `material`: Ingredient. An additional ingredient. - `material_count`: MinMaxBounds of int 1..8 (optional). The allowed count of material. Defaults to `1`. - `add_material_count_to_result`: bool (optional). When true, the number of materials will be added to the result count. Defaults to `false`. - `result`: TransmuteResult | item id. The result item that will be merged with the input ingredient. - Also has the fields of `NotificationInfo`, `CraftingBookInfo` - For example `{ input = [abandoned_camp_map], material = [abandoned_camp_map], result = {} }` - `FireworkShapeIngredients`: a record with fields - `[FireworkShape]`: Ingredient (optional) - For example `{}` - `Ingredient`: item id | #item tag | list of item ids (at least 1) - For example `[abandoned_camp_map]`, `abandoned_camp_map` - `IngredientItem`: a record with fields - `item`: item id - For example `{ item = abandoned_camp_map }` - `IngredientTag`: a record with fields - `tag`: item id | #item tag - For example `{ tag = abandoned_camp_map }` - `ItemResult`: a record with fields - `item`: item id - `count`: int (optional) - For example `{ item = abandoned_camp_map }` - `NotificationInfo`: a record with fields - `show_notification`: bool (optional). Determines if a notification is shown when unlocking this recipe. Defaults to `true`. - For example `{}` - `OptionalSmithingIngredients`: a record with fields - `base`: Ingredient (optional). Ingredient specifying an item to be trimmed. (eg. `"#minecraft:trimmable_armor"`) - `addition`: Ingredient (optional). Material that will be used. (eg. `"#minecraft:trim_materials"`) - `template`: Ingredient (optional). Template item that will be used for the pattern. - For example `{}` - `PotionIngredient`: a record with fields - `item`: Ingredient - `potion_contents`: PotionsPredicate (optional) - For example `{ item = [abandoned_camp_map] }` - `RecipeListRef`: recipe id | #recipe tag | list of recipe ids - For example `acacia_boat`, `[acacia_boat]` - `Smelting`: a record with fields - `ingredient`: Ingredient - `result`: ItemStackTemplate - `experience`: number (optional) - `cookingtime`: int. Hint: The "Normal" value for this is `200`. - Also has the fields of `NotificationInfo`, `CookingBookInfo` - For example `{ ingredient = [abandoned_camp_map], result = { … }, cookingtime = 0 }` - `Smithing`: a record with fields - `base`: IngredientValue - `addition`: IngredientValue - `result`: ItemResult - For example `{ base = …, addition = …, result = { … } }` - `SmithingIngredients`: { base?: Ingredient, addition?: Ingredient, template?: Ingredient } - For example `{}` - `SmithingTransform`: a record with fields - `base`: Ingredient. Ingredient specifying an item to be transformed. - `addition`: Ingredient (optional). Material that will be used. - `template`: Ingredient (optional). Template item that will be used for the pattern. - `result`: ItemStackTemplate. Resulting transformed item. - Also has the fields of `NotificationInfo` - For example `{ base = [abandoned_camp_map], result = { … } }` - `SmithingTrim`: a record with fields - `base`: Ingredient. Ingredient specifying an item to be trimmed. - `addition`: Ingredient. Material that will be used. - `template`: Ingredient. Template item that will be used for the pattern. - `pattern`: trim_pattern id. The trim pattern to apply to the result item. - Also has the fields of `NotificationInfo` - For example `{ base = [abandoned_camp_map], addition = [abandoned_camp_map], template = [abandoned_camp_map], pattern = bolt, … }` - `Stonecutting`: a record with fields - `ingredient`: Ingredient - `result`: ItemStackTemplate - Also has the fields of `NotificationInfo` - For example `{ ingredient = [abandoned_camp_map], result = { … } }` - `TransmuteResult`: a record with fields - `id`: item id (optional). Defaults to the input item. - `count`: int 1..99 (optional). Defaults to `1`. - `components`: DataComponentPatch (optional) - For example `{}` # Item components types Named types from this part of the game's schema: enums, aliases and records, with values that fit. - `AdventureModePredicate`: BlockPredicate | list of BlockPredicate (at least 1) - For example `[{}]`, `{}` - `ApplyEffectsConsumeEffect`: a record with fields - `effects`: list of MobEffectInstance - `probability`: number 0..1 (optional). Chance the effects will be applied once consumed. - For example `{ effects = [{ … }] }` - `AttackRange`: a record with fields - `min_reach`: number 0..64 (optional). Minimum distance to the target to be considered valid. Defaults to 0.0 - `max_reach`: number 0..64 (optional). Maximum distance to the target to be considered valid. Defaults to 3.0 - `min_creative_reach`: number 0..64 (optional). Minimum distance from the creative mode attacker to the target to be considered valid. Defaults to 0.0 - `max_creative_reach`: number 0..64 (optional). Maximum distance from the creative mode attacker to the target to be considered valid. Defaults to 5.0 - `hitbox_margin`: number 0..1 (optional). The margin applied to the target bounding box when checking for valid hitbox collision. Defaults to 0.3 - `mob_factor`: number 0..2 (optional). The multiplier applied to `min_reach` and `max_reach` when the user is a mob. - For example `{}` - `AttributeDisplay`: attribute_display object - For example `Default()` - `AttributeDisplayTextOverride`: a record with fields - `value`: Text. The text contents to show for this attribute modifer entry. - For example `{ value = "text" }` - `AttributeDisplayType`: one of - `"default"`: Shows the calculated attribute modifier values on the tooltip. - `"hidden"`: Does not show the attribute modifier entry in tooltips. - `"override"`: Replaces the shown attribute modifier text. - For example `default` - `AttributeModifiers`: a record with fields - `modifiers`: list of AttributeModifier - `show_in_tooltip`: bool (optional) - For example `{ modifiers = [{ … }] }` - `AttributeModifiersPredicate`: a record with fields - `modifiers`: CollectionPredicate of AttributeModifiersPredicateEntry (optional) - For example `{}` - `AttributeModifiersPredicateEntry`: a record with fields - `attribute`: attribute id | #attribute tag | list of attribute ids (optional) - `id`: attribute_modifier id (optional) - `amount`: MinMaxBounds of number (optional) - `operation`: AttributeOperation (optional) - `slot`: EquipmentSlotGroup (optional) - For example `{}` - `AxolotlVariant`: one of - `"lucy"` - `"wild"` - `"gold"` - `"cyan"` - `"blue"`: The rare variant. - For example `lucy` - `BlocksAttacks`: a record with fields - `block_delay_seconds`: number 0.. (optional). Number of seconds that right-click must be held before successfully blocking attacks. Defaults to `0`. - `disable_cooldown_scale`: number 0.. (optional). Multiplier applied to the number of seconds that the item will be on cooldown for when attacked by a disabling attack (`disable_blocking_for_seconds` on the `weapon` component). Defaults to `1`. If `0`, this item can never be disabled by attacks. - `damage_reductions`: list of DamageReduction (optional). Controls how much damage should be blocked in a given attack. If not specified, all damage is blocked. Each entry in the list contributes an amount of damage to be blocked, optionally filtered by a damage type. Each entry adds to blocked damage, determined by `clamp(base + factor * dealt_damage, 0, dealt_damage)`. The final damage applied in the attack to the entity is determined by `dealt_damage - clamp(blocked_damage, 0, dealt_damage)`. - `item_damage`: ItemDamageFunction (optional). Controls how much damage should be applied to the item from a given attack. If not specified, a point of durability is removed for every point of damage dealt. The final damage applied to the item is determined by `floor(base + factor * dealt_damage)`. The final value may be negative, causing the item to be repaired. - `block_sound`: SoundEventRef (optional). Sound played when an attack is successfully blocked. - `disabled_sound`: SoundEventRef (optional). Sound played when the item goes on its disabled cooldown due to an attack. - `bypassed_by`: damage_type id | #damage_type tag | list of damage_type ids (optional). Damage types in this tag are bypassing the blocking - For example `{}` - `BookGeneration`: one of `"0"`, `"1"`, `"2"`, `"3"` - For example `0` - `BrewingFuel`: a record with fields - `uses`: int | context_int_provider id. Total recipes the fuel will brew before being consumed. - `speed_multiplier`: number | context_float_provider id. Controls the recipe brewing speed. - For example `{ uses = 0, speed_multiplier = 0 }` - `BucketEntityData`: a record with fields - `NoAI`: bool (optional). Whether it should have an AI. - `Silent`: bool (optional). Whether the entity should make any sound. - `NoGravity`: bool (optional). Whether the entity should be effected by gravity. - `Glowing`: bool (optional). Whether the entity should glow. - `Invulnerable`: bool (optional). Whether the entity should take damage. - `PersistenceRequired`: bool (optional). Whether the entity should not despawn naturally. - `Health`: number (optional) - `HuntingCooldown`: int (optional). Turns into the expiry time of the memory module `has_hunting_cooldown` for axolotls. - `Age`: int (optional). The age for axolotl and tadpole. - `AgeLocked`: bool (optional). The age locked state for axolotl and tadpole. - `age`: int (optional). The age for sulfur cube. - `age_locked`: bool (optional). The age locked state for sulfur cube. - For example `{}` - `BundleContentsPredicate`: a record with fields - `items`: CollectionPredicate of ItemPredicate (optional) - For example `{}` - `CollectionCountPredicate`: a record with fields - `test`: P. The contents an entry's text must match exactly. - `count`: MinMaxBounds of int. The number of entries that must match the test. - For example `{ test = …, count = 0 }` - `CollectionPredicate`: a record with fields - `contains`: list of P (optional). A list of tests. For each test, there must be at least one entry whose contents match exactly. - `count`: list of { test: P, count: MinMaxBounds of int } (optional) - `size`: MinMaxBounds of int (optional). When set, total number of entries in the this collection. - For example `{}` - `Compostable`: a record with fields - `layers`: int | context_int_provider id - For example `{ layers = 0 }` - `Consumable`: a record with fields - `consume_seconds`: number 0.. (optional). Time taken for a player to consume the item. Defaults to 1.6. - `animation`: ItemUseAnimation (optional). View model/arms animation used during consumption of the item. Defaults to `eat`. - `sound`: SoundEventRef (optional). Sound played during and on completion of item consumption. If not specified, the default eating sound will be played. - `has_consume_particles`: bool (optional). Whether the `item` particle is emitted while consuming the item. Defaults to `true`. - `on_consume_effects`: list of ConsumeEffect (optional). Side effects which take place after consuming the item. - For example `{}` - `ConsumeEffect`: consume_effect object - For example `ApplyEffects(…)` - `ContainerLoot`: a record with fields - `loot_table`: loot_table id - `seed`: int (optional) - For example `{ loot_table = archaeology/desert_pyramid }` - `ContainerPredicate`: a record with fields - `items`: CollectionPredicate of ItemPredicate (optional) - For example `{}` - `ContainerSlot`: a record with fields - `slot`: int 0..255. The slot ID of the container. - `item`: ItemStackTemplate. The item stack in this container slot. - For example `{ slot = 0, item = { … } }` - `CookingFuel`: a record with fields - `burn_time`: int | context_int_provider id - `speed_multiplier`: number | context_float_provider id - For example `{ burn_time = 0, speed_multiplier = 0 }` - `CustomData`: CustomDataMap | string - For example `{}`, `"text"` - `CustomDataMap`: a record with fields - `[string]`: any (optional) - For example `{}` - `CustomModelData`: a record with fields - `floats`: list of number (optional) - `flags`: list of bool (optional) - `strings`: list of string (optional) - `colors`: list of RGB (optional) - For example `{}` - `DamageReduction`: a record with fields - `type`: damage_type id | #damage_type tag | list of damage_type ids (optional). An optional damage type to filter this reduction by. If not specified, any damage type is accepted for this reduction. - `base`: number. Constant amount of damage to be blocked. - `factor`: number. Fraction of the dealt damage that should be blocked. - `horizontal_blocking_angle`: number 0..< (optional). Maximum angle between facing direction and incoming attack direction for the blocking to be effective - For example `{ base = 0, factor = 0 }` - `DamageResistant`: a record with fields - `types`: damage_type id | #damage_type tag | list of damage_type ids. The damage types which the item is resistant to when in entity form. Additionally, this also affects whether the equipped item will be damaged when the wearer is hurt by a specified damage type. - For example `{ types = arrow }` - `DataComponentExactPredicate`: a record with fields - `[PersistentDataComponent]`: any (optional) - For example `{}` - `DataComponentPatch`: a record with fields - `[PersistentDataComponent]`: any (optional) - `[data_component_type id]`: object (optional) - For example `{}` - `DataComponentPredicate`: a record with fields - `[data_component_type id]`: any (optional) - For example `{}` - `DeathProtection`: a record with fields - `death_effects`: list of ConsumeEffect (optional). Effects applied when the item protects the holder. - For example `{}` - `DebugStickState`: a record with fields - `[block id]`: any (optional) - For example `{}` - `DyedColor`: a record with fields - `rgb`: int. Color of the armor. Calculated as `RED << 16 | GREEN << 8 | BLUE`. Each of these fields must be between 0 and 255, inclusive. - `show_in_tooltip`: bool (optional) - For example `{ rgb = 0 }` - `Enchantable`: a record with fields - `value`: int 1.. - For example `{ value = 1 }` - `EnchantmentLevels`: a record with fields - `[enchantment id]`: int 1..255 (optional) - For example `{}` - `Enchantments`: a record with fields - `levels`: EnchantmentLevels - `show_in_tooltip`: bool (optional) - For example `{ levels = {} }` - `Equippable`: a record with fields - `slot`: EquipmentSlot - `asset_id`: equipment id (optional) - `equip_sound`: SoundEventRef (optional). Sound event to play when the item is equipped. If not specified, the default armor equip sound will be played. - `shearing_sound`: SoundEventRef (optional). Sound event to play when the item is sheared from a mob. If not specified, the default shearing sound (`item.shears.snip`) will be played. - `camera_overlay`: texture id (optional). The overlay texture that should render in first person when equipped. - `allowed_entities`: entity_type id | #entity_type tag | list of entity_type ids (optional). Limits which entities can equip this item. - `dispensable`: bool (optional). Whether the item can be equipped by using a dispenser. Defaults to `true`. - `swappable`: bool (optional). Whether the item can be equipped by right-clicking. Defaults to `true`. - `damage_on_hurt`: bool (optional). Whether the item will be damaged when the wearer is damaged. Defaults to `true`. - `equip_on_interact`: bool (optional). Whether players can equip this item onto a target mob by right-clicking it (as long as this item can be equipped on the target at all). The item will not be equipped if the target already has an item in the relevant slot. Defaults to `false`. - `can_be_sheared`: bool (optional). Whether players can use shears to remove this item from a mob by right-clicking it (as long as other shearing conditions are satisfied). Defaults to `false`. - For example `{ slot = mainhand }` - `FireworkExplosionPredicate`: a record with fields - `shape`: FireworkShape (optional) - `has_twinkle`: bool (optional) - `has_trail`: bool (optional) - For example `{}` - `FireworkShape`: one of `"small_ball"`, `"large_ball"`, `"star"`, `"creeper"`, `"burst"` - For example `small_ball` - `FireworksPredicate`: a record with fields - `explosions`: CollectionPredicate of FireworkExplosionPredicate (optional) - `flight_duration`: MinMaxBounds of int (optional) - For example `{}` - `Food`: a record with fields - `nutrition`: int 0... Food points/haunches restored when eaten (capped to 20.0). - `saturation`: number. Exact value added to the player's saturation level, capped at whatever the [new] food points value is. - `can_always_eat`: bool (optional). Whether the item can be eaten when the player's food points/haunches are full. Defaults to `false` - For example `{ nutrition = 0, saturation = 0 }` - `FoodEffect`: a record with fields - `effect`: MobEffectInstance - `probability`: number 0..1 (optional). Chance for the effect to be applied. Defaults to 1. - For example `{ effect = { … } }` - `FoxType`: one of `"red"`, `"snow"` - For example `red` - `HorseVariant`: one of `"white"`, `"creamy"`, `"chestnut"`, `"brown"`, `"black"`, `"gray"`, `"dark_brown"` - For example `white` - `ItemCountPseudoPredicate`: MinMaxBounds of int 1..99 - For example `1`, `{}` - `ItemDamageFunction`: a record with fields - `threshold`: number 0... Minimum amount of damage dealt by the attack before this item damage is applied to the item. - `base`: number. Constant amount of damage applied to the item, if `threshold` is passed. - `factor`: number. Fraction of the dealt damage that should be applied to the item, if `threshold` is passed. - For example `{ threshold = 0, base = 0, factor = 0 }` - `ItemDamagePredicate`: a record with fields - `damage`: MinMaxBounds of int (optional) - `durability`: MinMaxBounds of int (optional) - For example `{}` - `ItemUseAnimation`: one of - `"none"` - `"eat"` - `"drink"` - `"block"` - `"bow"` - `"trident"` - `"spear"` - `"crossbow"` - `"spyglass"` - `"toot_horn"`: Used for Goat Horns. - `"brush"` - `"bundle"` - For example `none` - `JukeboxPlayablePredicate`: a record with fields - `song`: jukebox_song id | #jukebox_song tag | list of jukebox_song ids (optional) - For example `{}` - `KineticWeapon`: a record with fields - `delay_ticks`: int 0.. (optional). The time in ticks required for charging. Defaults to 0 - `contact_cooldown_ticks`: int 0.. (optional). The cooldown in ticks after hitting, and loosing contact with an entity before being able to hit it again Defaults to 10 - `dismount_conditions`: KineticWeaponEffectCondition (optional) - `knockback_conditions`: KineticWeaponEffectCondition (optional) - `damage_conditions`: KineticWeaponEffectCondition (optional) - `forward_movement`: number (optional). The distance the item moves out of hand during animation. Defaults to 0.0 - `damage_multiplier`: number (optional). The multiplier for the final damage from the relative speed. Defaults to 1.0 - `sound`: SoundEventRef (optional). Sound to play when the weapon is engaged. - `hit_sound`: SoundEventRef (optional). Sound to play when the weapon hits an entity. - For example `{}` - `KineticWeaponEffectCondition`: a record with fields - `max_duration_ticks`: int. The duration in ticks this condition can pass. Starts counting after charged. - `min_speed`: number (optional). The minimum attacker speed required. Defaults to 0.0 - `min_relative_speed`: number (optional). The minimum relative speed required. Defaults to 0.0 - For example `{ max_duration_ticks = 0 }` - `LlamaVariant`: one of `"creamy"`, `"white"`, `"brown"`, `"gray"` - For example `creamy` - `LodestoneTracker`: a record with fields - `target`: GlobalPos (optional). Location of the lodestone. Optional. If not set, the compass will spin randomly. - `tracked`: bool (optional). When `true`, the component is removed when the lodestone is broken. When `false`, the component is kept. Defaults to true. - For example `{}` - `MapDecoration`: a record with fields - `type`: map_decoration_type id. Decoration type. - `x`: number. World x position. - `z`: number. World z position. - `rotation`: number. Rotation of the decoration, measured in degrees clockwise. - For example `{ type = abandoned_camp, x = 0, z = 0, rotation = 0, … }` - `MapDecorations`: a record with fields - `[string]`: MapDecoration (optional) - For example `{}` - `MobVisibility`: a record with fields - `targeting_entity_types`: entity_type id | #entity_type tag | list of entity_type ids. Entities to match. - `visibility`: number 0..10. Visibility factor, with `0.0` reducing the range at which mobs detects the entity to `2`, while `10.0` increases the detection range tenfold. While multiple items with this component stack, the maximum vision will still never exceed `10.0`. - For example `{ targeting_entity_types = acacia_boat, visibility = 0 }` - `MooshroomType`: one of `"red"`, `"brown"` - For example `red` - `Occupant`: a record with fields - `entity_data`: AnyEntity - `min_ticks_in_hive`: int - `ticks_in_hive`: int - For example `{ entity_data = AcaciaBoat(…), min_ticks_in_hive = 0, ticks_in_hive = 0 }` - `ParrotVariant`: one of `"red_blue"`, `"blue"`, `"green"`, `"yellow_blue"`, `"gray"` - For example `red_blue` - `PersistentDataComponent`: data_component_type id - For example `additional_trade_cost` - `PiercingWeapon`: a record with fields - `deals_knockback`: bool (optional). Whether the attack deals knockback. Defaults to `true`. - `dismounts`: bool (optional). Whether the attack dismounts the target. Defaults to `false`. - `sound`: SoundEventRef (optional). Sound to play when using the weapon to attack. - `hit_sound`: SoundEventRef (optional). Sound to play when the weapon hits an entity. - For example `{}` - `PlaySoundConsumeEffect`: a record with fields - `sound`: SoundEventRef - For example `{ sound = ambient.basalt_deltas.additions }` - `PotDecorations`: a record with fields - `back`: ItemStackTemplate (optional) - `left`: ItemStackTemplate (optional) - `right`: ItemStackTemplate (optional) - `front`: ItemStackTemplate (optional) - For example `{}` - `PotionContents`: a record with fields - `potion`: potion id (optional) - `custom_color`: int (optional). Calculated as `RED << 16 | GREEN << 8 | BLUE`. Each of these fields must be between 0 and 255, inclusive. - `custom_name`: string (optional). If present, is used to generate the item name using the translation key `item.minecraft..effect.`. - `custom_effects`: list of MobEffectInstance (optional) - For example `{}` - `PotionTypeMatch`: potion id | #potion tag | list of potion ids - For example `awkward`, `[awkward]` - `PotionsPredicate`: a record with fields - `potions`: PotionTypeMatch (optional) - `effects`: CollectionPredicate of EntityEffectsPredicate (optional) - For example `{}` - `RabbitVariant`: one of - `"brown"` - `"white"` - `"black"` - `"white_splotched"` - `"gold"` - `"salt"` - `"evil"`: Killer rabbit - For example `brown` - `Rarity`: one of - `"common"`: White name, or aqua when enchanted. - `"uncommon"`: Yellow name, or aqua when enchanted. - `"rare"`: Aqua name, or light purple when enchanted. - `"epic"`: Light purple name. - For example `common` - `RemoveEffectsConsumeEffect`: a record with fields - `effects`: mob_effect id | #mob_effect tag | list of mob_effect ids - For example `{ effects = absorption }` - `Repairable`: a record with fields - `items`: item id | #item tag | list of item ids - For example `{ items = abandoned_camp_map }` - `SalmonType`: one of `"small"`, `"medium"`, `"large"` - For example `small` - `SignLines`: list of Text (exactly 4) - For example `["text"]` - `SignText`: a record with fields - `messages`: SignLines - `filtered_messages`: SignLines (optional). Shown to players with the profanity filter enabled on Realms. - `color`: DyeColor (optional) - `has_glowing_text`: bool (optional) - For example `{ messages = … }` - `SuspiciousStewEffect`: a record with fields - `id`: mob_effect id - `duration`: int 1.. (optional). Duration of the effect in ticks. Defaults to `160`; 8 seconds. - For example `{ id = absorption }` - `SwingAnimation`: a record with fields - `type`: SwingAnimationType (optional). The animation type to play when attacking or interacting using this item. Defaults to `whack`. - `duration`: int 0.. (optional). The animation duration in ticks. Defaults to 6 - For example `{}` - `SwingAnimationType`: one of `"none"`, `"whack"`, `"stab"` - For example `none` - `TeleportRandomlyConsumeEffect`: a record with fields - `diameter`: number 1.. (optional). Defaults to 16. - `directional_particles`: bool (optional). Whether to show a particle trail into the direction of teleportation. Defaults to `true`. - For example `{}` - `Tool`: a record with fields - `rules`: list of ToolRule. Blocks that this tool has a special behavior with. - `default_mining_speed`: number (optional). Used if no rules override it. Defaults to 1.0. - `damage_per_block`: int (optional). Amount of durability to remove each time a block is broken with this tool. Must be a non-negative integer. - `can_destroy_blocks_in_creative`: bool (optional). If `false`, players cannot break blocks while holding this tool in creative mode. Defaults to `true`. - For example `{ rules = [{ … }] }` - `ToolRule`: a record with fields - `blocks`: block id | #block tag | list of block ids - `speed`: number (optional). Overrides the default mining speed. - `correct_for_drops`: bool (optional). Overrides whether or not this tool is considered correct to mine at its most efficient speed, and to drop items if the block's loot table requires it. - For example `{ blocks = acacia_button }` - `TooltipDisplay`: a record with fields - `hide_tooltip`: bool (optional). If `true`, the item will have no tooltip when hovered. Defaults to `false`. - `hidden_components`: list of data_component_type ids (optional). List of components that should be hidden in the item tooltip. - For example `{}` - `Trim`: a record with fields - `material`: trim_material id | TrimMaterial. The trim material of this item.. - `pattern`: trim_pattern id | TrimPattern. The trim pattern of this item. - For example `{ material = amethyst, pattern = bolt }` - `TrimPredicate`: a record with fields - `material`: trim_material id | #trim_material tag | list of trim_material ids (optional) - `pattern`: trim_pattern id | #trim_pattern tag | list of trim_pattern ids (optional) - For example `{}` - `TropicalFishPattern`: one of `"kob"`, `"sunstreak"`, `"snooper"`, `"dasher"`, `"brinely"`, `"spotty"`, `"flopper"`, `"stripey"`, `"glitter"`, `"blockfish"`, `"betty"`, `"clayfish"` - For example `kob` - `Unbreakable`: object - For example `{}` - `UseCooldown`: a record with fields - `seconds`: number 0..<. Time the cooldown will last. - `cooldown_group`: cooldown_group id (optional). If present, this item will be part of a cooldown group and no longer share cooldowns with its base item type. Instead, cooldowns applied to this item will only be shared with any other items that are part of the same cooldown group. - For example `{ seconds = 0 }` - `UseEffects`: a record with fields - `can_sprint`: bool (optional). Whether the player can sprint while using this item. Defaults to `false`. - `speed_multiplier`: number 0..1 (optional). The speed multiplier applied to the player while using this item. Defaults to 0.2 - `interact_vibrations`: bool (optional). Whether using this item emits game events (`item_interact_start` and `item_interact_finish`). Defaults to `true`. - For example `{}` - `VillagerFood`: a record with fields - `nutrition`: int 1... How much hunger the item satiates in the Villager once eaten. - For example `{ nutrition = 1 }` - `Weapon`: a record with fields - `item_damage_per_attack`: int 0.. (optional). The amount to damage to the weapon item for each attack performed. Defaults to `1`. - `disable_blocking_for_seconds`: number 0.. (optional). If non-zero, will disable a blocking shield on successful attack for the specified amount of seconds. - For example `{}` - `WritableBookContent`: a record with fields - `pages`: list of Filterable of string - For example `{ pages = [{ … }] }` - `WritableBookPredicate`: a record with fields - `pages`: CollectionPredicate of string (optional). Matches the raw text, instead of filtered. - For example `{}` - `WrittenBookContent`: a record with fields - `pages`: list of Filterable of Text (optional) - `title`: Filterable of string (at most 32) - `author`: string - `generation`: BookGeneration (optional). Number of times this written book has been copied. Defaults to 0. If the value is greater than 1, the book cannot be copied. - `resolved`: bool (optional). Whether the dynamic content on the pages has been resolved. - For example `{ title = { … }, author = "text" }` - `WrittenBookPredicate`: a record with fields - `pages`: CollectionPredicate of Text (optional). Matches the raw text, instead of filtered. - `author`: string (optional) - `title`: string (optional) - `generation`: MinMaxBounds of int (optional) - `resolved`: bool (optional) - For example `{}` # Items types Named types from this part of the game's schema: enums, aliases and records, with values that fit. - `AttributeModifier`: a record with fields - `AttributeName`: attribute id (optional) - `Name`: string (optional). Identifying name of the modifier, has no real effect. - `Slot`: EquipmentSlotGroup (optional). Slot that the modifier is active in. - `Operation`: LegacyOperation (optional) - `Amount`: number (optional). Change in the attribute. - `UUID`: list of int (exactly 4) (optional) - For example `{}` - `AxolotlBucket`: a record with fields - `[string]`: any (optional). Custom item NBT tags - `EntityTag`: AnyEntity (optional) - `BucketVariantTag`: int (optional). Turns into the `Variant` entity tag. - Also has the fields of `ItemBase` - For example `{}` - `BasicFishBucket`: a record with fields - `EntityTag`: AnyEntity (optional) - For example `{}` - `BlockEntityTag`: a record with fields - `Base`: DyeColorInt (optional). Base color. - `Patterns`: list of BannerPatternLayer (optional) - For example `{}` - `BlockItem`: a record with fields - `[string]`: any (optional). Custom item NBT tags - `BlockEntityTag`: BlockEntityData (optional) - `BlockStateTag`: any (optional). Blockstate that the placed block will have. - Also has the fields of `ItemBase` - For example `{}` - `ColorDisplay`: a record with fields - `MapColor`: int (optional). Calculated as `RED << 16 | GREEN << 8 | BLUE`. Each of these fields must be between 0 and 255, inclusive. - Also has the fields of `Display` - For example `{}` - `Compass`: a record with fields - `[string]`: any (optional). Custom item NBT tags - `LodestoneDimension`: dimension id (optional) - `LodestonePos`: LodestonePos (optional) - `LodestoneTracked`: bool (optional). Whether the compass should be linked to a lodestone. When true, the compass will reset if the lodestone at the position is removed. - Also has the fields of `ItemBase` - For example `{}` - `Crossbow`: a record with fields - `[string]`: any (optional). Custom item NBT tags - `ChargedProjectiles`: list of ItemStack (0 to 3) (optional). Projectiles that are loaded. - `Charged`: bool (optional). Whether the crossbow is charged. - Also has the fields of `ItemBase` - For example `{}` - `DebugStick`: a record with fields - `[string]`: any (optional). Custom item NBT tags - `DebugProperty`: DebugStickState (optional) - Also has the fields of `ItemBase` - For example `{}` - `Decoration`: a record with fields - `type`: IconByteId. Decoration type. - `x`: number. World x position. - `z`: number. World z position. - `rot`: number. Rotation of the decoration, measured in degrees clockwise. - For example `{ type = 0, x = 0, z = 0, rot = 0, … }` - `Display`: a record with fields - `Name`: string (optional). A JSON text component. - `Lore`: list of string (optional). A list of JSON text components, each element being a lore line. - For example `{}` - `Effect`: a record with fields - `EffectId`: EffectId (optional) - `EffectDuration`: int 1.. (optional). Duration in ticks. - For example `{}` - `EffectItem`: a record with fields - `[string]`: any (optional). Custom item NBT tags - `custom_potion_effects`: list of MobEffectInstance (optional). List of the effects that will be applied with this item. - `Potion`: potion id (optional). Default potion effect - `CustomPotionColor`: int (optional). Calculated as `RED << 16 | GREEN << 8 | BLUE`. Each of these fields must be between 0 and 255, inclusive. - Also has the fields of `ItemBase` - For example `{}` - `EnchantedBook`: a record with fields - `[string]`: any (optional). Custom item NBT tags - `StoredEnchantments`: list of Enchantment (optional) - Also has the fields of `ItemBase` - For example `{}` - `Explosion`: a record with fields - `Flicker`: bool (optional). Whether the explosion should flicker. - `Trail`: bool (optional). Whether the explosion should have a trail. - `Type`: ExplosionType (optional) - `Colors`: list of int (optional). Colors of the explosion. Calculated as `RED << 16 | GREEN << 8 | BLUE`. Each of these fields must be between 0 and 255, inclusive. - `FadeColors`: list of int (optional). Colors of the explosion fade. Calculated as `RED << 16 | GREEN << 8 | BLUE`. Each of these fields must be between 0 and 255, inclusive. - For example `{}` - `ExplosionType`: one of `"0"`, `"1"`, `"2"`, `"3"`, `"4"` - For example `0` - `FilledMap`: a record with fields - `[string]`: any (optional). Custom item NBT tags - `map`: int (optional). Map number, representing the shared state holding map contents and markers. - `map_scale_direction`: int 1.. (optional). Amount to increase the current map scale by when crafting. - `map_to_lock`: bool (optional). Whether the map should be locked after being taken out of the cartography table. - `Decorations`: list of object (optional). Decorations on the map. - Also has the fields of `ItemBase` - For example `{}` - `FireworkRocket`: a record with fields - `[string]`: any (optional). Custom item NBT tags - `Fireworks`: Fireworks (optional) - Also has the fields of `ItemBase` - For example `{}` - `FireworkStar`: a record with fields - `[string]`: any (optional). Custom item NBT tags - `Explosion`: Explosion (optional) - Also has the fields of `ItemBase` - For example `{}` - `Fireworks`: a record with fields - `Flight`: int (optional). Duration of flight. - `Explosions`: list of Explosion (optional) - For example `{}` - `GoatHorn`: a record with fields - `[string]`: any (optional). Custom item NBT tags - `instrument`: instrument id (optional) - Also has the fields of `ItemBase` - For example `{}` - `HideFlags`: one of `"1"`, `"2"`, `"3"`, `"4"`, `"5"`, `"6"`, `"7"`, `"8"` - For example `1` - `IconByteId`: one of - `"0"`: White pentagon. - `"1"`: Green pentagon. - `"2"`: Red pentagon. - `"3"`: Blue pentagon. - `"4"`: White x. - `"5"`: Red triangle. - `"6"`: Large white dot. - `"7"`: Small white dot. - `"8"`: Woodland mansion. - `"9"`: Ocean monument. - `"10"` - `"11"` - `"12"` - `"13"` - `"14"` - `"15"` - `"16"` - `"17"` - `"18"` - `"19"` - `"20"` - `"21"` - `"22"` - `"23"` - `"24"` - `"25"` - `"26"` - For example `0` - `IdentifiedDecoration`: a record with fields - `id`: string. An arbitrary unique string identifying the decoration. - Also has the fields of `Decoration` - For example `{ type = 0, x = 0, z = 0, rot = 0, … }` - `ItemBase`: a record with fields - `Damage`: int (optional). Damage that an item has. Only used for tools, armor, etc. - `Unbreakable`: bool (optional). Whether the item should be unbreakable. Only used for tools, armor, etc. - `CanDestroy`: list of string (optional). List of the block states that can be destroyed by this item when holding it in adventure mode. - `CanPlaceOn`: list of string (optional). List of blockstates that this block item can be placed on. - `CustomModelData`: int (optional). Tag that describes the custom model an item will take. Used by the `custom_model_data` model overrides predicate. Has certain restrictions due to float conversion. - `Enchantments`: list of Enchantment (optional). List of enchantments that are on the item. - `RepairCost`: int (optional). Number of experience levels to add to the base level cost when repairing, combining, or renaming this item with an anvil. - `AttributeModifiers`: list of AttributeModifier (optional). Applied to an entity that has equipped the item. - `display`: Display (optional). Display settings. - `HideFlags`: int (optional). Bitfield for which flags to hide on an item. - `Trim`: Trim (optional). Trim to apply to the item & armor when worn. - `[string]`: any (optional). Custom item NBT tags - For example `{}` - `ItemStack`: a record with fields - `id`: item id. ID of the item. - `components`: DataComponentPatch (optional) - `count`: int 1..99 (optional). Number of items in the stack. Defaults to `1`. - For example `{ id = abandoned_camp_map }` - `ItemStackOfComponent`: a record with fields - `id`: item id. ID of the item. - `components`: T (optional) - `count`: int 1..99 (optional). Number of items in the stack. Defaults to `1`. - For example `{ id = abandoned_camp_map }` - `ItemStackTemplate`: ItemStack | item id - For example `{ id = abandoned_camp_map }`, `abandoned_camp_map` - `KnowledgeBook`: a record with fields - `[string]`: any (optional). Custom item NBT tags - `Recipes`: list of recipe ids (optional) - Also has the fields of `ItemBase` - For example `{}` - `LeatherArmor`: a record with fields - `[string]`: any (optional). Custom item NBT tags - Also has the fields of `ItemBase` - For example `{}` - `LodestonePos`: a record with fields - `X`: int (optional) - `Y`: int (optional) - `Z`: int (optional) - For example `{}` - `PlayerHead`: a record with fields - `[string]`: any (optional). Custom item NBT tags - `SkullOwner`: SkullOwner | string (optional) - Also has the fields of `ItemBase` - For example `{}` - `Shield`: a record with fields - `[string]`: any (optional). Custom item NBT tags - `BlockEntityTag`: { Base?: DyeColorInt, Patterns?: list of BannerPatternLayer } (optional). Banner Data. - Also has the fields of `ItemBase` - For example `{}` - `SingleItem`: a record with fields - `id`: item id. ID of the item. - `components`: DataComponentPatch (optional) - For example `{ id = abandoned_camp_map }` - `SingleItemOfComponent`: a record with fields - `id`: item id. ID of the item. - `components`: T (optional) - For example `{ id = abandoned_camp_map }` - `SpawnItem`: a record with fields - `[string]`: any (optional). Custom item NBT tags - `EntityTag`: AnyEntity (optional). Data of the spawned entity. - Also has the fields of `ItemBase` - For example `{}` - `SuspiciousStew`: a record with fields - `[string]`: any (optional). Custom item NBT tags - `Effects`: list of Effect (optional). Effects this stew will give. - Also has the fields of `ItemBase` - For example `{}` - `WritableBook`: a record with fields - `[string]`: any (optional). Custom item NBT tags - `pages`: list of string (optional) - Also has the fields of `ItemBase` - For example `{}` - `WrittenBook`: a record with fields - `[string]`: any (optional). Custom item NBT tags - `resolved`: bool (optional). Whether the dynamic content on the pages has been resolved. - `pages`: list of Filterable of string (optional). Pages of the book as JSON text components. - `generation`: BookGeneration (optional). Generation of the book. 0 = original, 1 = copy of original, 2 = copy of copy, 3 = tattered. - `author`: string (optional) - `title`: Filterable of string (optional) - Also has the fields of `ItemBase` - For example `{}` # Entity data types Named types from this part of the game's schema: enums, aliases and records, with values that fit. - `Abilities`: a record with fields - `walkSpeed`: number 0.1 (optional). Speed that the player walks at. - `flySpeed`: number 0.05 (optional). Speed that the player flies at. - `mayfly`: bool (optional). Whether the player can fly. - `flying`: bool (optional). Whether the player is flying. - `invulnerable`: bool (optional). Whether the player can only take damage from the void. - `mayBuild`: bool (optional). Whether the player may build. - `instabuild`: bool (optional). Whether the player destroys blocks instantly. - For example `{}` - `AcceleratingProjectileBase`: a record with fields - `acceleration_power`: number (optional) - Also has the fields of `ProjectileBase` - For example `{}` - `Action`: a record with fields - `player`: list of int (exactly 4) (optional) - `timestamp`: int 0.. (optional). Game tick of when the event occured. - For example `{}` - `AgeableMob`: a record with fields - `Age`: int (optional). The age of the mob in ticks. When negative, the mob is a baby. When 0 or above, the mob is an adult. If this mob is breedable, when 0 or above, represents the number of ticks before it can breed again. - `ForcedAge`: int (optional). A value of age assigned to this mob when it grows up. Incremented when a baby mob is fed. - `AgeLocked`: bool (optional) - For example `{}` - `Allay`: a record with fields - `DuplicationCooldown`: int (optional). Ticks until the allay can duplicate. This is set to 6000 game ticks (5 minutes) when the allay duplicates. - `Inventory`: list of ItemStack (exactly 1) (optional). Items it has picked up. Note that the item given by the player is in the allay's `HandItems[0]` tag, not here. - `listener`: VibrationListener (optional). Vibration game event listener. - Also has the fields of `MobBase` - For example `{}` - `AngerManagement`: a record with fields - `suspects`: list of Suspect (optional). Suspects that have angered the warden. - For example `{}` - `AnyEntity`: entity object - For example `AcaciaBoat()` - `AreaEffectCloud`: a record with fields - `Age`: int (optional). Number of ticks it has existed. Controls when it will despawn; when greater than `Duration + WaitTime`. - `Color`: int (optional). Color of the particles. calculated as `RED << 16 | GREEN << 8 | BLUE`. Each of these fields must be between 0 and 255, inclusive - `Duration`: int (optional). Maximum number of ticks until it will disappear after `WaitTime` is done - `ReapplicationDelay`: int (optional). Number of ticks until the effects are reapplied. - `WaitTime`: int (optional). Number of ticks until it appears. - `DurationOnUse`: int (optional). Amount the duration changes when it is active. - `Owner`: list of int (exactly 4) (optional) - `Radius`: number (optional). Radius of the particles & effect applications. - `RadiusOnUse`: number (optional). Change in the radius when it is used. - `RadiusPerTick`: number (optional). Change in the radius per tick. - `custom_particle`: Particle (optional). If present, the particle that the area effect cloud displays instead of the default `entity_effect` particle based on the potion contents. - `potion_contents`: PotionContents | potion id (optional) - `potion_duration_scale`: number (optional). The duration of the potion effect applied is scaled by this factor. Defaults to `1`. Will be `0.25` when throwing lingering potions. - Also has the fields of `EntityBase` - For example `{}` - `Armadillo`: a record with fields - `state`: ArmadilloState (optional) - `scute_time`: int 0.. (optional) - Also has the fields of `Breedable` - For example `{}` - `ArmadilloState`: one of `"idle"`, `"rolling"`, `"scared"`, `"unrolling"` - For example `idle` - `ArmorStand`: a record with fields - `equipment`: EntityEquipment (optional). The equipment items of the armor stand. - `Invisible`: bool (optional). Whether it should be invisible. - `Marker`: bool (optional). Whether it has no hitbox. - `NoBasePlate`: bool (optional). Whether it should have a no base plate. - `ShowArms`: bool (optional). Whether it should show its arms. - `Small`: bool (optional). Whether it is small. - `DisabledSlots`: int (optional). A bitfield of the slots that cannot be used. - `Pose`: Pose (optional). Body part rotations. - Also has the fields of `LivingEntity` - For example `{}` - `Arrow`: object - Also has the fields of `ArrowBase` - For example `{}` - `ArrowBase`: a record with fields - `shake`: int (optional). Shake it creates. - `pickup`: Pickup (optional). How players can pick up it. - `life`: int (optional). Ticks since it last moved. - `damage`: number (optional). Damage it should deal. - `inGround`: bool (optional). Whether it is in the ground. - `inBlockState`: BlockState (optional). Block it is in. - `crit`: bool (optional). Whether it should do critical damage. - `weapon`: ItemStack (optional). The item which has shot this arrow. - `PierceLevel`: int (optional). Number of entities it can pass through. - `SoundEvent`: sound_event id (optional). Sound event to play when it hits something. Can only be vanilla sound events - `item`: ItemStack (optional) - Also has the fields of `ProjectileBase` - For example `{}` - `Attribute`: a record with fields - `id`: attribute id (optional) - `base`: number (optional) - `modifiers`: list of AttributeModifier (optional) - For example `{}` - `AttributeModifier`: { id: attribute_modifier id, amount: number, operation: AttributeOperation } - For example `{ id = …, amount = 0, operation = add_value }` - `AxisAngle`: a record with fields - `axis`: list of number (exactly 3). Local position of the axis in [x, y, z]. - `angle`: number. Angle to rotate around the axis in radians. - For example `{ axis = [0, 0, 0], angle = 0 }` - `Axolotl`: a record with fields - `Variant`: AxolotlVariantInt (optional). The variant of the axolotl. - `FromBucket`: bool (optional). If this axolotl was released from a bucket. - Also has the fields of `Breedable` - For example `{}` - `AxolotlVariantInt`: one of `"0"`, `"1"`, `"2"`, `"3"`, `"4"` - For example `0` - `Bat`: a record with fields - `BatFlags`: bool (optional). Whether it is upside down. - Also has the fields of `MobBase` - For example `{}` - `BeamTarget`: a record with fields - `X`: int (optional) - `Y`: int (optional) - `Z`: int (optional) - For example `{}` - `Billboard`: one of - `"fixed"`: No rotation. - `"vertical"`: Pivot around the vertical axis. - `"horizontal"`: Pivot around the horizontal axis. - `"center"`: Pivot around both axes. - For example `fixed` - `BlockAttachedEntity`: a record with fields - `block_pos`: list of int (exactly 3) (optional) - Also has the fields of `EntityBase` - For example `{}` - `BlockDisplay`: a record with fields - `block_state`: BlockState (optional). Block state to display. Can display most block entities (eg. Chests, Beds, Furnaces, etc). Does not display specially rendered block entities (eg. The bell in a bell block, an end gateway, the book on an enchantment table, a banner, a sign, etc). - Also has the fields of `DisplayBase` - For example `{}` - `BlockLeash`: a record with fields - `X`: int (optional). X coordiante of leash knot. - `Y`: int (optional). Y coordiante of leash knot. - `Z`: int (optional). Z coordiante of leash knot. - For example `{}` - `Boat`: object - Also has the fields of `EntityBase` - For example `{}` - `BoatType`: one of `"oak"`, `"spruce"`, `"birch"`, `"jungle"`, `"acacia"`, `"dark_oak"`, `"mangrove"`, `"bamboo"`, `"cherry"` - For example `oak` - `Bogged`: a record with fields - `sheared`: bool (optional). Whether the mushrooms on this bogged have been sheared. - Also has the fields of `MobBase` - For example `{}` - `Brain`: a record with fields - `memories`: Memories (optional) - For example `{}` - `Breedable`: a record with fields - `InLove`: int 0.. (optional). Ticks until it stops searching for a mate. - `LoveCause`: list of int (exactly 4) (optional). Player that caused this mob to breed. - Also has the fields of `MobBase`, `AgeableMob` - For example `{}` - `Brightness`: a record with fields - `sky`: int 0..15. Value of skylight. - `block`: int 0..15. Value of block light. - For example `{ sky = 0, block = 0 }` - `BulletTarget`: a record with fields - `UUID`: list of int (exactly 4) (optional) - `X`: int (optional). X block coordinate of the it. - `Y`: int (optional). Y block coordinate of the it. - `Z`: int (optional). Z block coordinate of the it. - For example `{}` - `Camel`: a record with fields - `IsSitting`: bool (optional). Whether it is sitting. - `LastPoseTick`: int (optional). The tick when it started changing its pose. - Also has the fields of `HorseBase` - For example `{}` - `Cat`: a record with fields - `CollarColor`: DyeColorByte (optional). Collar color, present for stray cats. Defaults to 14 (red). - `variant`: cat_variant id (optional) - `sound_variant`: cat_sound_variant id (optional) - Also has the fields of `Tamable` - For example `{}` - `CatType`: one of `"-1"`, `"0"`, `"1"`, `"2"`, `"3"`, `"4"`, `"5"`, `"6"`, `"7"`, `"8"`, `"9"`, `"10"` - For example `-1` - `ChestBoat`: a record with fields - `LootTable`: loot_table id (optional). Loot table that will populate this chest boat. - `LootTableSeed`: int (optional). Seed of the loot table. - `Items`: list of SlottedItem of int 0..26 (0 to 27) (optional). Slots from 0 to 26. - Also has the fields of `Boat` - For example `{}` - `ChestMinecart`: a record with fields - `Items`: list of SlottedItem of int 0..26 (0 to 27) (optional). Slots from 0 to 26. - Also has the fields of `Minecart`, `ContainerMinecart` - For example `{}` - `ChestedHorse`: a record with fields - `ChestedHorse`: bool (optional). Whether it has a chest. - `Items`: list of (SlottedItem of int 0..14 | object) (0 to 15) (optional). Slots from 0 to 14. - Also has the fields of `HorseBase` - For example `{}` - `Chicken`: a record with fields - `IsChickenJockey`: bool (optional). Whether it is from a chicken jockey. If true it will despawn and will drop more experience. - `EggLayTime`: int (optional). Time until it lays another egg. - `variant`: chicken_variant id (optional) - `sound_variant`: chicken_sound_variant id (optional) - Also has the fields of `Breedable` - For example `{}` - `CommandBlockMinecart`: object - Also has the fields of `Minecart`, `BaseCommandBlock` - For example `{}` - `ContainerMinecart`: a record with fields - `LootTable`: loot_table id (optional). Loot table that will populate this minecart. - `LootTableSeed`: int (optional). Seed of the loot table. - For example `{}` - `CopperGolem`: a record with fields - `next_weather_age`: int -2.. (optional). Gametime in ticks when the copper golem oxidizes. `-2` represents "waxed" `-1` will be replaced with a random time between 504000 and 552000 ticks later - `weather_state`: WeatherState (optional) - Also has the fields of `MobBase` - For example `{}` - `Cow`: a record with fields - `variant`: cow_variant id (optional) - `sound_variant`: cow_sound_variant id (optional) - Also has the fields of `Breedable` - For example `{}` - `Creaking`: object - Also has the fields of `MobBase` - For example `{}` - `Creeper`: a record with fields - `powered`: bool (optional). Whether it is being struck by lightning. - `ExplosionRadius`: int (optional). Radius of the explosion. - `Fuse`: int (optional). Ticks until it explodes. - `ignited`: bool (optional). Whether it was lit with flint and steel. - Also has the fields of `MobBase` - For example `{}` - `CubeMob`: a record with fields - `Size`: int 0..126 (optional) - `wasOnGround`: bool (optional). Whether it is on the ground. - For example `{}` - `Cushion`: a record with fields - `color`: DyeColor (optional) - Also has the fields of `BlockAttachedEntity` - For example `{}` - `DecomposedTransformation`: a record with fields - `translation`: list of number (exactly 3). Translation in [x, y, z]. - `left_rotation`: Rotation. Using this rotation is enough for most transformations. - `right_rotation`: Rotation. For more complex transformations. Applied **before** scaling. - `scale`: list of number (exactly 3). Scale in [x, y, z]. - For example `{ translation = [0, 0, 0], left_rotation = [0, 0, 0, 0], right_rotation = [0, 0, 0, 0], scale = [0, 0, 0], … }` - `DespawnableProjectileBase`: object - Also has the fields of `AcceleratingProjectileBase` - For example `{}` - `DisabledSlots`: one of `"1"`, `"2"`, `"3"`, `"4"`, `"5"`, `"6"`, `"7"`, `"8"`, `"9"`, `"10"`, `"11"`, `"12"`, `"13"`, `"14"`, `"15"`, `"16"`, `"17"`, `"18"` - For example `1` - `DisplayBase`: a record with fields - `transformation`: Transformation (optional). Transformation applied to model (after normal entity orientation). Defaults to identity. Interpolated. For an easy GUI, check out [Misode's tool](https://misode.github.io/transformation/). The value is stored in decomposed object form for interpolation & ease-of-use, Supports storing a [non-canonical matrix form](https://gist.github.com/MulverineX/f473dbfd7cc8dadb326074fef05ad76a) describing a row-major matrix, which is automatically decomposed by the game with a performance cost. - `shadow_radius`: number 0.. (optional). Size of shadow. Defaults to 0 (no shadow). Interpolated. - `shadow_strength`: number 0..1 (optional). Strength of the shadow. Controls the opacity of the shadow as a function of distance to the block below. Defaults to 1. Interpolated. - `start_interpolation`: int (optional). Ticks after the next client tick to wait until starting the interpolation. Info: All interpolated properties are part of a single interpolation set. Any update to an interpolated property will cause all values of the interpolation set to be saved as "current". - Data command executions that do not change the value of a property (even if it's present in NBT) do not count as updates. - Updates are synchronized to clients at most once per tick, so multiple updates within a single command or a function will still count as a single update. Previous current values are saved as "previous". If interpolation is enabled, the entity will transition between "previous" and "current" values over time. `interpolation_duration` must be set every time an interpolatable property is updated to cause interpolation. Negative values are allowed, will cause an instant jump to the subtracted duration value, then interpolation will continue as normal. - `interpolation_duration`: int 0.. (optional). Ticks the interpolation should take to complete. - `teleport_duration`: int 0..59 (optional). How long in game ticks the entity takes to interpolate from its starting location to its destination when teleported. Defaults to 0 (no interpolation). - `billboard`: Billboard (optional). Controls if the model should pivot to face the player when rendered. Defaults to `fixed`. - `brightness`: Brightness (optional). When defined, overrides light values used for rendering. Omitted by default (which means rendering uses values from the entity position). - `view_range`: number 0.. (optional). Maximum view range of this entity. Actual distance depends on client-side render distance and entity distance scaling. Default value 1.0 (roughly the same as fireball). - `width`: number 0.. (optional). Describe width of the culling bounding box. Bounding box spans vertically from y to y+height and horizontally width/2 in all directions from the entity position. If set to 0, culling is disabled. Defaults to 0. - `height`: number 0.. (optional). Describes height of the culling bounding box. Bounding box spans vertically from y to y+height and horizontally width/2 in all directions from the entity position. If set to 0, culling is disabled. Defaults to 0. - `glow_color_override`: 0 | int (optional). Override glow border color. If set to 0, uses team color. Defaults to 0. Calculated as `RED << 16 | GREEN << 8 | BLUE`. Each of these fields must be between 0 and 255, inclusive. - Also has the fields of `EntityBase` - For example `{}` - `Dolphin`: a record with fields - `GotFish`: bool (optional). Whether it has gotten fish from a player. - `Moistness`: int (optional). Moistness level of the dolphin. Set to 2400 when the dolphin is in water or rain, otherwise decreases by 1 every tick. The dolphin takes damage when level is at 0 or below. - Also has the fields of `MobBase`, `AgeableMob` - For example `{}` - `DragonPhase`: one of `"0"`, `"1"`, `"2"`, `"3"`, `"4"`, `"5"`, `"6"`, `"7"`, `"8"`, `"9"`, `"10"` - For example `0` - `DropChances`: a record with fields - `[EquipmentSlot]`: number 0.. (optional). `0.0` is hardcoded to be unaffected by enchantments. Values between `0.0` and `1.0` (inclusive) randomizes durability of the dropped item. - For example `{}` - `Drowned`: object - Also has the fields of `ZombieBase`, `DrowningTracker` - For example `{}` - `DrowningTracker`: a record with fields - `DrownedConversionTime`: int (optional). Ticks until it converts. - `InWaterTime`: int (optional). Ticks it has been in the water. - For example `{}` - `EndCrystal`: a record with fields - `ShowBottom`: bool (optional). Whether to show the base of the end crystal. - `beam_target`: list of int (exactly 3) (optional). Coordinates that the beam is pointing to - Also has the fields of `EntityBase` - For example `{}` - `EnderDragon`: a record with fields - `DragonPhase`: DragonPhase (optional). The dragon's current state. - `DragonDeathTime`: int (optional). Number of ticks the dragon has been dead for, or `0` when alive. At `150`, the dragon begins spawning experience orbs every 5 ticks (first drop at 155). Removes dragon at values `200` and higher. - `sitting_damage_received`: number (optional). The amount of damage the dragon has received while perched. When this value is `50` or higher, it is reset to `0` and the dragon ends its perch. - Also has the fields of `MobBase` - For example `{}` - `EnderPearl`: entity object - For example `AcaciaBoat(…)` - `Enderman`: a record with fields - `carriedBlockState`: BlockState (optional). Block it is carrying. - Also has the fields of `MobBase`, `NeutralMob` - For example `{}` - `Endermite`: a record with fields - `Lifetime`: int (optional). How long it has existed. - `PlayerSpawned`: bool (optional). Whether enderman should attack it. - Also has the fields of `MobBase` - For example `{}` - `EnteredNetherPosition`: a record with fields - `x`: number (optional) - `y`: number (optional) - `z`: number (optional) - For example `{}` - `EntityBase`: a record with fields - `Pos`: list of number (exactly 3) (optional) - `Motion`: list of number (exactly 3) (optional) - `Rotation`: list of number (exactly 2) (optional). Rotation in [y-rotation, x-rotation] - `fall_distance`: number (optional). How far the entity has fallen. - `Fire`: int (optional). Ticks of fire left, or if negative, ticks until the entity starts to burn. - `Air`: int (optional). Ticks of air left. - `HasVisualFire`: bool (optional). Whether the entity has visual fire. - `OnGround`: bool (optional). Whether the entity is on the ground. - `NoGravity`: bool (optional). Whether the entity should be effected by gravity. - `Invulnerable`: bool (optional). Whether the entity is immune to damage. - `invulnerable_time`: int 0.. (optional). Temporary immunity duration of the entity, in ticks. The entity is immune to damage if `invulnerable_time` > 0 **or** `Invulnerable` is `true`. - `PortalCooldown`: int (optional). How long until the entity can go through a nether portal. - `UUID`: list of int (exactly 4) (optional) - `CustomName`: Text (optional) - `CustomNameVisible`: bool (optional). Whether the custom name should always be visible. - `Silent`: bool (optional). Whether the entity should make any sound. - `Passengers`: list of AnyEntity (optional). Passengers on the entity. - `Glowing`: bool (optional). Whether the entity should glow. - `Tags`: list of string (optional). Labelling tags on the entity. - `Team`: string (optional). Team to join when it is spawned. - `data`: CustomData (optional). Any stored data - `TicksFrozen`: int (optional). Ticks that this entity has been freezing. Although this tag is defined for all entities, it is actually only used by mobs that are not in the `freeze_immune_entity_types` entity type tag. This increases by one every tick the entity is in powdered snow, and decreases by two when it's out of it. - For example `{}` - `EntityEquipment`: a record with fields - `[EquipmentSlot]`: ItemStack (optional) - For example `{}` - `EvokerFangs`: a record with fields - `Warmup`: int (optional). Ticks until the fangs pop out of the ground. - `Owner`: list of int (exactly 4) (optional) - Also has the fields of `EntityBase` - For example `{}` - `ExperienceOrb`: a record with fields - `Age`: int (optional). Ticks that it has existed. - `Health`: int (optional) - `Value`: int (optional). Amount of experience it will give. - `Count`: int (optional). Remaining number of times that the orb can be picked up. When the orb is picked up, the value decreases by 1. When multiple orbs are merged, their values are added up to result orb. When the value reaches 0, the orb is depleted. - Also has the fields of `EntityBase` - For example `{}` - `EyeOfEnder`: a record with fields - `Item`: ItemStack (optional). Item to render as. - Also has the fields of `EntityBase` - For example `{}` - `FallDamageLogicData`: a record with fields - `current_explosion_impact_pos`: list of number (exactly 3) (optional). Added mid-air after being hit by an explosion. - `current_impulse_context_reset_grace_time`: int 0.. (optional). Used by fall damage logic. Decreases by 1 every tick. - For example `{}` - `FallingBlock`: a record with fields - `TileEntityData`: object (optional). NBT data for the placed block. - `BlockState`: BlockState (optional). Block state for the placed block. Defaults to sand. - `Time`: int (optional). Ticks it has existed. - `DropItem`: bool (optional). Whether it should drop as a block when destroyed. - `HurtEntities`: bool (optional). Whether this it should hurt entities. - `FallHurtMax`: int (optional). Maximum damage it should deal. - `FallHurtAmount`: number (optional). Damage multiplier. - `CancelDrop`: bool (optional). Whether the block should be destroyed instead of placed after landing on a solid block. When `true`, the block is not dropped as an item, even if the DropItem tag is set to `true`. However, if the entity is deleted due to its Time value being too high, this tag is ignored and an item is dropped depending on the `DropItem` tag. Defaults to `1` for falling suspicious sand and suspicious gravel, and `0` for the other vanilla falling blocks and any summoned falling block. - Also has the fields of `EntityBase` - For example `{}` - `FireWorkRocket`: a record with fields - `Life`: int (optional). Ticks it has existed. - `LifeTime`: int (optional). Ticks it will exist. - `ShotAtAngle`: bool (optional). Whether it should move at an angle. - `FireworksItem`: ItemStack (optional) - Also has the fields of `ProjectileBase` - For example `{}` - `FireballBase`: a record with fields - `Item`: ItemStack (optional). Item it should render as. - Also has the fields of `DespawnableProjectileBase` - For example `{}` - `Fish`: a record with fields - `FromBucket`: bool (optional). If it was released from a bucket. - Also has the fields of `MobBase` - For example `{}` - `Fox`: a record with fields - `Trusted`: list of list of int (exactly 4) (optional). List of trusted players. - `Sleeping`: bool (optional). Whether it is sleeping. - `Type`: FoxType (optional). The type of fox. - `Sitting`: bool (optional). Whether it is sitting. - `Crouching`: bool (optional). Whether it is crouching. - Also has the fields of `Breedable` - For example `{}` - `FreezingTracker`: a record with fields - `FrostbiteConversionTime`: int (optional). Ticks until it converts. - `FreezingTime`: int (optional). Ticks it has been in the powdered snow. - For example `{}` - `Frog`: a record with fields - `variant`: frog_variant id (optional) - Also has the fields of `Breedable` - For example `{}` - `Frostbite`: object - Also has the fields of `ZombieBase`, `DrowningTracker` - For example `{}` - `FurnaceMinecart`: a record with fields - `PushX`: number (optional). Acceleration in x axis. - `PushZ`: number (optional). Acceleration in z axis. - `Fuel`: int (optional). Ticks until the fuel runs out. - Also has the fields of `Minecart` - For example `{}` - `Gamemode`: one of `"0"`, `"1"`, `"2"`, `"3"` - For example `0` - `Gene`: one of - `"normal"`: (dominant) - `"lazy"`: (dominant) - `"worried"`: (dominant) - `"playful"`: (dominant) - `"brown"`: (recessive) - `"weak"`: (recessive) - `"aggressive"`: (dominant) - For example `normal` - `Ghast`: a record with fields - `ExplosionPower`: int 0.. (optional). Explosion radius of fireballs that are shot from it. - Also has the fields of `MobBase` - For example `{}` - `GlowSquid`: a record with fields - `DarkTicksRemaining`: int (optional). Ticks that it will wait before glowing. - Also has the fields of `MobBase`, `AgeableMob` - For example `{}` - `Goat`: a record with fields - `HasLeftHorn`: bool (optional). Whether it has its left horn. - `HasRightHorn`: bool (optional). Whether it has its right horn. - `IsScreamingGoat`: bool (optional). Whether it is a screaming goat. - Also has the fields of `Breedable` - For example `{}` - `HappyGhast`: a record with fields - `still_timeout`: int (optional) - Also has the fields of `MobBase`, `AgeableMob` - For example `{}` - `HivePos`: a record with fields - `X`: int (optional) - `Y`: int (optional) - `Z`: int (optional) - For example `{}` - `Hoglin`: a record with fields - `IsImmuneToZombification`: bool (optional). Whether it will not transform to a zoglin when it is in the Overword. - `CannotBeHunted`: bool (optional). Whether it cannot be hunted by piglins - `TimeInOverworld`: int (optional). The number of ticks it has been in the overworld. - Also has the fields of `Breedable` - For example `{}` - `HopperMinecart`: a record with fields - `Items`: list of SlottedItem of int 0..4 (0 to 5) (optional). Slots from 0 to 4. - `TransferCooldown`: int (optional). Ticks until an item can be transferred. - `Enabled`: bool (optional). Whether it should pick up items. - Also has the fields of `Minecart`, `ContainerMinecart` - For example `{}` - `Horse`: a record with fields - `Variant`: HorseVariantAndMarkings (optional). Variant of the horse. Stored as `baseColor | (markings << 8)`. - Also has the fields of `HorseBase` - For example `{}` - `HorseBase`: a record with fields - `Bred`: bool (optional). Unknown use. Remains `0` even if it was bred. - `EatingHaystack`: bool (optional). Whether it is eating a haystack. - `Tame`: bool (optional). Whether it has been tamed. - `Temper`: int 0..100 (optional). Higher values make it easier to tame. Increases with feeding. - `Owner`: list of int (exactly 4) (optional). Player who tamed it. - Also has the fields of `Breedable` - For example `{}` - `HorseVariantAndMarkings`: one of `"0"`, `"1"`, `"2"`, `"3"`, `"4"`, `"5"`, `"6"`, `"256"`, `"257"`, `"258"`, `"259"`, `"260"`, `"261"`, `"262"`, `"512"`, `"513"`, `"514"`, `"515"`, `"516"`, `"517"`, `"518"`, `"768"`, `"769"`, `"770"`, `"771"`, `"772"`, `"773"`, `"774"`, `"1024"`, `"1025"`, `"1026"`, `"1027"`, `"1028"`, `"1029"`, `"1030"` - For example `0` - `Interaction`: a record with fields - `width`: number (optional). Cube hitbox width centered on the entity. Negative values are effectively `| x |`. - `height`: number (optional). Cube hitbox height stretching up from the entity position. Negative values stretch the hitbox down. - `response`: bool (optional). Whether an action should trigger a response. Defaults to false. Response: Attack - When true, the default attack sound is played. Interaction - When true, the player's arm swings. - `attack`: Action (optional). Record of last attack (left click) event, can be updated every tick (no invulnerability frames). - `interaction`: Action (optional). Record of last interaction (use; right click) event, can be updated every tick, if the player is holding the key it updates every 3 ticks. - Also has the fields of `EntityBase` - For example `{}` - `IronGolem`: a record with fields - `PlayerCreated`: bool (optional). Whether a player created it. - Also has the fields of `MobBase`, `NeutralMob` - For example `{}` - `Item`: a record with fields - `Age`: int (optional). Ticks it has existed. - `Health`: int (optional) - `PickupDelay`: int (optional). Ticks until an entity can pick up this item. - `Owner`: list of int (exactly 4) (optional). Only this entity can pick up the item. - `Thrower`: list of int (exactly 4) (optional). Player who threw the item. Can be set and/or changed to any entity. - `Item`: ItemStack (optional) - Also has the fields of `EntityBase` - For example `{}` - `ItemCost`: a record with fields - `id`: item id. ID of the item. - `components`: DataComponentExactPredicate (optional) - `count`: int 1..99 (optional). Number of items in the stack. Defaults to `1`. - For example `{ id = abandoned_camp_map }` - `ItemDisplay`: a record with fields - `item`: ItemStack (optional). Item stack to display. - `item_display`: ItemDisplayContext (optional). Describes item model transform applied to item (as defined in the `display` section in model JSON). Defaults to `fixed`. - Also has the fields of `DisplayBase` - For example `{}` - `ItemFrame`: a record with fields - `Facing`: DirectionByte (optional). Direction it is facing. - `Item`: ItemStack (optional) - `ItemDropChance`: number (optional). Chance the item has to drop. - `ItemRotation`: int 0..7 (optional). Rotation of the item. - `Invisible`: bool (optional). Whether the item frame should be invisible. The item inside the frame is not effected. - `Fixed`: bool (optional). Whether the item frame should not be able to be broken and should disallow the item to be moved. - Also has the fields of `BlockAttachedEntity` - For example `{}` - `LargeFireball`: a record with fields - `ExplosionPower`: int (optional). Explosion radius. - Also has the fields of `FireballBase` - For example `{}` - `LeashOwner`: a record with fields - `UUID`: list of int (exactly 4) (optional) - For example `{}` - `LivingEntity`: a record with fields - `Health`: number (optional) - `AbsorptionAmount`: number (optional). How much absorption health it has. - `HurtTime`: int (optional). Timer since it has been damaged. Counts down to zero. - `DeathTime`: int (optional). Timer since it was marked as dead. Counts down to zero. - `FallFlying`: bool (optional). Whether it will glide when it falls. - `sleeping_pos`: list of int (exactly 3) (optional) - `Brain`: { memories?: Memories } (optional) - `attributes`: list of Attribute (optional) - `active_effects`: list of MobEffectInstance (optional) - `last_hurt_by_player`: list of int (exactly 4) (optional). The UUID of the player that last hurt this entity. Stored for 100 ticks. - `last_hurt_by_player_memory_time`: int 0..100 (optional). Amount of ticks that this entity will remember the player that last hurt this entity. Counts down from 100 to 0. - `last_hurt_by_mob`: list of int (exactly 4) (optional). The UUID of the mob that last hurt this entity. Stored for 100 ticks. - `ticks_since_last_hurt_by_mob`: int 0..100 (optional). Amount of ticks since this entity was last hurt by a mob. Counts up from 0 to 100. - `locator_bar_icon`: WaypointIcon (optional) - Also has the fields of `EntityBase`, `FallDamageLogicData` - For example `{}` - `Llama`: a record with fields - `Strength`: int 1..5 (optional). Determines both the number of items it can carry and how likely it is for wolves to run away. - `Variant`: LlamaVariantInt (optional). The variant of this llama. - Also has the fields of `ChestedHorse` - For example `{}` - `LlamaSpit`: object - Also has the fields of `ProjectileBase` - For example `{}` - `LlamaVariantInt`: one of `"0"`, `"1"`, `"2"`, `"3"` - For example `0` - `Mannequin`: a record with fields - `profile`: Profile (optional) - `hidden_layers`: list of PlayerModelPart (optional) - `main_hand`: HumanoidArm (optional). Defaults to `right`. - `pose`: MannequinPose (optional). Defaults to `standing`. - `immovable`: bool (optional). Defaults to `false`. - `description`: Text (optional). Text shown below the name tag. Defaults to the translated `entity.minecraft.mannequin.label`. - `hide_description`: bool (optional). Whether the below name text is displayed. Defaults to `false`. - `equipment`: EntityEquipment (optional). The equipment items of the mannequin. - Also has the fields of `LivingEntity` - For example `{}` - `MannequinPose`: one of `"standing"`, `"crouching"`, `"swimming"`, `"fall_flying"`, `"sleeping"` - For example `standing` - `Marker`: object - Also has the fields of `EntityBase` - For example `{}` - `Minecart`: a record with fields - `DisplayState`: BlockState (optional). Custom block to display. - `DisplayOffset`: int (optional). Vertical offset of the block display. - Also has the fields of `EntityBase` - For example `{}` - `MobBase`: a record with fields - `equipment`: EntityEquipment (optional). The equipment items of the mob, such as armor or weapons. - `drop_chances`: DropChances (optional). Chances of the mob dropping an equipment slot on death. - `DeathLootTable`: loot_table id (optional). Loot table that is dropped when the mob dies. - `DeathLootTableSeed`: int (optional). Seed for generating the death loot table. - `CanPickUpLoot`: bool (optional). Whether it can pick up loot. - `PersistenceRequired`: bool (optional). Whether it should not despawn naturally. - `LeftHanded`: bool (optional). Whether it is left handed. - `NoAI`: bool (optional). Whether it should have an AI. - `leash`: list of int (exactly 3) | { UUID?: list of int (exactly 4) } (optional). What the leash is attached to. - `home_radius`: int (optional). Defaults to -1, which represents "no home". - `home_pos`: list of int (exactly 3) (optional). This field will be discarded if `home_radius` is less than 0. - Also has the fields of `LivingEntity` - For example `{}` - `ModernAttributeModifier`: a record with fields - `id`: attribute_modifier id. The unique identifier of this attribute modifier. - `amount`: number. Change in the attribute. - `operation`: AttributeOperation. The operation used for this modifier. - For example `{ id = …, amount = 0, operation = add_value }` - `Mooshroom`: a record with fields - `Type`: MooshroomType (optional) - `stew_effects`: list of SuspiciousStewEffect (optional) - Also has the fields of `Breedable` - For example `{}` - `NeutralMob`: a record with fields - `anger_end_time`: int (optional). The time anger ends. - `angry_at`: list of int (exactly 4) (optional) - For example `{}` - `Ocelot`: a record with fields - `Trusting`: bool (optional). Whether it trusts players. - Also has the fields of `Breedable` - For example `{}` - `Offers`: a record with fields - `Recipes`: list of Recipe (optional). Trades it has to offer. - For example `{}` - `OminousItemSpawner`: a record with fields - `item`: ItemStack (optional) - `spawn_item_after_ticks`: int (optional) - Also has the fields of `EntityBase` - For example `{}` - `Owner`: a record with fields - `OwnerUUIDMost`: int (optional). Upper bits of the owner's UUID. - `OwnerUUIDLeast`: int (optional). Lower bits of the owner's UUID. - For example `{}` - `OwnerUuid`: a record with fields - `OwnerUUIDMost`: int (optional). Upper bits of the owner's UUID. - `OwnerUUIDLeast`: int (optional). Lower bits of the owner's UUID. - For example `{}` - `Painting`: a record with fields - `facing`: HorizontalDirectionByte (optional). Direction it is facing. - `variant`: painting_variant id (optional). Type of painting. - Also has the fields of `BlockAttachedEntity` - For example `{}` - `Panda`: a record with fields - `MainGene`: Gene (optional). Displayed gene. If this gene is recessive and 'HiddenGene' is not the same, the panda will display the 'normal' gene. - `HiddenGene`: Gene (optional). Hidden gene. - Also has the fields of `Breedable` - For example `{}` - `Parrot`: a record with fields - `Variant`: ParrotVariantInt (optional) - Also has the fields of `Tamable` - For example `{}` - `ParrotVariantInt`: one of `"0"`, `"1"`, `"2"`, `"3"`, `"4"` - For example `0` - `PatrolTarget`: a record with fields - `X`: int (optional) - `Y`: int (optional) - `Z`: int (optional) - For example `{}` - `Phantom`: a record with fields - `anchor_pos`: list of int (exactly 3) (optional). Approximate circle coordinates. - `size`: int 0..64 (optional) - Also has the fields of `MobBase` - For example `{}` - `Pickup`: one of `"0"`, `"1"`, `"2"` - For example `0` - `Pig`: a record with fields - `variant`: pig_variant id (optional) - `sound_variant`: pig_sound_variant id (optional) - Also has the fields of `Saddled` - For example `{}` - `Piglin`: a record with fields - `IsBaby`: bool (optional). Whether it is a baby. - `CannotHunt`: bool (optional). Whether it does not hunt hoglins. - `Inventory`: list of ItemStack (0 to 8) (optional) - Also has the fields of `PiglinBase` - For example `{}` - `PiglinBase`: a record with fields - `IsImmuneToZombification`: bool (optional). Whether it will not transform to a zombified piglin when it is in the Overworld. - `TimeInOverworld`: int (optional). Ticks it has been in the overworld. - Also has the fields of `MobBase` - For example `{}` - `Pillager`: a record with fields - `Inventory`: list of ItemStack (0 to 5) (optional) - Also has the fields of `RaiderBase` - For example `{}` - `Player`: a record with fields - `DataVersion`: int (optional). Version of the player NBT structure - `Dimension`: dimension id (optional) - `LastDeathLocation`: GlobalPos (optional). Location of the player's last death. - `playerGameType`: Gamemode (optional). Game mode that the player is in. - `previousPlayerGameType`: Gamemode (optional). Previous game mode that the player was in. - `Score`: int (optional). Score to display upon death. - `SelectedItemSlot`: int 0..8 (optional). Hotbar slot the player has selected. - `SelectedItem`: SlottedItem of int 0..8 (optional). Item in the hotbar slot the player has selected. - `equipment`: PlayerEquipment (optional) - `respawn`: Respawn (optional) - `SleepTimer`: int (optional). Ticks the player has been in bed. - `foodLevel`: int (optional). Level of the hunger bar. - `foodExhaustionLevel`: number (optional). Rate at which the `foodSaturationLevel` depletes. - `foodSaturationLevel`: number (optional). Rate at which the hunger bar depletes. - `foodTickTimer`: int (optional). Ticks until the player heals or takes starvation damage. - `XpLevel`: int (optional). Number of experience levels the player has. - `XpP`: number (optional). Percentage the experience bar is filled up. - `XpTotal`: int (optional). Total experience the player has. - `XpSeed`: int (optional). Seed for enchantments. - `Inventory`: list of SlottedItem of PlayerSlot (0 to 41) (optional) - `EnderItems`: list of SlottedItem of int 0..26 (0 to 27) (optional). The player's enderchest inventory. - `abilities`: Abilities (optional). Abilities of the player. - `entered_nether_pos`: list of number (exactly 3) (optional). Position that the player entered the nether at. - `raid_omen_position`: list of int (exactly 3) (optional) - `RootVehicle`: RootVehicle (optional). Entity that the player is riding. - `ShoulderEntityLeft`: AnyEntity (optional). Entity that is on the player's left shoulder. - `ShoulderEntityRight`: AnyEntity (optional). Entity that is on the player's right shoulder. - `seenCredits`: bool (optional). Whether the player has gone to the overworld after defeating the Ender Dragon. - `recipeBook`: RecipeBook (optional). Recipes that the player has. - `warden_spawn_tracker`: WardenSpawnTracker (optional). Tracking the warden spawning process for this player. - `ender_pearls`: list of EnderPearl (optional). Ender pearls thrown by this player. - `post_effects`: list of post_effect ids (optional) - `last_explosion_impact_pos`: list of number (exactly 3) (optional) - `spawn_extra_particles_on_fall`: bool (optional) - Also has the fields of `LivingEntity` - For example `{}` - `PlayerEquipment`: a record with fields - `[PlayerEquipmentSlot]`: ItemStack (optional) - For example `{}` - `PlayerEquipmentSlot`: one of `"offhand"`, `"head"`, `"chest"`, `"legs"`, `"feet"`, `"body"`, `"saddle"` - For example `offhand` - `PlayerReputationPart`: a record with fields - `Type`: ReputationPart (optional) - `Value`: any (depends on Type) (optional) - `Target`: list of int (exactly 4) (optional). UUID of the player that caused the gossip-worthy event(s) related to this reputation part. - For example `{}` - `PlayerSlot`: int 0..35 - For example `0` - `PolarBear`: object - Also has the fields of `Breedable`, `NeutralMob` - For example `{}` - `Pose`: a record with fields - `Body`: list of number (exactly 3) (optional) - `LeftArm`: list of number (exactly 3) (optional) - `RightArm`: list of number (exactly 3) (optional) - `LeftLeg`: list of number (exactly 3) (optional) - `RightLeg`: list of number (exactly 3) (optional) - `Head`: list of number (exactly 3) (optional) - For example `{}` - `Potion`: a record with fields - `Item`: ItemStack (optional). Item representation of the potion. - Also has the fields of `Throwable` - For example `{}` - `ProjectileBase`: a record with fields - `HasBeenShot`: bool (optional). Whether it has been shot. This is set to true when it exists for at least one tick, and is used by the game to ensure it only triggers the projectile_shoot game event once. - `Owner`: list of int (exactly 4) (optional) - `LeftOwner`: bool (optional). Whether it has left its owner. - `can_break`: AdventureModePredicate (optional) - Also has the fields of `EntityBase` - For example `{}` - `PuffState`: one of `"0"`, `"1"`, `"2"` - For example `0` - `Pufferfish`: a record with fields - `PuffState`: PuffState (optional). How puffed it is. - Also has the fields of `Fish` - For example `{}` - `Rabbit`: a record with fields - `RabbitType`: RabbitType (optional) - `MoreCarrotTicks`: int (optional). Ticks down once a carrot crop is eaten - Also has the fields of `Breedable` - For example `{}` - `RabbitType`: one of `"0"`, `"1"`, `"2"`, `"3"`, `"4"`, `"5"`, `"99"` - For example `0` - `RaiderBase`: a record with fields - `Patrolling`: bool (optional). Whether the raider is patrolling. - `PatrolLeader`: bool (optional). Whether the raider is leading the patrol. - `patrol_target`: list of int (exactly 3) (optional). Where the raider is heading towards. - `CanJoinRaid`: bool (optional). Whether the raider can join raids and count towards the progress bar. - `RaidId`: int (optional). Id of the raid that the raider is in. - `Wave`: int 0..8 (optional). Wave that the raider is in. - Also has the fields of `MobBase` - For example `{}` - `Ravager`: a record with fields - `AttackTick`: int (optional). Ticks until it can attack. - `RoarTick`: int (optional). Ticks until it can roar. - `StunTick`: int (optional). Ticks it is stunned for. - Also has the fields of `RaiderBase` - For example `{}` - `Recipe`: a record with fields - `rewardExp`: bool (optional). Whether it should reward experience for using this trade. Experience amount is `3 + random(0, 3)` plus `5` if the trade is causing the merchant to increase in tier. - `maxUses`: int 0.. (optional). Maximum number of uses for this trade before the merchant has to restock. - `uses`: int 0.. (optional). Times this trade has been used since the merchant last restocked. - `buy`: ItemCost (optional). Price item required by the merchant, count is modified depending on `demand` & per-player context. - `buyB`: ItemCost (optional). Second item required by the merchant, count does not change. - `sell`: ItemStack (optional). Item being offered by the merchant. - `xp`: int 0.. (optional). XP the merchant gains from the trade. - `priceMultiplier`: number (optional). How much demand & reputation each affect the count of the `buy` item. - `specialPrice`: int (optional). Modifier added to the original count of the `buy` item. - `demand`: int (optional). Count adjuster of the `buy` item based on demand. Minus twice the number of times the villager has the trade in stock. When restocking subtract the number of possible purchases before running out of stock and add twice the number of actually made purchases. When the demand becomes positive, the count is increased by the initial count times `priceMultiplier` times the demand. - For example `{}` - `RecipeBook`: a record with fields - `recipes`: list of recipe ids (optional). Recipes the player has acquired. - `toBeDisplayed`: list of recipe ids (optional). Recipes that should pulse in the crafting book. - `isFilteringCraftable`: bool (optional). Whether the player has filtered crafting on in the crafting table. - `isGuiOpen`: bool (optional). Whether the player has the crafting book open in the crafting table. - `isFurnaceFilteringCraftable`: bool (optional). Whether the player has filtered crafting on in the furnace. - `isFurnaceGuiOpen`: bool (optional). Whether the player has the crafting book open in the furnace. - For example `{}` - `ReputationPart`: one of - `"major_negative"`: Caused by the villager being directly killed, increasing by 25 each time. Increases others' `major_negative` by 15 when shared through gossip. Decays by 10 every 20 minutes. - `"minor_negative"`: Caused by the villager being directly hurt, increasing by 25 each time Increases others' `major_negative` by 5 when shared through gossip. Decays by 20 every 20 minutes. - `"major_positive"`: Caused by the villager being cured, is always set to 20. Does not increase others' `major_positive` through gossip. Does not decay. - `"minor_positive"`: Caused by the villager being cured, is increased by 25 each time. Increases others' `minor_positive` by 20 when shared through gossip. Decays by 1 every 20 minutes. - `"trading"`: Caused by trading with the villager, increasing by 2 each time. Does not increase others' `trading` through gossip. Decays by 2 every 20 minutes. - For example `major_negative` - `Respawn`: a record with fields - `pos`: list of int (exactly 3). The block coordinates of the player's respawn point - `yaw`: number. The Y-rotation of the player's respawn point - `pitch`: number. The X-rotation of the player's respawn point - `dimension`: dimension id. Dimension of the player's respawn point. - `forced`: bool (optional). Whether the player must spawn at the respawn point. - For example `{ pos = [0, 0, 0], yaw = 0, pitch = 0, dimension = overworld, … }` - `RootVehicle`: a record with fields - `Attach`: list of int (exactly 4) (optional). Ridden entity's UUID. - `Entity`: AnyEntity (optional). The ridden entity. - For example `{}` - `Rotation`: AxisAngle | list of number (exactly 4) - For example `[0, 0, 0, 0]`, `{ axis = [0, 0, 0], angle = 0 }` - `Saddled`: object - Also has the fields of `Breedable` - For example `{}` - `Salmon`: a record with fields - `type`: SalmonType (optional). The size variant of the salmon. - Also has the fields of `Fish` - For example `{}` - `Sheep`: a record with fields - `Sheared`: bool (optional). Whether it has been shorn. - `Color`: DyeColorByte (optional) - Also has the fields of `Breedable` - For example `{}` - `Shulker`: a record with fields - `Peek`: bool (optional). Whether it is peeking. - `AttachFace`: DirectionByte (optional). Which face it is attached to. - `Color`: DyeColorByte | ShulkerColor (optional) - Also has the fields of `MobBase` - For example `{}` - `ShulkerBullet`: a record with fields - `Steps`: int (optional). Steps it takes to reach the target - `Target`: BulletTarget (optional) - `Dir`: DirectionByte (optional) - `TXD`: number (optional). X offset to move based on the target's location. - `TYD`: number (optional). Y offset to move based on the target's location. - `TZD`: number (optional). Z offset to move based on the target's location. - Also has the fields of `ProjectileBase` - For example `{}` - `ShulkerColor`: one of `"16"` - For example `16` - `Skeleton`: a record with fields - `StrayConversionTime`: int (optional). Time until it converts to a stray. - Also has the fields of `MobBase` - For example `{}` - `SkeletonHorse`: a record with fields - `SkeletonTrap`: bool (optional). Whether it was spawned by a trap. - `SkeletonTrapTime`: int (optional). Ticks it has existed. - Also has the fields of `HorseBase` - For example `{}` - `Slime`: object - Also has the fields of `MobBase`, `CubeMob` - For example `{}` - `SnowGolem`: a record with fields - `Pumpkin`: bool (optional). Whether it has a pumpkin. - Also has the fields of `MobBase` - For example `{}` - `SpawnerMinecart`: a record with fields - `SpawnPotentials`: list of SpawnPotential (optional). List of potential entities to place next. - `SpawnData`: SpawnerEntry (optional). Data for the next mob to place. Will be overwritten by `SpawnPotentials`. - `SpawnCount`: int. Number of entities that will be placed. - `SpawnRange`: int (optional). Range that the spawned entities will be placed in. - `Delay`: int (optional). Ticks until the next spawn. - `MinSpawnDelay`: int (optional). Minimum random delay for the next spawn. - `MaxSpawnDelay`: int (optional). Maximum random delay for the next spawn. - `MaxNearbyEntities`: int (optional). Maximum number of entities nearby. - `RequiredPlayerRange`: int (optional). Radius in blocks that a player has to be within to spawn entities. - Also has the fields of `Minecart` - For example `{ SpawnCount = 0 }` - `SpectralArrow`: a record with fields - `Duration`: int (optional). Ticks the glowing effect lasts. - Also has the fields of `ArrowBase` - For example `{}` - `Spellcaster`: a record with fields - `SpellTicks`: int (optional). Ticks until the raider can cast its spell. - Also has the fields of `RaiderBase` - For example `{}` - `Squid`: object - Also has the fields of `MobBase`, `AgeableMob` - For example `{}` - `SulfurCube`: a record with fields - `pickup_timer`: int 0.. (optional) - `from_bucket`: bool (optional) - `fuse`: int -1.. (optional). `-1` represents "not ignited". - Also has the fields of `MobBase`, `AgeableMob`, `CubeMob` - For example `{}` - `Suspect`: a record with fields - `anger`: int 1..150 (optional). Level of anger that will decrease by 1 every second. - `uuid`: list of int (exactly 4) (optional) - For example `{}` - `Tadpole`: a record with fields - `Age`: int (optional). Age of it in ticks. When greater than or equal to 24000, it grows into a frog. - `FromBucket`: bool (optional). If it was released from a bucket. - Also has the fields of `MobBase` - For example `{}` - `Tamable`: a record with fields - `Owner`: list of int (exactly 4) (optional) - `Sitting`: bool (optional). Whether the mob is sitting. - Also has the fields of `Breedable` - For example `{}` - `TextAlignment`: one of `"center"`, `"left"`, `"right"` - For example `center` - `Throwable`: object - Also has the fields of `ProjectileBase` - For example `{}` - `ThrowableItem`: a record with fields - `Item`: ItemStack (optional). Item representation of the projectile. - Also has the fields of `Throwable` - For example `{}` - `Tnt`: a record with fields - `fuse`: int (optional). Ticks until it explodes. - `block_state`: BlockState (optional). Defaults to tnt. - `explosion_power`: number 0..128 (optional) - `owner`: list of int (exactly 4) (optional). The entity that primed this TNT. - Also has the fields of `EntityBase` - For example `{}` - `TntMinecart`: a record with fields - `fuse`: int (optional). Ticks until it explodes. - `explosion_power`: number 0..128 (optional) - `explosion_speed_factor`: number 0..128 (optional). Controls the amount of added damage depending on the speed of the minecart. - Also has the fields of `Minecart` - For example `{}` - `TraderLlama`: a record with fields - `DespawnDelay`: int (optional). When it will despawn. - Also has the fields of `Llama` - For example `{}` - `Transformation`: { translation: list of number (exactly 3), left_rotation: Rotation, right_rotation: Rotation, scale: list of number (exactly 3) } | list of number (exactly 16) - For example `{ translation = [0, 0, 0], left_rotation = [0, 0, 0, 0], right_rotation = [0, 0, 0, 0], scale = [0, 0, 0], … }`, `[0]` - `Trident`: a record with fields - `DealtDamage`: bool (optional). Whether it has already damaged an entity. - Also has the fields of `ArrowBase` - For example `{}` - `TropicalFish`: a record with fields - `Variant`: int (optional) - Also has the fields of `Fish` - For example `{}` - `TrustedUUID`: a record with fields - `L`: int (optional). Lower bits of the trusted player's UUID. - `M`: int (optional). Upper bits of the trusted player's UUID. - For example `{}` - `Turtle`: a record with fields - `has_egg`: bool (optional). Whether it has an egg. - Also has the fields of `Breedable` - For example `{}` - `UUIDLeash`: a record with fields - `UUIDMost`: int (optional). Upper bits of the other entity's UUID. - `UUIDLeast`: int (optional). Lower bits of the other entity's UUID. - For example `{}` - `Uuid`: a record with fields - `L`: int (optional). Lower bits of the target player's UUID - `M`: int (optional). Upper bits of the target player's UUID - For example `{}` - `Vex`: a record with fields - `bound_pos`: list of int (exactly 3) (optional). Coordinates of the center of its wander bounds. - `life_ticks`: int (optional). Ticks until it starts to die. - `owner`: list of int (exactly 4) (optional). The owner of this vex. - Also has the fields of `MobBase` - For example `{}` - `Villager`: a record with fields - `VillagerData`: VillagerData (optional) - `VillagerDataFinalized`: bool (optional) - `FoodLevel`: int 0..12 (optional). Determines whether the villager will be available to reproduce. When the value is `12` the villager can reproduce. After reproducing, the value is reset to `0`. To increase this value villagers will pick up food that is in range. Foods: Potatoes, Carrots, & Beetroots increase the level by `1`. Bread increases the level by `4`. - `Gossips`: list of PlayerReputationPart (optional). Affects per-player reputation which affects trade offer pricing and iron golem behavior. Reputation is assembled through events the villager has witnessed (within 16 blocks) or heard about from other villagers through gossip. All reputation parts decay over time except `major_positive` which is only ever increased (when the villager is cured). Decay occurs every 24k ticks (20 minutes), tracked by `LastGossipDecay`. Once a reputation part decays to zero it is removed from the list. - `LastGossipDecay`: int (optional). Last game-tick every gossip significance `Value` could have decayed. Once this reaches 24k (20 minutes) less than the current game tick a decay occurs again. - `LastRestock`: int (optional). Last game-tick it removed `uses` & updated `demand` of every trade offer by going to its `job_site`. - `RestocksToday`: int 0..2 (optional). Times it has reset the `uses` & updated `demand` of every trade offer by going to its `job_site` in the past 12k ticks (10 minutes). Time is tracked by `LastRestock`. When two restocks have occurred, another restock (and reset of this value to `0`) will only occur after 10 minutes. - `Xp`: int 0.. (optional). XP it has, increases when trades are used by each trade offer's `xp` value. After `250` the XP will continue to increase, but will do nothing more. Trade tiers: - `0..9` - Tier 1: Novice - `10..69` - Tier 2: Apprentice - `70..149` - Tier 3: Journeyman - `150..249` - Tier 4: Expert - `250..` - Tier 5: Master - Also has the fields of `Breedable`, `VillagerBase` - For example `{}` - `VillagerBase`: a record with fields - `Inventory`: list of ItemStack (0 to 8) (optional). Slots from 0 to 7. - `Offers`: Offers (optional). Trade offers it has. - For example `{}` - `VillagerData`: a record with fields - `level`: int (optional). Used for trading and badge rendering. - `profession`: villager_profession id (optional) - `type`: villager_type id (optional) - For example `{}` - `Vindicator`: a record with fields - `Johnny`: bool (optional). Whether it should try to attack most other mobs. - Also has the fields of `RaiderBase` - For example `{}` - `WanderTarget`: a record with fields - `X`: int (optional) - `Y`: int (optional) - `Z`: int (optional) - For example `{}` - `WanderingTrader`: a record with fields - `DespawnDelay`: int (optional). Ticks until it despawns. - `wander_target`: list of int (exactly 3) (optional). Where it is heading to. - Also has the fields of `MobBase`, `VillagerBase` - For example `{}` - `Warden`: a record with fields - `anger`: AngerManagement (optional). Anger management - `listener`: VibrationListener (optional). Vibration listener - Also has the fields of `MobBase` - For example `{}` - `WardenSpawnTracker`: a record with fields - `cooldown_ticks`: int 0.. (optional). Ticks before the `warning_level` can be increased again. Decreases by 1 every tick. It is set to 200 game ticks (10 seconds) every time the warning level is increased. - `ticks_since_last_warning`: int 0.. (optional). Ticks since the player was warned for warden spawning. Increases by 1 every tick. After 12000 game ticks (10 minutes) it will be set back to 0, and the `warning_level` will be decreased by 1. - `warning_level`: int 0..4 (optional). The current warning level. The warden will spawn at level `4`. - For example `{}` - `WaypointIcon`: a record with fields - `style`: waypoint_style id - `color`: RGB (optional) - For example `{ style = … }` - `WeatherState`: one of `"unaffected"`, `"exposed"`, `"weathered"`, `"oxidized"` - For example `unaffected` - `Wither`: a record with fields - `Invul`: int (optional). Ticks it is invulnerable for. - Also has the fields of `MobBase` - For example `{}` - `WitherSkull`: a record with fields - `dangerous`: bool (optional) - Also has the fields of `DespawnableProjectileBase` - For example `{}` - `Wolf`: a record with fields - `CollarColor`: DyeColorByte (optional). Collar color, present for wild wolfs. Defaults to 14 (red). - `variant`: wolf_variant id (optional) - `sound_variant`: wolf_sound_variant id (optional) - Also has the fields of `Tamable`, `NeutralMob` - For example `{}` - `Zoglin`: a record with fields - `IsBaby`: bool (optional). Whether it is a baby. - Also has the fields of `MobBase` - For example `{}` - `Zombie`: object - Also has the fields of `ZombieBase`, `DrowningTracker` - For example `{}` - `ZombieBase`: a record with fields - `IsBaby`: bool (optional). Whether it is a baby. - `CanBreakDoors`: bool (optional). Whether it can break doors. - Also has the fields of `MobBase`, `DrowningTracker` - For example `{}` - `ZombiePigman`: a record with fields - `IsBaby`: bool (optional). Whether it is a baby. - Also has the fields of `MobBase`, `NeutralMob` - For example `{}` - `ZombieVillager`: a record with fields - `VillagerData`: VillagerData (optional). Villager's skin data - `VillagerDataFinalized`: bool (optional) - `Gossips`: list of PlayerReputationPart (optional). Villager's gossips - `Offers`: Offers (optional). Villager's offers - `ConversionTime`: int (optional). Ticks until the it is converted. - `ConversionPlayer`: list of int (exactly 4) (optional). Player who triggered the conversion. - Also has the fields of `ZombieBase`, `DrowningTracker` - For example `{}` # Block entity data types Named types from this part of the game's schema: enums, aliases and records, with values that fit. - `Banner`: a record with fields - `patterns`: list of BannerPatternLayer (optional) - Also has the fields of `BlockEntity`, `Nameable` - For example `{}` - `BannerPatternLayer`: { color: DyeColor, pattern: banner_pattern id | BannerPattern } - For example `{ color = white, pattern = base }` - `BannerPatternType`: one of - `"bs"`: Bottom Stripe (Base) - `"ts"`: Top Stripe (Chief) - `"ls"`: Left Stripe (Pale dexter) - `"rs"`: Right Stripe (Pale sinister) - `"cs"`: Center Stripe (Vertical) (Pale) - `"ms"`: Middle Stripe (Horizontal) (Fess) - `"drs"`: Down Right Stripe (Bend) - `"dls"`: Down Left Stripe (Bend sinister) - `"ss"`: Small (Vertical) Stripes (Paly) - `"cr"`: Diagonal Cross (Saltire) - `"sc"`: Square Cross (Cross) - `"ld"`: Left of Diagonal (Per bend sinister) - `"rud"`: Right of upside-down Diagonal (Per bend) - `"lud"`: Left of upside-down Diagonal (Per bend inverted) - `"rd"`: Right of Diagonal (Per bend sinister inverted) - `"vh"`: Vertical Half (left) (Per pale) - `"vhr"`: Vertical Half (right) (Per pale inverted) - `"hh"`: Horizontal Half (top) (Per fess) - `"hhb"`: Horizontal Half (bottom) (Per fess inverted) - `"bl"`: Bottom Left Corner (Base dexter canton) - `"br"`: Bottom Right Corner (Base sinister canton) - `"tl"`: Top Left Corner (Chief dexter canton) - `"tr"`: Top Right Corner (Chief sinister canton) - `"bt"`: Bottom Triangle (Chevron) - `"tt"`: Top Triangle (Inverted chevron) - `"bts"`: Bottom Triangle Sawtooth (Base indented) - `"tts"`: Top Triangle Sawtooth (Chief indented) - `"mc"`: Middle Circle (Roundel) - `"mr"`: Middle Rhombus (Lozenge) - `"bo"`: Border (Bordure) - `"cbo"`: Curly Border (Bordure indented) - `"bri"`: Brick (Field masoned) - `"gra"`: Gradient (Gradient) - `"gru"`: Gradient upside-down (Base gradient) - `"cre"`: Creeper (Creeper charge) - `"sku"`: Skull (Skull charge) - `"flo"`: Flower (Flower charge) - `"moj"`: Mojang (Thing) - `"glb"`: Globe (Globe) - `"pig"`: Piglin (Piglin) - For example `bs` - `BaseCommandBlock`: a record with fields - `Command`: string (optional). The command to run. - `SuccessCount`: int (optional). Success count of the last command. - `LastOutput`: Text (optional). Output of the last command. - `TrackOutput`: bool (optional). Whether to record command output. - `UpdateLastExecution`: bool (optional). Whether to record the tick of the latest command execution. - `LastExecution`: int (optional). Tick of the latest command execution. - For example `{}` - `Beacon`: a record with fields - `Levels`: int (optional). Number of levels from the pyramid. - `primary_effect`: mob_effect id (optional) - `secondary_effect`: mob_effect id (optional) - Also has the fields of `BlockEntity`, `Nameable`, `Lockable` - For example `{}` - `Bee`: a record with fields - `min_ticks_in_hive`: int - `ticks_in_hive`: int - `entity_data`: AnyEntity - For example `{ min_ticks_in_hive = 0, ticks_in_hive = 0, entity_data = AcaciaBoat(…) }` - `Beehive`: a record with fields - `flower_pos`: list of int (exactly 3) (optional) - `bees`: list of Bee (optional) - Also has the fields of `BlockEntity` - For example `{}` - `BlockEntity`: a record with fields - `id`: block_entity_type id (optional) - `x`: int (optional) - `y`: int (optional) - `z`: int (optional) - `keepPacked`: bool (optional). Unknown 0 for regular block entities - `components`: DataComponentPatch (optional) - For example `{}` - `BlockEntityData`: block_entity object - For example `Banner()` - `BrewingStand`: a record with fields - `Items`: list of SlottedItem of int 0..4 (0 to 5) (optional). * 0: left brewing slot * 1: middle brewing slot * 2: right brewing slot * 3: ingredient slot * 4: fuel slot - `BrewTime`: int (optional). Number of ticks until the brewing is complete. - `Fuel`: int (optional). Amount of fuel the brewing stand has left. - `total_brew_time`: int (optional). The total amount of time the current brewing process will take. Defaults to `400`. - `total_fuel`: int (optional). The amount of fuel that was added in the last refuel. Defaults to `20`. - `speed_multiplier`: number (optional). Used to speed up or slow down the next brewing process. Defaults to `1`. - Also has the fields of `BlockEntity`, `Nameable`, `Lockable` - For example `{}` - `BrushableBlock`: a record with fields - `LootTable`: loot_table id (optional). Loot table that will decide the brushed loot. - `LootTableSeed`: int (optional). Seed of the loot table. - `item`: ItemStack (optional). Item that was rolled from the loot table, which is currently peeking out. - `hit_direction`: DirectionByte (optional). Direction of the block that was interacted with. Write-only, is not saved by the game. - Also has the fields of `BlockEntity` - For example `{}` - `Campfire`: a record with fields - `Items`: list of SlottedItem of int 0..3 (0 to 4) (optional) - `CookingTimes`: list of int (exactly 4) (optional). Ticks each item has been cooking. Index is according to item slot. - `CookingTotalTimes`: list of int (exactly 4) (optional). Ticks each item still has to cook. Index is according to item slot. - Also has the fields of `BlockEntity` - For example `{}` - `ChargeCursor`: a record with fields - `pos`: list of int (exactly 3) - `charge`: int 0..1000 (optional) - `decay_delay`: int 0..1 (optional) - `update_delay`: int 0.. (optional) - `facings`: list of Direction (optional) - For example `{ pos = [0, 0, 0] }` - `ChiseledBookshelf`: a record with fields - `Items`: list of SlottedItem of int 0..5 (0 to 6) (optional). Slots from 0 to 5. - `last_interacted_slot`: int 0..5 (optional) - Also has the fields of `BlockEntity` - For example `{}` - `CommandBlock`: a record with fields - `powered`: bool (optional). Whether it is powered by redstone. - `auto`: bool (optional). Whether it is automatically powered. - `conditionMet`: bool (optional). Whether the previous command block was successful when the command block was executed. This is always true for non-conditional command blocks. - Also has the fields of `BlockEntity`, `Nameable`, `BaseCommandBlock` - For example `{}` - `Comparator`: a record with fields - `OutputSignal`: int (optional). Strength of the redstone output. - Also has the fields of `BlockEntity` - For example `{}` - `Conduit`: a record with fields - `Target`: list of int (exactly 4) (optional). The hostile mob that the conduit is currently attacking. - Also has the fields of `BlockEntity` - For example `{}` - `Config`: a record with fields - `key_item`: ItemStack (optional). Item required to open the vault. - `loot_table`: loot_table id (optional). Defaults to "minecraft:chests/trial_chambers/reward". - `override_loot_table_to_display`: loot_table id (optional). The loot table to display items in the vault. Defaults to use the value in `loot_table` field. - `activation_range`: number (optional). The range when the vault should activate. - `deactivation_range`: number (optional). The range when the vault should deactivate. - For example `{}` - `Container27`: a record with fields - `Items`: list of SlottedItem of int 0..26 (0 to 27) (optional). Slots from 0 to 26. - Also has the fields of `ContainerBase` - For example `{}` - `Container9`: a record with fields - `Items`: list of SlottedItem of int 0..8 (0 to 9) (optional). Slots from 0 to 8. - Also has the fields of `ContainerBase` - For example `{}` - `ContainerBase`: a record with fields - `LootTable`: loot_table id (optional). Loot table that will populate this container. - `LootTableSeed`: int (optional). Seed of the loot table. - Also has the fields of `BlockEntity`, `Nameable`, `Lockable` - For example `{}` - `Crafter`: a record with fields - `crafting_ticks_remaining`: int (optional) - `disabled_slots`: list of int (at most 9) (optional) - `triggered`: 0 | 1 (optional) - Also has the fields of `Container9` - For example `{}` - `CreakingHeart`: a record with fields - `creaking`: list of int (exactly 4) (optional). The creaking mob that is linked to this heart. - Also has the fields of `BlockEntity` - For example `{}` - `CustomSpawnRules`: a record with fields - `block_light_limit`: InclusiveRange of int 0..15 (optional). Range of block light level required for the entity to spawn. - `sky_light_limit`: InclusiveRange of int 0..15 (optional). Range of sky light level required for the entity to spawn. - For example `{}` - `DecoratedPot`: a record with fields - `sherds`: PotDecorations (optional). Item ID of what was used for each side of the pot. Decoration textures are determined by `provides_pottery_pattern` component on the sherd items. - `LootTable`: loot_table id (optional). Loot table that will populate this container. - `LootTableSeed`: int (optional). Seed of the loot table. - `item`: ItemStack (optional) - Also has the fields of `BlockEntity` - For example `{}` - `EnchantingTable`: object - Also has the fields of `BlockEntity`, `Nameable` - For example `{}` - `EndGateway`: a record with fields - `Age`: int (optional). In game ticks. - `ExactTeleport`: bool (optional). Whether to teleport to the exact location. - `exit_portal`: list of int (exactly 3) (optional). Coordinates of where to teleport entities to. - Also has the fields of `BlockEntity` - For example `{}` - `ErrorMarker`: a record with fields - `pos`: list of int (exactly 3) - `text`: Text - For example `{ pos = [0, 0, 0], text = "text" }` - `ExitPortal`: a record with fields - `X`: int (optional) - `Y`: int (optional) - `Z`: int (optional) - For example `{}` - `FlowerPos`: a record with fields - `X`: int (optional) - `Y`: int (optional) - `Z`: int (optional) - For example `{}` - `Furnace`: a record with fields - `Items`: list of SlottedItem of int 0..2 (0 to 3) (optional). The items in this furnace, with slots: * 0: Item being smelted * 1: Fuel * 2: Output - `cooking_total_time`: int (optional). The total amount of time the current cooking process will take. Defaults to `0`. - `cooking_time_spent`: int (optional). The amount of time that the current cooking process has taken so far. Defaults to `0`. - `lit_time_remaining`: int (optional). The amount of burn time remaining. Defaults to `0`. - `lit_total_time`: int (optional). The total amount of burn time that was added in the last refuel. Defaults to `0`. - `speed_multiplier`: number (optional). Used to speed up or slow down the next cooking process. Defaults to `1`. - `RecipesUsed`: map of recipe id to int (optional). Recipes that have been used since the last time a result item was removed from the GUI. Used to calculate the experience to give to the player. - Also has the fields of `BlockEntity`, `Nameable`, `Lockable` - For example `{}` - `Hopper`: a record with fields - `Items`: list of SlottedItem of int 0..4 (0 to 5) (optional). Slots from 0 to 4. - `TransferCooldown`: int (optional). Ticks until an item can be transferred. - Also has the fields of `ContainerBase` - For example `{}` - `Jigsaw`: a record with fields - `joint`: JointType (optional). How the resultant structure can be transformed. - `pool`: template_pool id (optional). Structure pool this will "spawn" in. - `name`: string (optional). ID this will "spawn" in. - `target`: string (optional). ID of the type of jigsaw this will be "spawned" from. - `final_state`: string (optional). Final block state of the jigsaw. - For example `{}` - `JointType`: one of - `"rollable"`: The structure can be rotated - `"aligned"`: The structure cannot be transformed - For example `rollable` - `Jukebox`: a record with fields - `RecordItem`: ItemStack (optional) - `ticks_since_song_started`: int (optional) - Also has the fields of `BlockEntity` - For example `{}` - `Lectern`: a record with fields - `Book`: ItemStack (optional) - `Page`: int (optional). Current page the book is on. - Also has the fields of `BlockEntity` - For example `{}` - `LegacyBee`: a record with fields - `MinOccupationTicks`: int (optional) - `TicksInHive`: int (optional) - `EntityData`: AnyEntity (optional) - For example `{}` - `Lockable`: a record with fields - `lock`: ItemPredicate (optional). Item predicate testing the item that a player has to be holding to open this container. - For example `{}` - `Mirror`: one of `"NONE"`, `"LEFT_RIGHT"`, `"FRONT_BACK"` - For example `NONE` - `Mode`: one of `"SAVE"`, `"LOAD"`, `"DATA"`, `"CORNER"` - For example `SAVE` - `MovingPiston`: a record with fields - `blockState`: BlockState (optional). Moving block represented by the moving piston. - `facing`: DirectionByte (optional). The direction it is moving. - `progress`: number (optional). How far it has moved. - `extending`: bool (optional) - `source`: bool (optional). Whether the moving piston is the piston head. - Also has the fields of `BlockEntity` - For example `{}` - `Nameable`: a record with fields - `CustomName`: Text (optional). The custom name of this block. - For example `{}` - `NoneId`: -1 - For example `-1` - `OldSign`: a record with fields - `Color`: DyeColor (optional). Color the text has been dyed. - `GlowingText`: bool (optional) - `Text1`: string (optional). First line of text. - `Text2`: string (optional). Second line of text. - `Text3`: string (optional). Third line of text. - `Text4`: string (optional). Fourth line of text. - Also has the fields of `BlockEntity` - For example `{}` - `PotentSulfur`: a record with fields - `countdown`: int (optional). Time in seconds until the next state switch (between dormant and erupting). The timer only counts down when the potent sulfur creates a valid geyser. Negative values will be replaced with a new duration of the current state. - Also has the fields of `BlockEntity` - For example `{}` - `Properties`: a record with fields - `textures`: list of Texture (optional) - For example `{}` - `RecipesUsed`: a record with fields - `[recipe id]`: int (optional). How many times this recipe has been used. - For example `{}` - `SculkCatalyst`: a record with fields - `cursors`: list of ChargeCursor (optional) - Also has the fields of `BlockEntity` - For example `{}` - `SculkSensor`: a record with fields - `last_vibration_frequency`: int 1..15 (optional) - `listener`: VibrationListener (optional). Vibration listener - For example `{}` - `SculkShrieker`: a record with fields - `warning_level`: int (optional) - `listener`: VibrationListener (optional) - For example `{}` - `ServerData`: a record with fields - `state_updating_resumes_at`: int (optional). Ticks until the loot table is ran again to update the display item. - `rewarded_players`: list of list of int (exactly 4) (optional). When a player is in this list they can no longer open the vault, but other players can. - `items_to_eject`: list of ItemStack (optional). Items that are being ejected from the vault when it is opened. As each item is ejected, it is removed from this list, before ejection, it is previewed as the `display_item`. - `total_ejections_needed`: int (optional). Number of items that the loot table started off the opening with, does not change while items are ejected. - For example `{}` - `SharedData`: a record with fields - `display_item`: ItemStack (optional). Item that is displayed to players when they are in range of the vault. - `connected_players`: list of list of int (exactly 4) (optional) - `connected_particles_range`: number (optional) - For example `{}` - `Shelf`: a record with fields - `Items`: list of SlottedItem of int 0..2 (0 to 3) (optional). Slots from 0 to 2. - `align_items_to_bottom`: bool (optional). Defaults to `false`. - Also has the fields of `ContainerBase` - For example `{}` - `Sign`: a record with fields - `back_text`: SignText (optional) - `front_text`: SignText (optional) - `is_waxed`: bool (optional). Whether the sign has been made uneditable by applying wax. - `allow_op_features`: bool (optional). Whether the sign allows following features: 1. Resolving text components 2. Executing click events Defaults to `false`. - Also has the fields of `BlockEntity` - For example `{}` - `Skull`: a record with fields - `ExtraType`: string (optional). Name of the owner, if exists will be converted to SkullOwner. - `note_block_sound`: weighed_sound_event id (optional). Sound to play when played with a note block. Only works on player head. - `profile`: Profile (optional). Only works on player head. - `custom_name`: Text (optional) - Also has the fields of `BlockEntity` - For example `{}` - `SkullOwner`: a record with fields - `Id`: list of int (exactly 4) (optional). Optional. - `Name`: string (optional). Name of the owner, if missing appears as a steve head. - `Properties`: Properties (optional) - For example `{}` - `SpawnEquipment`: a record with fields - `loot_table`: loot_table id. Generates the equipment. - `slot_drop_chances`: number 0..1 | map of EquipmentSlot to number 0..1. Chance the mob will drop the equipment on death. - For example `{ loot_table = archaeology/desert_pyramid, slot_drop_chances = 0 }` - `SpawnPotential`: WeightedEntry of SpawnerEntry - For example `{ weight = 0, data = { … } }` - `Spawner`: a record with fields - `SpawnPotentials`: list of SpawnPotential (optional). Entities that can be placed. - `SpawnData`: SpawnerEntry (optional). Data for the next mob to spawn. Overwritten by `SpawnPotentials`. - `SpawnCount`: int (optional). Number of entities that will be placed. - `SpawnRange`: int (optional). Range that the spawned entities will be placed. - `Delay`: int (optional). Ticks until the next spawn. - `MinSpawnDelay`: int (optional). Minimum random delay for the next spawn. - `MaxSpawnDelay`: int (optional). Maximum random delay for the next spawn. - `MaxNearbyEntities`: int (optional). Maximum number of entities nearby. - `RequiredPlayerRange`: int (optional). Radius in blocks that a player has to be within to spawn entities. - Also has the fields of `BlockEntity` - For example `{}` - `SpawnerEntry`: a record with fields - `entity`: AnyEntity - `custom_spawn_rules`: CustomSpawnRules (optional) - `equipment`: SpawnEquipment (optional). Rolled items from the specified loot table will be equipped to the mob that spawns. - For example `{ entity = AcaciaBoat(…) }` - `TargetUuid`: a record with fields - `M`: int (optional). Upper bits of the target's UUID - `L`: int (optional). Lower bits of the target's UUID - For example `{}` - `TestBlock`: a record with fields - `mode`: TestBlockMode (optional) - `message`: string (optional) - `powered`: bool (optional) - Also has the fields of `BlockEntity` - For example `{}` - `TestBlockMode`: one of `"start"`, `"log"`, `"fail"`, `"accept"` - For example `start` - `TestInstanceBlock`: a record with fields - `data`: object (optional) - `errors`: list of { pos: list of int (exactly 3), text: Text } (optional) - Also has the fields of `BlockEntity` - For example `{}` - `TestInstanceBlockData`: a record with fields - `test`: test_instance id (optional) - `size`: list of int (exactly 3) - `rotation`: Rotation - `ignore_entities`: bool - `status`: TestInstanceBlockStatus - `error_message`: Text (optional) - For example `{ size = [0, 0, 0], rotation = none, ignore_entities = true, status = cleared, … }` - `TestInstanceBlockStatus`: one of `"cleared"`, `"running"`, `"finished"` - For example `cleared` - `Texture`: a record with fields - `Signature`: string (optional) - `Value`: string (optional). Base64 encoded JSON value of the texture index. - For example `{}` - `Vault`: a record with fields - `server_data`: { state_updating_resumes_at?: int, rewarded_players?: list of list of int (exactly 4), items_to_eject?: list of ItemStack, total_ejections_needed?: int } (optional) - `config`: object (optional) - `shared_data`: { display_item?: ItemStack, connected_players?: list of list of int (exactly 4), connected_particles_range?: number } (optional). When a player is in range of the vault, the same display item will be shown to all players. This is also used for the items that are being ejected from the vault. - For example `{}` # Dialogs types Named types from this part of the game's schema: enums, aliases and records, with values that fit. - `AfterAction`: one of - `"close"`: Closes the dialog. Returns to the previous non-dialog screen, if any. - `"none"`: Does nothing. Only available if `pause` is set to `false`. - `"wait_for_response"`: Replaces the dialog with a "Waiting for Response" screen. The waiting screen unpauses the game in single-player mode. - For example `close` - `BooleanInput`: a record with fields - `label`: Text. Label displayed to the right of control. - `initial`: bool (optional). Initial value of the control. Defaults to `false` (unchecked). - `on_true`: string (optional). String to send when the control is checked. Defaults to `"true"`. - `on_false`: string (optional). String to send when the control is unchecked. Defaults to `"false"`. - For example `{ label = "text" }` - `Button`: a record with fields - `label`: Text - `tooltip`: Text (optional) - `width`: int 1..1024 (optional). Width of the button. Defaults to 150. - `action`: ClickAction (optional). If not present, clicking button will simply close dialog without any action. - For example `{ label = "text" }` - `ButtonListDialogBase`: mcdoc:dialog_after_action object - For example `Close(…)` - `ClickAction`: dialog_action - For example `ChangePage(…)` - `ConfirmationDialog`: mcdoc:dialog_after_action object - For example `Close(…)` - `DialogBase`: mcdoc:dialog_after_action object - For example `Close(…)` - `DialogBody`: dialog_body - For example `Item(…)` - `DialogListRef`: Dialog | dialog id | #dialog tag | list of (dialog id | Dialog) - For example `Confirmation(…)`, `custom_options`, `[custom_options]` - `DynamicCustomAction`: a record with fields - `id`: id. ID of a custom action. Has no functionality on vanilla servers. - `additions`: any (depends on id) (optional). Static fields added in addition to the fields generated by input. - For example `{ id = "text" }` - `DynamicRunCommand`: a record with fields - `template`: string. A macro template to be interpred as a command. Special characters (including both `'` and `"`) from text input will be escaped to fit in SNBT literal. - For example `{ template = "text" }` - `InputControl`: input_control - For example `Boolean(…)` - `ItemBody`: a record with fields - `item`: ItemStackTemplate - `description`: PlainMessage | Text (optional). The description text rendered to the right of item. - `show_decorations`: bool (optional). Whether count and damage bar are rendered over the item. Defaults to `true`. - `show_tooltip`: bool (optional). Whether item tooltip shows up when the item is hovered. Defaults to `true`. - `width`: int 1..256 (optional). Width of the item. Defaults to 16. - `height`: int 1..256 (optional). Height of the item. Defaults to 16. - For example `{ item = { … } }` - `ListDialogBase`: mcdoc:dialog_after_action object - For example `Close(…)` - `MultiActionDialog`: mcdoc:dialog_after_action object - For example `Close(…)` - `MultiLine`: a record with fields - `max_lines`: int 1.. (optional) - `height`: int 1..512 (optional). Height of the input. If this field is not present: - If `max_lines` is present, the height will be chosen to fit the maximum number of lines. The chosen height is capped at 512. - If `max_lines` is also not present, the height will be chosen to fit 4 lines. - For example `{}` - `NoticeDialog`: mcdoc:dialog_after_action object - For example `Close(…)` - `NumberRangeInput`: a record with fields - `width`: int 1..1024 (optional). Defaults to 200. - `label`: Text. Label displayed on the slider. - `label_format`: string (optional). The translation to be used for building label. `%1$s` is replaced by `label`; `%2$s` is replaced by current value of the slider. Defaults to `options.generic_value`. - `start`: number. Start value, inclusive. - `end`: number. End value, inclusive. - `step`: number 0..< (optional). Step size of the input. If not present, any value from range is allowed. - `initial`: number (optional). Initial value of the slider. Rounded down nearest step. Defaults to the middle of the range. - For example `{ label = "text", start = 0, end = 0 }` - `Option`: a record with fields - `id`: string. String to send on submit. - `display`: Text (optional). Label displayed on the button. When not present, `id` will be used instead. - `initial`: bool (optional). Whether this option is the initial value. Only one option can have this field set to `true`. - For example `{ id = "text" }` - `PlainMessage`: a record with fields - `contents`: Text. A multiline label. Click events in the text trigger `after_action` like any other action. - `width`: int 1..1024 (optional). Maximum width of message. Defaults to 200. - For example `{ contents = "text" }` - `RedirectDialog`: mcdoc:dialog_after_action object - For example `Close(…)` - `ServerLinksDialog`: mcdoc:dialog_after_action object - For example `Close(…)` - `SingleOptionInput`: a record with fields - `width`: int 1..1024 (optional). Defaults to 200. - `label`: Text. Label displayed on the button. - `label_visible`: bool (optional). Defaults to `true`. - `options`: list of (Option | string) (at least 1) - For example `{ label = "text", options = [{ … }] }` - `TextInput`: a record with fields - `width`: int 1..1024 (optional). Defaults to 200. - `label`: Text. Label displayed to the left of control. - `label_visible`: bool (optional). Defaults to `true`. - `initial`: string (optional). Initial contents of the text input. Defaults to `""` (empty string). - `max_length`: int 1.. (optional). Maximum length of input Defaults to 32. - `multiline`: { max_lines?: int 1.., height?: int 1..512 } (optional). If present, allows users to input multiple lines. - For example `{ label = "text" }` # Mob variants types Named types from this part of the game's schema: enums, aliases and records, with values that fit. - `BiomeCheck`: a record with fields - `biomes`: biome id | #biome tag | list of biome ids. Checks if the entity is spawning in specific biomes. - For example `{ biomes = badlands }` - `CatSounds`: a record with fields - `ambient_sound`: SoundEventRef - `stray_ambient_sound`: SoundEventRef - `hiss_sound`: SoundEventRef - `hurt_sound`: SoundEventRef - `death_sound`: SoundEventRef - `eat_sound`: SoundEventRef - `beg_for_food_sound`: SoundEventRef - `purr_sound`: SoundEventRef - `purreow_sound`: SoundEventRef - For example `{ ambient_sound = ambient.basalt_deltas.additions, stray_ambient_sound = ambient.basalt_deltas.additions, hiss_sound = ambient.basalt_deltas.additions, hurt_sound = ambient.basalt_deltas.additions, … }` - `ChickenModelType`: one of `"normal"`, `"cold"` - For example `normal` - `ChickenSounds`: a record with fields - `ambient_sound`: SoundEventRef - `hurt_sound`: SoundEventRef - `death_sound`: SoundEventRef - `step_sound`: SoundEventRef - For example `{ ambient_sound = ambient.basalt_deltas.additions, hurt_sound = ambient.basalt_deltas.additions, death_sound = ambient.basalt_deltas.additions, step_sound = ambient.basalt_deltas.additions, … }` - `CowModelType`: one of `"normal"`, `"cold"`, `"warm"` - For example `normal` - `CowSounds`: a record with fields - `ambient_sound`: SoundEventRef - `hurt_sound`: SoundEventRef - `death_sound`: SoundEventRef - `step_sound`: SoundEventRef - For example `{ ambient_sound = ambient.basalt_deltas.additions, hurt_sound = ambient.basalt_deltas.additions, death_sound = ambient.basalt_deltas.additions, step_sound = ambient.basalt_deltas.additions, … }` - `MoonBrightnessCheck`: a record with fields - `range`: MinMaxBounds of number. Checks if the current moon brightness is within a certain range. - For example `{ range = 0 }` - `OptionalCatSounds`: a record with fields - `ambient_sound`: SoundEventRef (optional) - `stray_ambient_sound`: SoundEventRef (optional) - `hiss_sound`: SoundEventRef (optional) - `hurt_sound`: SoundEventRef (optional) - `death_sound`: SoundEventRef (optional) - `eat_sound`: SoundEventRef (optional) - `beg_for_food_sound`: SoundEventRef (optional) - `purr_sound`: SoundEventRef (optional) - `purreow_sound`: SoundEventRef (optional) - For example `{}` - `OptionalChickenSounds`: a record with fields - `ambient_sound`: SoundEventRef (optional) - `hurt_sound`: SoundEventRef (optional) - `death_sound`: SoundEventRef (optional) - `step_sound`: SoundEventRef (optional) - For example `{}` - `OptionalCowSounds`: a record with fields - `ambient_sound`: SoundEventRef (optional) - `hurt_sound`: SoundEventRef (optional) - `death_sound`: SoundEventRef (optional) - `step_sound`: SoundEventRef (optional) - For example `{}` - `OptionalPigSounds`: a record with fields - `ambient_sound`: SoundEventRef (optional) - `hurt_sound`: SoundEventRef (optional) - `death_sound`: SoundEventRef (optional) - `step_sound`: SoundEventRef (optional) - `eat_sound`: SoundEventRef (optional) - For example `{}` - `OptionalWolfSounds`: a record with fields - `ambient_sound`: SoundEventRef (optional) - `death_sound`: SoundEventRef (optional) - `growl_sound`: SoundEventRef (optional) - `hurt_sound`: SoundEventRef (optional) - `pant_sound`: SoundEventRef (optional) - `whine_sound`: SoundEventRef (optional) - For example `{}` - `PigModelType`: one of `"normal"`, `"cold"` - For example `normal` - `PigSounds`: a record with fields - `ambient_sound`: SoundEventRef - `hurt_sound`: SoundEventRef - `death_sound`: SoundEventRef - `step_sound`: SoundEventRef - `eat_sound`: SoundEventRef - For example `{ ambient_sound = ambient.basalt_deltas.additions, hurt_sound = ambient.basalt_deltas.additions, death_sound = ambient.basalt_deltas.additions, step_sound = ambient.basalt_deltas.additions, … }` - `SoundVariant`: a record with fields - `adult_sounds`: T - `baby_sounds`: T - For example `{ adult_sounds = …, baby_sounds = … }` - `SpawnCondition`: spawn_condition - For example `Biome(…)` - `SpawnPrioritySelector`: a record with fields - `condition`: SpawnCondition (optional). The spawn condition to check. If not present, the condition always matches. - `priority`: int. The spawn priority to use. - For example `{ priority = 0 }` - `SpawnPrioritySelectors`: a record with fields - `spawn_conditions`: list of SpawnPrioritySelector. The spawn conditions for this variant. Selection process: - Conditions for all variants for the given entity type are evaluated for the spawn position - Entries with a priority lower than the maximum priority of the remaining entries are removed - A random entry is picked out of the remaining ones - If no conditions are remaining, the variant remains unchanged from the default - For example `{ spawn_conditions = [{ … }] }` - `StructureCheck`: a record with fields - `structures`: structure id | #structure tag | list of structure ids. Checks if the entity is spawning in specific structures. - For example `{ structures = abandoned_camp_bamboo_jungle }` - `WolfSounds`: a record with fields - `ambient_sound`: SoundEventRef - `death_sound`: SoundEventRef - `growl_sound`: SoundEventRef - `hurt_sound`: SoundEventRef - `pant_sound`: SoundEventRef - `whine_sound`: SoundEventRef - For example `{ ambient_sound = ambient.basalt_deltas.additions, death_sound = ambient.basalt_deltas.additions, growl_sound = ambient.basalt_deltas.additions, hurt_sound = ambient.basalt_deltas.additions, … }` - `WolfVariantAssetInfo`: a record with fields - `wild`: texture id - `tame`: texture id - `angry`: texture id - For example `{ wild = block/acacia_door_bottom, tame = block/acacia_door_bottom, angry = block/acacia_door_bottom }` - `ZombieNautilusModelType`: one of `"normal"`, `"warm"` - For example `normal` # Resource pack types Named types from this part of the game's schema: enums, aliases and records, with values that fit. - `ActuallyTranslucentRGB`: int | list of number 0..1 (exactly 3) - For example `0`, `[0, 0, 0]` - `BannerAttachment`: one of `"wall"`, `"ground"` - For example `wall` - `BitmapProvider`: a record with fields - `file`: string - `height`: int (optional) - `ascent`: int - `chars`: list of string (at least 1) (at least 1) - For example `{ file = "text", ascent = 0, chars = ["text"] }` - `BlockStateDefinition`: Variants(…) | Multipart(…) - For example `{ variants = {} }`, `{ multipart = [{ … }] }` - `Book`: a record with fields - `open_angle`: number. Angle in degrees between book cover and book centerline. `0.0` for closed, `90.0` for open flat. - `page1`: number. The position of the first page inside the book. `0.0` for leftmost, `1.0` for rightmost. - `page2`: number. The position of the second page inside the book. `0.0` for leftmost, `1.0` for rightmost. - For example `{ open_angle = 0, page1 = 0, page2 = 0 }` - `ChargeType`: a record with fields - `cases`: list of SelectCase of CrossbowChargeType - For example `{ cases = [{ … }] }` - `Chest`: a record with fields - `texture`: texture id - `openness`: number 0..1 (optional). Defaults to `0`. - `chest_type`: ChestType (optional). Defaults to `single`. - For example `{ texture = block/acacia_door_bottom }` - `ChestType`: one of `"single"`, `"left"`, `"right"` - For example `single` - `CompassTarget`: one of - `"none"`: Always an invalid target. - `"spawn"`: Points at world spawn. - `"lodestone"`: Points at the location stored in the `lodestone_tracker` component. - `"recovery"`: Points at the last player death location. - For example `none` - `ComponentFlags`: a record with fields - `predicate`: data_component_predicate_type id. The component predicate to check. - `value`: any (depends on predicate). The predicate-specific value. - For example `{ predicate = attribute_modifiers, value = … }` - `ComponentStrings`: a record with fields - `component`: data_component_type id. The component type to check the values of. If the selected value comes from a registry that the client doesn't have access to, the entry will be silently ignored. - `cases`: list of SelectCase of any (depends on component) - For example `{ component = additional_trade_cost, cases = [{ … }] }` - `Composite`: a record with fields - `models`: list of ItemModel - `transformation`: Transformation (optional) - For example `{ models = [Composite(…)] }` - `Condition`: conditional_item_property object - For example `Broken(…)` - `ConditionalPropertyType`: one of `"broken"`, `"bundle/has_selected_item"`, `"carried"`, `"component"`, `"custom_model_data"`, `"damaged"`, `"extended_view"`, `"fishing_rod/cast"`, `"has_component"`, `"keybind_down"`, `"selected"`, `"using_item"`, `"view_entity"` - For example `broken` - `ConstantTint`: a record with fields - `value`: RGB. Constant tint color to apply. - For example `{ value = 0 }` - `ContextDimension`: a record with fields - `cases`: list of SelectCase of dimension id - For example `{ cases = [{ … }] }` - `ContextEntityType`: a record with fields - `cases`: list of SelectCase of entity_type id - For example `{ cases = [{ … }] }` - `CopperGolemStatue`: a record with fields - `pose`: CopperGolemStatuePose - `texture`: string - For example `{ pose = standing, texture = "text" }` - `CopperGolemStatuePose`: one of `"standing"`, `"sitting"`, `"running"`, `"star"` - For example `standing` - `Count`: a record with fields - `normalize`: bool (optional). If false, returns count clamped to `0..max_stack_size`. If true, returns count divided by the `max_stack_size` component, clamped to `0..1`. Defaults to true. - For example `{}` - `CrossbowChargeType`: one of `"none"`, `"arrow"`, `"rocket"` - For example `none` - `CustomModelDataTint`: a record with fields - `index`: int 0.. (optional). The index of the `colors` list in the `custom_model_data` component. Defaults to 0. - `default`: RGB. Tint to apply when the `custom_model_data` component is not present, or when it doesn't have a color in the specified index. - For example `{ default = 0 }` - `CustomizableItemDisplayContext`: one of `"firstperson_righthand"`, `"firstperson_lefthand"`, `"thirdperson_righthand"`, `"thirdperson_lefthand"`, `"gui"`, `"head"`, `"ground"`, `"fixed"`, `"on_shelf"` - For example `firstperson_righthand` - `Damage`: a record with fields - `normalize`: bool (optional). If false, returns value of damage, clamped to `0..max_damage`. If true, returns value of damage divided by the `max_damage` component, clamped to `0..1`. Defaults to true. - For example `{}` - `Directory`: a record with fields - `source`: string. Directory of texture locations to include, relative to the `textures` folder, not including the trailing `/`. - `prefix`: string. The sprite name prefix, usually ending with `/`. - For example `{ source = "text", prefix = "text" }` - `DisplayContext`: a record with fields - `cases`: list of SelectCase of ItemDisplayContext - For example `{ cases = [{ … }] }` - `DyeTint`: a record with fields - `default`: ActuallyTranslucentRGB. Tint to apply when the `dyed_color` component is not present. - For example `{ default = 0 }` - `Dyeable`: a record with fields - `color_when_undyed`: RGB (optional). If the item is not dyed, this color is used instead. If not specified and the item is not dyed, this layer will be hidden. - For example `{}` - `EndCube`: a record with fields - `effect`: EndCubeEffectType - For example `{ effect = portal }` - `EndCubeEffectType`: one of `"portal"`, `"gateway"` - For example `portal` - `Filter`: a record with fields - `pattern`: FilterPattern. Pattern to remove sprite identifiers already in the atlas. The order of sprite sources is important. - For example `{ pattern = {} }` - `FilterPattern`: a record with fields - `namespace`: string (optional) - `path`: string (optional) - For example `{}` - `FireworkTint`: a record with fields - `default`: ActuallyTranslucentRGB. Tint to apply when the `firework_explosion` component is not present. - For example `{ default = 0 }` - `FontOption`: one of `"uniform"`, `"jp"` - For example `uniform` - `GlyphProvider`: glyph_provider - For example `Bitmap(…)` - `GlyphProviderType`: one of `"bitmap"`, `"ttf"`, `"space"`, `"unihex"`, `"reference"` - For example `bitmap` - `GrassTint`: a record with fields - `temperature`: number 0..1 - `downfall`: number 0..1 - For example `{ temperature = 0, downfall = 0 }` - `HasComponent`: a record with fields - `component`: data_component_type id - `ignore_default`: bool (optional). Whether the default components should be handled as "no component". Defaults to false. - For example `{ component = additional_trade_cost }` - `Head`: a record with fields - `kind`: HeadType - `texture`: texture id (optional). Texture to use instead of the texture from `kind`. - `animation`: number (optional). Controls the animation time for piglin and dragon heads. Defaults to `0`. - For example `{ kind = creeper }` - `HeadType`: one of `"creeper"`, `"dragon"`, `"piglin"`, `"player"`, `"skeleton"`, `"wither_skeleton"`, `"zombie"` - For example `creeper` - `InternalTarget`: a record with fields - `width`: int (optional) - `height`: int (optional) - `persistent`: bool (optional). If `true`, target will be persistent across frames. Defaults to `false`. The contents of the target will be cleared when the screen is resized. - `clear_color`: RGBA (optional). Target will be filled with this color when created or cleared. Defaults to `0`. - For example `{}` - `ItemDefinition`: a record with fields - `model`: ItemModel - `hand_animation_on_swap`: bool (optional). Whether the down-and-up animation should be played in first-person view when the item stack is changed. Defaults to `true`. - `oversized_in_gui`: bool (optional). Whether the item model is allowed to be bigger than its item slot. Defaults to `false`, which clips the item model in GUI to the item slot size. The behavior of `true` is **not** officially supported. - `swap_animation_scale`: number (optional). How fast the item moves up and down when swapping items in hotbar. Defaults to 1.0 - For example `{ model = Composite(…) }` - `ItemDisplayContext`: one of `"none"`, `"firstperson_righthand"`, `"firstperson_lefthand"`, `"thirdperson_righthand"`, `"thirdperson_lefthand"`, `"gui"`, `"head"`, `"ground"`, `"fixed"`, `"on_shelf"` - For example `none` - `ItemModeltype`: one of `"bundle/selected_item"`, `"composite"`, `"condition"`, `"empty"`, `"model"`, `"range_dispatch"`, `"select"`, `"special"` - For example `bundle/selected_item` - `KeybindDown`: a record with fields - `keybind`: Keybind. The keybind ID to check for. - For example `{ keybind = key.advancements }` - `Layer`: a record with fields - `texture`: T. Texture location for this layer, inside `entity/equipment//`. - `dyeable`: Dyeable (optional). If specified, this layer will be tinted by the color contained in the `dyed_color` component. - For example `{ texture = … }` - `Layers`: a record with fields - `humanoid`: list of Layer of texture id (optional) - `humanoid_leggings`: list of Layer of texture id (optional) - `humanoid_baby`: list of Layer of texture id (optional) - `wings`: list of WingsLayer of texture id (optional) - `wolf_body`: list of Layer of texture id (optional) - `horse_body`: list of Layer of texture id (optional) - `llama_body`: list of Layer of texture id (optional) - `happy_ghast_body`: list of Layer of texture id (optional) - `nautilus_saddle`: list of Layer of texture id (optional) - `nautilus_body`: list of Layer of texture id (optional) - `pig_saddle`: list of Layer of texture id (optional) - `strider_saddle`: list of Layer of texture id (optional) - `camel_husk_saddle`: list of Layer of texture id (optional) - `camel_saddle`: list of Layer of texture id (optional) - `horse_saddle`: list of Layer of texture id (optional) - `donkey_saddle`: list of Layer of texture id (optional) - `mule_saddle`: list of Layer of texture id (optional) - `zombie_horse_saddle`: list of Layer of texture id (optional) - `skeleton_horse_saddle`: list of Layer of texture id (optional) - For example `{}` - `LocalTime`: a record with fields - `pattern`: string. Format to use for time formatting. Examples: `yyyy-MM-dd`, `HH:mm:ss`. - `locale`: string (optional). Defaults to the root locale. Examples: `en_US`, `cs_AU@numbers=thai;calendar=japanese`. - `time_zone`: string (optional). Defaults to the timezone set on the client. Examples: `Europe/Stockholm`, `GMT+0:45`. - `cases`: list of SelectCase of string - For example `{ pattern = "text", cases = [{ … }] }` - `MainHand`: a record with fields - `cases`: list of SelectCase of HumanoidArm - For example `{ cases = [{ … }] }` - `MapColorTint`: a record with fields - `default`: RGB. Tint to apply when the `map_color` component is not present. - For example `{ default = 0 }` - `ModelElement`: a record with fields - `from`: list of number -16..32 (exactly 3) - `to`: list of number -16..32 (exactly 3) - `faces`: map of Direction to object - `rotation`: ModelElementRotation (optional) - `shade_direction_override`: Direction (optional) - `light_emission`: int 0..15 (optional) - For example `{ from = [0, 0, 0], to = [0, 0, 0], faces = {} }` - `ModelElementRotation`: { origin: list of number (exactly 3), rescale?: bool, axis: Axis, angle: number } | { origin: list of number (exactly 3), rescale?: bool, [Axis]?: number } - For example `{ origin = [0, 0, 0], axis = x, angle = 0 }`, `{ origin = [0, 0, 0] }` - `ModelElementRotationBase`: a record with fields - `origin`: list of number (exactly 3) - `rescale`: bool (optional). Defaults to `false`. - For example `{ origin = [0, 0, 0] }` - `ModelRef`: model id - For example `block/acacia_button` - `ModelTint`: tint_source - For example `Constant(…)` - `ModelVariant`: ModelVariantBase | list of object - For example `{ model = block/acacia_button }`, `[{ … }]` - `ModelVariantBase`: a record with fields - `model`: ModelRef - `x`: 0 | 90 | 180 | 270 (optional) - `y`: 0 | 90 | 180 | 270 (optional) - `z`: 0 | 90 | 180 | 270 (optional) - `uvlock`: bool (optional). If set to `true`, the textures are not rotated with the block. - For example `{ model = block/acacia_button }` - `MultiPartCondition`: OR(…) | AND(…) | map of string to string - For example `{ OR = [{ … }] }`, `{ AND = [{ … }] }`, `{}` - `NumericPropertyType`: one of `"bundle/fullness"`, `"compass"`, `"cooldown"`, `"count"`, `"crossbow/pull"`, `"custom_model_data"`, `"damage"`, `"time"`, `"use_cycle"`, `"use_duration"` - For example `bundle/fullness` - `PaletteRef`: texture id - For example `block/acacia_door_bottom` - `PaletteTexture`: PaletteRef - For example `block/acacia_door_bottom` - `PalettedPermutations`: a record with fields - `textures`: list of texture ids - `palette_key`: PaletteTexture - `permutations`: map of string to PaletteTexture - `separator`: string (optional). Value to use when joining the texture and permutation names to produce the sprite name. Defaults to `_`. - For example `{ textures = [block/acacia_door_bottom], palette_key = block/acacia_door_bottom, permutations = {} }` - `Pass`: object - For example `{ vertex_shader = …, fragment_shader = …, output = … }` - `PotionTint`: a record with fields - `default`: RGB. Tint to apply when the `potion_contents` component is not present, or it has no effects and no `custom_color` is set. - For example `{ default = 0 }` - `RangeDispatch`: numeric_item_property object - For example `Compass(…)` - `ReferenceProvider`: a record with fields - `id`: font id - For example `{ id = alt }` - `Select`: select_item_property object - For example `BlockState(…)` - `SelectCase`: a record with fields - `when`: T | list of T - `model`: ItemModel - For example `{ when = …, model = Composite(…) }` - `SelectCases`: a record with fields - `cases`: list of SelectCase of T - For example `{ cases = [{ … }] }` - `SelectPropertyType`: one of `"block_state"`, `"charge_type"`, `"component"`, `"context_dimension"`, `"context_entity_type"`, `"custom_model_data"`, `"display_context"`, `"local_time"`, `"main_hand"`, `"trim_material"` - For example `block_state` - `ShulkerBox`: a record with fields - `texture`: texture id - `openness`: number 0..1 (optional) - For example `{ texture = block/acacia_door_bottom }` - `Single`: a record with fields - `resource`: texture id. A single texture location of the source. - `sprite`: texture id (optional). The identifier of the sprite that can referenced. If not specified, matches `resource`. - For example `{ resource = block/acacia_door_bottom }` - `SpaceProvider`: a record with fields - `advances`: map of string (exactly 1) to number - For example `{ advances = {} }` - `Special`: a record with fields - `model`: special_item_model. Renders a special hardcoded model. - `base`: ModelRef. Base model, providing transformations, particle texture and GUI light. - `transformation`: Transformation (optional) - For example `{ model = Banner(…), base = block/acacia_button }` - `SpecialModelType`: one of `"banner"`, `"bell"`, `"book"`, `"conduit"`, `"chest"`, `"copper_golem_statue"`, `"decorated_pot"`, `"end_cube"`, `"head"`, `"player_head"`, `"shield"`, `"shulker_box"`, `"trident"` - For example `banner` - `SpriteSource`: sprite_source - For example `Directory(…)` - `SpriteSourceType`: one of `"single"`, `"directory"`, `"filter"`, `"unstitch"`, `"paletted_permutations"` - For example `single` - `TargetInput`: a record with fields - `target`: shader_target id - `sampler_name`: string - `use_depth_buffer`: bool (optional) - `bilinear`: bool (optional) - For example `{ target = …, sampler_name = "text" }` - `Targets`: a record with fields - `[shader_target id]`: InternalTarget (optional) - For example `{}` - `TeamTint`: a record with fields - `default`: RGB. Tint to apply when there is no context entity, entity is not in a team or the team has no color. - For example `{ default = 0 }` - `TextureInput`: a record with fields - `location`: texture id - `sampler_name`: string - `width`: int 1.. - `height`: int 1.. - `bilinear`: bool (optional) - For example `{ location = block/acacia_door_bottom, sampler_name = "text", width = 1, height = 1, … }` - `TextureMaterial`: a record with fields - `sprite`: texture id - `force_translucent`: bool (optional). Whether the texture should be forced into the translucent render pass. Textures without any translucent pixels are not assigned to the translucent pass by default. Defaults to `false`. - For example `{ sprite = block/acacia_door_bottom }` - `Time`: a record with fields - `source`: TimeSource - `wobble`: bool (optional). Whether to oscillate for some time around target before settling. Defaults to true. - For example `{ source = daytime }` - `TimeSource`: one of `"daytime"`, `"moon_phase"`, `"random"` - For example `daytime` - `TintSourceType`: one of `"constant"`, `"custom_model_data"`, `"dye"`, `"firework"`, `"grass"`, `"potion"`, `"team"` - For example `constant` - `TrimOverride`: a record with fields - `when`: { pattern?: trim_pattern id, material?: trim_material id } - `texture`: id (optional). When present, overrides the base texture provided by trim pattern. The texture is located under `trims/entity//`. - `palette`: PaletteRef (optional). When present, overrides the palette texture provided by trim material. - For example `{ when = {} }` - `TtfProvider`: a record with fields - `file`: string - `size`: number (optional) - `oversample`: number (optional) - `shift`: list of number (exactly 2) (optional) - `skip`: string | list of string (optional) - For example `{ file = "text" }` - `UniformBlocks`: a record with fields - `[string]`: list of UniformValue (optional). List of uniform values in this block. The order must match the order in the shader file. - For example `{}` - `UniformValue`: a record with fields - `name`: string (optional). Unused by the game, but good to set in practice. - `type`: UniformValueType - `value`: any (depends on type) - For example `{ type = int, value = … }` - `UniformValueType`: one of `"int"`, `"ivec3"`, `"float"`, `"vec2"`, `"vec3"`, `"vec4"`, `"matrix4x4"` - For example `int` - `UnihexOverrideRange`: a record with fields - `from`: string. Minimum in codepoint range (inclusive). - `to`: string. Maximum in codepoint range (inclusive). - `left`: int 0..255. Position of left-most column of the glyph. - `right`: int 0..255. Position of right-most column of the glyph. - For example `{ from = "text", to = "text", left = 0, right = 0, … }` - `UnihexProvider`: a record with fields - `hex_file`: string. ZIP archive containing one or more *.hex files (files in archive with different extensions are ignored). - `size_overrides`: list of UnihexOverrideRange (optional). List of ranges to override the size of. - For example `{ hex_file = "text" }` - `Unstitch`: a record with fields - `resource`: texture id - `divisor_x`: number (optional). If set to the resource width, regions will use pixel coordinates. - `divisor_y`: number (optional). If set to the resource height, regions will use pixel coordinates. - `regions`: list of UnstitchRegion - For example `{ resource = block/acacia_door_bottom, regions = [{ … }] }` - `UnstitchRegion`: a record with fields - `sprite`: texture id - `x`: number - `y`: number - `width`: number - `height`: number - For example `{ sprite = block/acacia_door_bottom, x = 0, y = 0, width = 0, … }` - `UseCycle`: a record with fields - `period`: number (optional). returns remaining item use ticks modulo `period`. Defaults to 1. - For example `{}` - `UseDuration`: a record with fields - `remaining`: bool (optional). If true, returns remaining item use ticks. If false, returns item use ticks so far. Defaults to false. - For example `{}` - `ViewEntity`: object - For example `{}` - `WingsLayer`: a record with fields - `texture`: T. Texture location for this layer, inside `entity/equipment//`. - `dyeable`: Dyeable (optional). If specified, this layer will be tinted by the color contained in the `dyed_color` component. - `use_player_texture`: bool (optional). Whether this layer texture should be overridden by the player's custom elytra texture. Defaults to `false`. - For example `{ texture = … }` # Shared types Named types from this part of the game's schema: enums, aliases and records, with values that fit. - `AdmiringDisable`: a record with fields - `value`: bool. Whether the piglin cannot admire an item. Set when converting, when attacked, or when admiring an item. - Also has the fields of `ExpirableValue` - For example `{ value = true }` - `AdmiringItem`: a record with fields - `value`: bool. Whether the piglin is currently admiring an item. - Also has the fields of `ExpirableValue` - For example `{ value = true }` - `AngryAt`: a record with fields - `value`: list of int (exactly 4). The target of the piglin or piglin brute. - Also has the fields of `ExpirableValue` - For example `{ value = [0, 0, 0, 0] }` - `AttackTargetCooldown`: a record with fields - `value`: int - Also has the fields of `ExpirableValue` - For example `{ value = 0 }` - `AttributeName`: one of `"generic.maxHealth"`, `"generic.followRange"`, `"generic.knockbackResistance"`, `"generic.movementSpeed"`, `"generic.attackDamage"`, `"generic.armor"`, `"generic.armorToughness"`, `"generic.attackKnockback"`, `"generic.attackSpeed"`, `"generic.luck"`, `"horse.jumpStrength"`, `"generic.flyingSpeed"`, `"zombie.spawnReinforcements"` - For example `generic.maxHealth` - `AttributeOperation`: one of - `"add_value"`: Adds all of the modifiers' amounts to the current value of the attribute. - `"add_multiplied_base"`: Multiplies the current value of the attribute by `(1 + x)`, where `x` is the sum of the modifiers' amounts. - `"add_multiplied_total"`: For every modifier, multiplies the current value of the attribute by `(1 + x)`, where `x` is the amount of the particular modifier. - For example `add_value` - `Axis`: one of `"x"`, `"y"`, `"z"` - For example `x` - `BlockListRef`: block id | #block tag | list of block ids - For example `acacia_button`, `[acacia_button]` - `BlockNbtText`: a record with fields - `block`: string - `nbt`: string - `source`: "block" (optional) - `type`: "nbt" (optional) - Also has the fields of `TextNbtBase` - For example `{ block = "text", nbt = "text" }` - `BlockParticle`: a record with fields - `block_state`: BlockState - For example `{ block_state = acacia_button }` - `BlockPositionSource`: a record with fields - `pos`: list of int (exactly 3). Block position - For example `{ pos = [0, 0, 0] }` - `BlockState`: BlockState - For example `acacia_button`, `{ id = acacia_button }` - `BlockState`: block id | FullBlockState - For example `acacia_button`, `{ id = acacia_button }` - `BreezeJumpCooldown`: a record with fields - `value`: object. If present, the breeze will not long jump or slide. Set after performing a long jump. - Also has the fields of `ExpirableValue` - For example `{ value = {} }` - `BreezeJumpInhaling`: a record with fields - `value`: object. If present, the breeze will not long jump or shoot a wind charge when stuck. - Also has the fields of `ExpirableValue` - For example `{ value = {} }` - `BreezeJumpTarget`: a record with fields - `value`: list of int (exactly 3). The block position that the breeze is jumping towards. - Also has the fields of `ExpirableValue` - For example `{ value = [0, 0, 0] }` - `BreezeLeavingWater`: a record with fields - `value`: object. If present, the breeze is in water. - Also has the fields of `ExpirableValue` - For example `{ value = {} }` - `BreezeShoot`: a record with fields - `value`: object. If present, the breeze is able to shoot a wind charge, and will not long jump or slide. - Also has the fields of `ExpirableValue` - For example `{ value = {} }` - `BreezeShootCharging`: a record with fields - `value`: object. If present, the breeze will not shoot a wind charge. Set when starting to shoot. - Also has the fields of `ExpirableValue` - For example `{ value = {} }` - `BreezeShootCooldown`: a record with fields - `value`: object. If present, the breeze will not shoot a wind charge. Set after shooting - Also has the fields of `ExpirableValue` - For example `{ value = {} }` - `BreezeShootRecover`: a record with fields - `value`: object. If present, the breeze will not shoot a wind charge. - Also has the fields of `ExpirableValue` - For example `{ value = {} }` - `ChangePage`: a record with fields - `page`: int 1... The page number to go to. - For example `{ page = 1 }` - `ChargeCooldownTicks`: a record with fields - `value`: int - Also has the fields of `ExpirableValue` - For example `{ value = 0 }` - `ClickEvent`: click_event - For example `ChangePage(…)` - `ClickEventAction`: one of `"open_url"`, `"run_command"`, `"suggest_command"`, `"change_page"`, `"copy_to_clipboard"`, `"show_dialog"`, `"custom"` - For example `open_url` - `CopyToClipboard`: a record with fields - `value`: string. The text value to copy to the clipboard. - For example `{ value = "text" }` - `CustomAction`: a record with fields - `id`: id. ID of a custom action. Has no functionality on vanilla servers. - `payload`: any (depends on id) (optional) - For example `{ id = "text" }` - `DangerDetectedRecently`: a record with fields - `value`: bool. Whether the armadillo has detected danger recently. - Also has the fields of `ExpirableValue` - For example `{ value = true }` - `DigCooldown`: a record with fields - `value`: object. If present, the warden will not dig down. - Also has the fields of `ExpirableValue` - For example `{ value = {} }` - `Direction`: one of `"down"`, `"up"`, `"north"`, `"east"`, `"south"`, `"west"` - For example `down` - `DirectionByte`: one of `"0"`, `"1"`, `"2"`, `"3"`, `"4"`, `"5"` - For example `0` - `DirectionInt`: one of `"0"`, `"1"`, `"2"`, `"3"`, `"4"`, `"5"` - For example `0` - `DragonBreathParticle`: a record with fields - `power`: number (optional). Multiplier of initial velocity. Defaults to 1.0 - For example `{}` - `DustColor`: RGB - For example `0` - `DustColorTransitionParticle`: a record with fields - `from_color`: DustColor - `to_color`: DustColor - `scale`: number 0.01..4 - For example `{ from_color = 0, to_color = 0, scale = 0.01 }` - `DustParticle`: a record with fields - `color`: DustColor - `scale`: number 0.01..4 - For example `{ color = 0, scale = 0.01 }` - `DyeColor`: one of `"white"`, `"orange"`, `"magenta"`, `"light_blue"`, `"yellow"`, `"lime"`, `"pink"`, `"gray"`, `"light_gray"`, `"cyan"`, `"purple"`, `"blue"`, `"brown"`, `"green"`, `"red"`, `"black"` - For example `white` - `DyeColor`: one of `"white"`, `"orange"`, `"magenta"`, `"light_blue"`, `"yellow"`, `"lime"`, `"pink"`, `"gray"`, `"light_gray"`, `"cyan"`, `"purple"`, `"blue"`, `"brown"`, `"green"`, `"red"`, `"black"` - For example `white` - `DyeColorByte`: one of `"0"`, `"1"`, `"2"`, `"3"`, `"4"`, `"5"`, `"6"`, `"7"`, `"8"`, `"9"`, `"10"`, `"11"`, `"12"`, `"13"`, `"14"`, `"15"` - For example `0` - `DyeColorByte`: one of `"0"`, `"1"`, `"2"`, `"3"`, `"4"`, `"5"`, `"6"`, `"7"`, `"8"`, `"9"`, `"10"`, `"11"`, `"12"`, `"13"`, `"14"`, `"15"` - For example `0` - `DyeColorInt`: one of `"0"`, `"1"`, `"2"`, `"3"`, `"4"`, `"5"`, `"6"`, `"7"`, `"8"`, `"9"`, `"10"`, `"11"`, `"12"`, `"13"`, `"14"`, `"15"` - For example `0` - `DyeColorInt`: one of `"0"`, `"1"`, `"2"`, `"3"`, `"4"`, `"5"`, `"6"`, `"7"`, `"8"`, `"9"`, `"10"`, `"11"`, `"12"`, `"13"`, `"14"`, `"15"` - For example `0` - `EffectByteId`: one of `"1"`, `"2"`, `"3"`, `"4"`, `"5"`, `"6"`, `"7"`, `"8"`, `"9"`, `"10"`, `"11"`, `"12"`, `"13"`, `"14"`, `"15"`, `"16"`, `"17"`, `"18"`, `"19"`, `"20"`, `"21"`, `"22"`, `"23"`, `"24"`, `"25"`, `"26"`, `"27"`, `"28"`, `"29"`, `"30"`, `"31"`, `"32"` - For example `1` - `EffectId`: EffectId - For example `1` - `EffectId`: EffectIntId - For example `1` - `EffectIntId`: one of `"1"`, `"2"`, `"3"`, `"4"`, `"5"`, `"6"`, `"7"`, `"8"`, `"9"`, `"10"`, `"11"`, `"12"`, `"13"`, `"14"`, `"15"`, `"16"`, `"17"`, `"18"`, `"19"`, `"20"`, `"21"`, `"22"`, `"23"`, `"24"`, `"25"`, `"26"`, `"27"`, `"28"`, `"29"`, `"30"`, `"31"`, `"32"`, `"33"` - For example `1` - `EffectParticle`: a record with fields - `power`: number (optional). Multiplier of initial velocity. Defaults to 1.0 - `color`: RGB (optional) - For example `{}` - `EntityEffectParticle`: a record with fields - `color`: TranslucentParticle - For example `{ color = 0 }` - `EntityHoverContent`: a record with fields - `type`: entity_type id - `id`: string | list of int (exactly 4) - `name`: Text (optional) - For example `{ type = acacia_boat, id = [0, 0, 0, 0] }` - `EntityHoverValue`: a record with fields - `name`: string (optional) - `type`: string (optional) - `id`: string (optional) - For example `{}` - `EntityNbtText`: a record with fields - `entity`: string - `nbt`: string - `source`: "entity" (optional) - `type`: "nbt" (optional) - Also has the fields of `TextNbtBase` - For example `{ entity = @s, nbt = "text" }` - `EntityPositionSource`: a record with fields - `source_entity`: list of int (exactly 4) - `y_offset`: number (optional). offset from the entity's feet to the source position - For example `{ source_entity = [0, 0, 0, 0] }` - `EntityTooltipInfo`: a record with fields - `id`: entity_type id - `uuid`: string | list of int (exactly 4) - `name`: Text (optional) - For example `{ id = acacia_boat, uuid = [0, 0, 0, 0] }` - `EquipmentSlot`: one of `"mainhand"`, `"offhand"`, `"head"`, `"chest"`, `"legs"`, `"feet"`, `"body"`, `"saddle"` - For example `mainhand` - `EquipmentSlotGroup`: one of `"mainhand"`, `"offhand"`, `"head"`, `"chest"`, `"legs"`, `"feet"`, `"hand"`, `"armor"`, `"any"`, `"body"`, `"saddle"` - For example `mainhand` - `ExpirableValue`: a record with fields - `ttl`: int (optional). If present, ticks before this memory is automatically removed. - For example `{}` - `ExplicitInclusiveRange`: a record with fields - `min_inclusive`: T - `max_inclusive`: T - For example `{ min_inclusive = …, max_inclusive = … }` - `Filterable`: { raw: T, filtered?: T } | T - For example `{ raw = … }` - `FilteredText`: a record with fields - `raw`: T - `filtered`: T (optional). Shown only to players with chat filtering enabled. - For example `{ raw = … }` - `FlashParticle`: a record with fields - `color`: TranslucentParticle - For example `{ color = 0 }` - `FlatWeightedEntry`: a record with fields - `weight`: int 0.. - For example `{ weight = 0 }` - `FlatWeightedList`: list of FlatWeightedEntry of T - For example `[{ … }]` - `FluidState`: fluid id | { id: fluid id, properties?: any (depends on id) } - For example `empty`, `{ id = empty }` - `FullBlockState`: a record with fields - `id`: block id - `properties`: any (depends on id) (optional) - For example `{ id = acacia_button }` - `GazeCooldownTicks`: a record with fields - `value`: int. Ticks before the armadillo or camel can randomly look around again. - Also has the fields of `ExpirableValue` - For example `{ value = 0 }` - `GeyserBaseParticle`: a record with fields - `water_blocks`: int 1... Scales the particle size and its burst impulse. - `burst_impulse_base`: number. Scales the initial burst impulse - For example `{ water_blocks = 1, burst_impulse_base = 0 }` - `GeyserParticle`: a record with fields - `water_blocks`: int 1... Scales the particle size and its burst impulse. - For example `{ water_blocks = 1 }` - `GlobalPos`: a record with fields - `pos`: list of int (exactly 3). Coordinates of the location in [x, y, z] - `dimension`: dimension id. Dimension of the location - For example `{ pos = [0, 0, 0], dimension = overworld }` - `GolemDetectedRecently`: a record with fields - `value`: bool. Whether the villager has detected an iron golem recently. - Also has the fields of `ExpirableValue` - For example `{ value = true }` - `HasHuntingCooldown`: a record with fields - `value`: bool. Whether the axolotl is in a hunting cooldown. - Also has the fields of `ExpirableValue` - For example `{ value = true }` - `Home`: a record with fields - `value`: GlobalPos. Position of the villager's home. - Also has the fields of `ExpirableValue` - For example `{ value = { … } }` - `HorizontalDirectionByte`: one of `"0"`, `"1"`, `"2"`, `"3"` - For example `0` - `HoverEvent`: hover_event - For example `ShowEntity(…)` - `HoverEventAction`: one of `"show_text"`, `"show_item"`, `"show_entity"` - For example `show_text` - `HumanoidArm`: one of `"left"`, `"right"` - For example `left` - `HuntedRecently`: a record with fields - `value`: bool. Whether the piglin just hunted recently. Set after hunting or spawning in a bastion remnant. - Also has the fields of `ExpirableValue` - For example `{ value = true }` - `InclusiveRange`: T | { min_inclusive: T, max_inclusive: T } | list of T (exactly 2) - For example `{ min_inclusive = …, max_inclusive = … }` - `IsEmerging`: a record with fields - `value`: object. Whether the warden is currently emerging from the ground. - Also has the fields of `ExpirableValue` - For example `{ value = {} }` - `IsInWater`: a record with fields - `value`: object. Whether the frog is currently in water. - Also has the fields of `ExpirableValue` - For example `{ value = {} }` - `IsPanicking`: a record with fields - `value`: bool. Whether the mob is currently panicking. - Also has the fields of `ExpirableValue` - For example `{ value = true }` - `IsPregnant`: a record with fields - `value`: object. Whether the frog is pregnant. - Also has the fields of `ExpirableValue` - For example `{ value = {} }` - `IsSniffing`: a record with fields - `value`: object. Whether the warden or sniffer is currently sniffing. - Also has the fields of `ExpirableValue` - For example `{ value = {} }` - `IsTempted`: a record with fields - `value`: bool. Whether the mob is currently tempted by a player. - Also has the fields of `ExpirableValue` - For example `{ value = true }` - `ItemHoverContent`: a record with fields - `id`: item id - `count`: int (optional) - `components`: DataComponentPatch (optional) - For example `{ id = abandoned_camp_map }` - `ItemListRef`: item id | #item tag | list of item ids - For example `abandoned_camp_map`, `[abandoned_camp_map]` - `ItemParticle`: a record with fields - `item`: ItemStackTemplate - For example `{ item = { … } }` - `ItemPickupCooldownTicks`: a record with fields - `value`: int. Ticks before the allay goes to pick up an item again. - Also has the fields of `ExpirableValue` - For example `{ value = 0 }` - `JobSite`: a record with fields - `value`: GlobalPos. Position of the villager's job site. - Also has the fields of `ExpirableValue` - For example `{ value = { … } }` - `Keybind`: one of `"key.advancements"`, `"key.attack"`, `"key.back"`, `"key.chat"`, `"key.command"`, `"key.debug.clearChat"`, `"key.debug.copyLocation"`, `"key.debug.copyRecreateCommand"`, `"key.debug.crash"`, `"key.debug.debugOptions"`, `"key.debug.dumpDynamicTextures"`, `"key.debug.dumpVersion"`, `"key.debug.focusPause"`, `"key.debug.fpsCharts"`, `"key.debug.improvedTransparency"`, `"key.debug.lightmapTexture"`, `"key.debug.modifier"`, `"key.debug.networkCharts"`, `"key.debug.overlay"`, `"key.debug.profiling"`, `"key.debug.profilingChart"`, `"key.debug.reloadChunk"`, `"key.debug.reloadResourcePacks"`, `"key.debug.showAdvancedTooltips"`, `"key.debug.showChunkBorders"`, `"key.debug.showHitboxes"`, `"key.debug.spectate"`, `"key.debug.switchGameMode"`, `"key.drop"`, `"key.forward"`, `"key.friends"`, `"key.fullscreen"`, `"key.hotbar.1"`, `"key.hotbar.2"`, `"key.hotbar.3"`, `"key.hotbar.4"`, `"key.hotbar.5"`, `"key.hotbar.6"`, `"key.hotbar.7"`, `"key.hotbar.8"`, `"key.hotbar.9"`, `"key.inventory"`, `"key.jump"`, `"key.left"`, `"key.loadToolbarActivator"`, `"key.pickItem"`, `"key.playerlist"`, `"key.quickActions"`, `"key.right"`, `"key.saveToolbarActivator"`, `"key.screenshot"`, `"key.smoothCamera"`, `"key.sneak"`, `"key.spectatorHotbar"`, `"key.spectatorOutlines"`, `"key.sprint"`, `"key.swapOffhand"`, `"key.toggleGui"`, `"key.togglePerspective"`, `"key.toggleSpectatorShaderEffects"`, `"key.use"` - For example `key.advancements` - `KeybindText`: a record with fields - `keybind`: Keybind - `type`: "keybind" (optional) - Also has the fields of `TextBase` - For example `{ keybind = key.advancements }` - `LastSlept`: a record with fields - `value`: int. The gametime tick that the villager last slept in a bed. - Also has the fields of `ExpirableValue` - For example `{ value = 0 }` - `LastWoken`: a record with fields - `value`: int. The gametime tick that the villager last woke up from a bed. - Also has the fields of `ExpirableValue` - For example `{ value = 0 }` - `LastWorkedAtPoi`: a record with fields - `value`: int. The gametime tick that the villager last worked at their job site. - Also has the fields of `ExpirableValue` - For example `{ value = 0 }` - `LegacyDustColor`: list of number (exactly 3) - For example `[0, 0, 0]` - `LegacyOperation`: one of - `"0"`: aka. `add_value`. Adds all of the modifiers' amounts to the current value of the attribute. - `"1"`: aka. `add_multiplied_base`. Multiplies the current value of the attribute by (1 + x), where x is the sum of the modifiers' amounts. - `"2"`: aka. `add_multiplied_total`. For every modifier, multiplies the current value of the attribute by (1 + x), where x is the amount of the particular modifier. Functions the same as Operation 1 if there is only a single modifier with operation 1 or 2. However, for multiple modifiers it will multiply the modifiers rather than adding them - For example `0` - `LegacyTranslucentParticle`: list of number (exactly 4) - For example `[0, 0, 0, 0]` - `LikedNoteblock`: a record with fields - `value`: GlobalPos. The position and dimension of the note block that the allay likes. - Also has the fields of `ExpirableValue` - For example `{ value = { … } }` - `LikedNoteblockCooldownTicks`: a record with fields - `value`: int. Ticks before the allay stops putting items at the liked note block. - Also has the fields of `ExpirableValue` - For example `{ value = 0 }` - `LikedPlayer`: a record with fields - `value`: list of int (exactly 4). The UUID of the player entity that the allay likes. - Also has the fields of `ExpirableValue` - For example `{ value = [0, 0, 0, 0] }` - `LongJumpCoolingDown`: a record with fields - `value`: int. Ticks before the goat can long jump again. - Also has the fields of `ExpirableValue` - For example `{ value = 0 }` - `MeetingPoint`: a record with fields - `value`: GlobalPos. Position of the villager's meeting point. - Also has the fields of `ExpirableValue` - For example `{ value = { … } }` - `Memories`: a record with fields - `[memory_module_type id]`: any (optional) - For example `{}` - `MobEffectInstance`: object - For example `{ id = absorption }` - `ModernMobEffect`: a record with fields - `id`: mob_effect id - `amplifier`: int | int 0..255 (optional). Level I having value 0. Defaults to 0. - `duration`: -1 | int 1.. (optional). Duration of the effect in ticks. Infinite is represented by `-1`. - `ambient`: bool (optional). Whether the effect appears as a HUD icon in addition to in the inventory GUI (same behavior as beacons when `true`). Defaults to `false`. - `show_particles`: bool (optional). Defaults to `true`. - `show_icon`: bool (optional). Whether the effect appears in the inventory GUI. Defaults to `true` - `hidden_effect`: MobEffectInstance (optional). A lower amplifier effect of the same type. - For example `{ id = absorption }` - `NonEmptyFlatWeightedList`: list of FlatWeightedEntry of T (at least 1) - For example `[{ … }]` - `NonEmptyWeightedList`: list of WeightedEntry of T (at least 1) - For example `[{ … }]` - `NormalText`: a record with fields - `text`: string - `type`: "text" (optional) - Also has the fields of `TextBase` - For example `{ text = "text" }` - `ObjectTextConfig`: a record with fields - `fallback`: Text (optional). Used in places where object component cannot be displayed (for example, server log or narration). - For example `{}` - `OldDustParticle`: a record with fields - `r`: number - `g`: number - `b`: number - `scale`: number 0.01..4 - For example `{ r = 0, g = 0, b = 0, scale = 0.01, … }` - `OldDustTransition`: a record with fields - `fromColor`: DustColor - `toColor`: DustColor - `scale`: number 0.01..4 - For example `{ fromColor = 0, toColor = 0, scale = 0.01 }` - `OldEntityEffect`: a record with fields - `r`: number - `g`: number - `b`: number - `a`: number - For example `{ r = 0, g = 0, b = 0, a = 0, … }` - `OpenUrl`: a record with fields - `url`: string - For example `{ url = "text" }` - `PlayDeadTicks`: a record with fields - `value`: int. Ticks until the axolotl stops playing dead. - Also has the fields of `ExpirableValue` - For example `{ value = 0 }` - `PlayerHeadText`: a record with fields - `player`: Profile - `hat`: bool (optional). Whether the head layer is rendered. Defaults to `true`. - `object`: "player" (optional) - `type`: "object" (optional) - Also has the fields of `ObjectTextConfig`, `TextBase` - For example `{ player = {} }` - `PlayerModelPart`: one of `"cape"`, `"jacket"`, `"left_sleeve"`, `"right_sleeve"`, `"left_pants_leg"`, `"right_pants_leg"`, `"hat"` - For example `cape` - `PlayerModelType`: one of `"wide"`, `"slim"` - For example `wide` - `PositionSource`: position_source object - For example `Block(…)` - `PotentialJobSite`: a record with fields - `value`: GlobalPos. Position of a potential job site of the villager. - Also has the fields of `ExpirableValue` - For example `{ value = { … } }` - `Profile`: object | string - For example `{}`, `"text"` - `ProfileProperty`: a record with fields - `name`: string (0 to 64). Usually `textures`. - `value`: string (0 to 32767). Base64 encoded JSON value of the texture index. - `signature`: string (0 to 1024) (optional). Verifies the hash of the resulting texture. - For example `{ name = "text", value = "text" }` - `ProfilePropertyMap`: a record with fields - `[string]`: list of string (optional). The key is usually `textures`. Base64 encoded JSON value of the texture index. - For example `{}` - `RGB`: int | list of number 0..1 (exactly 3) - For example `0`, `[0, 0, 0]` - `RGBA`: int | list of number 0..1 (exactly 4) - For example `0`, `[0, 0, 0, 0]` - `RamCooldownTicks`: a record with fields - `value`: int. Ticks before the goat can ram again. - Also has the fields of `ExpirableValue` - For example `{ value = 0 }` - `ReceivingEvent`: a record with fields - `game_event`: game_event id - `distance`: number 0... Distance in blocks to the source - `pos`: list of number (exactly 3). Origin of the event - `source`: list of int (exactly 4) (optional). UUID of the source entity of the event, if one exists - `projectile_owner`: list of int (exactly 4) (optional). UUID of the owner of the projectile, if one exists - For example `{ game_event = block_activate, distance = 0, pos = [0, 0, 0] }` - `RecentProjectile`: a record with fields - `value`: object. Whether the warden has recently noticed a projectile vibration. - Also has the fields of `ExpirableValue` - For example `{ value = {} }` - `RoarSoundCooldown`: a record with fields - `value`: object. If present, the warden doesn't roar. - Also has the fields of `ExpirableValue` - For example `{ value = {} }` - `RoarSoundDelay`: a record with fields - `value`: object. If present, the warden doesn't roar. - Also has the fields of `ExpirableValue` - For example `{ value = {} }` - `Rotation`: one of `"none"`, `"clockwise_90"`, `"180"`, `"counterclockwise_90"` - For example `none` - `RunCommand`: a record with fields - `command`: string - For example `{ command = "text" }` - `SafePositionSource`: a record with fields - `type`: "block" - `pos`: list of int (exactly 3) - For example `{ type = block, pos = [0, 0, 0] }` - `ScoreHolder`: a record with fields - `objective`: string - `name`: string - For example `{ objective = "text", name = "text" }` - `ScoreText`: a record with fields - `score`: { objective: string, name: string } - `type`: "score" (optional) - Also has the fields of `TextBase` - For example `{ score = { … } }` - `SculkChargeParticle`: a record with fields - `roll`: number. Angle the particle texture is rotated to, measured in radians (π ~ 3.14 for 180° clockwise, negative for counter clockwise). - For example `{ roll = 0 }` - `SelectorText`: a record with fields - `selector`: string - `separator`: Text (optional) - `type`: "selector" (optional) - Also has the fields of `TextBase` - For example `{ selector = @s }` - `ShowDialog`: a record with fields - `dialog`: dialog id | Dialog - For example `{ dialog = custom_options }` - `ShowEntity`: a record with fields - `id`: entity_type id - `uuid`: string | list of int (exactly 4) - `name`: Text (optional) - For example `{ id = acacia_boat, uuid = [0, 0, 0, 0] }` - `ShowItem`: object - Also has the fields of `ItemStack` - For example `{ id = abandoned_camp_map }` - `ShowText`: a record with fields - `value`: Text - For example `{ value = "text" }` - `ShriekParticle`: a record with fields - `delay`: int 0... Ticks until the particle renders. - For example `{ delay = 0 }` - `SlottedItem`: a record with fields - `Slot`: T (optional). Inventory slot the item is in - Also has the fields of `ItemStack` - For example `{ id = abandoned_camp_map }` - `SniffCooldown`: a record with fields - `value`: object. If present, the warden or sniffer will not sniff. - Also has the fields of `ExpirableValue` - For example `{ value = {} }` - `SnifferExploredPositions`: a record with fields - `value`: list of list of int (exactly 3) (at most 20). Last 20 block positions that the sniffer has dug up. The sniffer will not dig in these positions. - Also has the fields of `ExpirableValue` - For example `{ value = [[0, 0, 0]] }` - `SonicBoomCooldown`: a record with fields - `value`: object. If present, the warden will not use the sonic boom attack. - Also has the fields of `ExpirableValue` - For example `{ value = {} }` - `SonicBoomSoundCooldown`: a record with fields - `value`: object. If present, the warden's sonic boom animation will not spawn particles and play sounds. - Also has the fields of `ExpirableValue` - For example `{ value = {} }` - `SonicBoomSoundDelay`: a record with fields - `value`: object. If present, will delay the warden's sonic boom animation. - Also has the fields of `ExpirableValue` - For example `{ value = {} }` - `SpriteText`: a record with fields - `atlas`: atlas id (optional). Defaults to `minecraft:blocks`. - `sprite`: texture id - `object`: "atlas" (optional) - `type`: "object" (optional) - Also has the fields of `ObjectTextConfig`, `TextBase` - For example `{ sprite = block/acacia_door_bottom }` - `StorageNbtText`: a record with fields - `storage`: storage id - `nbt`: string - `source`: "storage" (optional) - `type`: "nbt" (optional) - Also has the fields of `TextNbtBase` - For example `{ storage = …, nbt = "text" }` - `StringARGB`: int | string | list of number 0..1 (exactly 4) - For example `0`, `[0, 0, 0, 0]`, `"text"` - `StringRGB`: int | string | list of number 0..1 (exactly 3) - For example `0`, `[0, 0, 0]`, `"text"` - `SuggestCommand`: a record with fields - `command`: string - For example `{ command = "text" }` - `TemptationCooldownTicks`: a record with fields - `value`: int. Ticks before the mob can be tempted again. - Also has the fields of `ExpirableValue` - For example `{ value = 0 }` - `Text`: string | TextObject | list of Text (at least 1) - For example `"text"`, `{ … }`, `["text"]` - `TextBase`: a record with fields - `extra`: list of Text (at least 1) (optional) - Also has the fields of `TextStyle` - For example `{}` - `TextColor`: one of `"black"`, `"dark_blue"`, `"dark_green"`, `"dark_aqua"`, `"dark_red"`, `"dark_purple"`, `"gold"`, `"gray"`, `"dark_gray"`, `"blue"`, `"green"`, `"aqua"`, `"red"`, `"light_purple"`, `"yellow"`, `"white"` - For example `black` - `TextFormat`: one of `"obfuscated"`, `"bold"`, `"strikethrough"`, `"underline"`, `"italic"`, `"reset"` - For example `obfuscated` - `TextNbtBase`: a record with fields - `interpret`: bool (optional) - `plain`: bool (optional). Whether to remove colors from pretty-printed NBT structure when `interpret` is `false`. Defaults to `false`. Cannot be `true` when `interpret` is `true`. - `separator`: Text (optional) - Also has the fields of `TextBase` - For example `{}` - `TextObject`: object - For example `{ text = "text" }`, `{ translate = "text" }`, `{ score = { … } }`, `{ selector = @s }` - `TextStyle`: a record with fields - `color`: string | TextColor (optional) - `shadow_color`: RGBA (optional). Overrides the shadow properties of the text. If specified as 0, the shadow will never be displayed. - `font`: font id (optional) - `bold`: bool (optional) - `italic`: bool (optional) - `underlined`: bool (optional) - `strikethrough`: bool (optional) - `obfuscated`: bool (optional) - `insertion`: string (optional) - `click_event`: ClickEvent (optional) - `hover_event`: HoverEvent (optional) - For example `{}` - `TintedLeavesParticle`: a record with fields - `color`: RGBA - For example `{ color = 0 }` - `TouchCooldown`: a record with fields - `value`: object. If present, the warden will not react to being pushed by another mob. Set to 20 when touched. - Also has the fields of `ExpirableValue` - For example `{ value = {} }` - `TrailParticle`: a record with fields - `target`: list of number (exactly 3) - `color`: RGB - `duration`: int 1.. - For example `{ target = [0, 0, 0], color = 0, duration = 1 }` - `TranslatedText`: a record with fields - `translate`: string - `fallback`: string (optional) - `with`: list of TranslationArg (at least 1) (optional) - `type`: "translatable" (optional) - Also has the fields of `TextBase` - For example `{ translate = "text" }` - `TranslationArg`: Text | bool | int | number - For example `"text"`, `true`, `0` - `TranslucentParticle`: RGBA - For example `0` - `UniversalAnger`: a record with fields - `value`: bool. Whether the piglin is being universally angered. Only used when the `universalAnger` gamerule is enabled. - Also has the fields of `ExpirableValue` - For example `{ value = true }` - `UnknownDynamicAdditions`: a record with fields - `[string]`: any (optional) - For example `{}` - `UnreachableTransportBlockPositions`: a record with fields - `value`: list of GlobalPos. A list of container positions that the copper golem has visited and failed to interact with. - Also has the fields of `ExpirableValue` - For example `{ value = [{ … }] }` - `VerticalDirection`: one of `"down"`, `"up"` - For example `down` - `VibrationCooldown`: a record with fields - `value`: object. If present, the warden will not react to vibrations. Set to 40 when receiving a vibration. - Also has the fields of `ExpirableValue` - For example `{ value = {} }` - `VibrationListener`: a record with fields - `source`: PositionSource - `range`: int 1... Range in blocks where vibrations can be detected - `event`: ReceivingEvent (optional). Event that is being received, if any - `event_distance`: number 0.. (optional). Distance in blocks to the event that is being received - `event_delay`: int 1.. (optional). Delay in ticks until the event reaches this listener - For example `{ source = Block(…), range = 1 }` - `VibrationParticle`: object - Also has the fields of `VibrationParticleData` - For example `{ arrival_in_ticks = 0, destination = { … } }` - `VibrationParticleData`: a record with fields - `arrival_in_ticks`: int. Ticks in which to interpolate the particle's initial position to the destination. - `destination`: SafePositionSource - For example `{ arrival_in_ticks = 0, destination = { … } }` - `VisitedBlockPositions`: a record with fields - `value`: list of GlobalPos. A list of container positions that the copper golem has visited, whether successful or not. - Also has the fields of `ExpirableValue` - For example `{ value = [{ … }] }` - `WeightedEntry`: a record with fields - `weight`: int 0.. - `data`: T - For example `{ weight = 0, data = … }` - `WeightedList`: list of WeightedEntry of T - For example `[{ … }]` # Other data types Named types from this part of the game's schema: enums, aliases and records, with values that fit. - `AllOffTestEnvironment`: a record with fields - `definitions`: list of TestEnvironment - For example `{ definitions = [AllOf(…)] }` - `ArmorMaterial`: one of `"leather"`, `"chainmail"`, `"iron"`, `"gold"`, `"diamond"`, `"netherite"`, `"turtle"` - For example `leather` - `AttributeEntry`: a record with fields - `attribute`: attribute id. Attribute type to modify. - Also has the fields of `ModernAttributeModifier` - For example `{ attribute = air_drag_modifier, id = …, amount = 0, operation = add_value, … }` - `AttributeTrackBase`: a record with fields - `ease`: EasingType (optional). Defaults to `linear`. For visualization, check out: https://easings.net/ - For example `{}` - `BinomialIntGenerator`: a record with fields - `n`: int 0.. - `p`: number 0..1 - For example `{ n = 0, p = 0 }` - `BlockBasedTestInstance`: object - Also has the fields of `TestData` - For example `{ environment = default, structure = abandoned_camp/camp/bamboo_jungle/campsite_bamboo_jungle_1, max_ticks = 1 }` - `BlockPalette`: { palette: list of BlockState } | { palettes: list of list of BlockState } - For example `{ palette = [acacia_button] }`, `{ palettes = … }` - `BlockPattern`: a record with fields - `namespace`: string (optional) - `path`: string (optional) - For example `{}` - `BlockSoundSet`: a record with fields - `volume`: number 1e-05..10 (optional). Defaults to 1. - `pitch`: number 1e-05..2 (optional). Defauls to 1. - `break_sound`: SoundEventRef (optional) - `step_sound`: SoundEventRef (optional) - `place_sound`: SoundEventRef (optional) - `hit_sound`: SoundEventRef (optional) - `fall_sound`: SoundEventRef (optional) - For example `{}` - `BlockTransformData`: a record with fields - `block_state_provider`: BlockStateProviderRef. If the provider returns no result, the next transformer will be attempted. - `sound`: SoundEventRef (optional). Defaults to not playing sound. - `particle`: BlockTransformParticle (optional). Defaults to `none`. - `disallowed_faces`: list of Direction (optional). If a disallowed face is interacted with, the next transformer will be attempted. Defaults to empty (allowing all faces). - `loot`: loot_table id (optional). The loot to drop on a successful transformation. Defaults to drop nothing. - `drop_strategy`: BlockTransformDropStrategy (optional). Where the `loot` should drop. Defaults to `from_middle`. - `transform_type`: BlockTransformType (optional). How nearby blocks are affected by the transformation. Defaults to `single_block`. - `update_from_neighbors`: bool (optional). Whether the transformed block should update based on neighboring blocks. Defaults to `true`. - `consume_on_use`: bool (optional). Only has effect on stackable items. Defaults to `true`. - `item_damage_per_use`: int 0.. (optional). Only has effect on unstackable items. Defauls to 1. - For example `{ block_state_provider = CopyProperties(…) }` - `BlockTransformDropStrategy`: one of `"clicked_face"`, `"from_middle"` - For example `clicked_face` - `BlockTransformParticle`: one of `"none"`, `"scrape"`, `"wax_on"`, `"wax_off"` - For example `none` - `BlockTransformType`: one of - `"single_block"` - `"copper_chest"`: If the original block and the transformed block are both copper chests of any kind, the transform applies to the other half of the double chest. - For example `single_block` - `BoolGameRule`: a record with fields - `rule`: string - `value`: bool - For example `{ rule = "text", value = true }` - `ChatDecoration`: a record with fields - `translation_key`: string - `parameters`: list of ChatDecorationParameter - `style`: TextStyle (optional) - For example `{ translation_key = "text", parameters = [sender] }` - `ChatDecorationParameter`: one of `"sender"`, `"content"`, `"target"` - For example `sender` - `ClockTimeTestEnvironment`: a record with fields - `clock`: world_clock id - `time`: int 0.. - For example `{ clock = overworld, time = 0 }` - `ConstantIntGenerator`: a record with fields - `value`: int - For example `{ value = 0 }` - `ContactDamage`: a record with fields - `damage_type`: damage_type id - `amount`: FloatProvider of number 0.. - `attribute_to_source`: bool. Whether the damage is attributed to the sulfur cube. - For example `{ damage_type = arrow, amount = 0, attribute_to_source = true }` - `ContextNbtProvider`: a record with fields - `target`: NbtContextTarget - For example `{ target = this }` - `ContextScoreProvider`: a record with fields - `target`: EntityTarget - For example `{ target = this }` - `CubicBezierEase`: a record with fields - `cubic_bezier`: [number 0..1, number, number 0..1, number]. `[x1, y1, x2, y2]` For an easy GUI, check out: https://cubic-bezier.com/ - For example `{ cubic_bezier = [0, 0, 0, 0] }` - `DamageEffects`: one of - `"hurt"`: Default hurt sound. - `"thorns"`: Thorns hurt sound. - `"drowning"`: Drowing sound. - `"burning"`: A single tick of burning hurt sound. - `"poking"`: Berry bush poke sound. - `"freezing"`: A single tick of freezing hurt sound. - For example `hurt` - `DamageScaling`: one of - `"never"`: Always the same. - `"always"`: Always scale with difficulty. - `"when_caused_by_living_non_player"`: Scale with difficulty if it was caused by a living entity who is not a player. - For example `never` - `DeathMessageType`: one of - `"default"`: Resulting translation key of `death.attack.` + message_id. - `"fall_variants"`: Resulting translation key of `death.attack.` + message_id. - `"intentional_game_design"`: Resulting translation key of `death.attack.` + message_id + `.link`. - For example `default` - `Difficulty`: one of `"peaceful"`, `"easy"`, `"normal"`, `"hard"` - For example `peaceful` - `DifficultyTestEnvironment`: a record with fields - `difficulty`: Difficulty - For example `{ difficulty = peaceful }` - `EasingType`: SimpleEasingType | CubicBezierEase - For example `constant`, `{ cubic_bezier = [0, 0, 0, 0] }` - `EnvironmentAttributeTrackMap`: a record with fields - `[environment_attribute id]`: any (optional) - For example `{}` - `ExplicitTagEntry`: a record with fields - `id`: E - `required`: bool (optional) - For example `{ id = … }` - `ExplosionData`: a record with fields - `fuse`: int 1... The fuse time in ticks when ignited. When ignited by an explosion, the fuse will be a random value between `explosion_fuse / 8` and `3 * explosion_fuse / 8`. - `power`: int 0... The explosion power. - `causes_fire`: bool. Whether the explosion causes fire. - For example `{ fuse = 1, power = 0, causes_fire = true }` - `FeatureFlag`: one of `"vanilla"`, `"trade_rebalance"`, `"redstone_experiments"`, `"minecart_improvements"` - For example `vanilla` - `FixedScoreProvider`: a record with fields - `name`: string - For example `{ name = "text" }` - `FunctionTestEnvironment`: a record with fields - `setup`: function id (optional) - `teardown`: function id (optional) - For example `{}` - `FunctionTestInstance`: a record with fields - `function`: test_function id. Test function (Java code) to run. - Also has the fields of `TestData` - For example `{ environment = default, structure = abandoned_camp/camp/bamboo_jungle/campsite_bamboo_jungle_1, max_ticks = 1, function = always_pass, … }` - `GameRuleMap`: a record with fields - `[game_rule id]`: any (optional) - For example `{}` - `GameRulesTestEnvironment`: a record with fields - `rules`: map of game_rule id to any - For example `{ rules = {} }` - `IntGameRule`: a record with fields - `rule`: string - `value`: int - For example `{ rule = "text", value = 0 }` - `IntLimiter`: a record with fields - `min`: int (optional) - `max`: int (optional) - For example `{}` - `KnockbackModifiers`: a record with fields - `horizontal_power`: number. The horizontal power of the knockback. - `vertical_power`: number. The vertical power of the knockback. - For example `{ horizontal_power = 0, vertical_power = 0 }` - `LanguageInfo`: a record with fields - `name`: string (at least 1). Language name displayed in the language menu. - `region`: string (at least 1). Region name displayed in the language menu. - `bidirectional`: bool (optional). Whether the language reads right to left. Defaults to `false`. - For example `{ name = "text", region = "text" }` - `Languages`: a record with fields - `[string (1 to 16)]`: LanguageInfo (optional). The key matches language JSON file name (e.g. `en_us`). - For example `{}` - `MinMaxBounds`: T | { min?: T, max?: T } - For example `{}` - `MoonPhase`: one of `"full_moon"`, `"waning_gibbous"`, `"third_quarter"`, `"waning_crescent"`, `"new_moon"`, `"waxing_crescent"`, `"first_quarter"`, `"waxing_gibbous"` - For example `full_moon` - `Narration`: a record with fields - `decoration`: ChatDecoration (optional) - `priority`: NarrationPriority - For example `{ priority = chat }` - `NarrationPriority`: one of `"chat"`, `"system"` - For example `chat` - `NbtContextTarget`: EntityTarget | BlockEntityTarget - For example `this`, `block_entity` - `NbtProvider`: NbtContextTarget | nbt_provider - For example `this`, `Context(…)` - `NbtProviderSource`: one of `"this"`, `"attacker"`, `"direct_attacker"`, `"attacking_player"`, `"block_entity"` - For example `this` - `OldChatType`: a record with fields - `chat`: TextDisplay (optional) - `overlay`: TextDisplay (optional) - `narration`: Narration (optional) - For example `{}` - `OldTrimMaterialOverrides`: a record with fields - `[ArmorMaterial]`: string (optional) - For example `{}` - `Pack`: a record with fields - `pack`: object - `filter`: PackFilter (optional) - `features`: PackFeatures (optional) - `overlays`: PackOverlays (optional) - `language`: Languages (optional). Only used by resource pack. Adds additional languages to the language menu. - For example `{ pack = { … } }` - `PackBase`: a record with fields - `description`: Text - `pack_format`: int (optional). Optional since 1.21.9. Define it if you want older versions to recognize your pack with a “made for a newer version” warning message. Because of backwards compatibility, only the main pack format can be used here. Minor formats can only be specified in min and max format. - `supported_formats`: InclusiveRange of int (optional). Must not be specified in case min_format indicates a format version for 1.21.9 and later. - `min_format`: PackFormat (optional). The minimun format that is supported. To specify a minor version, use a list of two integers. - `max_format`: PackFormat (optional). The maximum format that is supported. To specify a minor version, use a list of two integers. - For example `{ description = "text" }` - `PackFeatures`: a record with fields - `enabled`: list of FeatureFlag - For example `{ enabled = [vanilla] }` - `PackFilter`: a record with fields - `block`: list of BlockPattern - For example `{ block = [{}] }` - `PackFormat`: int | [int, int 0..] | list of int (exactly 1) - For example `0`, `[0]`, `[0, 0]` - `PackOverlay`: a record with fields - `directory`: string (at least 1) - `formats`: InclusiveRange of int (optional) - `min_format`: PackFormat (optional) - `max_format`: PackFormat (optional) - For example `{ directory = "text" }` - `PackOverlays`: a record with fields - `entries`: list of PackOverlay - For example `{ entries = [{ … }] }` - `Palette`: a record with fields - `palette`: list of BlockState - For example `{ palette = [acacia_button] }` - `RandomIntGenerator`: int | random_int_generator object - For example `0`, `Binomial(…)` - `RandomIntGeneratorType`: one of `"uniform"`, `"binomial"`, `"constant"` - For example `uniform` - `RandomValueBounds`: number | { min: number, max: number } - For example `0`, `{ min = 0, max = 0 }` - `RandomizedPalette`: a record with fields - `palettes`: list of list of BlockState. Sets of different block states used in the structure, a random palette gets selected based on coordinates. - For example `{ palettes = … }` - `ScoreProvider`: EntityTarget | score_provider - For example `this`, `Context(…)` - `SimpleEasingType`: one of `"constant"`, `"linear"`, `"in_back"`, `"in_bounce"`, `"in_circ"`, `"in_cubic"`, `"in_elastic"`, `"in_expo"`, `"in_quad"`, `"in_quart"`, `"in_quint"`, `"in_sine"`, `"in_out_back"`, `"in_out_bounce"`, `"in_out_circ"`, `"in_out_cubic"`, `"in_out_elastic"`, `"in_out_expo"`, `"in_out_quad"`, `"in_out_quart"`, `"in_out_quint"`, `"in_out_sine"`, `"out_back"`, `"out_bounce"`, `"out_circ"`, `"out_cubic"`, `"out_elastic"`, `"out_expo"`, `"out_quad"`, `"out_quart"`, `"out_quint"`, `"out_sine"` - For example `constant` - `SoundEventRef`: sound_event id | { sound_id: weighed_sound_event id, range?: number } - For example `ambient.basalt_deltas.additions`, `{ sound_id = … }` - `SoundSettings`: a record with fields - `hit_sound`: SoundEventRef - `push_sound`: SoundEventRef - `push_sound_impulse_threshold`: number. Minimum impact speed required to trigger the sound. - `push_sound_cooldown`: number. Cooldown in seconds for the sound effect. - For example `{ hit_sound = ambient.basalt_deltas.additions, push_sound = ambient.basalt_deltas.additions, push_sound_impulse_threshold = 0, push_sound_cooldown = 0, … }` - `StorageNbtProvider`: a record with fields - `source`: storage id - For example `{ source = … }` - `StructureBlock`: a record with fields - `state`: int 0.. - `pos`: list of int 0.. (exactly 3) - `nbt`: any (optional) - For example `{ state = 0, pos = [0, 0, 0] }` - `StructureEntity`: a record with fields - `pos`: list of number 0.. (exactly 3) - `blockPos`: list of int 0.. (exactly 3) - `nbt`: AnyEntity - For example `{ pos = [0, 0, 0], blockPos = [0, 0, 0], nbt = AcaciaBoat(…) }` - `StructureNBT`: a record with fields - `DataVersion`: int 0... [Data version](https://minecraft.wiki/w/Data_version). - `size`: list of int 0.. (exactly 3) - `blocks`: list of { state: int 0.., pos: list of int 0.. (exactly 3), nbt?: any } - `entities`: list of { pos: list of number 0.. (exactly 3), blockPos: list of int 0.. (exactly 3), nbt: AnyEntity } - Also has the fields of `BlockPalette` - For example `{ DataVersion = 0, size = [0, 0, 0], blocks = [{ … }], entities = [{ … }], … }` - `Tag`: a record with fields - `replace`: bool (optional) - `values`: list of TagEntry of E - For example `{ values = [{ … }] }` - `TagEntry`: E | { id: E, required?: bool } - For example `{ id = … }` - `TestData`: a record with fields - `environment`: test_environment id | TestEnvironment. The test environment to run this test as part of. - `dimension`: dimension id (optional). Defaults to overworld. - `structure`: structure id. Structure NBT file to use for the test. - `max_ticks`: int 1... Maximum number of ticks allowed to pass before the test is considered timed out. - `setup_ticks`: int 0.. (optional). Ticks to wait after placing the structure before starting the test. Defaults to `0`. - `required`: bool (optional). Whether the test is considered required to pass for the full test suite to pass. Defaults to `true`. - `rotation`: Rotation (optional). Rotation to apply to the test structure. Defaults to `none`. - `manual_only`: bool (optional). If `true`, test is not included as part of automated test runs. Defaults to `false`. - `max_attempts`: int 1.. (optional). Number of attempts to run the test. Defaults to `1`. - `required_successes`: int 1.. (optional). Number of attempts that must succeed for the test to be considered successful. Defaults to `1`. - `sky_access`: bool (optional). Whether the test needs clear access to the sky. Defaults to `false`. If `false`, test is enclosed in barrier blocks. If `true`, the top is left open. - `padding`: int 0..128 (optional). Additional padding in blocks placed around the structure. Defaults to `0`. - For example `{ environment = default, structure = abandoned_camp/camp/bamboo_jungle/campsite_bamboo_jungle_1, max_ticks = 1 }` - `TextDisplay`: a record with fields - `decoration`: ChatDecoration (optional) - For example `{}` - `TimeMarker`: a record with fields - `ticks`: int 0.. - `show_in_commands`: bool (optional). Whether the time marker shows up in command suggestions. The time marker is still available in commands even if it is not suggested. Defaults to `false`. - For example `{ ticks = 0 }` - `TimeMarkerMap`: a record with fields - `[id]`: int 0.. | TimeMarker (optional). Time marker ID must be unique within the world clock. - For example `{}` - `TimeOfDayTestEnvironment`: a record with fields - `time`: int 0.. - For example `{ time = 0 }` - `TimelineAttributesTestEnvironment`: a record with fields - `timelines`: list of timeline ids - For example `{ timelines = [day] }` - `TradeCost`: a record with fields - `id`: item id. ID of the item. - `components`: DataComponentExactPredicate (optional) - `count`: IntNumberProvider (optional). Defaults to `1`. - For example `{ id = abandoned_camp_map }` - `TrialSpawnerConfig`: a record with fields - `spawn_range`: int 1..128 (optional). Maximum distance from the spawner that en entity can spawn - `total_mobs`: number (optional). Total amount of entities that are spawned during one activation, when 1 player is nearby - `total_mobs_added_per_player`: number (optional). Number added to `total_mobs` for each additional player - `simultaneous_mobs`: number (optional). Number of entities that that can be present at once, when 1 player is nearby - `simultaneous_mobs_added_per_player`: number (optional). Number added to `simultaneous_mobs` for each additional player - `ticks_between_spawn`: int (optional). Ticks until the next spawn. - `spawn_potentials`: list of SpawnPotential (optional). Entities that can be placed. - `loot_tables_to_eject`: WeightedList of loot_table id (optional). Loot tables to use when ejecting loot. Chooses one loot table based on weight and then uses it as often as there are players nearby. - `items_to_drop_when_ominous`: loot_table id (optional). Loot table to use when summoning ominous item spawners. One roll seeded based on rough location to determine all items used during the battle. - For example `{}` - `TrimMaterialOverrides`: a record with fields - `[equipment id]`: string (optional) - For example `{}` - `UniformIntGenerator`: a record with fields - `min`: int (optional) - `max`: int (optional) - For example `{}` - `UnknownStorage`: a record with fields - `[string]`: any (optional) - For example `{}` - `Weather`: one of `"clear"`, `"rain"`, `"thunder"` - For example `clear` - `WeatherTestEnvironment`: a record with fields - `weather`: Weather - For example `{ weather = clear }` - `WeightedSoundEvent`: a record with fields - `sound_id`: weighed_sound_event id - `range`: number (optional). Range in blocks. If the player is further than this range from the source of the sound, the sound will be inaudible. If omitted, the sound will have a variable range. - For example `{ sound_id = … }` # Lint rules Lint rules point out style problems and likely mistakes; errors the checker reports are not lint. A project can change any rule's severity in `mms.json`, and [Lint rules](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) in the guides explains how, and how to silence one. - [`accidental-markup`](https://minecraftmetascript.github.io/mms/docs/reference/lint/accidental-markup.md) (hint by default): A style mark in text that is never closed, such as the `*` of "5 * 3", so it is written as the character itself. The fix puts a backslash before it, which says so. - [`book-page-overflow`](https://minecraftmetascript.github.io/mms/docs/reference/lint/book-page-overflow.md) (warning by default): A Book page with more text than the book screen shows: 14 lines of about 19 characters. The game cuts the rest off. Widths are measured with the vanilla font, so text outside ASCII is a close guess. - [`constant-expression`](https://minecraftmetascript.github.io/mms/docs/reference/lint/constant-expression.md) (hint by default): An arithmetic expression of number literals can be written as its value. - [`custom-item-as-base`](https://minecraftmetascript.github.io/mms/docs/reference/lint/custom-item-as-base.md) (hint by default): A Book used where the game takes a plain item id, such as a recipe ingredient or an item tag. It stands for written_book there, so any written book matches. - [`deprecated`](https://minecraftmetascript.github.io/mms/docs/reference/lint/deprecated.md) (warning by default): A use of a declaration whose doc comment has a `@deprecated` tag. - [`external-asset`](https://minecraftmetascript.github.io/mms/docs/reference/lint/external-asset.md) (warning by default): An id of a texture, sound or structure in the project's namespace that no Texture, Sound or StructureFile call in the project provides. The pack still loads, but the file must come from another pack. - [`jigsaw-facing`](https://minecraftmetascript.github.io/mms/docs/reference/lint/jigsaw-facing.md) (warning by default): A jigsaw block that can never join its target: every jigsaw block with its target name in its pool faces a way it cannot meet. The game turns pieces only about the y axis, so a block facing up joins only one facing down, and a sideways block only a sideways one. - [`jigsaw-fit`](https://minecraftmetascript.github.io/mms/docs/reference/lint/jigsaw-fit.md) (warning by default): An internal jigsaw block (the block in front of it is inside its own piece, such as an arch mount on a road, or a jigsaw inset by a block by mistake) whose pool has pieces that stick out of the piece however they are turned. The game only places a piece joined at an internal jigsaw wholly inside its parent, so those pieces are never placed there. Height is not checked for terrain_matching pieces. - [`jigsaw-overlap`](https://minecraftmetascript.github.io/mms/docs/reference/lint/jigsaw-overlap.md) (info by default): A jigsaw block that can never grow when its piece joins a given parent: every piece its pool and the pool's fallback could place there overlaps the parent or the piece itself, however it is turned, and the game never places overlapping pieces. A junction narrower than the roads around it is the usual cause. Only certain cases are reported: every piece involved is a rigid project structure file with a known size and facing, and no pool involved has an empty or feature element. - [`jigsaw-unknown-name`](https://minecraftmetascript.github.io/mms/docs/reference/lint/jigsaw-unknown-name.md) (warning by default): A jigsaw block in a structure file that StructureFile("...") includes whose name or target is in a namespace with JigsawHole declarations, but is not one of them: most likely a typo made in the game's jigsaw screen. The quick fix declares it. Projects that declare no JigsawHole in a namespace are not checked there. - [`jigsaw-unknown-pool`](https://minecraftmetascript.github.io/mms/docs/reference/lint/jigsaw-unknown-pool.md) (warning by default): A jigsaw block in a structure file that StructureFile("...") includes draws from a pool in the project's namespace that no TemplatePool declares. The game skips the jigsaw, so the structure stops growing there. The quick fix declares the pool. - [`jigsaw-unreachable-target`](https://minecraftmetascript.github.io/mms/docs/reference/lint/jigsaw-unreachable-target.md) (warning by default): A jigsaw block whose target no piece of its pool can join: none of the pool's structure files has a jigsaw block with that name, or the pool has no pieces. Only pools whose pieces are all the project's own structure files are checked. - [`overrides-vanilla`](https://minecraftmetascript.github.io/mms/docs/reference/lint/overrides-vanilla.md) (info by default): A declaration in the minecraft namespace replaces the vanilla resource with the same id. - [`quoted-name`](https://minecraftmetascript.github.io/mms/docs/reference/lint/quoted-name.md) (hint by default): An id or enum name in quotes can be written bare: `minecraft:stone` or `stone` rather than "minecraft:stone". - [`redundant-namespace`](https://minecraftmetascript.github.io/mms/docs/reference/lint/redundant-namespace.md) (hint by default): A `minecraft:` prefix that can be dropped: `stone` means `minecraft:stone` unless the project declares its own `stone`. - [`spline-order`](https://minecraftmetascript.github.io/mms/docs/reference/lint/spline-order.md) (warning by default): A spline point whose location is lower than the point before it. The game looks points up by location assuming they go from lowest to highest, so points out of order give a broken curve. The quick fix sorts the points. - [`structure-unknown-loot-table`](https://minecraftmetascript.github.io/mms/docs/reference/lint/structure-unknown-loot-table.md) (warning by default): A chest, barrel, chest minecart or other container in a structure file that StructureFile("...") includes whose LootTable tag names a loot table nothing provides: in the minecraft namespace one vanilla does not have, and in a namespace the project declares in one that no LootTable declares. The game leaves the container empty without an error. The quick fix declares the table. Other namespaces may come from another pack and are not checked. - [`texture-outside-atlas`](https://minecraftmetascript.github.io/mms/docs/reference/lint/texture-outside-atlas.md) (warning by default): A texture a model names, outside the minecraft namespace, that neither the blocks atlas nor the items atlas stitches, so the game shows the missing texture. Vanilla's atlases take the files under textures/block/ and textures/item/; a Texture(...) in a Model goes under textures/block/ unless it is given an id name. The project's own `Atlas blocks` and `Atlas items` declarations in the minecraft namespace count too. - [`unused`](https://minecraftmetascript.github.io/mms/docs/reference/lint/unused.md) (hint by default): A worldgen piece, predicate or item modifier that nothing in the project references, so the game never uses it, or a const, Template, Type or Blueprint that nothing names. A TemplatePool counts as used when a jigsaw block in one of the project's structure files draws from it. - [`unused-asset`](https://minecraftmetascript.github.io/mms/docs/reference/lint/unused-asset.md) (info by default): A .png, .ogg or .nbt file in the project that no Texture, Sound or StructureFile call and no `icon` uses, so the packs leave it out. It is reported on the file itself (in VS Code's Problems panel, by `mms check`, and in the web editor's asset list), and not while the project has errors. - [`use-shorthand`](https://minecraftmetascript.github.io/mms/docs/reference/lint/use-shorthand.md) (hint by default): An object literal that has a shorter MMS form: an item entry as its id, `1..3` for a uniform provider or bounds, `diamond * 4` for a stack, a trigger call for a criterion, and `&&`, `||` and `!` for conditions. # accidental-markup Hint by default. A style mark in text that is never closed, such as the `*` of "5 * 3", so it is written as the character itself. The fix puts a backslash before it, which says so. ## Changing it Set the rule's severity in `mms.json`, to `error`, `warning`, `info`, `hint` or `off`: ```json { "lint": { "accidental-markup": "off" } } ``` To silence it on one line, write `// mms-ignore accidental-markup` on the line or the line above. See [Lint rules](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) in the guides for more. # book-page-overflow Warning by default. A Book page with more text than the book screen shows: 14 lines of about 19 characters. The game cuts the rest off. Widths are measured with the vanilla font, so text outside ASCII is a close guess. ## Changing it Set the rule's severity in `mms.json`, to `error`, `warning`, `info`, `hint` or `off`: ```json { "lint": { "book-page-overflow": "off" } } ``` To silence it on one line, write `// mms-ignore book-page-overflow` on the line or the line above. See [Lint rules](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) in the guides for more. # constant-expression Hint by default. An arithmetic expression of number literals can be written as its value. ## Changing it Set the rule's severity in `mms.json`, to `error`, `warning`, `info`, `hint` or `off`: ```json { "lint": { "constant-expression": "off" } } ``` To silence it on one line, write `// mms-ignore constant-expression` on the line or the line above. See [Lint rules](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) in the guides for more. # custom-item-as-base Hint by default. A Book used where the game takes a plain item id, such as a recipe ingredient or an item tag. It stands for written_book there, so any written book matches. ## Changing it Set the rule's severity in `mms.json`, to `error`, `warning`, `info`, `hint` or `off`: ```json { "lint": { "custom-item-as-base": "off" } } ``` To silence it on one line, write `// mms-ignore custom-item-as-base` on the line or the line above. See [Lint rules](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) in the guides for more. # deprecated Warning by default. A use of a declaration whose doc comment has a `@deprecated` tag. ## Changing it Set the rule's severity in `mms.json`, to `error`, `warning`, `info`, `hint` or `off`: ```json { "lint": { "deprecated": "off" } } ``` To silence it on one line, write `// mms-ignore deprecated` on the line or the line above. See [Lint rules](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) in the guides for more. # external-asset Warning by default. An id of a texture, sound or structure in the project's namespace that no Texture, Sound or StructureFile call in the project provides. The pack still loads, but the file must come from another pack. ## Changing it Set the rule's severity in `mms.json`, to `error`, `warning`, `info`, `hint` or `off`: ```json { "lint": { "external-asset": "off" } } ``` To silence it on one line, write `// mms-ignore external-asset` on the line or the line above. See [Lint rules](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) in the guides for more. # jigsaw-facing Warning by default. A jigsaw block that can never join its target: every jigsaw block with its target name in its pool faces a way it cannot meet. The game turns pieces only about the y axis, so a block facing up joins only one facing down, and a sideways block only a sideways one. ## Changing it Set the rule's severity in `mms.json`, to `error`, `warning`, `info`, `hint` or `off`: ```json { "lint": { "jigsaw-facing": "off" } } ``` To silence it on one line, write `// mms-ignore jigsaw-facing` on the line or the line above. See [Lint rules](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) in the guides for more. # jigsaw-fit Warning by default. An internal jigsaw block (the block in front of it is inside its own piece, such as an arch mount on a road, or a jigsaw inset by a block by mistake) whose pool has pieces that stick out of the piece however they are turned. The game only places a piece joined at an internal jigsaw wholly inside its parent, so those pieces are never placed there. Height is not checked for terrain_matching pieces. ## Changing it Set the rule's severity in `mms.json`, to `error`, `warning`, `info`, `hint` or `off`: ```json { "lint": { "jigsaw-fit": "off" } } ``` To silence it on one line, write `// mms-ignore jigsaw-fit` on the line or the line above. See [Lint rules](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) in the guides for more. # jigsaw-overlap Info by default. A jigsaw block that can never grow when its piece joins a given parent: every piece its pool and the pool's fallback could place there overlaps the parent or the piece itself, however it is turned, and the game never places overlapping pieces. A junction narrower than the roads around it is the usual cause. Only certain cases are reported: every piece involved is a rigid project structure file with a known size and facing, and no pool involved has an empty or feature element. ## Changing it Set the rule's severity in `mms.json`, to `error`, `warning`, `info`, `hint` or `off`: ```json { "lint": { "jigsaw-overlap": "off" } } ``` To silence it on one line, write `// mms-ignore jigsaw-overlap` on the line or the line above. See [Lint rules](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) in the guides for more. # jigsaw-unknown-name Warning by default. A jigsaw block in a structure file that StructureFile("...") includes whose name or target is in a namespace with JigsawHole declarations, but is not one of them: most likely a typo made in the game's jigsaw screen. The quick fix declares it. Projects that declare no JigsawHole in a namespace are not checked there. ## Changing it Set the rule's severity in `mms.json`, to `error`, `warning`, `info`, `hint` or `off`: ```json { "lint": { "jigsaw-unknown-name": "off" } } ``` To silence it on one line, write `// mms-ignore jigsaw-unknown-name` on the line or the line above. See [Lint rules](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) in the guides for more. # jigsaw-unknown-pool Warning by default. A jigsaw block in a structure file that StructureFile("...") includes draws from a pool in the project's namespace that no TemplatePool declares. The game skips the jigsaw, so the structure stops growing there. The quick fix declares the pool. ## Changing it Set the rule's severity in `mms.json`, to `error`, `warning`, `info`, `hint` or `off`: ```json { "lint": { "jigsaw-unknown-pool": "off" } } ``` To silence it on one line, write `// mms-ignore jigsaw-unknown-pool` on the line or the line above. See [Lint rules](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) in the guides for more. # jigsaw-unreachable-target Warning by default. A jigsaw block whose target no piece of its pool can join: none of the pool's structure files has a jigsaw block with that name, or the pool has no pieces. Only pools whose pieces are all the project's own structure files are checked. ## Changing it Set the rule's severity in `mms.json`, to `error`, `warning`, `info`, `hint` or `off`: ```json { "lint": { "jigsaw-unreachable-target": "off" } } ``` To silence it on one line, write `// mms-ignore jigsaw-unreachable-target` on the line or the line above. See [Lint rules](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) in the guides for more. # overrides-vanilla Info by default. A declaration in the minecraft namespace replaces the vanilla resource with the same id. ## Changing it Set the rule's severity in `mms.json`, to `error`, `warning`, `info`, `hint` or `off`: ```json { "lint": { "overrides-vanilla": "off" } } ``` To silence it on one line, write `// mms-ignore overrides-vanilla` on the line or the line above. See [Lint rules](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) in the guides for more. # quoted-name Hint by default. An id or enum name in quotes can be written bare: `minecraft:stone` or `stone` rather than "minecraft:stone". ## Changing it Set the rule's severity in `mms.json`, to `error`, `warning`, `info`, `hint` or `off`: ```json { "lint": { "quoted-name": "off" } } ``` To silence it on one line, write `// mms-ignore quoted-name` on the line or the line above. See [Lint rules](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) in the guides for more. # redundant-namespace Hint by default. A `minecraft:` prefix that can be dropped: `stone` means `minecraft:stone` unless the project declares its own `stone`. ## Changing it Set the rule's severity in `mms.json`, to `error`, `warning`, `info`, `hint` or `off`: ```json { "lint": { "redundant-namespace": "off" } } ``` To silence it on one line, write `// mms-ignore redundant-namespace` on the line or the line above. See [Lint rules](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) in the guides for more. # spline-order Warning by default. A spline point whose location is lower than the point before it. The game looks points up by location assuming they go from lowest to highest, so points out of order give a broken curve. The quick fix sorts the points. ## Changing it Set the rule's severity in `mms.json`, to `error`, `warning`, `info`, `hint` or `off`: ```json { "lint": { "spline-order": "off" } } ``` To silence it on one line, write `// mms-ignore spline-order` on the line or the line above. See [Lint rules](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) in the guides for more. # structure-unknown-loot-table Warning by default. A chest, barrel, chest minecart or other container in a structure file that StructureFile("...") includes whose LootTable tag names a loot table nothing provides: in the minecraft namespace one vanilla does not have, and in a namespace the project declares in one that no LootTable declares. The game leaves the container empty without an error. The quick fix declares the table. Other namespaces may come from another pack and are not checked. ## Changing it Set the rule's severity in `mms.json`, to `error`, `warning`, `info`, `hint` or `off`: ```json { "lint": { "structure-unknown-loot-table": "off" } } ``` To silence it on one line, write `// mms-ignore structure-unknown-loot-table` on the line or the line above. See [Lint rules](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) in the guides for more. # texture-outside-atlas Warning by default. A texture a model names, outside the minecraft namespace, that neither the blocks atlas nor the items atlas stitches, so the game shows the missing texture. Vanilla's atlases take the files under textures/block/ and textures/item/; a Texture(...) in a Model goes under textures/block/ unless it is given an id name. The project's own `Atlas blocks` and `Atlas items` declarations in the minecraft namespace count too. ## Changing it Set the rule's severity in `mms.json`, to `error`, `warning`, `info`, `hint` or `off`: ```json { "lint": { "texture-outside-atlas": "off" } } ``` To silence it on one line, write `// mms-ignore texture-outside-atlas` on the line or the line above. See [Lint rules](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) in the guides for more. # unused Hint by default. A worldgen piece, predicate or item modifier that nothing in the project references, so the game never uses it, or a const, Template, Type or Blueprint that nothing names. A TemplatePool counts as used when a jigsaw block in one of the project's structure files draws from it. ## Changing it Set the rule's severity in `mms.json`, to `error`, `warning`, `info`, `hint` or `off`: ```json { "lint": { "unused": "off" } } ``` To silence it on one line, write `// mms-ignore unused` on the line or the line above. See [Lint rules](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) in the guides for more. # unused-asset Info by default. A .png, .ogg or .nbt file in the project that no Texture, Sound or StructureFile call and no `icon` uses, so the packs leave it out. It is reported on the file itself (in VS Code's Problems panel, by `mms check`, and in the web editor's asset list), and not while the project has errors. ## Changing it Set the rule's severity in `mms.json`, to `error`, `warning`, `info`, `hint` or `off`: ```json { "lint": { "unused-asset": "off" } } ``` To silence it on one line, write `// mms-ignore unused-asset` on the line or the line above. See [Lint rules](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) in the guides for more. # use-shorthand Hint by default. An object literal that has a shorter MMS form: an item entry as its id, `1..3` for a uniform provider or bounds, `diamond * 4` for a stack, a trigger call for a criterion, and `&&`, `||` and `!` for conditions. ## Changing it Set the rule's severity in `mms.json`, to `error`, `warning`, `info`, `hint` or `off`: ```json { "lint": { "use-shorthand": "off" } } ``` To silence it on one line, write `// mms-ignore use-shorthand` on the line or the line above. See [Lint rules](https://minecraftmetascript.github.io/mms/docs/guides/lint.md) in the guides for more.