# EntityOwnerElement

Class · extends [`EntityBaseElement`](https://api.playcanvas.com/web-components/classes/EntityBaseElement.md) · category: Base Classes

Source: https://github.com/playcanvas/web-components/blob/252f001881302c266c8d727044408c32be2bb5e7/src/entity-owner.ts#L42

The base class for elements that create and own their backing entity: `<pc-entity>` and
`<pc-model>`, whose host entity carries the same authored properties. It carries the cached
property state, entity creation and parenting, and the reset that follows the entity's
destruction. `<pc-node>` sits outside this class: it borrows an entity a model instantiated,
and its properties are nullable overrides rather than owned values.

## Properties

### _built

```ts
protected _built: boolean = false
```

Whether the hierarchy has been built for this entity — set once `_buildHierarchy` has
parented it. Read by subclasses that gate work on the entity being in the scene graph.

## Accessors

### enabled

```ts
get enabled(): boolean
set enabled(value: boolean)
```

Gets the enabled state of the entity.

### name

```ts
get name(): string
set name(value: string)
```

Gets the name of the entity.

### position

```ts
get position(): Vec3
set position(value: Vec3)
```

Gets the position of the entity.

### rotation

```ts
get rotation(): Vec3
set rotation(value: Vec3)
```

Gets the rotation of the entity.

### scale

```ts
get scale(): Vec3
set scale(value: Vec3)
```

Gets the scale of the entity.

### tags

```ts
get tags(): string[]
set tags(value: string[])
```

Gets the tags of the entity.

## Methods

### _onBuilt

```ts
protected _onBuilt(): void
```

Called by `_buildHierarchy` once the backing entity has been parented — exactly once
per build cycle. The default announces readiness, which is what a parented `<pc-entity>`
means; `<pc-model>` overrides it to start loading content instead, because its readiness
tracks the content settling rather than the host entering the scene graph.

### _onEntityDestroy

```ts
protected _onEntityDestroy(entity: Entity): void
```

Handles the destruction of the backing entity. Resets the element so a later re-insertion
starts clean: `_built` must be cleared alongside `_entity`, or _buildHierarchy would bail
and a re-created entity would never be parented. Readiness is re-armed for the same
reason — with the entity gone, a resolved ready promise would resume its awaiters against
a null `entity`.

**Parameters**

- `entity` (`Entity`): The entity that was destroyed.

## Inherited from [EntityBaseElement](https://api.playcanvas.com/web-components/classes/EntityBaseElement.md)

- `protected _appElement: AppElement | null = null`
- `get closestApp(): AppElement | null`
- `get closestEntity(): EntityBaseElement | null`
- `get entity(): Entity | null`
- `protected _onReady(): void`
- `protected _registerEntity(entity: Entity): void`
- `protected _resetReady(): void`
- `protected _unregisterEntity(entity: Entity): void`
- `ready(): Promise<EntityOwnerElement>`
