Files
netease-bedrock-wiki/mcguide/20-玩法开发/14-预设玩法编程/13-PresetAPI/预设对象/零件/实体零件EntityBasePart.md
2025-07-31 17:53:14 +08:00

1.5 KiB
Raw Blame History

sidebarDepth
sidebarDepth
1

实体零件EntityBasePart

概述

  • 描述

    实体零件

  • 成员变量

    变量名
    数据类型
    说明
    engineType str 实体类型
    autoCreate bool 是否在零件初始化时自动创建关联实体默认为True
    persistence bool 创建的实体是否持久化默认为False设为True时创建完实体会将autoCreate重置为False

索引

接口
描述
CreateVirtualEntity 服务端 手动创建关联实体,如果已创建会直接返回
DestroyVirtualEntity 服务端 移除已创建的关联实体,引擎退出时会默认调用

CreateVirtualEntity

服务端

method in Preset.Parts.EntityBasePart.EntityBasePart

  • 描述

    手动创建关联实体,如果已创建会直接返回

  • 参数

  • 返回值

    数据类型
    说明
    str 返回创建的实体ID

DestroyVirtualEntity

服务端

method in Preset.Parts.EntityBasePart.EntityBasePart

  • 描述

    移除已创建的关联实体,引擎退出时会默认调用

  • 参数

  • 返回值