UNPKG

@minecraft/creator-tools

Version:

Minecraft Creator Tools command line and libraries.

35 lines (34 loc) 1.13 kB
"use strict"; // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. Object.defineProperty(exports, "__esModule", { value: true }); exports.TeleporterEntityTrait = void 0; const ContentTraits_1 = require("./ContentTraits"); /** * Teleporter - can teleport. */ class TeleporterEntityTrait extends ContentTraits_1.EntityContentTrait { get id() { return "teleporter"; } getData(config) { const teleportChance = config?.teleportChance ?? 0.01; return { id: "teleporter", displayName: "Teleporter", description: "Can teleport", category: "special", components: { "minecraft:teleport": { random_teleports: true, max_random_teleport_time: 30.0, random_teleport_cube: [32, 16, 32], target_distance: 16.0, target_teleport_chance: teleportChance, light_teleport_chance: 0.01, }, }, }; } } exports.TeleporterEntityTrait = TeleporterEntityTrait;