ServerEntity - DauntlessStudio/Bedrock-Developments GitHub Wiki
Remarks
The parent class for all Minecraft data types, i.e. MinecraftServerClient.
-
↳
ServerEntity
- hasFamilyTypes
- replacer
- serialize
- setAnimateScripts
- setAnimations
- setComponentGroups
- setComponents
- setDamageSensor
- setEvents
- setProperties
- toFile
- createFilePath
- createFromTemplate
- deserialize
- fromFile
- fromPathOrTemplate
• new ServerEntity(filepath
, template
): ServerEntity
Name | Type |
---|---|
filepath |
string |
template |
IServerEntity |
ts/app/types/server/entity.ts:262
• filePath: string
• format_version: `${number}.${number}.${number}`
ts/app/types/server/entity.ts:242
• minecraft:entity: Object
Name | Type |
---|---|
component_groups? |
IServerEntityComponentGroups |
components |
IServerEntityComponents |
description |
IServerEntityDescription |
events |
IServerEntityEvents |
IServerEntity.minecraft:entity
ts/app/types/server/entity.ts:243
• get
Identifier(): `${string}:${string}`
`${string}:${string}`
ts/app/types/server/entity.ts:254
• get
NameData(): NameData
ts/app/types/server/entity.ts:258
• get
DirectoryPath(): string
string
Remarks
The directory where this type of file is kept.
MinecraftDataType.DirectoryPath
ts/app/types/server/entity.ts:250
▸ hasFamilyTypes(...family
): boolean
Name | Type |
---|---|
...family |
string [] |
boolean
ts/app/types/server/entity.ts:546
▸ replacer(key
, value
): any
Name | Type |
---|---|
key |
string |
value |
any |
any
▸ serialize(): string
string
A string representation of this object.
Remarks
Serializes this object to a string.
▸ setAnimateScripts(...animations
): void
Name | Type |
---|---|
...animations |
(string | { [key: string] : string ; })[] |
void
ts/app/types/server/entity.ts:535
▸ setAnimations(animations
, handleExisting?
, options?
): void
Name | Type | Default value |
---|---|---|
animations |
Object |
undefined |
handleExisting |
"overwrite" | "merge" | "ignore"
|
'overwrite' |
options? |
IServerEntityAnimationOptions |
undefined |
void
ts/app/types/server/entity.ts:507
▸ setComponentGroups(groups
, handleExisting?
, options?
): void
Name | Type | Default value |
---|---|---|
groups |
IServerEntityComponentGroups |
undefined |
handleExisting |
"overwrite" | "merge" | "ignore"
|
'overwrite' |
options? |
IServerEntityComponentGroupOptions |
undefined |
void
ts/app/types/server/entity.ts:352
▸ setComponents(components
, handleExisting?
): void
Name | Type | Default value |
---|---|---|
components |
IServerItemComponents |
undefined |
handleExisting |
"overwrite" | "merge" | "ignore"
|
'overwrite' |
void
ts/app/types/server/entity.ts:329
▸ setDamageSensor(sensor
, options?
): void
Name | Type |
---|---|
sensor |
IServerEntityDamageSensor |
options? |
IServerEntityDamageSensorOptions |
void
ts/app/types/server/entity.ts:493
▸ setEvents(events
, handleExisting?
): void
Name | Type | Default value |
---|---|---|
events |
IServerEntityEvents |
undefined |
handleExisting |
"overwrite" | "merge" | "ignore"
|
'overwrite' |
void
ts/app/types/server/entity.ts:397
▸ setProperties(properties
, handleExisting?
, options?
): void
Name | Type | Default value |
---|---|---|
properties |
IServerEntityProperties |
undefined |
handleExisting |
"overwrite" | "merge" | "ignore"
|
'overwrite' |
options? |
IServerEntityPropertiesOptions |
undefined |
void
ts/app/types/server/entity.ts:420
▸ toFile(handleExisting?
): File
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. |
A File object with this MinecraftDataType's filepath, and this object serialized as the file contents.
Remarks
Creates a File object from this MinecraftDataType.
▸ createFilePath(nameData
): string
Name | Type | Description |
---|---|---|
nameData |
NameData |
The namedata to use when creating the filepath. |
string
The filepath as a string.
Remarks
Creates a filepath for this object type from a NameData.
MinecraftDataType.createFilePath
▸ createFromTemplate(nameData
): ServerEntity
Name | Type | Description |
---|---|---|
nameData |
NameData |
The namedata to use for identifiers and the filepath. |
An instance of this data type.
Remarks
Creates a new instance of the data type using reasonable defaults from a NameData.
MinecraftDataType.createFromTemplate
ts/app/types/server/entity.ts:268
▸ deserialize<T
>(create
, filepath
, json
): T
Name |
---|
T |
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. |
T
An instance of the MinecraftDataType child provided.
Remarks
Creates an instace of a MinecraftDataType child from a source string, used in fromFile.
▸ fromFile<T
>(create
, file
): T
Name |
---|
T |
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. |
T
An instance of the MinecraftDataType child provided.
Remarks
Crates an instance of a MinecraftDataTypeChild from a File.
▸ fromPathOrTemplate<T
>(create
, path
): T
Name |
---|
T |
Name | Type | Description |
---|---|---|
create |
(filePath : string , template : any ) => T
|
The child of MinecraftDataType to create. |
path |
string |
The filepath to create the object from. |
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.