实验性
只读
实验性
controlling只读
实验性
crouching只读
实验性
entity只读
实验性
interact只读
实验性
passenger只读
实验性
pull只读
实验性
rider只读
实验性
seat只读
实验性
type静态
只读
实验性
component实验性
Entity that will become the rider of this entity.
True if the rider entity was successfully added.
import { EntityComponentTypes } from "@minecraft/server";
import { Test, register } from "@minecraft/server-gametest";
import { MinecraftBlockTypes, MinecraftEntityTypes } from "@minecraft/vanilla-data";
function minibiomes(test: Test) {
const minecart = test.spawn(MinecraftEntityTypes.Minecart, { x: 9, y: 7, z: 7 });
const pig = test.spawn(MinecraftEntityTypes.Pig, { x: 9, y: 7, z: 7 });
test.setBlockType(MinecraftBlockTypes.Cobblestone, { x: 10, y: 7, z: 7 });
const minecartRideableComp = minecart.getComponent(EntityComponentTypes.Rideable);
minecartRideableComp?.addRider(pig);
test.succeedWhenEntityPresent(MinecraftEntityTypes.Pig, { x: 8, y: 3, z: 1 }, true);
}
register("ChallengeTests", "minibiomes", minibiomes).structureName("gametests:minibiomes").maxTicks(160);
实验性
Entity that should be ejected from this entity.
When added, this component adds the capability that an entity can be ridden by another entity.
示例: minibiomes.ts