bedrock-kit
    Preparing search index...

    Class Feature

    Represents a world generation feature definition from the behavior pack's features/ directory.

    Feature files use various root keys (minecraft:single_block_feature, minecraft:tree_feature, etc.) — all are parsed and exposed uniformly.

    Access via addon.features.get(id) or through featureRule.placesFeature.

    const feature = addon.features.get("tsu_nat:maple_tree");
    console.log(feature?.featureType); // "minecraft:tree_feature"
    console.log(feature?.placedByFeatureRules.length); // number of rules that place it

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      • id: string
      • filePath: string
      • data: Record<string, unknown>
      • rawText: string
      • addon: AddOn

      Returns Feature

    Properties

    data: Record<string, unknown>

    The raw parsed JSON data of the asset file.

    docstrings: CommentBlock[]

    All JSDoc-style comment blocks parsed from this asset's source file, in document order. Empty array when no /** … */ blocks are present.

    featureType: string

    The full JSON root key identifying the feature type, e.g. "minecraft:tree_feature".

    filePath: string

    Absolute path to the asset's file on disk. Empty string in browser mode.

    id: string

    The namespaced feature identifier, e.g. "tsu_nat:maple_tree".

    Accessors