API - DauntlessStudio/Bedrock-Developments GitHub Wiki

bedrock-development

Table of contents

Classes

Interfaces

Type Aliases

Variables

Functions

Type Aliases

ClientACName

Ƭ ClientACName: `controller.animation.${string}`

Defined in

ts/app/types/client/animation_controller.ts:6


ClientAnimationName

Ƭ ClientAnimationName: `animation.${string}`

Defined in

ts/app/types/client/animation.ts:7


ClientEntityGeometryReference

Ƭ ClientEntityGeometryReference: `geometry.${string}`

Defined in

ts/app/types/client/entity.ts:14


ClientEntityTexturePath

Ƭ ClientEntityTexturePath: `textures/${string}`

Defined in

ts/app/types/client/entity.ts:13


ClientSoundCategory

Ƭ ClientSoundCategory: "ambient" | "block" | "bottle" | "bucket" | "hostile" | "music" | "neutral" | "player" | "record" | "ui" | "weather"

Defined in

ts/app/types/client/sound_definitions.ts:6


DamageType

Ƭ DamageType: string

Defined in

ts/app/types/server/entity.ts:9


EffectNames

Ƭ EffectNames: "speed" | "slowness" | "haste" | "mining_fatigue" | "strength" | "instant_health" | "instant_damage" | "jump_boost" | "regeneration" | "resistance" | "fire_resistance" | "water_breathing" | "invisibility" | "blindness" | "night_vision" | "hunger" | "weakness" | "poison" | "wither" | "health_boost" | "absorptoin" | "saturation" | "levitation" | "fatal_poison" | "slow_falling" | "conduit_power" | "bad_omen" | "village_hero" | "darkness"

Defined in

ts/app/types/shared_types.ts:7


File

Ƭ File: Object

Remarks

File Representation, contains the file path, file contents, and how to handle existing files.

Type declaration

Name Type
fileContents string
filePath string
handleExisting? "overwrite" | "overwrite_silent"

Defined in

ts/app/file_manager.ts:12


FormatVersion

Ƭ FormatVersion: `${number}.${number}.${number}`

Defined in

ts/app/types/shared_types.ts:1


GeometryName

Ƭ GeometryName: `geometry.${string}`

Defined in

ts/app/types/client/geometry.ts:6


Identifier

Ƭ Identifier: `${string}:${string}`

Defined in

ts/app/types/shared_types.ts:2


MolangDoubleArray

Ƭ MolangDoubleArray: [number | string, number | string]

Defined in

ts/app/types/shared_types.ts:4


MolangOption

Ƭ MolangOption: string | Record<string, string>

Defined in

ts/app/types/shared_types.ts:3


MolangTripleArray

Ƭ MolangTripleArray: [number | string, number | string, number | string]

Defined in

ts/app/types/shared_types.ts:5


Range

Ƭ Range: number | [number, number]

Defined in

ts/app/types/server/entity.ts:10


ServerACName

Ƭ ServerACName: `controller.animation.${string}`

Defined in

ts/app/types/server/animation_controller.ts:6


ServerAnimationName

Ƭ ServerAnimationName: `animation.${string}`

Defined in

ts/app/types/server/animation.ts:6


ServerEntityTarget

Ƭ ServerEntityTarget: "block" | "damager" | "other" | "parent" | "player" | "self" | "target"

Defined in

ts/app/types/server/entity.ts:11


SlotOptions

Ƭ SlotOptions: "slot.weapon.mainhand" | "slot.weapon.offhand" | "slot.armor.head" | "slot.armor.chest" | "slot.armor.legs" | "slot.armor.feet" | "slot.hotbar" | "slot.inventory" | "slot.enderchest" | "slot.saddle" | "slot.armor" | "slot.chest" | "slot.equippable"

Defined in

ts/app/types/shared_types.ts:6

Variables

MOJANG

Const MOJANG: string

Defined in

ts/app/types/world.ts:11


currentFormatVersion

Const currentFormatVersion: "1.20.50"

Remarks

The format version shared by all Minecraft Types.

Defined in

ts/app/utils.ts:13

Functions

archiveDirectory

archiveDirectory(dir, zipPath, callback): void

Parameters

Name Type Description
dir string The directory to archive.
zipPath string The path the directory should be archived to.
callback Function A callback to run when the directory finishes archiving.

