世界修改
早期执行
Name of the batch for the test.
RegistrationBuilder object where additional configuration methods can be called.
世界修改
早期执行
RegistrationBuilder object where additional configuration methods can be called.
世界修改
早期执行
RegistrationBuilder object where additional configuration methods can be called.
世界修改
早期执行
Size, in blocks, around the GameTest where additional GameTests should not be created.
RegistrationBuilder object where additional configuration methods can be called.
世界修改
早期执行
If set to true, the test must pass in order for the entire run of tests to pass.
RegistrationBuilder object where additional configuration methods can be called.
世界修改
早期执行
RegistrationBuilder object where additional configuration methods can be called.
世界修改
早期执行
RegistrationBuilder object where additional configuration methods can be called.
世界修改
早期执行
可选
structureDimension: string | DimensionTypeRegistrationBuilder object where additional configuration methods can be called.
世界修改
早期执行
RegistrationBuilder object where additional configuration methods can be called.
Sets the name of the structure for a test to use. "xyz:bar"
will load /structures/xyz/bar.mcstructure
from the
behavior pack stack.
import { Test, register } from "@minecraft/server-gametest";
import { MinecraftEntityTypes } from "@minecraft/vanilla-data";
function phantomsShouldFlyFromCats(test: Test) {
test.spawn(MinecraftEntityTypes.Cat, { x: 4, y: 3, z: 3 });
test.spawn(MinecraftEntityTypes.Phantom, { x: 4, y: 3, z: 3 });
test.succeedWhenEntityPresent(MinecraftEntityTypes.Phantom, { x: 4, y: 6, z: 3 }, true);
}
register("MobBehaviorTests", "phantoms_should_fly_from_cats", phantomsShouldFlyFromCats)
.structureName("gametests:glass_cells");
世界修改
早期执行
RegistrationBuilder object where additional configuration methods can be called.
import { Test, register } from "@minecraft/server-gametest";
import { MinecraftEntityTypes } from "@minecraft/vanilla-data";
function phantomsShouldFlyFromCats(test: Test) {
test.spawn(MinecraftEntityTypes.Cat, { x: 4, y: 3, z: 3 });
test.spawn(MinecraftEntityTypes.Phantom, { x: 4, y: 3, z: 3 });
test.succeedWhenEntityPresent(MinecraftEntityTypes.Phantom, { x: 4, y: 6, z: 3 }, true);
}
register("MobBehaviorTests", "phantoms_should_fly_from_cats", phantomsShouldFlyFromCats)
.structureName("gametests:glass_cells");
A utility class to set GameTest parameters for a test. Methods can be chained together to set multiple properties.