Lays out book markup as a book's pages: a --- line starts the next page. The text is a list of lines, or TextFile("books/guide.mmsbook").
book_pages(text: BookText): [Text] textBookText
Every project has the prelude: Templates, Types and Blueprint kinds written in MMS, and the built-in templates the compiler supplies. Call a template like any helper.
Lays out book markup as a book's pages: a --- line starts the next page. The text is a list of lines, or TextFile("books/guide.mmsbook").
book_pages(text: BookText): [Text] textBookText The number of items in a list, fields in an object, or characters in a string.
len(value: any): int valueany A LangText as an object of language code to text; plain text is English.
by_language(text: LangText?): {string: string} textoptionalLangText? The English text of a LangText, or its first text when it has no English.
english(text: LangText): string textLangText Whether a string matches a regular expression, as a whole.
matches(text: string, pattern: string): bool textstring patternstring A string with every old replaced by new.
replace(text: string, old: string, new: string): string textstring oldstring newstring An asset call such as Texture("art/ruby.png") with an id name, unless it has one: named(texture, "item/ruby").
named(asset: any, name: string): any assetany namestring The kind of a value: "none", "bool", "number", "string", "name", "list", "object", "range", "commands", or "runtime" for a value only known when the pack runs.
kind_of(value: any): string valueany A whole number from 0 to 2147483647 made from a string, the same in every build: hash("dungeon:dungeon").
hash(text: string): int textstring Sends message to the chat of each player target selects: tell(@a, "Wave ${wave} begins"). The message is text markup, and ${...} in it shows a score, a Global, a selector's names or a constant.
tell(target: Selector, message: Text): Commands targetSelector messageText Shows message in large text in the middle of the screen of each player target selects, with subtitle under it.
title(target: Selector, message: Text, subtitle: Text?): Commands targetSelector messageText subtitleoptionalText? Whether target selects at least one entity, in a function: if (exists(@e[tag=boss])) { ... }.
exists(target: Selector): bool targetSelector How many entities target selects, in a function: let n = count(@e[type=zombie, distance=..16]).
count(target: Selector): int targetSelector Shows message just above the hotbar of each player target selects.
actionbar(target: Selector, message: Text): Commands targetSelector messageText 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 <namespace>:halls/hall in the pack. processors is a
processor list's id, or the processors written inline:
Piece("halls/hall", processors = [BlockRot(integrity = 0.8)]).
Piece(path: string, weight: int = 1, processors: Id<worldgen/processor_list> | ProcessorList = minecraft:empty, projection: Projection = rigid): WeightedElement pathstring weightdefault 1int processorsdefault minecraft:emptyId<worldgen/processor_list> | ProcessorList projectiondefault rigidProjection How many times a written book has been copied.
Type BookGeneration = "original" | "copy" | "copy_of_copy" | "tattered" Text in English, or one text per language: { en_us = "Ruby", de_de = "Rubin" }.
Type LangText = string | {string: string} Operators and literals are forms of expression. What one means depends on the type expected where it is written, so 1..3 is a uniform
number in a loot pool's rolls and bounds in a predicate. This is the shorthand the
language builds in.
lo..hi, a range. Either end can be left out.
IntNumberProviderRef goes1..3 where a number provider goes: a uniform number from 1 to 3.
FloatNumberProviderRef goes0.5..2 where a number provider goes: a uniform number from 0.5 to 2.
IntRange goes1..3, 1.. or ..3 where bounds go.
FloatRange goes0.5..2, 0.5.. or ..2 where bounds go.
MinMaxBounds goes1..3, 1.. or ..3 where bounds go.
a && b && .... A chain of && is one form, with every term; parentheses keep a group.
LootCondition goesa && b on loot conditions: true when every term is.
a || b || .... A chain of || is one form, with every term; parentheses keep a group.
LootCondition goesa || b on loot conditions: true when any term is.
a * b.
DensityFunction goesItemStackTemplate goesdiamond * 4: a stack of four diamonds.
A list. Lists inside it are flattened into it.
MaterialRule goes[a, b] where a surface rule goes: the first rule that applies.