Returns

void

Remarks

Archives a directory, compressing to a .zip or .mcworld for example.

Defined in

ts/app/file_manager.ts:213


cache

cache(target, propertyName, descriptor): void

Parameters

Name Type
target any
propertyName string
descriptor PropertyDescriptor

Returns

void

Defined in

ts/app/types/world.ts:14


chalk

chalk(...text): string

Parameters

Name Type
...text unknown[]

Returns

string

Remarks

A globally accessible instance of the Chalk class that provides colored text in the terminal.

Defined in

ts/app/utils.ts:8


copySourceDirectory

copySourceDirectory(src, dest): void

Parameters

Name Type Description
src string The path to a source directory within this module's src.
dest string The filepath to the destination where the directory should be copied to.

Returns

void

Remarks

Copies a source directory from this module to a destination.

Defined in

ts/app/file_manager.ts:194


copySourceFile

copySourceFile(sourceFile, targetPath, handleExisting?): void

Parameters

Name Type Description
sourceFile string The filepath to a source file within this module's src.
targetPath string The filepath to the destination the file should be copied to.
handleExisting? "overwrite" | "overwrite_silent" How to handle existing files. Undefined will not overwrite, 'overwite' replaces the file with this object, 'overwrite_silent' does the same with no terminal log.

Returns

void

Remarks

Copies a source file from this module to a destination.

Defined in

ts/app/file_manager.ts:164


getConfig

getConfig(): IConfigData | undefined

Returns

IConfigData | undefined

Remarks

Gets the config data from the working directory.

Defined in

ts/app/utils.ts:156


getFiles

getFiles(globPattern): File[]

Parameters

Name Type Description
globPattern string The glob pattern to use to find files.

Returns

File[]

An array of Files matching the pattern.

Remarks

Gets files matching a glob pattern.

Example

let files = getFiles(Directories.RESOURCE_PATH + 'texts/*.lang');

Defined in

ts/app/file_manager.ts:112


getStringFromTemporaryFile

getStringFromTemporaryFile(): Promise<string>

Returns

Promise<string>

A promise to a string.

Remarks

Creates a temporary file, opening it in Notepad. The contents of the file will be returned when Notepad is closed.

Defined in

ts/app/file_manager.ts:231


implementConfig

implementConfig(): void

Returns

void

Defined in

ts/app/utils.ts:163


isObject

isObject(item): boolean

Parameters

Name Type Description
item any The item to check.

Returns

boolean

True if the item is an object.

Remarks

Determines if a value is an object or a primitive.

Defined in

ts/app/utils.ts:113


mergeDeep

mergeDeep(target, source): any

Parameters

Name Type Description
target any The target object to merge with.
source any The source object to merge with the target.

Returns

any

An object with the properties of the source and target merged deeply.

Remarks

Performs a deep merge between two objects.

Example

mergeDeep({subProperty: {targetKey: 1}}, {subProperty: {sourceKey: 2}}); 
// Returns {subProperty: {targetKey: 1, sourceKey: 2}};

Defined in

ts/app/utils.ts:128


non_serializable

non_serializable(target, key): void

Parameters

Name Type
target any
key string | symbol

Returns

void

Defined in

ts/app/types/minecraft.ts:6


runProgram

runProgram(): Promise<void>

Returns

Promise<void>

Defined in

ts/app/commands/index.ts:9


setAddonName

setAddonName(addon): void

Parameters

Name Type Description
addon string The addon name as <team_name>_<project_name>.

Returns

void

Remarks

Sets the global addon data from the addon namespace.

Defined in

ts/app/utils.ts:193


setConfig

setConfig(config): void

Parameters

Name Type Description
config IConfigData The config data to write.

Returns

void

Remarks

Sets the bedrock.config.json file contents.

Defined in

ts/app/utils.ts:175


setFiles

setFiles(files): void

Parameters

Name Type Description
files File[] The array of Files to write.

Returns

void

Remarks

Writes an array of files.

Example

let files = getFiles(Directories.RESOURCE_PATH + 'texts/*.lang');
files.forEach(file => file.fileContents = ':)');
setFiles(files);

Defined in

ts/app/file_manager.ts:130

⚠️ **GitHub.com Fallback** ⚠️