Skip to content

ServerEntity

github-actions[bot] edited this page Jul 15, 2024 · 19 revisions

Class: ServerEntity

Remarks

The parent class for all Minecraft data types, i.e. MinecraftServerClient.

Hierarchy

Implements

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new ServerEntity(filepath, template): ServerEntity

Parameters

Name Type
filepath string
template IServerEntity

Returns

ServerEntity

Overrides

MinecraftDataType.constructor

Defined in

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

Properties

filePath

filePath: string

Inherited from

MinecraftDataType.filePath

Defined in

ts/app/types/minecraft.ts:23


format_version

format_version: `${number}.${number}.${number}`

Implementation of

IServerEntity.format_version

Defined in

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


minecraft:entity

minecraft:entity: Object

Type declaration

Name Type
component_groups? IServerEntityComponentGroups
components IServerEntityComponents
description IServerEntityDescription
events IServerEntityEvents

Implementation of

IServerEntity.minecraft:entity

Defined in

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

Accessors

Identifier

get Identifier(): `${string}:${string}`

Returns

`${string}:${string}`

Defined in

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


NameData

get NameData(): NameData

Returns

NameData

Defined in

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


DirectoryPath

get DirectoryPath(): string

Returns

string

Remarks

The directory where this type of file is kept.

Overrides

MinecraftDataType.DirectoryPath

Defined in

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

Methods

hasFamilyTypes

hasFamilyTypes(...family): boolean

Parameters

Name Type
...family string[]

Returns

boolean

Defined in

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


replacer

replacer(key, value): any

Parameters

Name Type
key string
value any

Returns

any

Inherited from

MinecraftDataType.replacer

Defined in

ts/app/types/minecraft.ts:72


serialize

serialize(): string

Returns

string

A string representation of this object.

Remarks

Serializes this object to a string.

Inherited from

MinecraftDataType.serialize

Defined in

ts/app/types/minecraft.ts:63


setAnimateScripts

setAnimateScripts(...animations): void

Parameters

Name Type
...animations (string | { [key: string]: string; })[]

Returns

void

Defined in

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


setAnimations

setAnimations(animations, handleExisting?, options?): void

Parameters

Name Type Default value
animations Object undefined
handleExisting "overwrite" | "merge" | "ignore" 'overwrite'
options? IServerEntityAnimationOptions undefined

Returns

void

Defined in

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


setComponentGroups

setComponentGroups(groups, handleExisting?, options?): void

Parameters

Name Type Default value
groups IServerEntityComponentGroups undefined
handleExisting "overwrite" | "merge" | "ignore" 'overwrite'
options? IServerEntityComponentGroupOptions undefined

Returns

void

Defined in

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


setComponents

setComponents(components, handleExisting?): void

Parameters

Name Type Default value
components IServerItemComponents undefined
handleExisting "overwrite" | "merge" | "ignore" 'overwrite'

Returns

void

Defined in

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


setDamageSensor

setDamageSensor(sensor, options?): void

Parameters

Name Type
sensor IServerEntityDamageSensor
options? IServerEntityDamageSensorOptions

Returns

void

Defined in

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


setEvents

setEvents(events, handleExisting?): void

Parameters

Name Type Default value
events IServerEntityEvents undefined
handleExisting "overwrite" | "merge" | "ignore" 'overwrite'

Returns

void

Defined in

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


setProperties

setProperties(properties, handleExisting?, options?): void

Parameters

Name Type Default value
properties IServerEntityProperties undefined
handleExisting "overwrite" | "merge" | "ignore" 'overwrite'
options? IServerEntityPropertiesOptions undefined

Returns

void

Defined in

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


toFile

toFile(handleExisting?): File

Parameters

Name Type Description
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

File

A File object with this MinecraftDataType's filepath, and this object serialized as the file contents.

Remarks

Creates a File object from this MinecraftDataType.

Inherited from

MinecraftDataType.toFile

Defined in

ts/app/types/minecraft.ts:98


createFilePath

createFilePath(nameData): string

Parameters

Name Type Description
nameData NameData The namedata to use when creating the filepath.

Returns

string

The filepath as a string.

Remarks

Creates a filepath for this object type from a NameData.

Inherited from

MinecraftDataType.createFilePath

Defined in

ts/app/types/minecraft.ts:46


createFromTemplate

createFromTemplate(nameData): ServerEntity

Parameters

Name Type Description
nameData NameData The namedata to use for identifiers and the filepath.

Returns

ServerEntity

An instance of this data type.

Remarks

Creates a new instance of the data type using reasonable defaults from a NameData.

Overrides

MinecraftDataType.createFromTemplate

Defined in

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


deserialize

deserialize<T>(create, filepath, json): T

Type parameters

Name
T

Parameters

Name Type Description
create (filePath: string, template: any) => T The child of MinecraftDataType to create.
filepath string The filepath the MinecraftDataType can be written to with toFile.
json string The source string this should be deserialized from.

Returns

T

An instance of the MinecraftDataType child provided.

Remarks

Creates an instace of a MinecraftDataType child from a source string, used in fromFile.

Inherited from

MinecraftDataType.deserialize

Defined in

ts/app/types/minecraft.ts:83


fromFile

fromFile<T>(create, file): T

Type parameters

Name
T

Parameters

Name Type Description
create (filePath: string, template: any) => T The child of MinecraftDataType to create.
file File The File object used to deserialize into this object.

Returns

T

An instance of the MinecraftDataType child provided.

Remarks

Crates an instance of a MinecraftDataTypeChild from a File.

Inherited from

MinecraftDataType.fromFile

Defined in

ts/app/types/minecraft.ts:108


fromPathOrTemplate

fromPathOrTemplate<T>(create, path): T

Type parameters

Name
T

Parameters

Name Type Description
create (filePath: string, template: any) => T The child of MinecraftDataType to create.
path string The filepath to create the object from.

Returns

T

The deserialized file as a child of MinecraftDataType, or this object's createFromTemplate default if the file doesn't exist.

Remarks

Creates a MinecraftDataType object from a filepath, or a template if that filepath doesn't exist.

Inherited from

MinecraftDataType.fromPathOrTemplate

Defined in

ts/app/types/minecraft.ts:118

bedrock-development

Clone this wiki locally