MiScript Documentation
MINECRAFT · SCRIPT ENGINE

MiScript – User Guide#

Version: 0.8.0-alpha.19, Minecraft Java Edition 26.3.

MiScript executes scripts from special blocks and .miscript files.

Contents#

Basics of language#

Installation and first launch#

Minecraft 26.3, Forge Required 66.1.0 or newer in branch 66 Java 25In a multiplayer game, MiScript is installed on both the server and the client.

  1. Put JAR MiScript in a folder mods When you update, remove the old JAR MiScript.
  2. Launch the game through the Forge profile and discover the world.
  3. With operator rights, in creative mode, get the script block:
MiScript / text
/give @s miscript:script_block
  1. Set the yellow block and open it with the right mouse button.
  2. Write and run:
MiScript / text
print("Привет из MiScript!")

The result will appear in the block console under the editor. print() It doesn't send messages to a game chat.

Editor and files#

Script block editor#

The code is stored in the block itself and stored with the world. The code limit is 16,384 characters; the console stores the last 100 lines, the long lines are reduced to 512 characters.

Continuation of compliance#

When you save peace, MiScript automatically saves running blocks and files: variables, lists, class objects, NBT, copies of blocks and objects, nested calls and loop space. Once downloaded, the code continues from the saved place; rows are not re-executed.

The state is preserved at the time of saving the world, as well as the rest of the Minecraft data. The maximum size of the execution shot is 16 MiB. Scripts stopped before the alpha.7 installation cannot be restored retroactively.

The auto-start settings are also saved along with the block.

Automatic block start-up#

In the field. "Condition" Specify an expression that returns True or FalseThe empty field disables this way of starting. As long as the block is free, the condition is checked every tick. True Once it's done, the block checks the condition again, if it's still running. TrueIt's re-launched. False It does not interrupt an already working script.

For example, the condition of launching on the saved flag:

MiScript / text
Dimention("overworld").persistent.get("gate.enabled", False)

The condition is executed separately from the block code: its local variables are not available in it. It can read the state of the world, but not change the world, type messages or wait for input. The error is displayed in the console; after fixing, click Save.

Button "Redstone on/off" It's a different way of starting up. As long as the block receives a signal, it starts whenever the previous execution has been completed. Deleting the signal does not stop the current start. If both are enabled, redstone signal is sufficient. or Only one copy of the script of this block is executed at the same time.

After changing the settings, press "Preserve.". "Stop it." interrupts execution and suppresses auto-start until the next save or manual start.

Transfer of variables between blocks#

One script's variables don't automatically become the other's variables. persistentBoth blocks have to choose. Same measurement and record nameThis also works for blocks located in different dimensions.

The sender block records the launch number and flag:

MiScript / text
import world
shared = Dimention("overworld").persistent
shared.set("gate.amount", 16)
shared.set("gate.enabled", True)

Set a condition for the receiver block Dimention("overworld").persistent.get("gate.enabled", False)And in the code, write:

MiScript / text
import world
shared = Dimention("overworld").persistent
amount = shared.get("gate.amount", 0)
shared.set("gate.enabled", False)  # Обработать запрос один раз
print(amount)                     # 16

Records are stored with the world, and through this repository, you can transfer numbers, strings, True/False, None The value read is a copy: after changing the list, call again. set()Write by one name replaces the previous value; for different recipients, use different names. This is data exchange, not script call: for a direct call, there is run("block:ID").

Scripts in files#

Files are placed in a folder Miscripts inside a folder of a particular world, next to level.dat:

MiScript / text
<папка мира>/Miscripts/hello.miscript
<папка мира>/Miscripts/quests/start.miscript

In a single game, the folder of the world is usually in the savesThe network game uses server files. All dimensions of one world use a shared folder. Miscripts.

Teams with operator rights:

Team team. Action.
/miscript run hello Run a block with an ID hello file hello.miscript.
/miscript run quests/start Run the file from the subfolder.
/miscript stop hello Stop the active launch of the team.
/miscript input hello текст ответа Respond to waiting input().
/miscript input hello Send an empty line.

When a file is started by a team print() In a single-player game, it's a log of the built-in server, not a chat window.

Calling another script from the code:

MiScript / text
run("quests/start")       # Файл Miscripts/quests/start.miscript
run("gate_open")          # ID блока или имя файла
run("block:gate_open")    # Только блок
run("file:gate_open")     # Только файл

The script that is called runs before it returns to the caller script, and it has its own variables, but it has a common step limit and the same launch source. ontick When you call from the block, the output remains in the console of the original unit.

run("имя") Searches for block ID in all dimensions and file Miscripts/имя.miscriptThe way / or \ ending .miscript If a file and a block match, or multiple blocks have the same ID, an error occurs. block: and file: select the type of source; the same ID of several blocks must be renamed.

The block can be in the unloaded chunk: the mod will load it while the code is read and free up retention. The index is saved with the world; old worlds are indexed when the first search for the block. The first search can take time in the big world. The rename is counted after the block is saved.

Called code uses coordinates, measurement, input and console provocative It's a self-launched script, and ontick Child code error stops the call; cyclic chains run() They're not allowed. They're the same search rules. /miscript run, /miscript stop and /miscript input In the input argument, prefix in quotation marks: /miscript input "block:gate_open" ответ.

Editor's keys#

Code and value recording#

The variable stores the value under your chosen name. True - Yes, False - No, no, None - It doesn't matter.

The new line completes the instruction. () and [] The protrusions are for readability; the body of a condition, cycle, or function is { ... }The commentary begins with #.

MiScript / text
number = 2 + 3
message = "Привет"
enabled = True
nothing = None
items = [1, 2, 3]
# Это комментарий

Integers and fractional numbers, strings are supported. True, False, None And lists. The fractions use a dot. 1.5. INF and inf Positive infinity; they cannot be reassigned.

Operators and conditions#

Recording. Meaning.
+, -, *, / Arithmetic.
// Division rounded down: -3 // 2 giver -2.
% Remainder: -3 % 2 giver 1.
==, !=, <, <=, >, >= Comparisons.
and, or, not Logical operations.
MiScript / text
score = 7
if score >= 10 {
    print("Победа")
} else if score > 0 {
    print("Игра продолжается")
} else {
    print("Начало игры")
}

Cycles#

A loop is a way to repeat the same code several times without rewriting it.

MiScript / text
for number in [1, 2, 3] {
    print("Привет")
}
# Три числа — три повторения. Выведет «Привет» три раза.

At the first repetition. number equal 1And the second one. 2And the third time, 3You can see that.

MiScript / text
for number in [1, 2, 3] {
    print(number)
}
# Вывод по строкам: 1, 2, 3

While repeating the code as long as the condition is correct.

MiScript / text
number = 1
while number <= 3 {
    print(number)
    number = number + 1
}
# Вывод: 1, 2, 3. После увеличения до 4 условие станет неверным.
Team team. What's he doing?
break He's just finishing his cycle.
continue Passes the remaining code of this repetition and moves to the next value.

else after the cycle is performed if the cycle is completed without break.

You can repeat it three times like this:

MiScript / text
for number in range(3) {
    print(number)
}
# number по очереди равна 0, 1, 2. Число 3 уже не входит.

Functions, classes and variables#

A function is a code with its own name that can be called again. return returns the result of the call:

MiScript / text
def double(value) {
    return value * 2
}
print(double(4))

Assignment within a function creates a local variable; conditions and cycles do not create a separate domain of variables.

The class describes its own type of object, and here each counter stores its own. valueIn methods. self The child class gets the parental methods.

MiScript / text
class Counter {
    def __init__(self, start) {
        self.value = start
    }
    def increase(self) {
        self.value = self.value + 1
        return self.value
    }
}
class MyCounter(Counter) {
    def show(self) {
        print(self.value)
    }
}
c = MyCounter(4)
c.show()

Fields of own objects are given through self.имяBuilt-in challenge. super() It's not provided yet.

Lists and lines#

Indices start at zero. Negative indices come at an end.

Recording. Action.
len(values) The length of a list, line, or available storage.
values[0] The first element.
values[-1] The last element.
values[0] = 9 Replace the element.
values.append(9) Add to the end, return. None.
values.pop() Remove and return the last item.
values.pop(index) Remove and return the index element.
values.index(value) Find the first match; absence causes error.
values[start:stop:step] Slice; stop It's not in it.
values[:] A surface copy of the list.
values[::-1] Reverse order.
values[1:3] = [7, 8, 9] Replace the part of the list with a change in length.

In a slice with increments other than 1, the number of new items must match the number of items being replaced. Zero step is forbidden. Slices are readable in rows. In inventory, the number of slots is fixed, so you can't change their length.

Tics and condition#

One game tick is usually 1/20 of a second, and when the server slows down, the tics go slower than real time.

ontick { ... } The variables are stored between its calls as part of the current launch:

MiScript / text
count = 0
ontick {
    count = count + 1
    print(count)
    wait(20)
    if count == 3 {
        break
    }
}

break directly ontick It shuts down this processor. Inside the nested loop, it completes the loop.

Function Action.
wait(ticks) Wait for a whole non-negative number of game tics.
delay(ticks) The same as wait.
sleep(seconds) Turn the seconds into tics of 20 per second rounded up and wait.

The delay pauses the current script; the game and other scripts continue to work. The execution resumes after a delay from the same place. ontick No calls are created, no missed calls are accumulated. Multiple handlers of a single script are executed in series.

Limit of implementation. 100 steps It's runtime and 100 common steps to call the tick handlers. It's runtime steps, not lines of code. Positive delay updates the limit, zero doesn't. input() and inputchat() The limit doesn't update.

Selectors#

Current modules: chat, world, random, player, progress, scoreboard, server, recipes, loot, registries, bossbars, maps, commandsThey can be listed by comma: import chat, worldThe register of variable names and functions is important: write. Player, ItemStack, True That's right.

Recording. Who does it stand for?
player Nick of the player who started the file or clicked "Run" in the block; without such a player, None.
@s The launch source itself: entity, block, or console.
@p The nearest player in the chosen dimension.
@pl All players involved, including other dimensions.
@pl["Veverp","Irvis"] These players are in that order.
@e Loaded entities in the measurement of the source.
@e[type="zombie",radius=10,limit=3] Up to three zombies within 10 blocks.
@e[name="Guard",limit=1] An entity with a given name.
@e[uuid="..."] An entity with a specified UUID.

Ugh @e and @p There are also filters. dim, x, y, zFor the radius or the nearest player, when starting from the console, you need to explicitly specify all three coordinates. limit limits the number, but does not in itself mean the choice of the nearest; for the nearest player there is @p.

Selectors can be passed through forand one result to be obtained by the index: @e[type="pig",limit=1][0]If you don't have a result, the index will cause an error: the link is tied to the UUID; the entity that is uploaded or remote is not available; the property of the selector itself requires exactly one goal.

@all, @cb and @cb["001"] Chat Message Source Filters; this is not the choice of any entity in the world.

The entity from the sample can be read name, uuid, id (type) vars and storageSlots are only available to entities with supported inventory:

MiScript / text
for villager in @e[type="villager", radius=10] {
    villager.storage[0] = ItemStack("bread", 3)
}

For this example, we need to import worldThe stack read from the slot is a copy: when it is changed, assign it back to the slot.

Standard library#

These functions are available immediately, without importCall is the name of the function with brackets: print("Привет")In parentheses, you pass on the arguments -- the values that it works with.

Output, input and launch#

print()#

Show the values in the console of the scripting block, when you run the file by the command, in the server log. print("Ответ:", 42)It doesn't bring anything back.

input()#

Pause the script and get a response from the field under the console. input() returns a line; the first argument is an optional hint:

MiScript / text
name = input("Как вас зовут?")
print("Привет,", name)

Parameter. pars sets the divider, count They're written by name. The result of splitting is a list of lines; another number of parts causes an error.

MiScript / text
values = input(pars=" ", count=2)  # Например, введите: 10 20
x = int(values[0])                # 10
y = int(values[1])                # 20
print(x + y)                     # 30

run(name)#

Perform another script: name Block ID, file name or path within MiscriptsExamples: run("gate_open"), run("quests/start"), run("block:gate_open"), run("file:gate_open")It doesn't return anything. Search details are in the "Scripts in Files" section.

Value conversion#

int(x)#

Turn a number, True/False Or the text with the number in the whole. The fractional part is dropped to zero. int(-2.8) → -2. int() → 0.

float(x)#

Get a fractional number from a number, True/False or a numbered text: float("1.5") → 1.5. float() → 0.0.

str(x)#

Convert meaning into text: str(42) → "42". str() It's an empty line.

bool(x)#

Get it True or FalseZero, NoneA blank line and an empty list are given False; non-empty meanings True. bool() → False.

list(x)#

Get a copy of the list, a list of string characters, or a list of inventory/sample items. list("кот") → ["к", "о", "т"]. list() → [].

Numbers and lists#

INF and inf They're two positive infinity names, and they're used, for example, to read the entire history of chat.

abs(a)#

Module of number a: abs(-5) → 5.

sqrt(a)#

The square root of a nonnegative number a: sqrt(9) → 3.0.

pow(a, b)#

Number. a degree b: pow(2, 3) → 8.

round(a, b)#

Round the number a downhill before b signs after the dot: round(1.239, 2) → 1.23, round(-1.231, 2) → -1.24. b Integer from −4096 to 4096; the negative value rounds to tens, hundreds, etc.

len(value)#

Number of list elements, string symbols, inventory slots or sampling purposes value: len([10, 20]) → 2.

range(start, end, step)#

Create a list of integers from start before end, non- end. step - a whole step by default 1; Zero is forbidden. You can write it. range(end) or range(start, end).

MiScript / text
print(range(3))         # [0, 1, 2]
print(range(2, 7, 2))   # [2, 4, 6]
print(range(3, 0, -1))  # [3, 2, 1]

Methods of the list#

MiScript / text
items = ["камень", "земля"]
items.append("песок")   # Теперь три элемента
print(items.index("земля"))  # 1
print(items.pop())     # "песок"; в списке снова два элемента

items.append(value)#

Add value bottom-list itemsIt doesn't bring anything back.

items.index(value)#

Return the number of the first element equal to valueIf you don't have one, it's a mistake.

items.pop(index)#

Remove and return the item with the number indexIf the number is not specified, the last number is deleted, negative numbers are counted from the end: -1 - Last one.

Delays#

wait(ticks)#

Wait ticks Play tics are an integer from zero. wait(20) And then the script goes on from the next line; it doesn't return anything.

delay(ticks)#

The same as wait(ticks).

sleep(seconds)#

Wait seconds seconds, including fractional: sleep(0.5) 10 tics. Seconds translate into tics of 20 per second rounded upwards. It doesn't return anything. ontick It is described in the section "Tics and condition".

Library: world#

MiScript / text
import world
w = Dimention.current()
w.setblock(10,64,20,"stone")

The names of Minecraft are written in the following lines: "minecraft:stone"For regular gaming objects, prefix minecraft: can be omitted "stone". pos in the methods below - coordinates Position(x, y, z) list [x, y, z]; region region Region(...).

Functions#

AABB(min_x, min_y, min_z, max_x, max_y, max_z)#

Create a rectangular volume to test collisions, which is the space between two corners, not a list of blocks.

Arguments: min_x, min_y, min_z - lower corner; max_x, max_y, max_z All coordinates are numbers; each lower coordinate must not exceed the upper coordinate.

Result: rectangular area.

Dimension(id)#

Dimention's middle name.

Arguments: id Measurement in the same format as Dimention(id).

Outcome: measurement.

Dimention(id)#

Measurement by ID, object, or list from exactly one ID.

Arguments: id Measurement ID, such as "overworld", "nether", "the_end"; also a measurement object or a list of one ID.

Outcome: measurement.

ItemStack(id, count=1)#

Separate stack of objects.

Arguments: id - Item ID, such as "minecraft:dirt" or "dirt". count The number of items in the stack, integer.

The result: a stack of objects.

NBT()#

Create empty extra data with fields by name, such as: data = NBT()then data.text = "Привет"This is needed for complex Minecraft components; the usual properties of blocks and items are more convenient to change with finished fields.

Result: NBT data.

Ground path search settings.

Arguments: width The width of the passing creature in blocks is greater than 0 and not greater than 4. height height of the creature in blocks, greater than 0 and not more than 4. can_swim - True - allow passage through the water. can_open_doors - True - take into account the opening of doors. max_fall - the permissible drop height in the blocks, a whole 0-16. max_nodes - how many points are allowed to be checked during the search, a whole 1-4,096.

Result: Path search settings.

Position(x, y, z)#

Coordinates with x/y/z fields.

Arguments: x - X coordinate, number. y - coordinate Y, number. z - coordinate Z, number.

Result: coordinates.

Region(x1, y1, z1, x2, y2, z2)#

Block area; both corners are included.

Arguments: x1, y1, z1 - coordinates of one angle; x2, y2, z2 The order of the angles is any. Both of the extreme blocks enter the region; a maximum of 32,768 blocks.

Result: block area.

Vec3(x, y, z)#

Coordinates with x/y/z fields.

Arguments: x - X coordinate, number. y - coordinate Y, number. z - coordinate Z, number.

Result: coordinates.

equip(target, slot, itemstack)#

Change gear; None clears the slot.

Arguments: target Who to choose: name, Player, selector or list. slot Slot equipment: "mainhand", "offhand", "head", "chest", "legs" or "feet". itemstack A stack of ItemStack; None clears the slot if the method permits.

Returns. None.

getdim(target=@s)#

List. Their measurements are in the same order.

Arguments: target Who to choose: name, Player, selector or list.

Returns the list of lines.

getpos(target=@s)#

List. Copies of the selected sources/entities.

Arguments: target Who to choose: name, Player, selector or list.

Result: list -- coordinates.

give(target, itemstack)#

Give a copy of the stack to each recipient; the rest falls next to each other.

Arguments: target Who to choose: name, Player, selector or list. itemstack A stack of ItemStack issued; an empty stack or None is prohibited.

Returns. None.

Object: Measurement - w#

The default measurement is the source measurement, the console overworld. Dimension is the middle name Dimention. getdim() returns the list: Dimention(...) accepts it only for one item.

MiScript / text
import world
w = Dimention.current()
area = Region(10,64,20, 12,66,22)  # 3×3×3, оба угла включены
w.copy(area, Position(100,64,100))
# w.copy(area, [100,64,100], to_dim="nether")

In copy/move destination – the place where you will go minimum angle The coordinates of the blocks are rounded down, including negative ones. The area is limited to 32,768 blocks. pos/start/end/destination take Position or [x,y,z].

Direct setblock/fill/copy/move record blocks without the usual chain of neighbor updates; place/interact/use_item_on, growth, explosion and liquid can trigger regular mechanics. Unloaded janks are loaded for the duration of the operation. The methods called do not guarantee successful gameplay: check success/changed where they return.

