@minecraft/creator-tools
Version:
Minecraft Creator Tools command line and libraries.
35 lines (34 loc) • 1.07 kB
JavaScript
;
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
Object.defineProperty(exports, "__esModule", { value: true });
exports.ThrowableItemTrait = void 0;
const ContentTraits_1 = require("./ContentTraits");
/**
* Throwable - can be thrown.
*/
class ThrowableItemTrait extends ContentTraits_1.ItemContentTrait {
get id() {
return "throwable";
}
getData(config) {
const launchPower = config?.launchPower ?? 1.0;
return {
id: "throwable",
displayName: "Throwable",
description: "Can be thrown",
category: "special",
components: {
"minecraft:throwable": {
do_swing_animation: true,
launch_power_scale: launchPower,
max_launch_power: 1.5,
},
"minecraft:projectile": {
projectile_entity: "minecraft:snowball",
},
},
};
}
}
exports.ThrowableItemTrait = ThrowableItemTrait;