# 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 the `.vsix` for your system from the same release, such as `mms-win32-x64-1.0.0.vsix` or `mms-darwin-arm64-1.0.0.vsix`, through **Extensions → … → Install from VSIX**. It includes `mms`, so you do not need the command line to use the editor. (The universal `mms-1.0.0.vsix` does not, 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) 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`](../../examples/treasure/) and [`functions-advanced`](../../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](../guides/resources.md) and the [reference](https://minecraftmetascript.github.io/mms/docs/reference). 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](../guides/lint.md) findings, and `mms fix` applies the fixes that are always safe. `mms test` runs the project's [`Test` declarations](../guides/functions.md#tests). ## Next - [Writing resources](../guides/resources.md): the shorthand for loot tables, recipes, density functions and more. - [Functions](../guides/functions.md): variables, control flow, calls and strings in function code. - [Tutorial: a custom dimension](tutorial-dimension.md): a complete worldgen project. - [Language reference](../reference/language/declarations.md): 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 custom dimension This tutorial builds a dimension of floating islands, step by step. The finished project is [`examples/sky-islands`](../../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 = "#minecraft: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](../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 = { type = noise settings = islands biome_source = { type = fixed biome = meadow } } } ``` 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. # 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. **Sugar.** Shorthand 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. ## 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`](../../examples/jigsaw/) and [`treasure`](../../examples/treasure/) examples use it. `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 (VS Code's **Jigsaw** view, which copies a `/give` command for a set-up jigsaw block). 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`](../../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. 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`](../../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`. ## 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. 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`](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`](../../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", "block/glowstone_1") } } Model block/glowstone_2 { parent = block/cube_all, textures = { all = Texture("art/glow2.png", "block/glowstone_2") } } ``` | 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", "block/name")`, which copies the file to `textures/block/name.png`. A texture id can name a vanilla texture, such as `block/stone`. `sounds.json` is still generated from `Sound(...)`, and textures cannot have `.png.mcmeta` animation yet. The [`resource-pack`](../../examples/resource-pack/) example shows each kind with vanilla textures; [`embers`](../../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](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`](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](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`](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`](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`](../../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. 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"`. Functions read it as a string, and setting it to any other string 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. 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 `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]) } ``` ### 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]}") } ``` ## 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](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`. 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 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](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` and `tellraw`) and keeps entities that `summon` creates, with their type, tags and position, for `kill`, `tag`, `execute as`, `execute at` and `if entity`. Selectors are `@e` and `@s`, with `type`, `tag`, `limit` and `sort=arbitrary`. 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](../concepts/how-functions-compile.md). # 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. | Rule | Default | Fix | What it reports | | --- | --- | --- | --- | | `unused` | hint | none | A density function, noise, feature, carver, processor list, surface rule or condition, predicate, item modifier, parameter list or template pool that nothing references, by id or in a command. A template pool also counts as used when a jigsaw block in one of the project's structure files draws from it. The game never loads these on its own. Declarations in `minecraft` are skipped, because they override vanilla files. A `const`, `Template`, `Type` or `Blueprint` that nothing names is reported too. The editor fades the name. | | `quoted-name` | hint | safe | An id, dispatch key or enum name written in quotes: `"minecraft:stone"` becomes `stone`. | | `redundant-namespace` | hint | safe | A `minecraft:` prefix that can be dropped. It is kept when the project declares its own resource with the short name. | | `use-shorthand` | hint | safe | An object literal with a shorter form: a dispatched object as its helper call (`{ type = noise, noise = ridge }` becomes `Noise(noise = ridge)`), and the shorthand forms in [resources.md](resources.md): bare item entries, `1..3`, `diamond * 4`, trigger calls, `&&`, `||`, `!` and density arithmetic. Parentheses are added where precedence needs them. | | `custom-item-as-base` | hint | quick fix | A [custom item](resources.md#custom-items) or [Book](resources.md#books) in a field that takes a plain item id, such as a recipe ingredient or an item tag. It is written as its base item, so the field also matches the base item without the custom components. The quick fix writes the base item instead. | | `accidental-markup` | hint | safe | A style mark in text outside a book that is never closed, such as the `*` in `"5 * 3"`. It is written as the character itself; the fix puts a backslash before it to say so. | | `constant-expression` | hint | safe | Arithmetic on number literals, such as `2 * 0.25`, which is replaced by its value. | | `deprecated` | warning | none | A use of a declaration whose [doc comment](../start/getting-started.md#doc-comments) has a `@deprecated` tag, anywhere in the project, commands included. The message carries the tag's text, and the editor strikes the use out. | | `external-asset` | warning | none | A texture, sound or structure id in a namespace the project declares that no `Texture`, `Sound` or `Structure` call in the project provides. The pack still loads, so this is a warning: the file has to come from another pack. See [Asset files](resources.md#asset-files). | | `unused-asset` | info | none | A `.png`, `.ogg` or `.nbt` file in the project that no `Texture`, `Sound` or `Structure` call and no `icon` uses, so the packs leave it out. It has no source line, so it shows on the file itself: in VS Code's Problems panel, in `mms check` output, and as an "unused" badge in the web editor's asset list. Nothing is reported while the project has errors. | | `jigsaw-unknown-name` | warning | quick fix | A jigsaw block in a structure file whose name or target is in a namespace that declares [`JigsawHole`](resources.md#jigsaw-holes)s but is not one of them, most likely a typo made in the game's jigsaw screen. The message names the closest declared hole; the quick fix declares the name. Namespaces without any `JigsawHole` are not checked. | | `book-page-overflow` | warning | none | A [Book](resources.md#books) page with more text than the book screen shows, 14 lines of 114 pixels. The game cuts the rest off without a warning. Widths come from the vanilla font, so text outside ASCII is a close guess. In a `.mmsbook` file the warning is in the file. | | `overrides-vanilla` | info | none | A declaration that replaces a vanilla resource, such as `LootTable minecraft:blocks/stone`. A tag only counts when it sets `replace`, since otherwise it adds to vanilla's entries. It is skipped when the project namespace is `minecraft`. | ## 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. # How functions compile What a [function](../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) 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](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](../../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](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](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. Commas between items are optional. | | `{ 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) reference lists them by what they make. Your own [Templates](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](../../guides/resources.md) shows each form. ## Types Types come from three places: the game's own schema (`ItemStack`, `LootPool`, `HeightProvider`), the language (`int`, `float`, `bool`, `string`, `Text`, `Function`, `Commands`) and `Type` declarations. | 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 | | `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} 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](reuse.md#templates), [Blueprints](blueprints.md) and [Storage](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. ## 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](functions.md#command-templates) and [Text](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) 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. # 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) list their fields. ```mms Objective wand_cooldown /** A wand: a stick that casts a spell, with a cooldown. */ Blueprint Wand { /** The wand's name, in markup. */ 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 = "{gold}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](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](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. # 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](../../guides/functions.md) explains each part at length, and [How functions compile](../../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 | `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 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](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. The [guide](../../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](../../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 = "{#ff8800}Ember Shard" components = { lore = ["{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](../../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](../../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](../../guides/functions.md#tests) lists what the interpreter can run. # Reference: declaration kinds - `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. - `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/` - `MaterialCondition`: writes `data//worldgen/material_condition/` - `MaterialRule`: writes `data//worldgen/material_rule/` - `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 Blueprint in the prelude. 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. 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. - `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. Its name stands for: - 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 Blueprint in the prelude. 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. 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. Its name stands for: - 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 Blueprint in the prelude. 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}`. 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 `:`. # Reference: templates and forms ### book_pages ``` book_pages(text: BookText): [Text] ``` 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")`. - `text`: BookText ### cos ``` cos(degrees: double): double ``` The cosine of an angle in degrees. - `degrees`: double ### sin ``` sin(degrees: double): double ``` The sine of an angle in degrees. - `degrees`: double ### len ``` len(value: any): int ``` The number of items in a list, fields in an object, or characters in a string. - `value`: any ### by_language ``` by_language(text: LangText?): {string: string} ``` A LangText as an object of language code to text; plain text is English. - `text`: LangText? (optional) ### english ``` english(text: LangText): string ``` The English text of a LangText, or its first text when it has no English. - `text`: LangText ### contains ``` contains(list: [any], value: any): bool ``` Whether a list holds a value. - `list`: [any] - `value`: any ### matches ``` matches(text: string, pattern: string): bool ``` Whether a string matches a regular expression, as a whole. - `text`: string - `pattern`: string ### replace ``` replace(text: string, old: string, new: string): string ``` A string with every `old` replaced by `new`. - `text`: string - `old`: string - `new`: string ### named ``` named(asset: any, name: string): any ``` An asset call such as Texture("art/ruby.png") with an id name, unless it has one: named(texture, "item/ruby"). - `asset`: any - `name`: string ### kind_of ``` kind_of(value: any): string ``` 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. - `value`: any ### hash ``` hash(text: string): int ``` A whole number from 0 to 2147483647 made from a string, the same in every build: `hash("dungeon:dungeon")`. - `text`: string ### tell ``` tell(target: Selector, message: Text): Commands ``` 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. - `target`: Selector - `message`: Text ### title ``` title(target: Selector, message: Text, subtitle: Text?): Commands ``` Shows `message` in large text in the middle of the screen of each player `target` selects, with `subtitle` under it. - `target`: Selector - `message`: Text - `subtitle`: Text? (optional) ### exists ``` exists(target: Selector): bool ``` Whether `target` selects at least one entity, in a function: `if (exists(@e[tag=boss])) { ... }`. - `target`: Selector ### count ``` count(target: Selector): int ``` How many entities `target` selects, in a function: `let n = count(@e[type=zombie, distance=..16])`. - `target`: Selector ### actionbar ``` actionbar(target: Selector, message: Text): Commands ``` Shows `message` just above the hotbar of each player `target` selects. - `target`: Selector - `message`: Text ### Piece ``` Piece(path: string, weight: int = 1, processors: Id | ProcessorList = minecraft:empty, projection: Projection = rigid): WeightedElement ``` 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)])`. - `path`: string - `weight`: int (default `1`) - `processors`: Id | ProcessorList (default `minecraft:empty`) - `projection`: Projection (default `rigid`) ### BookGeneration ``` Type BookGeneration = "original" | "copy" | "copy_of_copy" | "tattered" ``` How many times a written book has been copied. ### LangText ``` Type LangText = string | {string: string} ``` Text in English, or one text per language: `{ en_us = "Ruby", de_de = "Rubin" }`. ## Forms of expression What an operator or literal means depends on the type expected where it is written. - 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. # Reference: helpers A helper builds one typed object. `Name(a, b)` fills the parameters in order; `Name(a = 1)` names them. ## Objects ### 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) ### 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) ### 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 ### LootPool ``` LootPool(rolls: IntNumberProviderRef, entries: [LootPoolEntry]) ``` - `rolls`: IntNumberProviderRef - `entries`: list of LootPoolEntry ### 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 ### 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 (`minecraft:biome_source`) ### 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) ``` 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) ### TheEnd ``` TheEnd() ``` Makes `minecraft:the_end`. The End's biomes: the central island, highlands, midlands, small islands and barrens. ## Block predicate (`minecraft:block_predicate`) ### 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 (`minecraft:block_state_provider`) ### 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 (`minecraft:carver_config`) ### 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 (`minecraft:chunk_generator`) ### 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 (`minecraft:click_event`) ### 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 (`minecraft:context_float_provider`) ### 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 (`minecraft:context_int_provider`) ### 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 (`minecraft:density_function`) ### 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 (`minecraft:dialog`) ### Confirmation ``` Confirmation(title: Text, yes: Button, no: Button, external_title?: Text, body?: DialogBody | [DialogBody], inputs?: [InputControl], can_close_with_escape?: bool, after_action?: AfterAction) ``` 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`. ### 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) ``` 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. ### 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) ``` 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. ### Notice ``` Notice(title: Text, external_title?: Text, body?: DialogBody | [DialogBody], inputs?: [InputControl], can_close_with_escape?: bool, after_action?: AfterAction, action?: Button) ``` 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. ### 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) ``` 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. ## Dialog action (`minecraft:dialog_action`) ### 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 (`minecraft:dialog_body`) ### 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 (`minecraft:enchantment_provider`) ### 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 (`minecraft:feature_config`) ### 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 (`minecraft:feature_size`) ### 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 (`minecraft:float_provider`) ### 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 (`minecraft:foliage_placer`) ### 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 (`minecraft:glyph_provider`) ### 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 (`minecraft:height_provider`) ### 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 (`minecraft:hover_event`) ### 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 (`minecraft:input_control`) ### 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 (`minecraft:int_provider`) ### 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 (`minecraft:item_model`) ### 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 (`minecraft:level_based_value`) ### 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 (`minecraft:list_operation`) ### 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 (`minecraft:loot_condition`) ### 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 (`minecraft:loot_function`) ### 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 (`minecraft:loot_pool_entry`) ### 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 (`minecraft:material_condition`) ### 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 (`minecraft:material_rule`) ### 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 (`minecraft:nbt_provider`) ### Context ``` Context(target: NbtContextTarget) ``` Makes `minecraft:context`. - `target`: NbtContextTarget ### Storage ``` Storage(source: storage id) ``` Makes `minecraft:storage`. - `source`: storage id ## Placement modifier (`minecraft:placement_modifier`) ### 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 (`minecraft:pos_rule_test`) ### 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 (`minecraft:recipe_serializer`) ### 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 (`minecraft:root_placer`) ### 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 (`minecraft:rule_block_entity_modifier`) ### 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 (`minecraft:rule_test`) ### 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 (`minecraft:score_provider`) ### Context ``` Context(target: EntityTarget) ``` Makes `minecraft:context`. - `target`: EntityTarget ### Fixed ``` Fixed(name: string) ``` Makes `minecraft:fixed`. - `name`: string ## Slot source (`minecraft:slot_source`) ### 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 (`minecraft:spawn_condition`) ### 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 (`minecraft:special_item_model`) ### 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 (`minecraft:sprite_source`) ### 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 (`minecraft:structure_config`) ### 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 (`minecraft:structure_placement`) ### 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 (`minecraft:template_pool_element`) ### 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 (`minecraft:template_processor`) ### 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 (`minecraft:test_environment_definition`) ### 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 (`minecraft:test_instance`) ### 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 (`minecraft:tint_source`) ### 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 (`minecraft:tree_decorator`) ### 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 (`minecraft:trigger`) ### 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 (`minecraft:trunk_placer`) ### 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 (`minecraft:worldgen/pool_alias_binding`) ### 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 # Reference: types - `ActuallyTranslucentRGB`: int | list of number 0..1 (exactly 3) - `AdvancementEntityPredicate`: PredicateRef - `AdvancementLocationPredicate`: PredicateRef - `AfterAction`: one of "close", "none", "wait_for_response" - `AggregateOperands`: ContextFloatProvider | context_float_provider id | #context_float_provider tag | list of FloatRef (at least 1) - `AggregateOperands`: ContextIntProvider | context_int_provider id | #context_int_provider tag | list of IntRef (at least 1) - `AnyEntity`: object - `ApplyBonusFormula`: one of "ore_drops", "uniform_bonus_count", "binomial_with_bonus_count" - `AttributeOperation`: one of "add_value", "add_multiplied_base", "add_multiplied_total" - `Axis`: one of "x", "y", "z" - `BannerAttachment`: one of "wall", "ground" - `BiomeTemperature`: one of "cold", "warm" - `BlockEntityTarget`: "block_entity" - `BlockListRef`: block id | #block tag | list of block ids - `BlockState`: block id | FullBlockState - `BlockStateProvider`: TypedBlockStateProvider | FullBlockState - `BlockStateProviderRef`: BlockStateProvider | block_state_provider id - `BlockTransformDropStrategy`: one of "clicked_face", "from_middle" - `BlockTransformParticle`: one of "none", "scrape", "wax_on", "wax_off" - `BlockTransformType`: one of "single_block", "copper_chest" - `BoundingBox`: one of "piece", "full" - `CardinalLightType`: one of "default", "nether" - `CarverListRef`: ConfiguredCarver | carver id | #carver tag | list of (carver id | ConfiguredCarver) - `CaveSurface`: one of "floor", "ceiling" - `ChatDecorationParameter`: one of "sender", "content", "target" - `ChestType`: one of "single", "left", "right" - `ChickenModelType`: one of "normal", "cold" - `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" - `ConfiguredFeatureRef`: feature id | ConfiguredFeature - `ContainerComponents`: one of "container", "bundle_contents", "charged_projectiles" - `ContextFloatProvider`: number | context_float_provider - `ContextIntProvider`: int | context_int_provider - `CookingBookCategory`: one of "food", "blocks", "misc" - `CopperGolemStatuePose`: one of "standing", "sitting", "running", "star" - `CopyNbtStrategy`: one of "replace", "append", "merge" - `CowModelType`: one of "normal", "cold", "warm" - `CraftingBookCategory`: one of "building", "redstone", "equipment", "misc" - `CubicSpline`: number | { coordinate: DensityFunctionRef, points: list of SplinePoint } - `CustomData`: CustomDataMap | string - `CustomSpawnRules`: object - `CustomizableItemDisplayContext`: one of "firstperson_righthand", "firstperson_lefthand", "thirdperson_righthand", "thirdperson_lefthand", "gui", "head", "ground", "fixed", "on_shelf" - `DamageEffects`: one of "hurt", "thorns", "drowning", "burning", "poking", "freezing" - `DamageScaling`: one of "never", "always", "when_caused_by_living_non_player" - `DeathMessageType`: one of "default", "fall_variants", "intentional_game_design" - `DecorationStep`: one of "raw_generation", "lakes", "local_modifications", "underground_structures", "surface_structures", "strongholds", "underground_ores", "underground_decoration", "fluid_springs", "vegetal_decoration", "top_layer_modification" - `DensityFunction`: NoiseRange | density_function - `DensityFunctionRef`: density_function id | DensityFunction - `DialogListRef`: Dialog | dialog id | #dialog tag | list of (dialog id | Dialog) - `Difficulty`: one of "peaceful", "easy", "normal", "hard" - `DimensionTypeRef`: dimension_type id - `Direction`: one of "down", "up", "north", "east", "south", "west" - `DistanceMetric`: one of "euclidean", "euclidean_squared", "manhattan", "chebyshev" - `DyeColor`: one of "white", "orange", "magenta", "light_blue", "yellow", "lime", "pink", "gray", "light_gray", "cyan", "purple", "blue", "brown", "green", "red", "black" - `DynamicDrops`: one of "contents", "sherds" - `EnchantmentsType`: enchantment id | #enchantment tag | list of enchantment ids (at least 1) - `EndCubeEffectType`: one of "portal", "gateway" - `EntityPredicate`: EntitySubPredicateMap - `EntityTarget`: one of "this", "attacker", "direct_attacker", "attacking_player", "target_entity", "interacting_entity" - `EquipmentSlot`: one of "mainhand", "offhand", "head", "chest", "legs", "feet", "body", "saddle" - `EquipmentSlotGroup`: one of "mainhand", "offhand", "head", "chest", "legs", "feet", "hand", "armor", "any", "body", "saddle" - `FeatureRef`: PlacedFeatureRef - `Filterable`: { raw: T, filtered?: T } | T - `FireworkShape`: one of "small_ball", "large_ball", "star", "creeper", "burst" - `FlatWeightedList`: list of FlatWeightedEntry of T - `FloatNumberProvider`: ContextFloatProvider - `FloatNumberProviderRef`: FloatRef - `FloatProvider`: T | float_provider - `FloatRange`: FloatNumberProviderRef | { min?: FloatNumberProviderRef, max?: FloatNumberProviderRef } - `FloatRef`: context_float_provider id | ContextFloatProvider - `FluidState`: fluid id | { id: fluid id, properties?: any (depends on id) } - `FontOption`: one of "uniform", "jp" - `FrequencyReductionMethod`: one of "default", "legacy_type_1", "legacy_type_2", "legacy_type_3" - `GlobalEnvironmentAttributeMap`: object - `GrassColorModifier`: one of "none", "dark_forest", "swamp" - `HeadType`: one of "creeper", "dragon", "piglin", "player", "skeleton", "wither_skeleton", "zombie" - `HeightProvider`: height_provider | VerticalAnchor - `HeightmapType`: one of "MOTION_BLOCKING", "MOTION_BLOCKING_NO_LEAVES", "OCEAN_FLOOR", "OCEAN_FLOOR_WG", "WORLD_SURFACE", "WORLD_SURFACE_WG" - `InclusiveRange`: T | { min_inclusive: T, max_inclusive: T } | list of T (exactly 2) - `Ingredient`: item id | #item tag | list of item ids (at least 1) - `IntNumberProvider`: ContextIntProvider - `IntNumberProviderRef`: IntRef - `IntProvider`: T | int_provider - `IntRange`: IntNumberProviderRef | { min?: IntNumberProviderRef, max?: IntNumberProviderRef } - `IntRef`: context_int_provider id | ContextIntProvider - `IntegerEnvironmentAttribute`: string - `ItemListRef`: item id | #item tag | list of item ids - `ItemModifier`: LootFunction | item_modifier id | #item_modifier tag | list of (item_modifier id | LootFunction) - `ItemModifierWithoutRootRef`: LootFunction | list of ItemModifierWithoutRootRef - `ItemPredicate`: { items?: item id | #item tag | list of item ids, count?: MinMaxBounds of int, components?: DataComponentExactPredicate, predicates?: DataComponentPredicate } - `ItemStack`: object - `ItemStackTarget`: "tool" - `ItemStackTemplate`: ItemStack | item id - `LevelBasedValue`: LevelBasedValue - `LevelBasedValue`: number | LevelBasedValueMap - `LiquidSettings`: one of "apply_waterlogging", "ignore_waterlogging" - `ListOperationMode`: one of "append", "insert", "replace_all", "replace_section" - `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" - `LootTableListRef`: LootTable | loot_table id | #loot_table tag | list of (loot_table id | LootTable) - `MaterialConditionRef`: material_condition id | MaterialCondition - `MaterialRuleRef`: material_rule id | MaterialRule - `MinMaxBounds`: T | { min?: T, max?: T } - `MineshaftType`: one of "normal", "mesa" - `MobCategory`: one of "monster", "creature", "ambient", "axolotls", "underground_water_creature", "water_creature", "water_ambient", "misc" - `ModelElementRotation`: { origin: list of number (exactly 3), rescale?: bool, axis: Axis, angle: number } | { origin: list of number (exactly 3), rescale?: bool, [Axis]?: number } - `ModelRef`: model id - `ModelVariant`: ModelVariantBase | list of object - `MultiNoisePreset`: one of "nether", "overworld" - `MultiPartCondition`: OR(…) | AND(…) | map of string to string - `MultifaceBlock`: one of "glow_lichen", "sculk_vein" - `NbtContextTarget`: EntityTarget | BlockEntityTarget - `NbtProvider`: NbtContextTarget | nbt_provider - `NoiseGeneratorSettingsRef`: noise_settings id | object - `NoiseParametersRef`: noise id | NoiseParameters - `NoiseRange`: number -1e+06..1e+06 - `NonEmptyWeightedList`: list of WeightedEntry of T (at least 1) - `NumericPropertyType`: one of "bundle/fullness", "compass", "cooldown", "count", "crossbow/pull", "custom_model_data", "damage", "time", "use_cycle", "use_duration" - `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" - `PaletteRef`: texture id - `PaletteTexture`: PaletteRef - `Pass`: object - `PigModelType`: one of "normal", "cold" - `PlacedFeatureListRef`: PlacedFeature | placed_feature id | #placed_feature tag | list of (placed_feature id | PlacedFeature) (at least 1) - `PlacedFeatureRef`: PlacedFeature | placed_feature id - `PositionalEnvironmentAttribute`: environment_attribute id - `PositionalEnvironmentAttributeMap`: object - `PotionTypeMatch`: potion id | #potion tag | list of potion ids - `Predicate`: LootCondition - `PredicateListRef`: LootCondition | predicate id | #predicate tag | list of (predicate id | LootCondition) - `PredicateRef`: Predicate | predicate id - `ProcessorList`: Processors(…) | list of Processor - `ProcessorListRef`: processor_list id | ProcessorList - `Projection`: one of "rigid", "terrain_matching" - `RGB`: int | list of number 0..1 (exactly 3) - `RGBA`: int | list of number 0..1 (exactly 4) - `RecipeListRef`: recipe id | #recipe tag | list of recipe ids - `Rotation`: one of "none", "clockwise_90", "180", "counterclockwise_90" - `Rotation`: AxisAngle | list of number (exactly 4) - `RuinedPortalPlacement`: one of "on_land_surface", "partly_buried", "on_ocean_floor", "in_mountain", "underground", "in_nether" - `ScoreProvider`: EntityTarget | score_provider - `SelectPropertyType`: one of "block_state", "charge_type", "component", "context_dimension", "context_entity_type", "custom_model_data", "display_context", "local_time", "main_hand", "trim_material" - `SetNameTarget`: one of "item_name", "custom_name" - `SkyboxType`: one of "none", "overworld", "end" - `SlotSource`: TypedSlotSource | slot_source id | #slot_source tag | list of (slot_source id | TypedSlotSource) - `SoundEventRef`: sound_event id | { sound_id: weighed_sound_event id, range?: number } - `SpawnEquipment`: object - `SpawnPotential`: WeightedEntry of SpawnerEntry - `SpawnerData`: object - `SpawnerEntry`: object - `SpreadType`: one of "linear", "triangular" - `StringRGB`: int | string | list of number 0..1 (exactly 3) - `StructureSetRef`: structure_set id | StructureSet - `TemperatureModifier`: one of "none", "frozen" - `TemplateEntry`: object - `TerrainAdaptation`: one of "none", "beard_thin", "beard_box", "bury", "encapsulate" - `Text`: string | TextObject | list of Text (at least 1) - `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" - `TextObject`: object - `TilingMode`: one of "clamp_to_edge", "repeat", "mirrored_repeat" - `Transformation`: { translation: list of number (exactly 3), left_rotation: Rotation, right_rotation: Rotation, scale: list of number (exactly 3) } | list of number (exactly 16) - `UniformValueType`: one of "int", "ivec3", "float", "vec2", "vec3", "vec4", "matrix4x4" - `VerticalAnchor`: Absolute(…) | AboveBottom(…) | BelowTop(…) | RelativeToSeaLevel(…) - `VerticalDirection`: one of "down", "up" - `Weather`: one of "clear", "rain", "thunder" - `WeightedList`: list of WeightedEntry of T - `ZombieNautilusModelType`: one of "normal", "warm" # Reference: lint rules - `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. - `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. - `constant-expression` (hint by default): An arithmetic expression of number literals can be written as its value. - `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. - `deprecated` (warning by default): A use of a declaration whose doc comment has a `@deprecated` tag. - `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. - `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. - `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. - `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. - `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. - `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. - `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. - `overrides-vanilla` (info by default): A declaration in the minecraft namespace replaces the vanilla resource with the same id. - `quoted-name` (hint by default): An id or enum name in quotes can be written bare: `minecraft:stone` or `stone` rather than "minecraft:stone". - `redundant-namespace` (hint by default): A `minecraft:` prefix that can be dropped: `stone` means `minecraft:stone` unless the project declares its own `stone`. - `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. - `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. - `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.