Conditional selection of blocks#

predicate into scan, count_blocks and replace - Your verification function. It gets a record from entry.block (copy block) and entry.position (its coordinates) and returns True Give me the name of the function. bracketless:

MiScript / text
def is_stone(entry) {
    return entry.block.id == "minecraft:stone"
}
area = Region(10,64,20, 12,66,22)
print(w.count_blocks(area, is_stone))
for entry in w.scan(area, is_stone) {
    print(entry.position.x, entry.position.y, entry.position.z)
}

Variables#

Methods#

w.activate(pos, actor=None)#

Empty hand interaction.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. actor - which player performs the action; the name, player or selector of one player.

The result: Success: True on success, otherwise False.

w.apply_bonemeal(pos, actor=None)#

Apply the bone meal to the block at the pos point.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. actor - which player performs the action; the name, player or selector of one player.

Result: Success fields – whether the action is taken, changed – whether the world has changed.

w.biome_at(pos)#

Biome ID.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

Result: text.

w.biome_tags(pos)#

Biome tags.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

Returns the list of lines.

w.block_light(pos)#

Read the level of light from blocks – torches, light stone and similar sources, without the light of the sky.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

Result: an integer from 0 to 15.

w.break_block(pos, actor=None, tool=None)#

Destroy the block, taking into account the tool/player and prey.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. actor - which player performs the action; the name, player or selector of one player. tool Tool: Item ID, ItemStack or None.

Result: success - success, remaining - the remaining pile.

w.can_activate(pos)#

Check for a block’s own interaction; it does not guarantee success.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

Result: True or False.

w.can_apply_bonemeal(pos, item=None, actor=None)#

Check the use of bone meal.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. item - Item ID or ItemStack. actor - which player performs the action; the name, player or selector of one player.

Result: True or False.

w.can_freeze(pos)#

Can the water at the pos point freeze by the rules of the biome, just a test, without changing the world?

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

Result: True or False.

w.can_grow(pos)#

Whether the block is a supported crop or a seedling, that answer alone doesn't guarantee that the tree will fit.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

Result: True or False.

w.can_ignite(pos)#

Is it possible to put fire at the pos point, returns True/False and doesn't change the world?

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

Result: True or False.

w.can_melt(pos)#

Is there enough light from the blocks to melt ordinary ice at the pos point.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

Result: True or False.

w.can_place(pos, state, actor=None)#

Check replacement, support and collisions.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. state Block ID or a copy of it obtained by getblock. actor - which player performs the action; the name, player or selector of one player.

Result: True or False.

w.can_see_sky(pos)#

Check the open sky according to the rules of the game.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

Result: True or False.

w.can_snow(pos)#

Is it possible to place snow at the pos point according to the rules of the biome?

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

Result: True or False.

w.can_survive(pos, state)#

Does the environment allow such a block?

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. state Block ID or a copy of it obtained by getblock.

Result: True or False.

w.collisions(box)#

Finding the hard parts of the blocks inside the box is what gets in the way. The result is a list of records: position indicates the block, shape.boxes contains its rectangular parts in the coordinates of the world. A blank list means there are no obstacles.

Arguments: box AABB (min_x,min_y,min_z,max_x,max_y,max_z)

Result: list of obstacles. Example: len(w.collisions(AABB(10, 64, 20, 11, 66, 21))) How many blocks does this volume cross?

w.compare(region, other)#

Comparison of equal in shape areas; equal and different.

Arguments: region - which area to treat; Region(x1,y1,z1,x2,y2,z2). other The second area for comparison.

The result: equal - whether the areas matched, different - how many blocks differ.

w.copy(region, destination, to_dim=None)#

Copy blocks and data; the purpose is the minimum angle.

Arguments: region - which area to treat; Region(x1,y1,z1,x2,y2,z2). destination - where to move the minimum angle of the region; coordinates or [x,y,z]. to_dim Where to copy; Measurement ID or Dimention

Result: the counters examined - checked, changed - changed.

w.count_blocks(region, predicate)#

Calculate the appropriate blocks.

Arguments: region - which area to treat; Region(x1,y1,z1,x2,y2,z2). predicate Verification function; returns True to a suitable block.

Result: integer.

w.create_portal(pos, axis="x")#

Fill a suitable empty obsidian frame; x/z axis.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. axis The direction of the portal plane: "x" or "z".

The result: Success: True on success, otherwise False.

Dimension.current()#

Measurement of the source; for the console, the upper world.

Outcome: measurement.

Dimention.current()#

Measurement of the source; for the console, the upper world.

Outcome: measurement.

w.downfall(pos)#

Climate humidity.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

The result is a fractional number.

w.emit_game_event(id, pos, source=None)#

Send a game signal to the sensors. It's not a subscription to a script event.

Arguments: id - Minecraft record ID in the specified directory. pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. source - from what entity the action is considered; entity, Player, selector of one goal or None.

Returns. None.

w.explode(pos, power, source=None, fire=False, blocks=True)#

Request an explosion, force 0...64.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. power Force of explosion: 0 to 64. source - from what entity the action is considered; entity, Player, selector of one goal or None. fire True to create fire, False without fire. blocks True is to break blocks, False is to leave blocks.

Result: field requested: whether an explosion was requested.

w.extinguish(pos)#

Remove the fire at the pos. If the fire wasn't there, success will be False.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

The result: Success: True on success, otherwise False.

w.fill(region, state)#

Fill in the area; examined/changed - viewed/modified blocks.

Arguments: region - which area to treat; Region(x1,y1,z1,x2,y2,z2). state Block ID or a copy of it obtained by getblock.

Result: the counters examined - checked, changed - changed.

w.fluid_at(pos)#

Liquid: id/empty/source/height.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

Result: information about the liquid: id, empty, source, height.

w.fluid_can_flow(from, to)#

Check the border of neighboring cells for the current fluid, not the entire future simulation.

Arguments: from - where the liquid is coming from; the coordinates of the block. to - where the liquid flows; coordinates of the neighboring block.

Result: True or False.

w.fluid_tick(pos)#

Perform a fluid step.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

The result: Success: True on success, otherwise False.

w.freeze_water(pos)#

Replace water with ice if biome conditions allow freezing.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

The result: Success: True on success, otherwise False.

w.getblock(x, y, z)#

Read the block shot.

Arguments: x - X coordinate, number. y - coordinate Y, number. z - coordinate Z, number.

Result: A copy of the block.

w.getblocks(region)#

List of posts from position and block.

Arguments: region - which area to treat; Region(x1,y1,z1,x2,y2,z2).

Result: List - position coordinates and a copy of block.

w.grow_crop(pos)#

Accelerate a culture that is supported.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

Result: Success fields – whether the action is taken, changed – whether the world has changed.

w.grow_tree(pos)#

Try to grow a seedling; the tree may not fit.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

Result: Success fields – whether the action is taken, changed – whether the world has changed.

w.height_at(x, z, kind="non_air")#

Y of the upper suitable unit: non_air - not air; solid - with the shape of a collision; ground - solid without foliage. None if there is nothing.

Arguments: x - X coordinate, number. z - coordinate Z, number. kind - text: non_air/solid/ground.

The result is an integer or None.

w.heightmap(kind)#

Get an elevation map for the rule you choose. Her method gets(x,z) returns Y to the top occupied block, or None.

Arguments: kind World_surface/ocean_floor/motion_blocking/motion_blocking_no_leaves (also *_wg)

Result: elevation map object: call .get(x, z)to obtain a Y block, for example, w.heightmap("world_surface").get(10, 20).

w.ignite(pos)#

Place the fire at the pos point if the game permits its placement.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

The result: Success: True on success, otherwise False.

w.ignite_tnt(pos)#

Burn the TNT installed.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

The result: Success: True on success, otherwise False.

w.interact(pos, actor, hand)#

Interact with a real player with an object in his hand.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. actor - which player performs the action; the name, player or selector of one player. hand - Hand: mainhand or offhand.

Result: success - success, remaining - the remaining pile.

w.is_loaded(pos)#

Check for a full chunk without loading it.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

Result: True or False.

w.launch_firework(pos, item, velocity=None)#

Launch ItemStack rockets; UUID or None.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. item - Item ID or ItemStack. velocity The speed of the rocket is Position or [x,y,z].

Result: text or None.

w.light_at(pos)#

Total play level light with current sky dimming.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

Result: integer.

w.lightning(pos, visual_only=False)#

Create lightning or its visual version.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. visual_only True is only an image of lightning, without its usual action.

The result: Success: True on success, otherwise False.

w.locate_biome(id, origin, radius=640)#

Position of biome or None found; radius up to 6400 blocks.

Arguments: id Biome ID, such as "minecraft:plains". origin Where to start the search; Position or [x,y,z]. radius - search radius.

Result: coordinates or None.

w.locate_structure(id, origin, radius=32)#

Find the structure; radius up to 100 chunks.

Arguments: id - Minecraft record ID in the specified directory. origin Where to start the search; Position or [x,y,z]. radius - search radius.

Result: coordinates or None.

w.melt_ice(pos)#

Melt ordinary ice at the point of pos, if the light level allows.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

The result: Success: True on success, otherwise False.

w.move(region, destination)#

Move blocks and data.

Arguments: region - which area to treat; Region(x1,y1,z1,x2,y2,z2). destination - where to move the minimum angle of the region; coordinates or [x,y,z].

Result: the counters examined - checked, changed - changed.

w.pathfind(start, end, profile)#

Find the ground path from start to end. Both points must be no further than 32 blocks apart. The call itself does not move anyone.

Arguments: start The starting point; Position or [x,y,z]. end Endpoint: Position or [x,y,z]. profile settings of NavigationProfile(...).

Result: None if there is no way; otherwise path.points - a list of coordinates in order, path.reached - if we made it to the destination.

MiScript / text
path = w.pathfind([10,64,20], [15,64,20], NavigationProfile())
if path != None {
    print(path.reached)
    for point in path.points {
        print(point.x, point.y, point.z)
    }
}
w.place(pos, item, face, actor=None)#

Put the block item on point.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. item - Item ID or ItemStack. face Block side: up/down/north/south/east/west. actor - which player performs the action; the name, player or selector of one player.

Result: success - success, remaining - the remaining pile.

w.place_snow(pos, layers=1)#

Put the specified number of snow layers at the pos point, if biome conditions permit.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. layers The number of layers of snow, whole from 1 to 8.

The result: Success: True on success, otherwise False.

w.play_note(pos)#

Put the playback of the tuned music block in the queue.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

Result: field requested: whether the action is taken.

w.precipitation(pos)#

The type of precipitation.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

Result: text.

w.random_tick(pos)#

Causing a random block tick; change is not guaranteed.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

The result: Success: True on success, otherwise False.

w.raycast(start, end, fluids=False)#

Check the start-to-end segment: which block it meets first, which is convenient for line-of-sight testing.

Arguments: start and end - Position or [x,y,z]. fluids - True to account for liquids along with blocks.

Result: None, if no hit; otherwise, position is the coordinates of the block, location is the exact point of hit, face is the block side.

w.replace(region, predicate, state)#

Replace suitable blocks.

Arguments: region - which area to treat; Region(x1,y1,z1,x2,y2,z2). predicate Verification function; returns True to a suitable block. state Block ID or a copy of it obtained by getblock.

Returns. None.

w.ring_bell(pos, source=None, direction="north")#

Try to ring the bell.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. source - from what entity the action is considered; entity, Player, selector of one goal or None. direction Side of impact: "north", "south", "east", "west", "up" or "down".

The result: Success: True on success, otherwise False.

w.save()#

Keep the measurement and general data; operator right is required.

The result contains a done, a result, an error, and success is verified through result.success.

w.scan(region, predicate)#

Find suitable position/block records.

Arguments: region - which area to treat; Region(x1,y1,z1,x2,y2,z2). predicate Verification function; returns True to a suitable block.

Result: List - position coordinates and a copy of block.

w.schedule_block_tick(pos, delay)#

Plan a block tick; delay is a positive whole.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. delay - delay in game tics.

Returns. None.

w.schedule_fluid_tick(pos, delay)#

Schedule the next step of the liquid at the pos point through the delay tics.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. delay - delay in game tics.

Returns. None.

w.set_biome(region, id)#

Change the biome, result changed_cells; the biome cell is 4×4×4.

Arguments: region - which area to treat; Region(x1,y1,z1,x2,y2,z2). id Biome ID, such as "minecraft:plains".

The result is the number of changed cells in result.changed_cells.

w.setblock(x, y, z, state)#

Apply a block ID or snapshot; returns None.

Arguments: x - X coordinate, number. y - coordinate Y, number. z - coordinate Z, number. state Block ID or a copy of it obtained by getblock.

Returns. None.

w.setblockstates(x, y, z, facing="east")#

Modify the listed properties.

Arguments: x - X coordinate, number. y - coordinate Y, number. z - coordinate Z, number. facing An example of a block property is the direction "east." Instead of facing, you can transfer other real properties of that block by name, such as lit=True.

Returns. None.

w.skip_night()#

Go to the time of awakening and wake the sleepers; the number of sleepers is not checked.

The result: success – is the transition made, time – new time.

w.sky_light(pos)#

Read the level of light coming from the sky at pos, 0 to 15. This is the lighting inside the world; the torches are not included.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

Result: an integer from 0 to 15.

w.spawn(type, pos, components=None)#

Create an entity; returns a link or None.

Arguments: type - The right type of ID. pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. components Additional properties of an object or entity in the NBT.

Result: Essence or None.

w.temperature(pos)#

The temperature of the biome adjusted for altitude; not degrees Celsius.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

The result is a fractional number.

w.use_item_on(pos, item, face, actor=None)#

Apply a given object, for example, fill the boiler with a bucket.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. item - Item ID or ItemStack. face Block side: up/down/north/south/east/west. actor - which player performs the action; the name, player or selector of one player.

Result: success - success, remaining - the remaining pile.

Object: Rectangular volume - box#

Continuous rectangular volume; the bottom coordinates should not exceed the top coordinates, used for geometry and collisions, and the Region for entire blocks.

Variables#

Object: Copy of the block - b#

Getblock returns to independent copy. Object is not tied to coordinates; only setblock changes. You can put the same image in a different place.

MiScript / text
import world
w = Dimention.current()
w.setblock(10,64,20,"barrel")
b = w.getblock(10,64,20)
b.storage[0] = ItemStack("dirt",16)
w.setblock(10,64,20,b)

So different blocks have additional parameters, like the furnace has burning time, the plate has text. They're grouped in fields. b.furnace, b.sign These groups are available only to the appropriate type: b.furnace at the furnace/melting furnace/smokinghouse; stone error; None in a separate special field means missing the stored data key. Assigning None deletes the key, after using Minecraft can restore the default value.

The block_entity_type is equal to None, the chest is equal to minecraft:chest. schema() is optional: it lists only special fields, such as b.furnace fields, and not all properties of b. The shapes of the block correspond to the moment of reading. After changing its state, apply a copy and call getblock again.

Forms b.collision_shape and b.outline_shape list boxesEach of its elements is a rectangular part with fields min_x/min_y/min_z/max_x/max_y/max_z. The coordinates are calculated from the block itself: a normal full cube takes from 0 to 1 on each axis; the steps of the parts have several. The first shape interferes with movement, the second sets the frame when pointing.

Variables#

Methods#

b.schema()#

Special field certificate; does not change the world.

The result is a list of descriptions. Each name has a field name, type has a type of value, writable has True if the field can be changed.

Object: b.banner - banner#

Variables#

Methods#

b.banner.schema()#

View the available fields of this group; this is an optional reference, without changing the block.

The result is a list of descriptions. Each name has a field name, type has a type of value, writable has True if the field can be changed.

Object: b.beacon - lighthouse#

Variables#

Methods#

b.beacon.schema()#

View the available fields of this group; this is an optional reference, without changing the block.

The result is a list of descriptions. Each name has a field name, type has a type of value, writable has True if the field can be changed.

Object: b.beehive - hive#

Variables#

Methods#

b.beehive.schema()#

View the available fields of this group; this is an optional reference, without changing the block.

The result is a list of descriptions. Each name has a field name, type has a type of value, writable has True if the field can be changed.

Object: b.bookshelf - carved bookshelf#

Variables#

Methods#

b.bookshelf.schema()#

View the available fields of this group; this is an optional reference, without changing the block.

The result is a list of descriptions. Each name has a field name, type has a type of value, writable has True if the field can be changed.

Object: b.brewing - cooking rack#

Variables#

Methods#

b.brewing.schema()#

View the available fields of this group; this is an optional reference, without changing the block.

The result is a list of descriptions. Each name has a field name, type has a type of value, writable has True if the field can be changed.

Object: b.campfire - fire#

Variables#

Methods#

b.campfire.schema()#

View the available fields of this group; this is an optional reference, without changing the block.

The result is a list of descriptions. Each name has a field name, type has a type of value, writable has True if the field can be changed.

Object: b.command_block is a common Minecraft command unit#

Variables#

Methods#

b.command_block.schema()#

View the available fields of this group; this is an optional reference, without changing the block.

The result is a list of descriptions. Each name has a field name, type has a type of value, writable has True if the field can be changed.

Object: b.crafter - autocrafter#

Variables#

Methods#

b.crafter.schema()#

View the available fields of this group; this is an optional reference, without changing the block.

The result is a list of descriptions. Each name has a field name, type has a type of value, writable has True if the field can be changed.

Object: b.decorated_pot - decorated pot#

Variables#

Methods#

b.decorated_pot.schema()#

View the available fields of this group; this is an optional reference, without changing the block.

The result is a list of descriptions. Each name has a field name, type has a type of value, writable has True if the field can be changed.

Object: b.furnace - oven data#

These are the parameters of a furnace, smelter or smoker. The time is indicated in the game ticks: usually 20 ticks = 1 second. The content of the slots is located separately in b.storage.

MiScript / text
b = w.getblock(10,64,20)   # Здесь должна стоять печь
print(b.furnace.burn_time)
b.furnace.cook_time = 0   # Сбросить прогресс переплавки
w.setblock(10,64,20,b)     # Применить изменённую копию

Variables#

Methods#

b.furnace.schema()#

View the available fields of this group; this is an optional reference, without changing the block.

The result is a list of descriptions. Each name has a field name, type has a type of value, writable has True if the field can be changed.

Object: b.hopper - funnel#

Variables#

Methods#

b.hopper.schema()#

View the available fields of this group; this is an optional reference, without changing the block.

The result is a list of descriptions. Each name has a field name, type has a type of value, writable has True if the field can be changed.

Object: b.jukebox - Player#

Variables#

Methods#

b.jukebox.schema()#

