BetaBetaExpression of the condition to evaluate.
Message that is passed if the condition does not evaluate to true.
BetaBetaEntity that you wish to test the location against.
Structure-relative location to test whether the specified mob can reach.
OptionalcanReach: booleanIf true, tests whether the mob can reach the location. If false, tests whether the mob is not able to reach the location.
BetaLocation of the block with a container (for example, a chest) to test is empty of contents.
BetaIdentifier of the entity to match (e.g., 'minecraft:skeleton').
Container slot index to test.
Name of the armor to look for.
Data value integer to look for.
Location of the entity with armor to test for.
OptionalhasArmor: booleanWhether or not the entity is expected to have the specified armor equipped.
BetaIdentifier of the specified entity (e.g., 'minecraft:skeleton'). If the namespace is not specified, 'minecraft:' is assumed.
Identifier of the component to check for. If the namespace is not specified, 'minecraft:' is assumed.
Location of the block with a container (for example, a chest.)
OptionalhasComponent: booleanDetermines whether to test that the component exists, or does not.
BetaEntity instance to test for.
OptionalisPresent: booleanIf true, this function tests whether the specified entity is present in the GameTest area. If false, tests that the specified entity is not present.
Tests that an entity instance is present within the GameTest area. If not, an exception is thrown.
gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
const attackerId = "fox";
const victimId = "chicken";
test.spawn(attackerId, { x: 5, y: 2, z: 5 });
let victim = test.spawn(victimId, { x: 2, y: 2, z: 2 });
test.assertEntityInstancePresentInArea(victim, true);
test.succeedWhen(() => {
test.assertEntityInstancePresentInArea(victim, false);
});
})
.maxTicks(400)
.structureName("gametests:mediumglass");
BetaType of entity to test for (e.g., 'minecraft:skeleton'). If an entity namespace is not specified, 'minecraft:' is assumed.
Location of the entity to test for.
OptionalsearchDistance: numberThe distance to search for the entity from the blockLocation.
OptionalisPresent: booleanIf true, this function tests whether an entity of the specified type is present. If false, tests that an entity of the specified type is not present.
BetaType of entity to test for (e.g., 'minecraft:skeleton'). If an entity namespace is not specified, 'minecraft:' is assumed.
OptionalisPresent: booleanIf true, this function tests whether an entity of the specified type is present in the GameTest area. If false, tests that an entity of the specified type is not present.
Tests that an entity of a specified type is present within the GameTest area. If not, an exception is thrown.
gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
const attackerId = "fox";
const victimId = "chicken";
test.spawn(attackerId, { x: 5, y: 2, z: 5 });
test.spawn(victimId, { x: 2, y: 2, z: 2 });
test.assertEntityPresentInArea(victimId, true);
test.succeedWhen(() => {
test.assertEntityPresentInArea(victimId, false);
});
})
.maxTicks(400)
.structureName("gametests:mediumglass");
BetaLocation of the entity to look for.
Identifier of the entity (e.g., 'minecraft:skeleton') to look for. Note if no namespace is specified, 'minecraft:' is assumed.
Callback function where facets of the selected entity can be tested for. If this callback function returns false or no entity with the specified identifier is found, an exception is thrown.
BetaType of entity to test for (e.g., 'minecraft:skeleton'). If an entity namespace is not specified, 'minecraft:' is assumed.
Location of the entity to test for.
OptionalisTouching: booleanIf true, this function tests whether the entity is touching the specified location. If false, tests that an entity is not testing the specified location.
BetaLocation of the block to test for.
OptionalisWaterlogged: booleanWhether to test that the block at position is expected to be waterlogged.
BetaType of item to look for.
Location to search around for the specified set of items.
Range, in blocks, to aggregate a count of items around. If 0, will only search the particular block at position.
Number of items, at minimum, to look and test for.
BetaType of item to test for.
Location of the item entity to test for.
OptionalsearchDistance: numberRadius in blocks to look for the item entity.
OptionalisPresent: booleanIf true, this function tests whether an item entity of the specified type is present. If false, tests that an item entity of the specified type is not present.
BetaLocation to test.
Expected power level.
BetaLocation of the block to destroy.
OptionaldropResources: booleanWhether to add resources exposed with a particular drop.
BetaCallback function that runs. If the function runs successfully, the test is marked as a failure. Typically, this function will have .assertXyz method calls within it.
BetaLocation of the block to retrieve a sculk spreader from.
BetaBetaLocation to pulse Redstone at.
Number of ticks to pulse Redstone.
BetaPermutation that contains the configuration data for a block.
Location of the block to set.
BetaEntity that is explodable.
Length of time, in ticks, before the entity explodes.
BetaType of entity to create. If no namespace is provided,
'minecraft:' is assumed. Note that an optional initial spawn
event can be specified between less than/greater than signs
(e.g., namespace:entityType
The spawned entity. If the entity cannot be spawned, returns undefined.
gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
const attackerId = "fox";
const victimId = "chicken";
test.spawn(attackerId, { x: 5, y: 2, z: 5 });
test.spawn(victimId, { x: 2, y: 2, z: 2 });
test.assertEntityPresentInArea(victimId, true);
test.succeedWhen(() => {
test.assertEntityPresentInArea(victimId, false);
});
})
.maxTicks(400)
.structureName("gametests:mediumglass");
BetaType of entity to create. If no namespace is provided,
'minecraft:' is assumed. Note that an optional initial spawn
event can be specified between less than/greater than signs
(e.g., namespace:entityType
The spawned entity. If the entity cannot be spawned, returns undefined.
BetaA new GameTestSequence with chaining methods that facilitate creating a set of steps.
BetaCallback function that runs. If the function runs successfully, the test is marked as a success. Typically, this function will have .assertXyz method calls within it.
BetaTick after the start of the GameTest to run the testing callback at.
Callback function that runs. If the function runs successfully, the test is marked as a success.
BetaTesting callback function that runs. If the function runs successfully, the test is marked as a success.
Runs the given callback every tick. When the callback successfully executes, the test is marked as a success. Specifically, the test will succeed when the callback does not throw an exception.
gt.register("StarterTests", "simpleMobTest", (test: gt.Test) => {
const attackerId = "fox";
const victimId = "chicken";
test.spawn(attackerId, { x: 5, y: 2, z: 5 });
test.spawn(victimId, { x: 2, y: 2, z: 2 });
test.assertEntityPresentInArea(victimId, true);
test.succeedWhen(() => {
test.assertEntityPresentInArea(victimId, false);
});
})
.maxTicks(400)
.structureName("gametests:mediumglass");
BetaBetaType of entity to look for. If no namespace is specified, 'minecraft:' is assumed.
Type of component to test for the presence of. If no namespace is specified, 'minecraft:' is assumed.
Block location of the entity to test.
If true, this function tests for the presence of a component. If false, this function tests for the lack of a component.
BetaType of entity to test for (e.g., 'minecraft:skeleton'). If an entity namespace is not specified, 'minecraft:' is assumed.
Location of the entity to test for.
OptionalisPresent: booleanIf true, this function tests whether an entity of the specified type is present. If false, tests that an entity of the specified type is not present.
BetaEvent to trigger. Valid values include minecraft:drip, minecraft:grow_stalagtite, minecraft:grow_stalagmite, minecraft:grow_up, minecraft:grow_down and minecraft:grow_sideways.
OptionaleventParameters: number[]
Main class for GameTest functions, with helpers and data for manipulating the respective test. Note that all methods of this class expect BlockLocations and Locations relative to the GameTest structure block.