Skip to content

PrefabEntityTemplate

16.16

Class Documentation

Edit documentation

An entity template that groups other placed templates into one prefab. The members are other items of the same MapPlaceableContainer. They do not spawn on their own: they spawn as children of the prefab entity.

Load. When the template loads, the client hashes each string of MemberList and stores the hashes in the Hierarchy definition. When the template is registered with the world, each hash is looked up among the item keys of the container that places the prefab, in the same chunk instance. Each template that it finds is marked as a member of this prefab. At map load the client spawns every placed template except the marked members (see GameEntityTemplate).

Spawn. When the client creates the prefab entity, it spawns each member template as a separate entity. Each member entity has the prefab entity as its parent, and the prefab's HierarchyGeComponent keeps the list of children.

Activation. A child entity takes its initial active state from the parent instead of from its own template. When the prefab entity activates or deactivates, the hierarchy component activates or deactivates every child.

Properties

MemberList

List2<String> = []
16.20
Edit documentation

Names of the member items. Each name is hashed and compared with the keys of the Items map of the container that places the prefab. The client resolves the members when the template is registered, not when the prefab spawns.