View the available fields of this group; this is an optional reference, without changing the block.

The result is a list of descriptions. Each name has a field name, type has a type of value, writable has True if the field can be changed.

Object: b.lectern - department#

Variables#

Methods#

b.lectern.schema()#

View the available fields of this group; this is an optional reference, without changing the block.

The result is a list of descriptions. Each name has a field name, type has a type of value, writable has True if the field can be changed.

Object: b.sign - plaque#

Variables#

Methods#

b.sign.schema()#

View the available fields of this group; this is an optional reference, without changing the block.

The result is a list of descriptions. Each name has a field name, type has a type of value, writable has True if the field can be changed.

Object: b.skull - head#

Variables#

Methods#

b.skull.schema()#

View the available fields of this group; this is an optional reference, without changing the block.

The result is a list of descriptions. Each name has a field name, type has a type of value, writable has True if the field can be changed.

Object: b.spawner - Mob spawner#

Variables#

Methods#

b.spawner.schema()#

View the available fields of this group; this is an optional reference, without changing the block.

The result is a list of descriptions. Each name has a field name, type has a type of value, writable has True if the field can be changed.

Object: b.trial_spawner - test spawner#

Variables#

Methods#

b.trial_spawner.schema()#

View the available fields of this group; this is an optional reference, without changing the block.

The result is a list of descriptions. Each name has a field name, type has a type of value, writable has True if the field can be changed.

Object: b.vault - storage-reward#

Variables#

Methods#

b.vault.schema()#

View the available fields of this group; this is an optional reference, without changing the block.

The result is a list of descriptions. Each name has a field name, type has a type of value, writable has True if the field can be changed.

Object: Chunk - chunk#

Chunk - a patch of the world the size 16 × 16 blocks of X/Z to the height of the worldIn the code. chunk A variable with information about one such region, not a list of its blocks. chunk = w.chunks.get(x, z) and read the fields you want:

MiScript / text
import world
w = Dimention.current()
chunk = w.chunks.get(2, -1)
print(chunk.x, chunk.z)       # 2, -1 — номера чанка
print(chunk.is_ticking)       # Обрабатываются ли сейчас его блоки
print(chunk.inhabited_time)   # Накопленное время активности игроков, тики

This chank takes X from 32 to 47 and Z from -16 to -1. The chank number for the block coordinate is calculated using // 16: for example, block [35, 64, -3] chunky [2, -1].

Variables#

Object: w.border - boundary of measurement#

Variables#

Methods#

w.border.transition(size, ticks)#

Gradually change the diameter for game tics.

Arguments: size - new diameter of the border in blocks. ticks How many game tics; usually 20 tics = 1 second.

Returns. None.

Object: w.border.warnings - border warnings#

Variables#

Object: w.chunks - measurement chunks#

Methods#

w.chunks.get(x, z)#

Get information about the chanka by its x/z numbers, not by the coordinates of the block.

Arguments: x, z Entire Chank numbers by X/Z. Use the block coordinates x // 16, z // 16.

The result: an object with information about one chunk. Save it, for example. chunk = w.chunks.get(2, -1), then read. chunk.x, chunk.z, chunk.status, chunk.is_ticking, chunk.inhabited_time, chunk.dataThe fields are described in the "Chunk" section. The call automatically loads the read chunk, but does not keep it loaded after surgery; there is a hold to hold it. w.chunks.hold().

w.chunks.hold(x, z)#

Keep Chunk loaded; return handle with active.

Arguments: x - X coordinate, number. z - coordinate Z, number.

Result: Value for releasing the chunk through release.

w.chunks.is_loaded(x, z)#

Check the loading of the full chunk.

Arguments: x - X coordinate, number. z - coordinate Z, number.

Result: True or False.

w.chunks.loaded()#

Get a list of fully loaded chunks of this dimension.

Result: List of objects with the same fields as w.chunks.get()It can be recycled. for And read the details of each chanka.

w.chunks.loaded_count()#

Find out the number of fully loaded chunks of this dimension.

Result: integer.

w.chunks.release(handle)#

Free your hold.

Arguments: handle The value obtained by the hold.

Returns. None.

Object: w.effects – sounds, particles and signals#

Methods#

w.effects.level_event(id, pos, data=0)#

The numerical effect of Minecraft is at a point.

Arguments: id - Minecraft record ID in the specified directory. pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. data - NBT data.

Returns. None.

w.effects.particles(id, pos, count, options=None, targets=@pl)#

Send particles; complex parameters - NBT.

Arguments: id - Particle ID; pos - coordinates; count - the number of particles. options Additional NBT settings of the selected particle type or None. targets Recipient Players: Names, Player, Selector or List

Result: Number of recipients in result.sent.

w.effects.sound(id, pos, volume=1, pitch=1, targets=@pl)#

Send sound to players in this dimension.

Arguments: id Sound ID, such as "minecraft:block.note_block.pling" pos - coordinates. volume - volume 0-16, pitch - 0-4 pitch. targets Recipient players: name, player, selector or list.

Result: Number of recipients in result.sent.

w.effects.stop_sound(id, targets=@pl)#

Stop the sound from the selected players in this dimension; id=None stops all sounds.

Arguments: id - the ID of the stopped sound; targets Names, Player, selector, or list of recipients.

Result: Number of recipients in result.sent.

w.effects.vibration(id, pos, source=None)#

Send a game signal over the ID.

Arguments: id - Minecraft record ID in the specified directory. pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. source - from what entity the action is considered; entity, Player, selector of one goal or None.

Returns. None.

Object: w.features - natural objects of generation#

Methods#

w.features.place(id, pos)#

Try to place a registered generation facility.

Arguments: id - Minecraft record ID in the specified directory. pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

The result: Success: True on success, otherwise False.

Object: w.persistent - stored measurement values#

The stored data of this particular dimension is None/bool/int/float/str and nested lists. The key is a non-empty string of up to 256 characters, does not begin with ___. Values should be finite numbers; depth to 32, list to 32768 elements, total volume to 1 MiB per measurement. Do not save Player/Block/ItemStack/functions: save the desired ID and normal values.

MiScript / text
visits = w.persistent.get("visits",0)
w.persistent.set("visits",visits+1)

Read list – copy: after editing, call set. w.save() allows you to request saving.

Methods#

w.persistent.get(key, default=None)#

Read the value or the backup.

Arguments: key the name of the retained value. default - what to return, if such a value is not already.

Result: value depending on the selected data.

w.persistent.remove(key)#

Remove the value; return it to whether it existed.

Arguments: key the name of the retained value.

Result: True or False.

w.persistent.set(key, value)#

Write the meaning in the data of the world.

Arguments: key the name of the retained value. value - a new meaning.

Returns. None.

Object: w.pois - places of residents#

Methods#

w.pois.home(entity)#

The house that memorized the entity. If there is a memory, the result contains position and dimension; otherwise, None.

Arguments: entity One living entity: a link from a selector, Player, name or UUID; usually a resident.

Result: position - coordinates, dimension - measurement or None.

w.pois.job(entity)#

A workplace that an entity has memorized. If there is a memory, the result contains position and dimension; otherwise, None.

Arguments: entity One living entity: a link from a selector, Player, name or UUID; usually a resident.

Result: position - coordinates, dimension - measurement or None.

w.pois.query(pos=None, radius=64, type=None, occupancy="any")#

Find points of interest, such as local jobs.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. radius - search radius. type - The right type of ID. occupancy What places to look for: any - any, has_space - free, is_occupied - occupied.

The result: the list is the point of interest of the resident.

w.pois.release(reservation)#

Free up the space previously occupied by this script through reserve.

Arguments: reservation The value obtained by the reserve.

Result: True or False.

w.pois.reserve(pos, owner)#

Reserve space at the point of interest of the resident. This is the place considered by the game for home or work, not an object.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. owner Who occupies a place; a name or one entity.

Result: None, if there is no space; otherwise the value of reservation for the subsequent w.pois.release(reservation)His field active shows if the reservation is valid.

Object: w.raids - Measurement raids#

It's a Minecraft raid, not a forced mob at any point. You need a POI-busy village, authorized raids, and difficulty above peaceful; you don't have to be an observer. Under the wrong conditions, you're wrong.

MiScript / text
r = w.raids.start(player,omen_level=3)
print(r.id,r.omen_level,r.status)

omen_level is the bad omen level 1-5, default 1. This is not the number of waves: the main waves depend on server.difficulty. Initial preparation usually takes 300 ticks (15 seconds at 20 TPS).

Methods#

w.raids.get(id)#

Receive an existing raid by its numerical ID.

Arguments: id - The numerical ID of the raid from r.id.

Result: raid.

w.raids.list()#

Get a list of raids of this dimension.

Result: List - raid.

w.raids.start(player, pos=None, omen_level=1)#

Run/find a raid at the player or pos. bad omen level 1-5. Need village, allowed raids and difficulty above peaceful; otherwise error.

Arguments: player Player: The name, player or selector of a single player. pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. omen_level The level of the bad omen: integer 1-5.

Result: raid.

Object: w.structures - structures and patterns#

Methods#

w.structures.at(pos)#

Structures whose limiting boxes include a dot.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z].

Result: List - information about the found structure.

w.structures.generate(id, pos, rotation="none", mirror="none", seed=None)#

Create a structure according to the rules of Minecraft generation in the selected chunk, this is a generation based on the terrain, not an exact insertion of the finished building.

Arguments: id - Structure ID; pos - Chunk's point of choice. rotation and mirror Only "none" is accepted; use place_template to turn the finished building. seed whole grain generation or None for the grain of the world.

The result: success – success, bounds – boundaries for success.

w.structures.place_template(id, pos, rotation="none", mirror="none", seed=0)#

Place a template with block data, without entities.

Arguments: id - Pattern ID; pos - insertion coordinates. rotation “none,” “clockwise_90,” “clockwise_180,” or “counterclockwise_90.” mirror “None,” “left_right,” or “front_back.” seed - a whole grain of random choice.

The result: Success: True on success, otherwise False.

w.structures.query(region)#

Structures whose limiting boxes cross the area.

Arguments: region - which area to treat; Region(x1,y1,z1,x2,y2,z2).

Result: List - information about the found structure.

w.structures.save_template(region, id)#

Save the area blocks as a template for the world to follow.

Arguments: region - which area to treat; Region(x1,y1,z1,x2,y2,z2). id Structure ID or saved template, such as "minecraft:village_plains".

The result contains a done, a result, an error, and success is verified through result.success.

Object: W.Time - the clock of the selected measurement#

The clocks are chosen by the measurement type and can be shared across multiple dimensions. If the clock is not available, the day_time/set/add reading is an error. dawn/dusk without the clock - False. game_time of the entire server is available as server.game_time.

Variables#

Methods#

w.time.add(ticks)#

Add the number of ticks to the game clock.

Arguments: ticks How many game tics; usually 20 tics = 1 second.

Returns. None.

w.time.set(ticks)#

Set the value of the clock in the game ticks.

Arguments: ticks How many game tics; usually 20 tics = 1 second.

Returns. None.

Object: w.weather - type of weather in dimension#

It's a kind of general weather with a measurement support check. Without weather, reading is clear/0, recording is forbidden. The general weather settings are in server.weather, and each dimension's weather is not affected by this API.

Variables#

Methods#

w.weather.set(kind, duration=12000)#

Set the overall weather and duration with one call.

Arguments: kind - text: clear/rain/thunder. duration Duration in ticks; usually 20 ticks = 1 second.

Returns. None.

Object: Charm - stack.enchantment#

String ID: stack.enchantment["minecraft:sharpness"] = 3. Level 0 removes the spell. Changes the separated stack, it needs to be issued/write back.

Methods#

stack.enchantment.ids()#

I.D. spells of this pile.

Returns the list of lines.

Object: Subject - stack#

A stack is a standalone copy of an item with number, name, charms and components. When you read from a live inventory, you write the change back to the slot; give a copy to each recipient, and the rest falls next to you.

MiScript / text
import world
stack = ItemStack("diamond_sword",1)
stack.name = "Меч"
stack.enchantment["minecraft:sharpness"] = 3
give(player,stack)

Charm level 0 removes the enchantment of the stack. enchantment.ids() lists the stack's charms, registries.enchantments.ids() all registered spells. Some spells are only suitable for certain objects.

Variables#

Additional data — data#

NBT is a set of values with names. For example, you can store together the name of the task, the number of items collected and the list of rewards. NBT()Write the fields through a dot or square brackets:

MiScript / text
import world, commands
quest = NBT()
quest.name = "Собрать камень"
quest.collected = 3
quest.rewards = ["dirt", "apple"]
print(quest.name)             # Собрать камень
print(quest["collected"])     # 3

# Сохранить данные в мире, в командном хранилище Minecraft.
command_storage["miscript:quest"] = quest

# Прочитать их, увеличить счётчик и сохранить изменённую копию.
saved = command_storage["miscript:quest"]
saved.collected = saved.collected + 1
command_storage["miscript:quest"] = saved

The command vault requires operator rights. quest = NBT() Creates data only for the current launch; command_storage It keeps them together with the world.

Fields may contain numbers, rows, lists, and other NBT sets. quest.reward = NBT()then quest.reward.count = 5Embezzlement. None removes the field; reading the missing field causes an error. For a colon name, use brackets: data["minecraft:custom_data"].

NBT is also found in the b.data And the names and values should be Minecraft formats, and the random field doesn't create new game mechanics. b.furnace.cook_timeIt's more convenient to use it. Changes to the block copy are applied through w.setblock(x, y, z, b).

Path search settings - profile#

The end of the path should be no more than 32 blocks, and the parameters are determined when you create NavigationProfile(...); this is a description of the searcher, not a navigation of a living entity.

Variables#

Object: Coordinates - pos#

This is a separate coordinate value. Changing pos.x does not move the player/block. Use pl.teleport(pos) or pl.x/y/z to move the player.

Variables#

Object: Area of blocks - Area#

Two opposite angles, both included. Creation: Region(x1,y1,z1,x2,y2,z2) The order of the angles is arbitrary; the dimensions are limited to 32,768 blocks.

Variables#

Object: Text of the side of the plate - side#

Lines are four fixed line slots: side.lines[0]...side.lines[3] This is not an extensible list; append/pop is not supported. Inside b.sign.front/back, the copy of the plate used by the setblock changes.

Variables#

Library: server#

MiScript / text
import server
print(server.difficulty)

Object: Server - Shared Server#

Variables#

Methods#

server.set_spawn(pos, dim=None, yaw=0, pitch=0)#

Set a common point of rebirth and its measurement.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. dim Measurement ID, such as "nether"; you can transfer Dimention. yaw - a horizontal turn in degrees. pitch - Inclination of the gaze in degrees from -90 to 90.

Returns. None.

Object: Game Rules - server.rules#

Indices are string ID rules: server.rules[id]. The value should be bool/int; an incorrect type/range causes an error. ids() lists the available IDs.

Methods#

server.rules.ids()#

All the IDs of the available rules.

Returns the list of lines.

Object: Weather - server.weather#

General weather of the server: kind=clear/rain/thunder. set(kind,duration) changes the view and duration in one action, with a preliminary check of arguments. support for weather display with a specific measurement checks w.weather.supported.

Variables#

Methods#

server.weather.set(kind, duration=12000)#

Set the overall weather and duration with one call.

Arguments: kind - text: clear/rain/thunder. duration Duration in ticks; usually 20 ticks = 1 second.

Returns. None.

Library: player#

MiScript / text
import player
pl = Player("Veverp")
pl.health = 20
pl.ender_storage[0] = ItemStack("diamond", 3)

Functions#

Player - pl#

The fields listed below can be read and modified unless otherwise indicated.

Health and nutrition

Situation and movement

Regime and status

Experience, renaissance and profile

Player's methods#

Inventory and equipment#

pl.storage - 36 major slots, pl.ender_storage 27 slots of the ender chest. The indexes start from scratch. Reading gives you a copy. ItemStack or None; to use the modified copy, assign it back.

MiScript / text
item = pl.storage[0]
if item != None {
    item.count = 5
    pl.storage[0] = item
}
pl.equipment["head"] = ItemStack("diamond_helmet")

Here. inventory - variable c pl.storage or pl.ender_storage.

Effects, Attributes, and Progress#

MiScript / text
pl.effects["speed"] = Effect("speed", duration=600, level=2)
print(pl.effects["speed"].duration)
pl.effects["speed"] = None
pl.attributes["max_health"] = 40

Messages and interfaces#

Appearances#

MiScript / text
pl.skinset("Notch")
pl.skinset(Skin(texture="minecraft:entity/player/wide/steve", model="slim"))
pl.display_name = "{color=gold}Хранитель{/}"

pl.skinset(descriptor) and pl.set_skin(descriptor) the same methods; it can also be assigned pl.skinThe colon-free line represents the Minecraft profile, the colon line represents the resource ID. For the profile UUID, use the Minecraft profile. Skin(profile="...").

pl.skin returns the NBT description of the current redefinition. pl.reset_skin() The configuration is saved in the world and synchronized with MiScript clients. The profile is uploaded by the client through Minecraft services; the resource must be in vogue or the accepted resource package. my_mod:skins/hero file- assets/my_mod/textures/skins/hero.pngArbitrary HTTP PNG addresses are not accepted here.

The methods of changing the skin return the result with done, status, result.requestedIt confirms the configuration setup on the server, not the end of the client’s texture load.

Administration - players.admin#

UUID techniques work for offline profiles, too, requiring source administrator rights; operator management requires owner rights.

Library: event#

event It allows you to set a rule: “When that happens, do my job.”For example, show a message when you press G. You don't need to check the keyboard in the loop.

First example: key response#

MiScript / text
import event

def pressed(data) {
    if data.key == "g" {
        data.player.message("Ты нажал G!")
    }
}

event.on("key.press", pressed)

How it works:

  1. def pressed(data) It creates our function. It doesn't work as long as it doesn't.
  2. event.on("key.press", pressed) instructs MiScript to call it every time you press the key. pressed spell without ().
  3. The player presses G. MiScript itself calls the function and transmits it to data pressing information.
  4. data.key line "g"eh data.player - the player who pressed, the message is sent to him.

If G is pressed by another player, the function will start again with his data. Run this script once, close the editor and press G while playing.

What is data?#

data The usual name of the variable we selected def pressed(data)You can call her. ctx Or else. MiScript itself transmits an object with information about one event to it. You do not need to create this object manually.

The content depends on the event:

What happened? What can I read?
Keystroke. data.key - Which one? data.player - who pressed.
Player breaks block data.position - coordinates; data.block - block; data.player - who breaks.
The creature is taking damage. data.entity - to whom the damage is inflicted; data.amount - How many.

These are real game objects: data.player.name reads the name, data.player.message("Привет") sends a message, data.entity.health reads the health of a living thing. If the event list has a field marked "or NoneFirst, check that it is not equal. None.

