@minecraft/creator-tools
Version:
Minecraft Creator Tools command line and libraries.
34 lines (33 loc) • 1.07 kB
JavaScript
;
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
Object.defineProperty(exports, "__esModule", { value: true });
exports.SoftMaterialBlockTrait = void 0;
const ContentTraits_1 = require("./ContentTraits");
/**
* Soft material - easily breakable.
*/
class SoftMaterialBlockTrait extends ContentTraits_1.BlockContentTrait {
get id() {
return "soft_material";
}
getData(config) {
const hardness = config?.hardness ?? 0.5;
return {
id: "soft_material",
displayName: "Soft Material",
description: "Easily breakable",
category: "material",
components: {
"minecraft:destructible_by_mining": {
seconds_to_destroy: hardness,
},
"minecraft:destructible_by_explosion": {
explosion_resistance: 0.5,
},
"minecraft:map_color": "#D2B48C",
},
};
}
}
exports.SoftMaterialBlockTrait = SoftMaterialBlockTrait;