# EntityBaseElement

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

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

The base class for elements that front an engine [Entity](https://api.playcanvas.com/engine/classes/Entity.html): `<pc-entity>` and
`<pc-model>`, which create one, and `<pc-node>`, which binds to one inside a model's
instantiated hierarchy. It carries what all of them need — the `entity` contract, registration
with the owning application (which joins picked scene nodes back to elements by identity,
never by name), and the pointer listener bookkeeping that tells the application when to pick.

## Properties

### _appElement

```ts
protected _appElement: AppElement | null = null
```

The application element this entity is registered with, cached at registration time so the
entity can be unregistered even once this element has left the DOM.

## Accessors

### entity

```ts
get entity(): Entity | null
```

The PlayCanvas entity instance. `null` until the element is ready, and again once the
entity is gone — await [whenReady](https://api.playcanvas.com/web-components/functions/whenReady.md) or the element's `ready()` promise before
accessing it.

## Methods

### _registerEntity

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

Registers `entity` as this element's backing entity with the owning application, which
joins engine nodes back to elements by identity (never by name).

**Parameters**

- `entity` (`Entity`): The entity to register.

### _unregisterEntity

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

Removes the registration for `entity`.

**Parameters**

- `entity` (`Entity`): The entity to unregister.

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

- `get closestApp(): AppElement | null`

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

- `get closestEntity(): EntityBaseElement | null`

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

- `protected _onReady(): void`
- `protected _resetReady(): void`
- `ready(): Promise<EntityBaseElement>`