There's no key press. data.blockThe exact list of available fields is given in the event catalog below.

Functions of the library#

A challenge What's it for?
event.on(name, handler) Call your function. handler(data) every time nameFor example, event.on("key.press", pressed)Returns the subscription, you can save it to a variable and disable it.
event.once(name, handler) Call the function only at the first appropriate event, then the subscription is deleted itself.
event.off(subscription) Delete the saved subscription. TrueIf she was still acting, otherwise. False.
event.wait(name, filter=None, timeout=INF) Stop on that line and wait for the event. Returns his data, and as time goes on, None. timeout It's set in ticks. INF It means waiting as long as it takes. The example below.
event.after(ticks, handler) Call once. handler(data) through ticks It brings back a timer that can be canceled.
event.every(ticks, handler) Call in handler(data) every ticks Ticks. Returns the timer. The interval must be positive.
event.cancel(subscription) The same as event.off: delete the subscription or timer.
event.key_down(player, key) Check if the player is holding the key. event.key_down(pl, "g")It's coming back. True/False.
event.mouse_down(player, key) Check the retention of the mouse button: "left" - LCM, "right" - PKM, "middle" - The wheel, too. "button4"…"button8".
event.names() Get a list of embedded event names: lines like "key.press".
event.emit(name, payload=None) Send your event and give it additional data via NBT, an example at the end of the section, returns whether it was canceled.

How to turn off the reaction#

Save the result. event.on It's a variable. subscription The connection between the event and your function. pressed function from the first example:

MiScript / text
subscription = event.on("key.press", pressed)

subscription.enabled = False  # Временно отключить реакцию
subscription.enabled = True   # Включить обратно
subscription.cancel()         # Удалить окончательно

subscription.active shows whether the subscription has been removed; subscription.name It contains the name of the event. subscription.cancel() can write event.off(subscription)You can't turn a remote subscription back on -- create a new one through event.on.

How to Prohibit Action#

Some events have an option with .before — prior to completionYou can call in it. data.cancel()to prohibit the action.

MiScript / text
import event

def protect(data) {
    if data.position.y < 0 {
        data.cancel()
    }
}

event.on("block.break.before", protect)

This script prohibits players from breaking blocks below Y=0. data.position.y The height of the block they are trying to break.

In functions for .before We can't wait wait(), input(), inputchat() or event.wait(): you have to make a decision right away. Normal event functions can wait. If the event happens again while you're waiting, another function call will start.

How to Wait for Events on a Specific Line#

MiScript / text
import event

print("Нажми любую клавишу в течение пяти секунд")
data = event.wait("key.press", timeout=100)

if data != None {
    print("Нажата клавиша:", data.key)
} else {
    print("Время вышло")
}

There is no need for a separate function: the script is waiting on the line with event.wait100 tics, usually 5 seconds, so you can wait for normal events; names with .before That's not the right thing to do.

How to run code over time#

MiScript / text
import event

def remind(data) {
    print("Прошло пять секунд")
}

timer = event.after(100, remind)

Replace it every five seconds. after on every. timer.cancel() stops the timer; timer.enabled = False It's a timer that puts him on hold. data There is general information, for example. data.tickbut no data.player.

Optional subscription settings#

Full recording: event.on(name, handler, filter=None, priority=0, phase=None)Ugh. event.once Same settings.

An example of a filter is to call pressed From the first example, only when pressed by Veverp:

MiScript / text
def only_veverp(data) {
    return data.player.name == "Veverp"
}

event.on("key.press", pressed, filter=only_veverp)

Background on the event#

In addition to the fields from the catalog, you can always read:

Field. Meaning.
data.name Title of the event, for example "key.press".
data.phase "before" A decision can be made prior to action; "after" - Notification. Cancellation checks. cancellable.
data.cancellable Can we call in? data.cancel(); True/False.
data.cancelled Is it called? data.cancel() for this data.
data.tick The game tick number when the event was transmitted to the script.

Coordinates are read as data.position.x, .y, .z. data.dimension - a string measurement ID. data.item and data.block Copies: Changing their fields does not change the world.

The subscription script stays running. The Stop button deletes its subscriptions. When you restart the world, subscriptions and waiting calls are restored. While the script block is uploaded, its timers are on pause, and events do not accumulate for it.

Catalogue of events#

Select a name from the tables and transfer it to event.on or event.waitThe column on the right lists the available data. .before The second one tells you that it's not an action, and the second one tells you that it's an event, and when you try to interact, it doesn't always mean that it's a successful action, but it's specified in the line.

Keyboard and mouse#

Event. Additional fields
key.press, key.release data.player, data.key - pressed/released key. Retention does not repeat press.
mouse.press, mouse.release data.player, data.button - Mouse button.
mouse.scroll data.player, data.delta Wheel scrolling: positive up, negative down.
action.press data.player, data.action — attack (attack) use (use) or pick (block selection) Considers the buttons selected by the player in the control settings.

Keyword names: a…z, 0…9, f1…f24, space, enter, escape, tab, backspace, delete, home, end, page_up, page_down, left, right, up, down, left_shift, right_shift, left_control, right_control, left_alt, right_altFor the rest of us, key_ and a numerical code.

The input transmits the MiScript set by the player. Printing in the chat, menu and editor does not cause these events. When you open a window or lose focus, the retention states are reset. The key notification can no longer be canceled on the server; cancel the game action itself through its event. before.

Players.#

Event. Fields other than general
player.join, player.leave, player.respawn data.player, data.entity - Player? data.position, data.dimension.
player.dimension data.player, data.entity, data.position, data.dimension, data.from - ID of the previous dimension, data.to - new.
player.chat.before, player.chat data.player, data.entity, data.position, data.dimension, data.text - a player's message. .before You can't send it out.

Blocks and objects#

Event. When to call and what fields are available
block.break.before, block.break Before the player is destroyed and after the successful destruction. data.player, data.position, data.dimension, data.block Both versions transmit the full picture of the previous one. data.old_block and data.new_block - before and after the destruction.
block.place.before, block.place Installation of the unit by entity: cancelled installation and confirmed block. data.entity, data.player either None, data.position, data.dimension, data.block.
block.interact.before, block.interact The player pressed the PCM on the block; the second option tells you that the attempt is not prohibited. data.player, data.position, data.dimension, data.block, data.hand — mainhand/offhandThe notification does not guarantee that the block had an action.
block.bonemeal.before, block.bonemeal The player tries to use bone meal; the second option tells you that the attempt is not prohibited. data.player either None, data.position, data.dimension, data.block, data.itemThe growth of the plant is not guaranteed.
block.tree_grow.before Before attempting to generate a tree, it can be prohibited. data.position, data.dimension, data.block.
item.use.before, item.use The beginning of long-term use of the subject: food, onions and similar items. data.entity, data.player either None, data.position, data.dimension, data.itemNot every short right click starts to use.
item.consume Use of the item is complete. data.entity, data.player either None, data.position, data.dimension, data.item - the stack used.
item.pickup.before, item.pickup Before and after the player's selection. data.player, data.entity, data.position, data.dimension, data.item.
item.drop The player threw the object away and throwing it away was not prohibited. data.player, data.entity, data.position, data.dimension, data.item.
item.break The item broke when used. data.player, data.entity, data.position, data.dimension, data.item - The old pile, data.slot - equipment slot or None.
item.craft, item.smelt The player took the result of crafting / melting. data.player, data.entity, data.position, data.dimension, data.item - the result.

Creatures and the world#

Event. When to call and what fields are available
entity.spawn.before, entity.spawn A being or other object appears in the world or is downloaded from a save. data.entity, data.player either None, data.position, data.dimension, data.loaded_from_disk - if it's downloaded from the disk.
entity.interact.before, entity.interact The player pressed the PCM essentially; the second option reports that the attempt is not prohibited. data.entity - Target, data.player - an active player, data.position, data.dimension.
entity.attack.before, entity.attack The player tries to attack: data.player - Who, data.entity - Who, data.position, data.dimensionThe second option states that the attack is not prohibited; hit and damage are not guaranteed.
entity.damage.before Before treating damage to a living creature. data.entity, data.player either None, data.position, data.dimension, data.attacker either None, data.amount Damage prior to final treatment.
entity.damage Minecraft took a hit. data.entity, data.player either None, data.position, data.dimension, data.attacker either None, data.amount - initial damage, data.health_lost How much health is lost. Absorption can leave data.health_lost zero.
entity.death.before, entity.death The creature dies: .before It allows you to save him, the second option reports death. data.entity, data.player either None, data.position, data.dimension, data.attacker either NoneCancellation leaves a minimum of 1 HP if the handler has not regained health himself.
entity.tame.before, entity.tame Attempting to tame an animal; the second option states that it is not prohibited. data.entity - animal, data.player - tame, data.position, data.dimension.
entity.breed.before, entity.breed Before birth and after the addition of the baby. data.entity, data.partner, data.child, data.player either None, data.position, data.dimension.
entity.projectile_impact.before, entity.projectile_impact Collision of projectile: you can prohibit the handling of the hit; then the notification of the received hit. data.entity - projectile, data.target - the substance or None, data.block_position - block or None, data.position - point of impact, data.dimension.
world.explosion.before Before the explosion. data.position, data.dimension; can be canceled.
world.explosion Targets have been identified. data.position, data.dimension, data.blocks - coordinate list, data.entities It's a list of targets, not a report of blocks that have been completely destroyed.
world.tick The end of the server tick, separately for each dimension. data.dimension, data.time - the game time of this dimension in ticks.
inventory.open The menu's open. data.player, data.entity, data.position, data.dimension, data.container_id - the number of the open menu, data.menu_type - An ID of his kind.
inventory.close The menu's closed. data.player, data.entity, data.position, data.dimension, data.container_id - Closed menu number.

Additional developments#

The table lists new events in this version, and each row has a complete list of fields. data.entity - essence, data.player player or None, data.position - coordinates, data.dimension - Measurement ID.

Couples with .before It is possible to prohibit the action through data.cancel()The second name tells us that the attempt was not forbidden; it does not always mean a change of condition — for example, treatment in full health will not add anything. For pistons and plant growth, the usual event reports an action already performed.

Event. When you're called Available data
entity.heal.before Can be canceled: treatment of the creature; amount - requested restoration of health. data.entity, data.player, data.position, data.dimension, data.amount
entity.heal Not prohibited: treatment of the creature; amount - requested restoration of health. data.entity, data.player, data.position, data.dimension, data.amount
entity.fall.before Can be canceled: landing; distance - height of fall, multiplier - damage multiplier. data.entity, data.player, data.position, data.dimension, data.distance, data.multiplier
entity.fall Not prohibited: landing; distance - drop height, multiplier - damage multiplier. data.entity, data.player, data.position, data.dimension, data.distance, data.multiplier
entity.jump The creature jumped. data.entity, data.player, data.position, data.dimension
entity.equipment The equipment has changed: slot - the name of the slot, old_item and new_item - copies of the stacks or None. data.entity, data.player, data.position, data.dimension, data.slot, data.old_item, data.new_item
entity.target.before You can cancel: change of purpose; target - proposed goal or None. data.entity, data.player, data.position, data.dimension, data.target
entity.target Not prohibited: change of purpose; target - proposed goal or None. data.entity, data.player, data.position, data.dimension, data.target
entity.effect_remove.before Can be reversed: deletion of effect; effect - copy of effect or None. data.entity, data.player, data.position, data.dimension, data.effect
entity.effect_remove Not prohibited: removal of the effect; effect - copy of the effect or None. data.entity, data.player, data.position, data.dimension, data.effect
entity.effect_add An effect is added or updated; effect is new, old_effect is old or None. data.entity, data.player, data.position, data.dimension, data.effect, data.old_effect
entity.effect_expire The effect is gone; the effect is a copy. data.entity, data.player, data.position, data.dimension, data.effect
entity.drops.before Can be canceled: prey loss; items - copies of falling stacks. data.entity, data.player, data.position, data.dimension, data.items
entity.drops Not prohibited: prey fallout; items - copies of falling stacks. data.entity, data.player, data.position, data.dimension, data.items
entity.xp_drop.before Can be canceled: loss of experience; amount - quantity. data.entity, data.player, data.position, data.dimension, data.amount
entity.xp_drop Not forbidden: loss of experience; amount - quantity. data.entity, data.player, data.position, data.dimension, data.amount
entity.drown.before Can be cancelled: drowning treatment; amount - proposed damage. data.entity, data.player, data.position, data.dimension, data.amount
entity.drown Not prohibited: Drowning treatment; amount - proposed damage. data.entity, data.player, data.position, data.dimension, data.amount
entity.breathe Calculation of breathing: consume - air flow, refill - replenishment. data.entity, data.player, data.position, data.dimension, data.consume, data.refill
item.use_tick.before You can cancel: tick use of the item; item - copy, duration - remaining tics. data.entity, data.player, data.position, data.dimension, data.item, data.duration
item.use_tick Not prohibited: tick use of the item; item - copy, duration - remaining tics. data.entity, data.player, data.position, data.dimension, data.item, data.duration
item.use_stop.before You can cancel: interruption of the use of the object; item - copy, duration - remaining tics. data.entity, data.player, data.position, data.dimension, data.item, data.duration
item.use_stop Not prohibited: interruption of the use of the object; item - copy, duration - remaining tics. data.entity, data.player, data.position, data.dimension, data.item, data.duration
entity.dimension.before Can be canceled: transition to another dimension; to - destination ID. data.entity, data.player, data.position, data.dimension, data.to
entity.lightning.before You can cancel: lightning strike; lightning is its essence. data.entity, data.player, data.position, data.dimension, data.lightning
entity.lightning Not forbidden: lightning strikes; lightning is its essence. data.entity, data.player, data.position, data.dimension, data.lightning
item.expire.before Can be canceled: the disappearance of an object over the lifespan; item - a copy of a pile. data.entity, data.player, data.position, data.dimension, data.item
item.expire Not prohibited: the disappearance of an object by the lifetime; item - a copy of a pile. data.entity, data.player, data.position, data.dimension, data.item
entity.convert.before Can be canceled: transformation of the mob; to_type - ID of a new kind. data.entity, data.player, data.position, data.dimension, data.to_type
entity.convert The mob has changed; the outcome is a new entity. data.entity, data.player, data.position, data.dimension, data.outcome
player.xp.before Can be reversed: change in experience points; amount - change, can be negative. data.entity, data.player, data.position, data.dimension, data.amount
player.xp Not forbidden: change of experience points; amount - change, can be negative. data.entity, data.player, data.position, data.dimension, data.amount
player.level.before Can be canceled: level change; amount - the number of added / removed levels. data.entity, data.player, data.position, data.dimension, data.amount
player.level Not prohibited: level change; amount is the number of levels added/removed. data.entity, data.player, data.position, data.dimension, data.amount
player.xp_pickup.before Can be canceled: selection of experience; orb - sphere. data.entity, data.player, data.position, data.dimension, data.orb
player.xp_pickup Not forbidden: selection of experience; orb - sphere. data.entity, data.player, data.position, data.dimension, data.orb
player.gamemode.before You can cancel: Mode change; old_mode and new_mode are string names. data.entity, data.player, data.position, data.dimension, data.old_mode, data.new_mode
player.gamemode Not prohibited: Mode change; old_mode and new_mode are string names. data.entity, data.player, data.position, data.dimension, data.old_mode, data.new_mode
player.wake Player wakes up. data.entity, data.player, data.position, data.dimension
player.advancement The player has accomplished the achievement; id is a string ID. data.entity, data.player, data.position, data.dimension, data.id
player.trade The player made a deal. data.entity, data.player, data.position, data.dimension
item.brew_take The player took the potion; item is a copy of the stack. data.entity, data.player, data.position, data.dimension, data.item
item.anvil The player took the result of the anvil; item - a copy of the result. data.entity, data.player, data.position, data.dimension, data.item
block.trample.before You can cancel: trampling the bed; entity - who came, distance - the height of the fall. data.position, data.dimension, data.block, data.entity, data.distance
block.trample Not forbidden: trampling the bed; entity - who came, distance - the height of the fall. data.position, data.dimension, data.block, data.entity, data.distance
block.portal.before Can be canceled: the creation of the portal of the Lower world. data.position, data.dimension, data.block
block.fluid_place.before You can cancel: the liquid replaces the block; the source - the coordinates of the liquid, new_id - the ID of the new block. data.position, data.dimension, data.block, data.source, data.new_id
block.fluid_place Not prohibited: liquid replaces the block; source - coordinates of the liquid, new_id - ID of the new block. data.position, data.dimension, data.block, data.source, data.new_id
block.neighbors.before Can be canceled: notification of neighboring blocks. Cancellation prohibits sending this notification. data.position, data.dimension, data.block
block.note.before You can cancel: play the notation block; note - note number 0-24. data.position, data.dimension, data.block, data.note
block.note Not prohibited: play a note block; note - note number 0-24. data.position, data.dimension, data.block, data.note
block.note_change.before You can cancel: change the note of the note block; note - a new note number. data.position, data.dimension, data.block, data.note
block.note_change Not prohibited: change the note of the note block; note - a new note number. data.position, data.dimension, data.block, data.note
block.piston.before You can cancel: the movement of the piston; direction - side, extending - extension or retraction. data.position, data.dimension, data.block, data.direction, data.extending
block.piston The piston moved the blocks; direction - side, extending - extension. data.position, data.dimension, data.block, data.direction, data.extending
block.crop_grow The plant has grown; old_id is the old block ID. data.position, data.dimension, data.block, data.old_id
block.crop_grow.before The plant is trying to grow; you can stop growing. data.position, data.dimension, data.block
entity.mount.before You can cancel the boarding / exit of transport; vehicle - transport. data.entity, data.player, data.position, data.dimension, data.vehicle
entity.mount Landing/exiting from transport is not prohibited; vehicle is transport. data.entity, data.player, data.position, data.dimension, data.vehicle
entity.dismount.before You can cancel the boarding / exit of transport; vehicle - transport. data.entity, data.player, data.position, data.dimension, data.vehicle
entity.dismount Landing/exiting from transport is not prohibited; vehicle is transport. data.entity, data.player, data.position, data.dimension, data.vehicle
entity.teleport.before You can cancel the teleportation of a team, accidental movement, pearls or chorus; destination - where. data.entity, data.player, data.position, data.dimension, data.destination
entity.teleport Teleportation of this type is not prohibited; destination is where. data.entity, data.player, data.position, data.dimension, data.destination
world.load Measurement loading. data.dimension
world.unload Measurement unloading. data.dimension
world.save The world retains a dimension. data.dimension
chunk.load Chunk is loaded/unloaded. x/z is the chank number, not the block coordinates; generated is whether it is created for the first time. data.dimension, data.x, data.z, data.generated
chunk.unload Chunk is unloaded; x/z is the chank numbers. data.dimension, data.x, data.z
entity.leave The entity is removed or unloaded; the reason is the cause of the deletion or unknown. data.entity, data.player, data.position, data.dimension, data.reason

Download events are only available to existing subscriptions. chunk.load informs about the loading of the chunk; the handler function is performed later when the script gets its move. item.use_tick and entity.breathe They can come often – use them only when necessary.

Inventory, natural changes and mechanisms#

For blocks data.position - coordinates, data.dimension - Measurement ID; data.block and data.old_block - the old picture. data.new_block in a normal event, a new photograph; in .before A state change is only a proposed state without new container data. data.changed In a normal event, it tells you whether the block or its stored data has changed.

At the buttons, levers and doors .before The processing of the interaction itself, including the sound, can continue. data.cancel(): the object already extracted for insertion is returned to the sender.

Events marked tick-tick They detect a change on the next server tick, and the few changes that follow that tick are combined into one, and the first snapshot after the subscription is activated is the original one, and these events cannot be reversed.

Event. Action and data Fields
block.change.before You can cancel. You change the state of the block, including changes from commands and scripts. data.dimension, data.position, data.block, data.old_block, data.new_block
block.change The state of the block changes, including changes from commands and scripts. data.dimension, data.position, data.block, data.old_block, data.new_block, data.changed
block.freeze.before You can cancel it. You can replace the water with regular or frozen ice, and it works with this kind of replacement from the script. data.dimension, data.position, data.block, data.old_block, data.new_block
block.freeze The water is replaced by regular or frozen ice, and it works with this script replacement. data.dimension, data.position, data.block, data.old_block, data.new_block, data.changed
block.snow_form.before You can cancel it. You get a layer of snow, or you get more layers. data.dimension, data.position, data.block, data.old_block, data.new_block
block.snow_form A layer of snow appears or the number of layers increases. data.dimension, data.position, data.block, data.old_block, data.new_block, data.changed
block.fire_ignite.before You can cancel. There's a fire in the block. data.dimension, data.position, data.block, data.old_block, data.new_block
block.fire_ignite There's a fire in the block. data.dimension, data.position, data.block, data.old_block, data.new_block, data.changed
block.fire_spread.before You can cancel it. The fire comes in the course of the game tick that spreads the fire. data.dimension, data.position, data.block, data.old_block, data.new_block
block.fire_spread The fire appears during the game tick spreading fire. data.dimension, data.position, data.block, data.old_block, data.new_block, data.changed
block.button.before You can cancel. You change the state of the button press. The value is new_block.states.powered. data.dimension, data.position, data.block, data.old_block, data.new_block
block.button Changes the button state. Value is new_block.states.powered. data.dimension, data.position, data.block, data.old_block, data.new_block, data.changed
block.lever.before You can cancel. You switch the lever. The value is new_block.states.powered. data.dimension, data.position, data.block, data.old_block, data.new_block
block.lever The lever switches. The value is new_block.states.powered. data.dimension, data.position, data.block, data.old_block, data.new_block, data.changed
block.door.before You can cancel. Half of the door opens/closes. It means new_block.states.open. data.dimension, data.position, data.block, data.old_block, data.new_block
block.door Half the door opens/closes. Meaning new_block.states.open. data.dimension, data.position, data.block, data.old_block, data.new_block, data.changed
block.melt.before You can cancel. The game melts ice or snow. data.dimension, data.position, data.block, data.old_block
block.melt The game melts ice or snow. data.dimension, data.position, data.block, data.old_block, data.new_block, data.changed
block.leaf_decay.before You can cancel. The leaves try to fall. The usual event is after the actual fall. data.dimension, data.position, data.block, data.old_block
block.leaf_decay The foliage tries to fall. The usual event is after the actual fall. data.dimension, data.position, data.block, data.old_block, data.new_block, data.changed
block.burn.before You can cancel. The game checks the combustion of the combustible block. The usual event is only if the block has really changed; face is the side of the impact. data.dimension, data.position, data.block, data.old_block, data.face
block.burn The game checks the combustion of the combustible block. The usual event is only if the block has really changed; face is the side of the impact. data.dimension, data.position, data.block, data.old_block, data.new_block, data.changed, data.face
block.fluid_flow.before It can be reversed. The fluid tries to flow into the cell. The position is the destination cell, the source is the next cell on the flow side, the direction is the direction. data.dimension, data.position, data.block, data.old_block, data.source, data.direction
block.fluid_flow The liquid tries to flow into the cell. position is the destination cell, source is the neighboring cell from the flow side, direction is the direction. data.dimension, data.position, data.block, data.old_block, data.new_block, data.changed, data.source, data.direction
block.fall.before We can cancel. The gravitational block starts to fall when it's scheduled to upgrade. data.dimension, data.position, data.block, data.old_block
block.fall Gravitational block begins to fall on its planned update. data.dimension, data.position, data.block, data.old_block, data.new_block, data.changed
block.land.before Can be reversed. The falling entity sets the block when it lands. The entity is the falling block. When it forbids the installation, the game handles the unsuccessful landing according to its own rules. data.dimension, data.position, data.block, data.old_block, data.new_block, data.entity
block.land The falling entity establishes the block when it lands. The entity is the falling block. When it is not installed, the game handles the unsuccessful landing according to its own rules. data.dimension, data.position, data.block, data.old_block, data.new_block, data.changed, data.entity
block.dispense.before Can be cancelled. The distributor processes the activation. changed reports a change in the status/data of the block; creation of the item is not guaranteed. data.dimension, data.position, data.block, data.old_block
block.dispense The Distributor handles activation. changed reports a change in the status/data of the block; creation of the item is not guaranteed. data.dimension, data.position, data.block, data.old_block, data.new_block, data.changed
block.dropper.before Can be reversed. The issuer processes the activation. changed reports a change in the state/data of the block. data.dimension, data.position, data.block, data.old_block
block.dropper The emitter processes the activation. changed reports a change in the state/data of the block. data.dimension, data.position, data.block, data.old_block, data.new_block, data.changed
block.crafter.before Crafter handles activation. changed reports state/data change; there is no guarantee of a suitable prescription. data.dimension, data.position, data.block, data.old_block
block.crafter Crafter processes activation. changed reports a change in state/data; there is no guarantee of a suitable recipe. data.dimension, data.position, data.block, data.old_block, data.new_block, data.changed
block.vibration.before Can be reversed. The scalk sensor is activated by vibration. entity is source or None; power is signal strength, frequency is frequency. data.dimension, data.position, data.block, data.old_block, data.entity, data.power, data.frequency
block.vibration The scalk sensor is activated by vibration. entity is source or None; power is signal strength, frequency is frequency. data.dimension, data.position, data.block, data.old_block, data.new_block, data.changed, data.entity, data.power, data.frequency
inventory.click.before Click on the open menu. slot is the menu index, container_id is the menu number, action is the action type, button is the Minecraft button/action code. item is the copy of the pile before the click or None. data.player, data.entity, data.position, data.dimension, data.slot, data.button, data.action, data.container_id, data.item
inventory.click Click on the open menu is processed. slot - index in the menu, container_id - menu number, action - action type, button - Minecraft button/action code. item - a copy of the pile before the click or None. data.player, data.entity, data.position, data.dimension, data.slot, data.button, data.action, data.container_id, data.item
inventory.transfer.before Can be canceled. Carrying items with a funnel or inserting a thrower into a vault. item is a copy of the stack, count is a requested number to before and transferred to a normal event. source/destination is the coordinates of either None; source_entity/destination_entity is either entity or None; direction is the side of interaction with the storage or None. data.dimension, data.source, data.destination, data.source_entity, data.destination_entity, data.item, data.count, data.direction
inventory.transfer The transfer of objects by funnel or insertion by the thrower into the storage. item is a copy of the pile, count is the requested number to before and transferred in a normal event. source/destination is the coordinates of either None; source_entity/destination_entity is either entity or None; direction is the side of interaction with the storage or None. data.dimension, data.source, data.destination, data.source_entity, data.destination_entity, data.item, data.count, data.direction
inventory.slot Tick-to-tick. The main slot of the player has changed: slot is 0-35, as in pl.storage. old_item/new_item is the old and new copy of the pile or None. data.player, data.entity, data.position, data.dimension, data.slot, data.container_id, data.old_item, data.new_item
inventory.menu_slot Tick-to-tick. The open menu slot has changed: slot is an index in this menu, container_id is its number. old_item/new_item is a copy of the stacks or None. The menu indices are different from pl.storage. data.player, data.entity, data.position, data.dimension, data.slot, data.container_id, data.old_item, data.new_item
player.food Tick-to-tick. Old_value/value is the old and new number. data.player, data.entity, data.position, data.dimension, data.old_value, data.value
player.saturation Tick-to-tick. The saturation has changed. old_value/value is the old and new number. data.player, data.entity, data.position, data.dimension, data.old_value, data.value
player.exhaustion Tick-to-tick. Changed power consumption. old_value/value is the old and new number. data.player, data.entity, data.position, data.dimension, data.old_value, data.value
world.weather Tick-to-tick. Old_weather/weather - clear, rain or thunder; dimension - measurement ID. data.dimension, data.old_weather, data.weather
world.day Tick-to-tick. The value of w.time.is_day has become True. time - reading the measurement clock; dimension - ID. Gaming lighting is taken into account. data.dimension, data.time
world.night Tick-to-tick. The value of w.time.is_day became False. time - the indication of the measuring clock; dimension - ID. data.dimension, data.time
world.time_change Tick-to-tick. Measurement clocks are changed by leap. old_time/time - old and new tics, dimension - ID. A normal move on one tick does not cause an event. data.dimension, data.time, data.old_time

Slots are scanned only if there are subscriptions. Slots and observed weather are re-created after the world is loaded; changes during unsubscription do not accumulate.

Change the outcome of the event#

For example, any treatment restores exactly two health conditions:

MiScript / text
import event
def heal(data) {
    data.result.amount = 2
}
event.on("entity.heal.before", heal)

data.result Only the events listed below have edits, which apply after the processors. .before; data.cancel() It prohibits the action itself. result After the return from the processor can no longer be changed.

Event. Fields result
entity.heal.before amount
entity.damage.before amount
entity.xp_drop.before amount
player.xp.before amount
player.level.before amount
entity.fall.before distance, multiplier
entity.knockback.before strength, x, z
item.fish.before items, rod_damage
entity.drops.before items
item.anvil_prepare.before item, cost, material_cost
block.harvest.before allowed
block.break_speed.before speed
block.bucket_use.before item
item.enchant_level.before level

Numbers must be finite. Treatment/damage - 0.1,000,000; experience with the mob - 0.2 147 483 647, change experience/level player - whole in the range -2 147 483 648..2 147 483 647. For the fall distance - 0.30 000 000, multiplier - 0.1000; force drop - 0.1000, x/z - from -30 000 000 to 30 000 000. Breakdown rate - 0.1 000 000 000.

items - a list of up to 256 stacks of objects. item - the result, cost - price levels (0..2 147 483 647), material_cost - material consumption (0.64). rod_damage - wear of the fishing rod (0.1 000 000). result.item The bucket specifies the item to be returned instead of normal use. result.level The enchanting table is 0..32767.

Additional developments#

The table shows the event fields; general name, phase, tick, cancellable, cancelled described above. screen The header of the screen, not its software ID.

Client notifications require MiScript from the player and cannot be cancelled on the server. data.player - sender, data.client_reported The camera, sound, particles, hints and rendering transmit no more than one notification of each kind per client tick. These are messages of customer status, not proof of game action.

Once-in-tick events compare the state between server tics: the first snapshot after a subscription serves as the initial one; changes within a single tick can combine.

Event. What happened? Data data
entity.knockback.before Can be reversed: Rejection; strength - force, x/z - direction. entity, player, dimension, position, strength, x, z, result
entity.knockback Rejection, strength, force, x/z, direction. entity, player, dimension, position, strength, x, z, result
entity.totem.before Use of the totem of immortality; item - totem, hand - hand. entity, player, dimension, position, item, hand, attacker
entity.totem Use of the totem of immortality; item - totem, hand - hand. entity, player, dimension, position, item, hand, attacker
entity.mob_grief.before Requesting permission from Mobu to change the world. cancel() prohibits. entity, player, dimension, position
entity.spawn_position.before Checking the location of the mob. reason - the reason for the appearance. entity, player, dimension, position, reason
entity.despawn.before Checking the disappearance of the mob. cancel() leaves the mob. entity, player, dimension, position
entity.spawn_finalize.before Preparation of a new mob. cancel() prohibits the appearance. entity, player, dimension, position, reason
player.command.before Attempt to execute a command, including the console and command blocks. command - full text; player can be None. entity, player, dimension, position, command
player.clone A new player object is created after death/return. original_uuid is the former UUID, death is due to death. entity, player, dimension, position, original_uuid, death
player.advancement_progress Achievement criterion is issued/withdrawed. id - achievement ID, criterion - criterion, granted - issued, complete - all achievement is completed. entity, player, dimension, position, id, criterion, granted, complete
player.spawnpoint.before Attempting to change the player's rebirth point. entity, player, dimension, position
item.anvil_prepare.before Calculation of the anvil result. left/right is input, text is a new name. You can replace the result with the result. entity, player, dimension, position, left, right, text, result
block.break_speed.before Breakdown speed: speed, result.speed allows you to change it. You can cancel it. entity, player, dimension, position, block, speed, result
block.harvest.before Check the possibility of obtaining block mining. result.allowed = True/False changes the resolution; cancel() prohibits. entity, player, dimension, position, block, result
block.bucket_use.before Bucket use. item is a bucket, position is a selected block or None. You can cancel or set result.item. entity, player, dimension, position, item, result
player.sleep.before You can cancel: Attempting to go to bed. The usual event is when the player actually fell asleep. entity, player, dimension, position
player.sleep Trying to go to bed is a common occurrence when the player has actually fallen asleep. entity, player, dimension, position
item.fish.before Can be canceled: Catch: items - list of items, rod_damage - wear fishing rod, hook - floats. entity, player, dimension, position, items, rod_damage, hook, result
item.fish Catch: items - list of items, rod_damage - wear fishing rod, hook - floats. entity, player, dimension, position, items, rod_damage, hook, result
item.enchant_level.before Calculation of the price of the cell of the enchanting table: row - cell 0..2, power - strength of bookshelves, item - subject. result.level changes the price; cancel() sets 0. dimension, position, block, row, power, item, result
world.game_event.before Can be canceled: Game signal for listeners of vibrations. id - ID signal, entity - source or None. dimension, position, id, entity
world.game_event Game signal for listeners of vibrations. id - ID signal, entity - source or None. dimension, position, id, entity
chunk.save Conservation of Chanca data. x/z is the Chanca number. dimension, x, z
chunk.generate For the first time, a new generated chank has been downloaded. x/z is the chank number. dimension, x, z
server.started The server is running; already restored file scripts are being received.
server.stopping The server stops. The handler runs immediately before the scripts are saved; waiting is forbidden.
world.tags_reload Updated server tags.
world.datapack_reload The reboot of the data packs was successfully completed.
server.tick.start The server's game tick begins. The handler receives a notification when the script is executed next.
server.tick.end The end of the server's game tick. The handler receives a notification when the script is executed next.
world.tick.start The beginning of the game tick measurement. The handler receives a notification at the nearest execution of the script. dimension
world.tick.end The end of the game tick measurement. The handler receives a notification when the script is executed next. dimension
entity.tick.start The beginning of the entity's game tick. The handler receives a notification when the script is executed next. entity, player, dimension, position
entity.tick.end End of the entity's game tick. The handler receives a notification when the script is executed next. entity, player, dimension, position
player.tick.start The player's tick begins. The handler receives a notification when the script is executed next. entity, player, dimension, position
player.tick.end The end of the player's game tick. The handler receives a notification when the script is executed next. entity, player, dimension, position
block.random_tick.before Can be cancelled: Random block tick. dimension, position, block, old_block, new_block, changed
block.random_tick Random block tic. dimension, position, block, old_block, new_block, changed
block.scheduled_tick.before Can be cancelled: Planned block tick. dimension, position, block, old_block, new_block, changed
block.scheduled_tick Planned block tick. dimension, position, block, old_block, new_block, changed
block.bell.before Can be cancelled: The bell rings; the usual event is after a successful bell. dimension, position, block, old_block, new_block, changed
block.bell The bell rings; the usual event is after a successful bell rings. dimension, position, block, old_block, new_block, changed
block.brew.before Can be canceled: Completion of potions. dimension, position, block, old_block, new_block, changed
block.brew Completion of potions. dimension, position, block, old_block, new_block, changed
block.cook.before Can be canceled: Obtaining the finished item by oven/smoking/melting. dimension, position, block, old_block, new_block, changed
block.cook Obtaining the finished object by oven / smoker / melter. dimension, position, block, old_block, new_block, changed
block.entity_tick.before Can be canceled: Tick of the block mechanism, such as a furnace or funnel. dimension, position, block, old_block, new_block, changed
block.entity_tick The tic of the block mechanism, such as a furnace or funnel. dimension, position, block, old_block, new_block, changed
block.break_start.before Can be cancelled: The player has begun to break the block. dimension, position, block, player, face
block.break_start The player started breaking the block. dimension, position, block, player, face
block.break_stop.before Can be cancelled: The player has sent a request to complete the break; this is not yet confirmation of the destruction. dimension, position, block, player, face
block.break_stop The player sent a request to complete the break; this is not yet confirmation of the destruction. dimension, position, block, player, face
block.break_abort.before Can be cancelled: The player interrupted the break. dimension, position, block, player, face
block.break_abort The player interrupted the break. dimension, position, block, player, face
block.data A block is a current copy of its data; a separate event is not guaranteed for each field change. dimension, position, block
player.stat The statistics counter has changed. id is the name of the counter in Minecraft format, old / new is the value. entity, player, dimension, position, id, old, new
player.recipe_unlock Recipes are open. ids is a list of string IDs for only really changed recipes. entity, player, dimension, position, ids
player.recipe_lock Recipes withdrawn. ids - a list of string IDs only really changed recipes. entity, player, dimension, position, ids
entity.grow.before You can cancel: The baby becomes an adult. entity, player, dimension, position
entity.grow The baby is becoming an adult. entity, player, dimension, position
entity.projectile_launch.before Can be canceled: Set the initial projectile speed through the shoot; cancellation leaves the projectile without this launch. entity, player, dimension, position, power, spread
entity.projectile_launch The initial velocity of the projectile is set through the shoot; cancellation leaves the projectile without this launch. entity, player, dimension, position, power, spread
entity.leash.before Can be reversed: The entity is tied with a leash. entity, player, dimension, position, holder
entity.leash The entity is tied with a leash. entity, player, dimension, position, holder
entity.unleash.before Can be canceled: The essence untied. entity, player, dimension, position, holder
entity.unleash The entity is untied. entity, player, dimension, position, holder
entity.restock.before Can be canceled: Residents replenish trade offers. entity, player, dimension, position
entity.restock Residents are replenishing trade offers. entity, player, dimension, position
item.cooldown_start Recharging of group items began. id - group ID, duration - tics; at the end of 0. entity, player, dimension, position, id, duration
item.cooldown_end Ended or removed recharging group. id - ID group, duration - tics; at the end of 0. entity, player, dimension, position, id, duration
block.bucket_empty.before Can be canceled: The bucket tries to pour the contents. The usual event is after a successful action. dimension, position, block, entity, player, new_block
block.bucket_empty The bucket tries to pour out the contents. The usual event is after a successful action. dimension, position, block, entity, player, new_block
block.fire_extinguish.before Can be canceled: Fire is replaced by another block, including attenuation. Works with such a change from the command / script; cancellation prohibits recording of the state. dimension, position, block, old_block, new_block, changed
block.fire_extinguish The fire is replaced by another block, including attenuation, and works when such a change from the command / script; cancellation prohibits the recording of the state. dimension, position, block, old_block, new_block, changed
block.grass_spread.before Can be reversed: An herbal block, mycelium, or moss appears. Works when this is replaced from the command/script; cancellation prohibits recording the condition. dimension, position, block, old_block, new_block, changed
block.grass_spread You get an herbal block, a mycelium, or a moss, and it works when you change it from the command/script; cancellation prohibits recording the condition. dimension, position, block, old_block, new_block, changed
block.vine_spread.before Can be cancelled: A vine/liana block appears, and it works with such a change from the command/script; cancellation prohibits the recording of the state. dimension, position, block, old_block, new_block, changed
block.vine_spread A vine/liana block appears, and it works with this change from the command/script; cancellation prohibits recording the state. dimension, position, block, old_block, new_block, changed
block.sculk_spread.before Can be cancelled: A block of the roller family appears. It works with such a change from the command/script; cancellation prohibits the recording of the state. dimension, position, block, old_block, new_block, changed
block.sculk_spread A block of the roller family appears. It also works when this is replaced from the command/script; cancellation prohibits the recording of the state. dimension, position, block, old_block, new_block, changed
block.fluid_mix.before Can be reversed: The liquid is replaced by stone, cobblestone, obsidian or basalt. Works with such a change from the command / script; cancellation prohibits the recording of the state. dimension, position, block, old_block, new_block, changed
block.fluid_mix The liquid is replaced by stone, cobblestone, obsidian or basalt, and works when this is replaced from the command/script; cancellation prohibits the recording of the state. dimension, position, block, old_block, new_block, changed
block.till.before You can cancel: The block turns into a bed. It also works with this change from the command/script; cancellation prohibits recording the state. dimension, position, block, old_block, new_block, changed
block.till The block turns into a bed. It also works with this change from the command/script; cancellation prohibits the recording of the state. dimension, position, block, old_block, new_block, changed
block.path.before You can cancel: The block turns into a path. It also works with this change from the command/script; cancellation prohibits the recording of the state. dimension, position, block, old_block, new_block, changed
block.path The block turns into a path. It also works with this change from the command/script; cancellation prohibits the recording of the state. dimension, position, block, old_block, new_block, changed
block.strip.before You can cancel: The block is replaced with its clothed version. It works with such a change from the command / script; cancellation prohibits the recording of the state. dimension, position, block, old_block, new_block, changed
block.strip The block is replaced with its clothed version, and it works with such a change from the command/script; cancellation prohibits the recording of the state. dimension, position, block, old_block, new_block, changed
block.wax.before You can cancel: Waxed coating is added. Works with this command/script replacement; cancellation prohibits recording of the state. dimension, position, block, old_block, new_block, changed
block.wax Waxed coating is added. It works when you replace it from the command/script; cancellation prohibits recording the state. dimension, position, block, old_block, new_block, changed
block.unwax.before Can be canceled: Waxed coating is removed. Works with such a change from the command/script; cancellation prohibits the recording of the state. dimension, position, block, old_block, new_block, changed
block.unwax It removes the wax coating. It also works when you replace it from the command/script; cancellation prohibits recording the state. dimension, position, block, old_block, new_block, changed
block.scrape.before Can be reversed: Removes one step of oxidation of the copper block. Works with such a replacement from the command / script; cancellation prohibits the recording of the state. dimension, position, block, old_block, new_block, changed
block.scrape One step of oxidation of the copper block is removed, and it also works with this substitution from the command / script; cancellation prohibits the recording of the state. dimension, position, block, old_block, new_block, changed
world.border Tick-to-tick. The boundary of the world has changed. old/new — [center X, center Z, size, block warning, second warning, damage, safe zone]. dimension, old, new
world.difficulty Tick-to-tick. The difficulty has changed. old/new are string names. dimension, old, new
world.gamerule Tick-to-tick. The rule has changed. id is the ID of the rule, old / new is the old and new value. dimension, id, old, new
world.moon Tick-to-tick. The calculated phase of the moon has changed: old/new is the number 0..7, 0 is the full moon. dimension, old, new
key.repeat Repeat the key held in the game. player, client_reported, key
client.focus The game window has lost/has lost focus. player, client_reported, focused
client.tick.start The beginning of the customer tick. player, client_reported
client.tick.end End of customer tick. player, client_reported
screen.open The screen's about to open. player, client_reported, screen
screen.close The screen is closing. player, client_reported, screen
screen.render Screen rendering; x/y is a mouse in interface coordinates. player, client_reported, screen, x, y
screen.key The key is on the open screen. player, client_reported, screen, key
screen.mouse Press the mouse on the screen; button is the SDL number (left 1, middle 2, right 3). player, client_reported, screen, button, x, y
screen.scroll Scrolling on the screen; delta is vertical displacement. player, client_reported, screen, delta, x, y
text.input Enter the symbol in the open screen; text is the entered symbol. player, client_reported, screen, text
client.chat The client received a chat message; text - text without design. player, client_reported, text
client.sound The client requested audio playback; id - ID. This is not audibility confirmation. player, client_reported, id
client.camera Camera angles in degrees. player, client_reported, yaw, pitch, roll
client.fov Camera angle in degrees. player, client_reported, fov
client.render.start Beginning of the shot. player, client_reported
client.render.end End of frame. player, client_reported
client.hud The HUD game interface has been prepared. player, client_reported
client.world_render The world is painted. player, client_reported
client.particle A particle is created; id is ID, x/y/z is place. player, client_reported, id, x, y, z
client.tooltip Collected a hint of the subject; id - the subject, text - its text up to 2048 characters. player, client_reported, id, text
client.resources_reload The client has finished reloading the resources. player, client_reported

Mining, work desks and life cycle#

An example is to replace the mining of any block with two diamonds, and the event also works when you ask for a mining calculation.

MiScript / text
import event
def drops(data) {
    data.result.items = [ItemStack("diamond", 2)]
}
event.on("block.drops.before", drops)

block.xp_drop.before: data.result.amount - experience from the block. block.fuel.before: data.result.ticks Both take a whole 0..2147483647; cancelling the event gives a 0.

In block replacement events data.cause the name of the intercepted operation, for example block.random_tick, block.scheduled_tick, block.fluid_flow or world.precipitationIf the source is not identified, the value is "unknown"In this field, you can not always distinguish commands from scripts.

Event. Action and data
item.grindstone.before Can be cancelled: Receiving a sharpener result. item is the stack that is received, container_id is the open menu number. Before allows/disallows mouse action over the output slot; a normal event comes for each actual receive call, including a Shift click.
item.grindstone The item is the stack you get, container_id is the open menu number. Before allows/disables the mouse over the output slot; the usual event comes for every actual receive call, including the Shift click.
item.smithing.before Can be canceled: Receiving the result of the blacksmith table. item - the resulting stack, container_id - the number of the open menu. Before allows / prohibits the mouse action over the output slot; the usual event comes for each actual call of the receive, including the Shift click.
item.smithing Receiving the result of the blacksmith table. item is the resulting stack, container_id is the number of the open menu. Before allows / prohibits the mouse from acting over the output slot; the usual event comes for each actual call of the receive, including the Shift click.
item.stonecutting.before Can be canceled: Getting a stone-result. item is the stack that you get, container_id is the open menu number. Before allows/disallows the mouse to move over the output slot; a normal event comes for every actual receive call, including a Shift click.
item.stonecutting Receiving the result of stone-result. item is the resulting stack, container_id is the number of the open menu. Before allows / disallows the mouse action over the output slot; the usual event comes for each actual call of receipt, including Shift-click.
item.loom.before Can be canceled: Receiving the result of the weaving table. item - the resulting stack, container_id - the number of the open menu. Before allows / prohibits the mouse from acting over the output slot; the usual event comes for each actual call of the receipt, including the Shift click.
item.loom Receiving the result of the weaving table. item is the resulting stack, container_id is the number of the open menu. Before allows / prohibits the mouse from acting over the output slot; the usual event comes for each actual call of receipt, including the Shift click.
item.cartography.before Can be cancelled: Receiving the mapper's table result. item is the stack received, container_id is the open menu number. Before allows/disallows mouse action over the output slot; a normal event comes for each actual receive call, including Shift click.
item.cartography Receiving the mapper's table result. item is the stack that you get, container_id is the open menu number. Before allows/disallows the mouse to move over the output slot; the usual event comes for every actual receive call, including the Shift click.
block.break_progress The visible stage of destruction has been updated. Progress is 0..9; −1 removes cracks. entity is the destroying entity or None. This is a notification of the progress displayed, not the percentage of remaining strength.
block.shape.before Can be reversed: Calculating the status of the block because of the neighbor, neighbor - the coordinates of the neighbor, new_block in the usual event - the calculated state. Cancellation leaves the previous state in this calculation.
block.shape Calculating the state of the block due to the neighbor. neighbor - the coordinates of the neighbor; new_block in the ordinary event - the calculated state. Cancellation leaves the same state in this calculation.
world.precipitation.before Can be canceled: Checking the impact of rain/snow on the selected column: snow accumulation, freezing and the impact of precipitation on the surface. position - top cell of the column; this is not the event of each snowflake.
world.precipitation Checking the impact of rain/snow on the selected column: snow accumulation, freezing and exposure to precipitation on the surface. position - top column cell; it is not the event of each snowflake.
entity.shear.before Cancel: Cutting a sheep, a snow golem, a marsh skeleton or a mushroom cow.Cancel blocks the haircut itself; external interactions, such as wear and tear of scissors, may continue.
entity.shear Cutting a sheep, a snow golem, a marsh skeleton, or a mushroom cow, and cancelling it blocks the haircut itself; external interactions, such as wear and tear on scissors, can continue.
entity.portal_enter.before Can be cancelled: Entity marked in the portal if no recharge is in effect. portal_position - [x,y,z] portal cells. Each tic of stay may come; for the transfer itself, use entity.dimension.before/player.dimension.
entity.portal_enter Portal_position - [x,y,z] portal cells. Each tic of the stay may come; use entity.dimension.before/player.dimension for the transfer itself.
world.explosion.after The explosion completed damage calculation, block processing and fire creation. affected_blocks is the number of calculated impact cells, including undestructed ones; entity is the source or None.
block.bucket_fill.before You can cancel: The bucket takes the contents of the selected block. The usual event comes only with a non-empty result; the item is the resulting bucket.
block.bucket_fill The bucket takes the contents of the selected block. The usual event comes only when the result is empty; the item is the resulting bucket.
block.drops.before You can cancel: calculated block production. items - list of stacks; block - requested block state, entity - destroyer or None. Before allows you to change the result.items. Works when you program the request of extraction, and not only when it drops out.
block.drops Block mining is calculated. items are a list of stacks; block is the requested block state, entity is a destroyer or None. Before allows you to change result.items. It works when you program the extraction request, and not only when it drops out.
block.xp_drop.before Can be cancelled: Definition of experience from a block. amount - quantity, result.amount changes it; cancellation sets 0. A normal event reports the allowed amount.
block.xp_drop Definition of experience from a block. amount - quantity, result.amount changes it; cancellation sets 0. A normal event reports the allowed amount.
block.fuel.before Can be reversed: Calculation of the combustion time of the fuel in the furnace, smoker or smelter. Ticks — tics of combustion; result.ticks changes them. Cancellation sets 0. Calculation by itself does not mean fuel consumption.
block.fuel Calculating the combustion time of the fuel in the furnace, smoker, or smelter. Ticks are the tics of combustion; result.ticks changes them. Cancellation sets 0. The calculation alone does not mean fuel consumption.
world.feature The natural object is successfully placed. id is the registered ID of its feature or None at its embedded value; position is the initial position of the placement. The notification from the generation stream comes to the server, you can not cancel it.
world.structure The placement of a part of the structure in the chanka is complete. id is the structure ID or None, chunk_x/chunk_z is the chanka number; position is the center of the area of this placement. One structure gives several events. Cancellation is not supported.
world.bossbar The server has updated the properties of the boss band. id - UUID bands, title - name, progress - filling 0..1, visible - visibility. Includes raid strips and user stripes.
entity.anger Once in a server tick: changed UUID targets of constant aggression neutral mob. old/new — strings UUID or None. The first observation creates the initial state; you can not cancel.
world.raid_start Once in a server tick: A new raid appears. id is the numerical ID of the raid, wave is the wave number, status is ongoing/victory/loss/stopped/removed. position is the center. The first check after subscription only remembers existing raids.
world.raid_wave Once in the server tick: Changed the number of the caused wave. id - numerical ID raid, wave - wave number, status - ongoing/victory/loss/stopped/removed. position - center. The first check after subscription only remembers existing raids.
world.raid_end Once in a server tick: the raid is completed or deleted. id is the numerical ID of the raid, wave is the wave number, status is ongoing/victory/loss/stopped/removed. position - center. The first check after subscription only remembers existing raids.
server.starting The server prepares to launch after the measurements are loaded, runs immediately on the recovered file scripts; no waiting is allowed. A late subscription does not receive a previous launch.
registry.ready The current launch registries are available to recovered file scripts. The notification is queued up to the first game tick; the late subscription does not receive it retroactively.
server.stopped Forge has confirmed server shutdown. Normal stored handler values and standard computations are available; game APIs, expectations and new subscriptions are not available. print writes to the server log. Changes to this handler are no longer stored in a closed world; save edits to server.stopping.

When you start, the restored file scripts receive world.load for all uploaded measurements up to the first game tick. world.unload is delivered at the actual unloading of the measurement; such processor as and server.stopped, performs only normal calculations, cannot wait or access the game API, and print Writes to the server log. Changes to save the world. server.stopping.

The generation has a limited number of notifications waiting to be sent to the server: up to 256 at a time; when overflowing, new notifications are missed.

event.names() It also shows events added by installed mods through MiScript integration. RuntimeFoundry events will appear when RuntimeFoundry itself is connected with this integration; MiScript does not create fictitious events of the missing mod.

How to trigger an event#

For example, one piece of code sends out an open gate signal, and the other one responds to it. custom:gate_open We'll give you the gate number.

MiScript / text
import event

def gate(data) {
    print("Сигнал для ворот номер", data.number)
}

event.on("custom:gate_open", gate)
payload = NBT()
payload.number = 3
event.emit("custom:gate_open", payload)

payload - a set of transmitted fields. event.emit transmits 3 into data.numberMiScript calling. gate, and appears in the console. Сигнал для ворот номер 3.

Start with your names. custom:For your canceled signal, use the ending. .beforeThe fields. name, phase, tick NBT cannot be transmitted inside the NBT; it is filled with MiScript.

Library: entity#

The entity is a mob, a player, an arrow, an object on the ground, a boat, and other similar objects, and the resulting object refers to a particular entity by UUID; the change in its properties acts immediately.

MiScript / text
import entity

guard = spawn("zombie", [10, 64, 20])
guard.name = "Страж"
guard.max_health = 40
guard.health = 40
guard.equipment["mainhand"] = ItemStack("iron_sword")
print(guard.uuid)

Functions#

A challenge Description and outcome
Entity(uuid) A link to an entity with this UUID. It doesn't create or download it. An unknown UUID, let's say, check. status.
LivingEntity(uuid) A link to verify that it's a downloaded living thing, otherwise it's a mistake.
Mob(uuid) The link to check that it's a downloaded mob, otherwise it's a mistake.
entities.find(target) List of entities by selector, UUID, entity object, or target list.
Entity.find(target) The same as entities.find.
spawn(id, pos, dim=None, components=None) Create an entity and return its object. id - Type ID, pos — [x,y,z]/Position, dim ID or measurement object; default source measurement. components It's an optional NBT with supported components. It's an error if you fail to create.

w.spawn(type,pos,components=None) It creates essence in dimension. w And it also brings back the link to it.

MiScript / text
found = entities.find(@e[type="minecraft:zombie",sort="nearest",limit=1])
if len(found) > 0 {
    guard = found[0]
    print(guard.uuid)
}

You can save the object itself in a script variable, or you can transfer the UUID by a string. Once you get the string, the other script uses it. Entity(saved_uuid)Mob names are not unique; UUIDs denote a particular entity.

Essence - e#

You can change the fields below unless you say otherwise, and in an inappropriate species, the reference to a special property makes a mistake: an arrow, for example, has no health.

Status of reference

Name, position and physics

Data, communications and inventory

Methods of substance#

A challenge Action and outcome
e.teleport(pos, dim=None, rotation=None) If necessary, move to another dimension. pos — [x,y,z]/Position; rotation — [yaw,pitch]without dim It's the current dimension.
e.move(offset) Teleporting to displacement [dx,dy,dz] from the current situation.
e.rotate(yaw,pitch) Set a turn in degrees.
e.look_at(pos) Turn to that point.
e.push(offset) Add in. [dx,dy,dz] to speed.
e.ignite(ticks=100) For the cryper to start the countdown; clearly transmitted ticks It's the length of it.
e.extinguish() Putting out the fire doesn't cancel the triggering cryper explosion.
e.freeze(ticks) Set the accumulated freeze, doesn't turn the entity into a block of ice.
e.damage(source,amount) inflict 0–1,000,000 damages of this type, for example "generic"Returns if you've taken a hit.
e.kill() Kill with the usual processing of death.
e.remove() Delete without the usual death and prey. Players can't be removed like this. Player.kick.
e.add_tag(tag), e.remove_tag(tag) Add/remove the label; return if it has changed.
e.ride(target) Put the entity on one chosen transport; bring back success.
e.dismount() Get off the transport.
e.add_passenger(target), e.remove_passenger(target) Putting one selected entity on e Take her off if she's sitting on eThey bring back success.
e.leash(target), e.unleash() Tie it to the chosen entity/remove the leash with the object falling out, only for the right species.
e.line_of_sight(target) Are there no block collisions on the straight line between the eyes of entities? True/False.
e.raycast(distance) Check the block in the direction of view at a distance of 0-256. position - point of impact, block_position - block coordinates, face - the party; or None.
e.snapshot() Read a separate NBT copy of the entity's stored game data, and the edits to that copy do not apply.
e.properties() List of available property names for this species.
e.schema() List of records name, type, writableName, type, and ability to assign the entire property.

Living things#

A challenge Action and outcome
e.add_effect(effect) Add Effect(...); to bring back success.
e.remove_effect(id), e.clear_effects() Remove one or all of the effects; return if there has been a change.
e.attack(target) Attack one entity within four blocks; for the mob/player. Returns the result of the attempt.
e.consume(stack) Immediately use the transferred copy of the stack with effects, returns the remainder or None; the slot itself doesn't cheat.
e.start_using(stack,hand="mainhand") Place the stack in your hand, replacing the previous contents, and start using it. hand — mainhand/offhand.
e.stop_using() Terminate use.
e.swing(hand="mainhand") Show a wave of your hand. It doesn't do damage by itself.

Mobs and displacement#

MiScript / text
job = guard.navigation.move_to([20, 64, 30], speed=1)
while not job.done {
    wait(1)
}
print(job.status)
Challenge/field Description and outcome
e.navigation.move_to(pos,speed=1) Start moving; return the task job. speed The geometry of the world and conventional AI can interfere with movement.
e.navigation.path_to(pos) Build a path without starting to move. None or points - the coordinate list, reachable whether the goal is attainable and next_index - the next path index.
e.navigation.stop() Stop the movement and cancel the current task.
e.navigation.path The current path in the same format or NoneJust reading.
e.navigation.done, e.navigation.stuck Is the current path completed/is there a stuck path? Reading only.
job.status moving, paused, arrived, failed or cancelled.
job.done Whether the task is completed: arrival, error or cancellation.
job.cancel() Cancel this task; the new task of the same mob does not affect.

Short options: e.navigate_to(pos,speed=1), e.path_to(pos), e.stop_navigation().

Properties of individual species#

species Properties and methods
Age mobs e.age: negative number - tics until adulthood, positive - delay in reproduction, 0 - an adult without delay.
Animals. e.in_love - readiness for reproduction; e.breed(target) Give birth to a baby with a suitable partner no more than eight blocks, if the playing conditions are met.
Domesticated animals e.tamed, e.sitting, e.owner; e.tame(player) - tame the player, bring back success.
sheep e.color name of the color, for example blue; e.sheared - If she's shaved.
Resident e.profession, e.biome_type String ID of the profession and biomass species; e.level — 1–5; e.xp - a non-negative experience.
Object on the ground e.stack - A stack of empty stuff. e.pickup_delay Delayed selection, 0-32767; e.age - lived tics; e.lifetime - full life in tics; e.thrower - the casting entity, the same as owner; e.pickup_target UUID of the authorized recipient or None.
A shell. e.direction a single flight vector, only reading; e.owner - the owner; e.shoot(direction,speed=1,inaccuracy=0) We're going to run it in a vector, velocity is 0-100, scatter is 0-100.
Arrow e.projectile_damage - baseline damage, e.critical, e.piercing — 0–127; e.pickup_policy — disallowed, allowed, creative_only.
Lighted by TNT e.fuse - remaining tics; e.power - Explosion force 0-64.
kriper e.fuse - the duration of the countdown 1-32767, e.power - base force 0-64, e.charged - Is it charged? e.ignite().
Armor rack e.arms, e.base_plate - hands and a stand; e.marker It's just readable. e.part_poses - NBT with corners head, body, left_arm, right_arm, left_leg, right_legeach [x,y,z] When you change the copy, you can assign it back.

Other specific data supported by the game itself is available through components; their formats depend on the component ID. A list of properties of a particular entity can be obtained through properties().

Resident's transactions#

MiScript / text
v = spawn("villager", [10, 64, 20])
v.trades.clear()
v.trades.append(Trade(ItemStack("emerald", 2), ItemStack("bread", 3)))
t = v.trades[0]
t.max_uses = 20
v.trades[0] = t
v.restock()

Trade(buy, sell, secondary=None, max_uses=12, xp=1, price_multiplier=0.05) - offer of trade. buy/sell - entrance and exit stacks; secondary - Second entrance. max_uses - the number of uses before replenishment; xp - experience of the resident; price_multiplier - the impact of demand. Additional fields: uses, special_price, demand, reward_expThe deal and the items inside it are copies. After the changes, take the deal back.

v.trades[i] reads/replaces the transaction; append(trade) adds; pop(index=-1) Remove it and return it. clear() It removes everything. len(v.trades) - number of transactions.

v.gossip[uuid] Fields: major_negative (0..100), minor_negative (0..200), minor_positive (0..25), major_positive (0..20), trading (0.25), value 0 or at least 2. v.reputation[uuid] Reputation, only reading.

AI mob#

e.goals.kinds() A list of available targets: float, random_stroll, random_look, look_at_player, melee_attack, panic, avoid_water_stroll, follow_mob, follow_owner, breed, open_door, retaliate, target_player.

MiScript / text
goal = e.goals.add("random_stroll", priority=5, speed=1)
e.goals.remove(goal)

goals.list() Returns the NBT list with id, kind, priority, running; empty id means standard goal. clear() Remove the targets of movement and enemy selection, including standard ones. disable("move")/enable("move") They control the flag; look, jump, target are also available. Settings are recorded to restore the entity. retaliate selects the offender, target_player the nearest visible player. Add also melee_attack. follow_owner works in tamed animals, breed in animals, open_door in ground navigation. follow_mob follows another mob, avoid_water_stroll walks, avoids water. Brain behavior is controlled separately.

e.brain.memories.ids() - the memory available to this mob. memories[id] reads the value or None; assigning None erases it. set(id, value, ticks) It sets a deadline in ticks. remaining(id) returns the remainder, or INF. schema(id) For example, last_slept is the number of tics, like_player and angry_at - UUID by line, home/job_site - NBT with dimension and pos=[x,y,z] Flag memories are accepted by True; None deletes them; memory that the AI creates only temporarily is readable in supported formats and is not written.

MiScript / text
v = spawn("villager", [10,64,20])
v.job_site = [12,64,20]
print(v.job_site.position)
v.bed = None

v.job_site, v.bed, v.meeting_point You can either return the NBT with dimension and position=[x,y,z] or None when you read it, you can transfer [x,y,z] to the resident's dimension, or you can change the NBT copy you read and assign it back, and it changes the resident's memory, but it doesn't put blocks and it doesn't reserve space.

e.navigation.active - Is there movement? target - the coordinates of the target or None; speed 0.001-16 speed multiplier can be changed. path It contains points, reachable, and next_index.

e.ignite(ticks=100) TNT, the explosive trolley, and the cryper set a timer before the blast in the ticks.

allay.liked_player - UUID of the player to whom the silence brings objects; allay.liked_item - Sample object. None clears the field.

e.brain.sensors.ids() - the sensors of the mob; sensors[id] = False Turns off the sensor, turns on True. brain.activities Available activities, brain.active Current; an assignment of an ID attempts to incorporate the available activity with the verification of its conditions. brain.clear() It cleanses the memory. brain.stop() Stops current behaviors.

Species properties#

Changes in normal properties are applied immediately. transform, interpolation, shadow, hitbox, block states and objects come back in copies: change the copy and assign it back. Properties are available only to the right type; the exact list gives you a copy. e.properties()The access to the record. e.schema().

The essence Field. Meaning.
ExperienceOrb value Experience in one field: 1..32767.
ExperienceOrb age Age of the sphere in ticks, 0..5999; disappears at 6000.
ExperienceOrb lifetime Sphere lifetime: 6,000 tics. Reading only.
FallingBlockEntity block_state A copy of the state of the falling block; assign the modified copy back.
FallingBlockEntity drop_item Fall out of the object if installation is impossible.
FallingBlockEntity hurt_entities Damage on landing.
FallingBlockEntity damage_per_distance Damage per drop block: 0.1000000.
FallingBlockEntity damage_max Limit the damage from the fall.
MinecartFurnace fuel The remaining fuel of the trolley in ticks: 0..32000.
MinecartTNT fuse Timer of the trolley explosion: -1 not lit, otherwise tics before the explosion.
AbstractHorse domestication Horse tameness: 0..max_domestication.
AbstractHorse max_domestication Maximum tameness. Reading only.
AbstractHorse tamed Is the horse tamed?
AbstractHorse jump_strength Basic horse jump force: 0.32.
AbstractHorse saddle Saddle; None takes it off.
AbstractHorse armour The item in the body armor slot; None takes it off.
Display transform Translation[3], scale[3], left_rotation[4], right_rotation[4]. Quaternions [x,y,z,w]; assign back after changes.
Display interpolation Duration/delay/teleport_duration in tics; teleport_duration 0..59.
Display billboard Turn to camera: fixed/vertical/horizontal/center.
Display brightness Light [blocks, sky], both 0..15; None is lighting the world.
Display shadow Shadow image: radius 0..64, strength 0..1.
Display view_range Display distance multiplier: 0..1024.
BlockDisplay block A copy of the displayed block state; you can also assign a block ID.
ItemDisplay item Displayed stack; None hides the item.
ItemDisplay item_context Model position: none/gui/ground/fixed/head and Minecraft hand contexts.
TextDisplay text Text with the same design tags as chat().
TextDisplay line_width The width of the text transfer in pixels.
TextDisplay background Text background as an iconic 32-bit ARGB number.
TextDisplay opacity Opacity of text: 0..255.
TextDisplay style_flags Text flags: 1 shadow, 2 through walls, 4 standard background, 8 left, 16 right.
Interaction hitbox A snapshot of the width/height click zone in blocks: 0..1024.
Interaction response Demonstrate the customer’s response to the interaction.
Interaction last_attacker The last attacking player, if he's loaded, read only.
Interaction last_interactor The last player to interact, if it's loaded. Read only.
Fox trust Up to two UUIDs of trusted creatures; [] clears the fox's trust.
HangingEntity facing Horizontal side of the wall entity; support is required.
AbstractHurtingProjectile power Acceleration of a projectile, such as a fireball: 0.64.
PrimedTnt igniter TNT arsonist, if available. Read only.
AbstractArrow projectile_item A snapshot of an arrow or trident object, and assign a copy back after the spell changes.
ThrownTrident loyalty The current level of Loyalty; changing the spell of projectile_item. Reading only.
ThrownTrident dealt_damage The trident has already hit the target.
FishingHook hooked_entity A rod-locked entity, just reading.
FishingHook open_water Is it considered open water for fishing? Read only.
FishingHook lure_ticks The remaining tics of anticipation of the fish's approach.
FishingHook hook_ticks The remaining tics until the lick, just reading.
FishingHook nibble_ticks The remaining tic screen, just reading.
Bee hive The coordinates of a remembered hive; None forgets the hive.
Bee flower The coordinates of the remembered flower.
Bee nectar Does the bee carry nectar?
Bee stung The bee has already stung; it affects its future life.
Allay dancing Is the quiet dancer?
Enderman carried_block A copy of the block being carried by the enderman; None removes the block.
Shulker attachment Side of attachment of the shalker: down/up/north/south/east/west.
Shulker peek Opening of the shell shalker: 0..100.
Zombie break_doors Allow zombies to break down doors if complexity permits.
Zombie converting Is it going to become a drowned man, just reading?
Zombie conversion_ticks Ticks before zombies become drowned; -1 reverses the transformation.
WitherBoss invulnerability_ticks The remaining tics of the initial invulnerability of the viser.
WitherBoss phase Wieser phase: invulnerable or combat. Reading only.
EnderDragon phase Dragon phase: numerical ID 0..10 from Minecraft.
ItemFrame item The subject of the frame; None clears the frame.
ItemFrame item_rotation Rotation of the subject in the frame: 0..7, step 45 degrees.
ItemFrame facing The frame can break if there's no support behind it.
ArmorStand marker Make the rack a marker without the usual collision.
AbstractMinecart rail_state The condition of the block under the current position of the trolley; check the id, it's not always the rail. Reading only.
LivingEntity last_damage The latest recent source of damage is type and attacker_uuid (an empty line without an attacker), or None. Read only.

e.variant and e.sound_variant available when the entity provides the relevant component. Other species components are listed through e.components.ids() and read/write by ID.

e.bossbar Existing vizér/dragon band or None. e.interact(target, hand="mainhand") It performs interaction on behalf of the player no further than six blocks. e.barter(stack) Takes exactly one gold bar for an adult piglin with an empty second hand. e.retrieve(stack) It cuts the fishing rod and returns the wear of the tool; a stack of fishing rod is transmitted.

Library: chat#

MiScript / text
import chat
chat("Script", "Привет!")

Features are available as chat(..), say(..) and via chat space. Author is the displayed signature, not the rights enhancement. Getchat target filters the authors, clearchat selects the recipients of the clearchat.

Functions#

chat(author, text)#

Send a message to the general game chat.

Arguments: author - signature of the author of the communication. text - text of the message.

Returns. None.

chatmsg(target, author, text)#

Send a message only to selected players.

Arguments: target Which player to send the message to. author - signature of the author of the communication. text - text of the message.

Returns. None.

clearchat(a=INF, target=@pl)#

Remove the last a messages from the windows of the selected players.

Arguments: a The number of last messages to be deleted; INF is all. target - Which players to clean the chat room.

Returns. None.

getchat(a=INF, target=@pl)#

Texts of the last a posts of selected authors, from old to new.

Arguments: a Number of last posts to read; INF is everything. target - whose posts to read; the name or filter of the authors.

Returns the list of lines.

inputchat(author)#

Wait for the next message from the appropriate author, return the text.

Arguments: author Whose message is waiting; the name or filter of the authors.

Result: text.

say(author, text)#

The second name is chat, with the same arguments and behavior. Use import chat, don't import say.

Arguments: author - signature of the author of the communication. text - text of the message.

Returns. None.

Colors, highlights and references#

The text is written directly inside the message:

MiScript / text
chat("Script", "{color=gold}Золотой текст{/}")
chat("Script", "{bold}Жирный текст{/}")
chat("Script", "{url=https://example.com}Открыть сайт{/}")

The {/} tag ends the selected design.

MiScript / text
chat("NPC", "{color=gold,bold}Привет{/}! {run=/help}Помощь{/} {url=https://example.com}Сайт{/}")

Tags: color, bold, italic, underline, strikethrough, obfuscated, run, urlThe color is Minecraft's name or #rrggbbTags can be inserted; they close through {/}. {{ and }} The semicolon can be summed up in quotation marks: {run='/say a,b'}.

The click command is executed by the player with his The URL must be HTTP/HTTPS. Functions are also available through chat.getchat(...), chat.chatmsg(...) etc.

Library: random#

MiScript / text
import random
print(random(1,10))

random(1, 2, 0.5) pick out 1, 1.5, 2The upper boundary is chosen only if it can be reached by the specified step. x= or seed=.

Normal. random(...) That's enough for most tasks. Random(123) It creates its own generator: 123 is its initial setup (seed), two generators with the same setup will give the same sequence for the same calls. Random() He chooses it automatically.

MiScript / text
rng = Random(123)
print(rng.integer(1, 6))  # Свой бросок кубика
print(random(1, 2, 0.01))  # Например, 1.32

Functions#

Random()#

Independent random number generator.

Arguments: seed It's an integer; the same grain repeats the sequence.

Result: Random number generator.

random(x, y, step=1)#

Select the x+n*step grid value in the closed x..y range.

Arguments: x The lower bound of a random number. y - upper limit, not less than x. step The distance between the permissible numbers is greater than 0; for example, 0.5.

Result: number.

Object: Own random number generator - rng#

Create it through rng = Random() or rng = Random(123).

Methods#

rng.boolean(chance)#

True is 0 to 1 probability.

Arguments: chance - probability: 0 to 1.

Result: True or False.

rng.choice(values)#

One item on a non-empty list.

Arguments: values - a list of values.

Result: value depending on the selected data.

rng.choices(values, count)#

A choice with possible repetitions.

Arguments: values - a list of values. count - how many values to get.

Result: list.

rng.decimal(min, max)#

The fractional, upper boundary is excluded; with equal boundaries, it is a value.

Arguments: min - The lower bound. max - upper limit.

The result is a fractional number.

rng.gaussian(mean, sigma)#

Normal distribution number; sigma is nonnegative.

Arguments: mean - the average of random values. sigma - the range of random values, a number from 0.

The result is a fractional number.

rng.integer(min, max)#

Entire, both boundaries are included; transfer entire boundaries.

Arguments: min - The lower bound. max - upper limit.

Result: integer.

rng.reseed(seed)#

Reset the generator sequence.

Arguments: seed - a whole grain of random choice.

Returns. None.

rng.sample(values, count)#

Selection without reusing the position.

Arguments: values - a list of values. count - how many values to get.

Result: list.

rng.shuffle(values)#

Mix the original list; the result is None.

Arguments: values - a list of values.

Returns. None.

Object: Common Random Number Generator - Random#

Methods#

random.boolean(chance)#

True is 0 to 1 probability.

Arguments: chance - probability: 0 to 1.

Result: True or False.

random.choice(values)#

One item on a non-empty list.

Arguments: values - a list of values.

Result: value depending on the selected data.

random.choices(values, count)#

A choice with possible repetitions.

Arguments: values - a list of values. count - how many values to get.

Result: list.

random.decimal(min, max)#

The fractional, upper boundary is excluded; with equal boundaries, it is a value.

Arguments: min - The lower bound. max - upper limit.

The result is a fractional number.

random.gaussian(mean, sigma)#

Normal distribution number; sigma is nonnegative.

Arguments: mean - the average of random values. sigma - the range of random values, a number from 0.

The result is a fractional number.

random.integer(min, max)#

Entire, both boundaries are included; transfer entire boundaries.

Arguments: min - The lower bound. max - upper limit.

Result: integer.

random.reseed(seed)#

Reset the generator sequence.

Arguments: seed - a whole grain of random choice.

Returns. None.

random.sample(values, count)#

Selection without reusing the position.

Arguments: values - a list of values. count - how many values to get.

Result: list.

random.shuffle(values)#

Mix the original list; the result is None.

Arguments: values - a list of values.

Returns. None.

Library: recipes#

MiScript / text
import recipes
r = recipes.get("oak_planks")
print(r.result([["oak_log"]]).count)

Functions of recipes#

The default calculation uses a source measurement; recipes.in_dimension("nether").get(id) specifies it explicitly for contextual fashion recipes.

Methods#

recipes.dependencies(output, recursive=True)#

Find manufacturing dependencies, including known dynamic types.

Arguments: output Which product to look for: ID or ItemStack? recursive - True - also look for what ingredients are made of.

Result: List of recipes and required ingredients.

recipes.get(id)#

Get one prescription by ID.

Arguments: id Recipe ID, such as "minecraft:oak_planks".

Result: recipe.

recipes.in_dimension(dim)#

Select a measurement for calculations/commands; the directory remains shared.

Arguments: dim Measurement ID, such as "nether"; you can transfer Dimention.

Result: recipes.

recipes.list()#

Get a list of server recipes.

The result: a list is a recipe.

Object: Recipe - r#

This is one recipe object obtained by recipes.get(id). Crafting input — grid lines up to 3×3: [[ItemStack("oak_log",2)]. Smithing — [template,base,addition]. Single recipes —Stack, ID, or a list from a single slot. craft consumes a variable input list/stop, but does not give items to game inventory, does not waste fuel and stove time. Res like a bucket are returned separately. For a dynamic recipe, pass the real one: empty ingredients do not mean a free recipe.

Variables#

Methods#

r.craft(input)#

Perform one operation on the transmitted images; result/remaining_items.

Arguments: input Ingredients: ItemStack, list of slots or lines of crafting grid.

Result: result - item, remaining_items - ingredients residue.

r.ingredient_matches(index, item)#

Check the specific ingredient, taking into account the components.

Arguments: index The ingredient number of the recipe starting from zero. item - Item ID or ItemStack.

Result: True or False.

r.matches(input)#

Whether a particular grid/entry is appropriate.

Arguments: input Ingredients: ItemStack, list of slots or lines of crafting grid.

Result: True or False.

r.remaining_items(input)#

Calculate the remains like empty buckets without spending.

Arguments: input Ingredients: ItemStack, list of slots or lines of crafting grid.

Result: List - stack of items or None.

r.result(input)#

Calculate the result without spending.

Arguments: input Ingredients: ItemStack, list of slots or lines of crafting grid.

The result: a stack of items or None.

r.uses(item)#

Static check whether the item is used as an ingredient.

Arguments: item - Item ID or ItemStack.

Result: True or False.

Library: loot#

MiScript / text
import loot
drops = loot.roll("minecraft:chests/simple_dungeon", LootContext([0,64,0]))
print(drops)

Functions#

LootContext(pos, actor=None, tool=None, state=None, luck=0)#

Context of calculation of production, without automatic issuance.

Arguments: pos where to perform the action; Position coordinates(x,y,z) or list [x,y,z]. actor - which player performs the action; the name, player or selector of one player. tool Tool: Item ID, ItemStack or None. state Block ID or a copy of it obtained by getblock. luck - numerical luck for calculating production, from -1,000,000 to 1,000,000.

Result: data to calculate production.

Loot functions#

Tables are shared by the server, and the calculation depends on the measurement. The default is the source; loot.in_dimension("nether") selects another. Minecraft 26.3's NBT terms/modifiers use the type field.

Variables#

Methods#

loot.in_dimension(dim)#

Select a measurement for calculations/commands; the directory remains shared.

Arguments: dim Measurement ID, such as "nether"; you can transfer Dimention.

Result: a production catalog with the selected measurement.

loot.pools(id)#

Table drop-out groups.

Arguments: id - ID of the table, conditions or modifier of production - depending on the call.

Result: List - group of prey dropout.

loot.roll(id, context)#

Calculate the stacks of production without automatic issuance.

Arguments: id - ID of the table, conditions or modifier of production - depending on the call. context LootContext(...) data to calculate production.

The result: the list is a stack of objects.

loot.table(id)#

Description of the table: id/data/pool_count.

Arguments: id - ID of the table, conditions or modifier of production - depending on the call.

Result: table of production: id, data, pool_count.

Object: loot.conditions#

Methods#

loot.conditions.from_data(data)#

Create a condition from NBT Minecraft.

Arguments: data - NBT data.

Result: condition of prey loss.

loot.conditions.get(id)#

Get a condition.

Arguments: id - ID of the table, conditions or modifier of production - depending on the call.

Result: condition of prey loss.

loot.conditions.ids()#

ID of the registered conditions.

Returns the list of lines.

Subject: loot.modifiers#

Methods#

loot.modifiers.from_data(data)#

Create a modifier from NBT.

Arguments: data - NBT data.

Result: change of object in calculation of extraction.

loot.modifiers.get(id)#

Get a modifier.

Arguments: id - ID of the table, conditions or modifier of production - depending on the call.

Result: change of object in calculation of extraction.

loot.modifiers.ids()#

ID of registered mining modifiers.

Returns the list of lines.

Library: progress#

MiScript / text
import progress
grant_advancement(player, "minecraft:story/mine_stone")

Achievements and stats are common to the server. Achievement IDs are Minecraft directory lines, not translated titles. Achievements/reviews return the number of players that have changed; reading requires exactly one player.

Functions#

advancement_criteria(id)#

String names of achievement criteria.

Arguments: id A string achievement ID, such as "minecraft:story/mine_stone".

Returns the list of lines.

advancement_ids()#

All Achievement IDs: A list of strings, including hidden recipes.

Returns the list of lines.

get_advancement_criteria(target, id)#

List of criteria already met by one player.

Arguments: target Who to choose: name, Player, selector or list. id A string achievement ID, such as "minecraft:story/mine_stone".

Returns the list of lines.

get_advancements(target)#

The ID of one player’s fully accomplished achievements: a list of lines.

Arguments: target Who to choose: name, Player, selector or list.

Returns the list of lines.

grant_advancement(target, id, criterion=None)#

Give me a specific achievement or a benchmark, get back the number of players that have changed.

Arguments: target Who to choose: name, Player, selector or list. id A string achievement ID, such as "minecraft:story/mine_stone". criterion The name of the individual achievement requirement from advancement_criteria(id); None is to give the entire achievement.

Result: integer.

has_advancement(target, id)#

Do you have a single player: True/False?

Arguments: target Who to choose: name, Player, selector or list. id A string achievement ID, such as "minecraft:story/mine_stone".

Result: True or False.

revoke_advancement(target, id, criterion=None)#

To revoke a particular achievement, or its criterion, to bring back the number of players that have changed.

Arguments: target Who to choose: name, Player, selector or list. id A string achievement ID, such as "minecraft:story/mine_stone". criterion The name of the individual requirement from advancement_criteria(id); None is to withdraw the entire achievement.

Result: integer.

Subject: statistics#

Methods#

statistics.add(target, type, id, value)#

Add value; the result must remain non-negative.

Arguments: target Who to choose: name, Player, selector or list. type a category of statistics, such as “custom”. id What to count, for example, "jump" - jumps. value - by how much to increase the value.

Result: integer.

statistics.get(target, type, id)#

A list of values for players.

Arguments: target Who to choose: name, Player, selector or list. type a category of statistics, such as “custom”. id What to count, for example, "jump" - jumps.

Returns a list of whole numbers.

statistics.ids(type)#

Available ID of the selected type.

Arguments: type a category of statistics, such as “custom”.

Returns the list of lines.

statistics.reset(target, type, id)#

Zero one of the statistics; the result is the number of players.

Arguments: target Who to choose: name, Player, selector or list. type a category of statistics, such as “custom”. id What to count, for example, "jump" - jumps.

Result: integer.

statistics.set(target, type, id, value)#

Select statistics; the result is the number of players.

Arguments: target Who to choose: name, Player, selector or list. type a category of statistics, such as “custom”. id What to count, for example, "jump" - jumps. value - a new meaning.

Result: integer.

statistics.types()#

Types of statistics.

Returns the list of lines.

Library: scoreboard#

MiScript / text
import scoreboard
board = Scoreboard("stats", title="Статистика")
board["Монеты"] = 10
board.show()

Functions#

Scoreboard(id, criterion="dummy", title=id)#

Create or receive a counter; existing strings are saved.

Arguments: id - Counter ID, like "stats." criterion - the rule of counting; dummy - the numbers set the script. title - a headline on the screen.

Result: counter.

Scoreboard.get(id)#

Receive an existing object; if no ID is an error.

Arguments: id - Counter ID, like "stats."

Result: counter.

Scoreboard.ids()#

List of server string ID counters.

Returns the list of lines.

Scoringboard functions#

Variables#

Methods#

scoreboard.create(id, criterion="dummy", title=id)#

Create a named counter (objective).

Arguments: id - Counter ID, like "stats." criterion - the rule of counting; dummy - the numbers set the script. title - a headline on the screen.

Returns. None.

scoreboard.criteria()#

Available counting criteria.

Returns the list of lines.

scoreboard.display(slot, objective)#

Show the selected counter in the screen slot; objective=None frees the slot by saving numbers.

Arguments: slot Place of display or equipment; options depend on the call. objective - The ID of the displayed counter or None to hide.

Returns. None.

scoreboard.get(id)#

Get the meter settings.

Arguments: id - Counter ID, like "stats."

Result: Counter settings.

scoreboard.ids()#

Named meter ID.

Returns the list of lines.

scoreboard.remove(id)#

Delete the meter and its values.

Arguments: id - Counter ID, like "stats."

Returns. None.

scoreboard.score(objective, holder)#

A value/locked/number_format account.

Arguments: objective - The ID of the displayed counter or None to hide. holder Signature of the line or the name of the player.

Result: line settings: value, locked, number_format.

Object: Counter - board#

In Minecraft, this meter is called objective. The Scoreboard object allows you to work without the word objectives.

MiScript / text
import scoreboard
board = Scoreboard("stats",title="Статистика")
coins = 10
board.show()
ontick {
    board["Монеты"] = coins
}

The board reads a number (including fractional) or None. board["HP"] = 19.625The fraction is displayed and stored in the world. In the standard Minecraft list, strings are sorted by the whole part; hearts mode uses whole hearts. Manually changing the number_format of a string returns it to the whole Minecraft account. Assignment creates/updates a string; None deletes a string. There is no automatic binding to a variable: repeat assignment when you change or ontick.

Repeated Scoreboard(..) connects to an existing ID without clearing the numbers; the explicitly transferred title changes the header. The new counter uses criterion="dummy": the numbers specify the script. The existing counter does not change the criterion. hide saves the data, removes the counter with them. The counters are saved in the world.

show defaults to show sidebar to all players. One slot holds one counter. For list/below_name, the key must be the player's nickname. Criteria like health can prohibit manual recording. scoreboard.create/get/ids/remove, as described below.

Variables#

Methods#

board.hide()#

Remove this counter from the display slots, saving the lines.

Returns. None.

board.remove()#

Remove the meter along with its values.

Returns. None.

board.row(name)#

Line settings: value, locked, number_format, as in scoreboard.score below.

Arguments: name - Signature of the counter line, for example, "Coins"; for display under the nickname - the player's nickname.

Result: line settings: value, locked, number_format.

board.show(slot="sidebar")#

Show all players: sidebar, list, player list, below_name, under names. One slot shows a single counter; list/below_name, the line key must be the player's nickname.

Arguments: slot “Sidebar” on the side of the screen, “list” on the player list, and “below_name” on the username.

Returns. None.

Object: Team of players - team#

Variables#

Subject: scoreboard.teams#

Methods#

scoreboard.teams.create(id)#

Build a team.

Arguments: id - Team ID, such as "red."

Returns. None.

scoreboard.teams.get(id)#

Get the team's object.

Arguments: id - Team ID, such as "red."

Result: team of players.

scoreboard.teams.ids()#

Team names.

Returns the list of lines.

scoreboard.teams.join(id, holder)#

Add a member.

Arguments: id - Team ID, such as "red." holder Signature of the line or the name of the player.

Result: True or False.

scoreboard.teams.leave(holder)#

Remove a member from the team.

Arguments: holder Signature of the line or the name of the player.

Result: True or False.

scoreboard.teams.members(id)#

Team members.

Arguments: id - Team ID, such as "red."

Returns the list of lines.

scoreboard.teams.remove(id)#

Delete the team.

Arguments: id - Team ID, such as "red."

Returns. None.

Library: bossbars#

MiScript / text
import bossbars
bar = bossbars.create("quest", "Задание")
bar.progress = 0.5
bar.show(player)

Functions of bossbars#

bossbars.create(id, title)#

Create a boss strip that doesn't require a real boss.

Arguments: id - the band ID you selected, such as "quest". title - a headline on the screen.

Result: Boss band.

bossbars.get(id)#

Get a strip on her ID.

Arguments: id - the band ID you selected, such as "quest".

Result: Boss band.

bossbars.ids()#

Get a list of IDs of available bands.

Returns the list of lines.

Object: Boss Band - bar#

The user bar does not require a boss entity. ID is unique on the server. progress is 0-1; color pink/blue/red/green/yellow/purple/white; styles progress/notched_6/notched_10/notched_12/notched_20. Show it through bar.show(player) or bar.show(@pl). After removal, the link is invalid. Raid/dragon strips are controlled by the game: they cannot be removed as user-generated.

Variables#

Methods#

bar.hide(target)#

Hide the lane from the selected players.

Arguments: target Who to choose: name, Player, selector or list.

Returns. None.

bar.remove()#

Remove the user bandwidth and hide it from all recipients.

Returns. None.

bar.show(target)#

Show the lane to selected players.

Arguments: target Who to choose: name, Player, selector or list.

Returns. None.

Library: maps#

MiScript / text
import maps, world
map = maps.create([0,64,0])
give(player,map.item)

Maps functions#

When creating maps.create(...,dim=None), dim selects the dimension to be depicted; by default, the source. colors are fixed 16,384 bytes 0–255, the index y*128+x. User icons are temporary. map.item is a stack of cards that can be issued via give.

Methods#

maps.create(center, scale=0, tracking=True, unlimited_tracking=False, dim=None)#

Create a map, scale 0...4.

Arguments: center X/Z; Position or [x,y,z]. scale Map scale: integer 0-4. tracking - True - track the players on the map. unlimited_tracking - True - mark players outside the map. dim Measurement ID, such as "nether"; you can transfer Dimention.

Result: map.

maps.get(id)#

Receive a card by the number of ID or ItemStack of the card filled.

Arguments: id The numerical number of the card or ItemStack of the completed card.

Result: map.

maps.lock(id)#

Create a copy of the map with a new ID and a frozen image of the area.

Arguments: id The numerical number of the card or ItemStack of the completed card.

Result: map.

maps.scale(id)#

Create a copy of a card with a new ID and scale one level larger; maximum scale is 4.

Arguments: id The numerical number of the card or ItemStack of the completed card.

Result: map.

Object: Map - map#

Variables#

Methods#

map.add_marker(id, type, pos, rotation=0, name=None)#

Add an icon like Minecraft.

Arguments: id the name of the icon you have chosen on this card; type - Minecraft badge ID. pos - coordinates in the world; rotation - corner of the corner; name - Signature or None.

Returns. None.

map.marker(id)#

Receive information about the icon or None, if there is no such ID.

Arguments: id The ID you selected on this card.

Result: Type, x, y, rotation, name or None.

map.remove_marker(id)#

Delete the badge with this ID.

Arguments: id The ID you selected on this card.

Returns. None.

map.update(targets=@pl)#

Send changes to selected players, result sent.

Arguments: targets Recipients: Names, Player, selector or list.

Result: Number of recipients in result.sent.

Library: commands#

MiScript / text
import commands
commands.execute("say Привет")

Functions of commands#

Commands use the source rights of the launch. commands.in_dimension(dim) selects a measurement; w.commands The datapack function is the .mcfunction file, and the datapack condition is the saved Minecraft verification. commands.predicate(...) Checks this condition with LootContext data.

Methods#

commands.execute(command)#

Execute commands with source rights; success/results.

Arguments: command - Minecraft team text.

Returns. None.

commands.function(id)#

Perform the datapack function.

Arguments: id The ID of a function or datapack condition, such as "my_pack:start".

Returns. None.

commands.predicate(id, context)#

Check the datapack predicate from LootContext.

Arguments: id The ID of a function or datapack condition, such as "my_pack:start". context LootContext(...) data to calculate production.

Returns. None.

Context of execution of commands#

command_storage[id] Additional NBT data from the Minecraft command repository, which requires operator rights to record: change the copy you read and assign it back to the same ID.

Methods#

commands.in_dimension(dim)#

Receive commands with another dimension as the execution site.

Arguments: dim Measurement ID, such as "nether"; you can transfer Dimention.

Result: Teams with the chosen measurement.

Library: registries#

MiScript / text
import registries
print(registries.enchantments.ids())

Registries functions#

Registries are Minecraft definition directories. Reading a definition doesn't mean you can change it or log it from a script. components.validate checks the transmitted data. If it's incorrect, an error appears.

Variables#

Methods#

registries.data(registry, id)#

Description of the recording, if its format is supported.

Arguments: registry The name of the directory, such as minecraft:item. id - Minecraft record ID in the specified directory.

Result: value depending on the selected data.

registries.entries(registry)#

Minecraft catalog entries ID.

Arguments: registry The name of the directory, such as minecraft:item.

Returns the list of lines.

registries.ids()#

The ID of Minecraft catalogs is Minecraft definition lists.

Returns the list of lines.

registries.schemas(registry, id)#

Information about available data/record properties.

Arguments: registry The name of the directory, such as minecraft:item. id - Minecraft record ID in the specified directory.

Result: information about the properties of the selected block or object.

registries.tags(registry, id=None)#

Minecraft catalog tags or tags for a specific record.

Arguments: registry The name of the directory, such as minecraft:item. id - Minecraft record ID in the specified directory.

Returns the list of lines.

Subject: registries.components#

Methods#

registries.components.get(id)#

Information about the type of component.

Arguments: id An ID of a component of an item, such as "minecraft:custom_name".

Result: Component ID and Persistent Sign – Whether or not it persists.

registries.components.ids()#

Component type ID.

Returns the list of lines.

registries.components.validate(id, value)#

Check the value data for compliance with the id component. If the format is incorrect, an error occurs.

Arguments: id Component ID, such as minecraft:custom_name value The data of this component: string, number, list or NBT depending on the selected component.

Result: Proven value in Minecraft format, not True/False.

Subject: registries.enchantments#

Methods#

registries.enchantments.ids()#

The ID of all spells.

Returns the list of lines.

is library#

MiScript / text
import world, is
w = Dimention.current()
b = w.getblock(10, 64, 20)
if is.tag(b, "minecraft:logs") {
    print("Это бревно")
}

The checks return True or False, and if you don't have the right arguments or data, you get an error.

Limitations#

There are no separate GUI, redstone, and npc libraries in this version, and no checks on trading and using a live player item have been tested separately.