# EntityElement

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

Source: https://github.com/playcanvas/web-components/blob/b95efbfac5c64c11284a27e8e18224700d05fc77/src/entity.ts#L50

The EntityElement interface provides properties and methods for manipulating
[`<pc-entity>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-entity/) elements.
The EntityElement interface also inherits the properties and methods of the
[HTMLElement](https://developer.mozilla.org/docs/Web/API/HTMLElement) interface.

The pointer events below are dispatched by the containing `<pc-app>` element when the pointer
intersects this entity's geometry. They are only generated while the entity has a listener for
them, registered either with [EventTarget.addEventListener](https://developer.mozilla.org/docs/Web/API/EventTarget/addEventListener) or with the matching inline
attribute (`onpointerdown`, `onclick`, ...).

**elementSummary** The `<pc-entity>` element creates an entity: a named, transformable node of the
scene hierarchy, and the host for component elements such as `<pc-camera>`, `<pc-light>` and
`<pc-render>`. Place it in the `<pc-scene>`, or nest it under another `<pc-entity>`, a
`<pc-model>` or a `<pc-node>` to parent it there.

**attribute** enabled - The enabled state of the entity.

**attribute** name - The name of the entity.

**attribute** position - The position of the entity.

**attribute** rotation - The rotation of the entity.

**attribute** scale - The scale of the entity.

**attribute** tags - The tags of the entity.

**attribute** onpointerenter - Script to run when the pointer moves onto the entity.

**attribute** onpointerleave - Script to run when the pointer moves off the entity.

**attribute** onpointermove - Script to run when the pointer moves over the entity.

**attribute** onpointerdown - Script to run when a pointer button is pressed over the
entity.

**attribute** onpointerup - Script to run when a pointer button is released over the
entity.

**attribute** onclick - Script to run when the entity is clicked: a primary pointer
button pressed and then released over it.

**fires** pointerenter - Fired when the pointer moves onto the entity.

**fires** pointerleave - Fired when the pointer moves off the entity.

**fires** pointermove - Fired when the pointer moves over the entity.

**fires** pointerdown - Fired when a pointer button is pressed over the entity.

**fires** pointerup - Fired when a pointer button is released over the entity.

**fires** click - Fired when a primary pointer button is pressed and then released
over the entity. A press and release that picked different entities fires on their nearest
common ancestor instead, as in the DOM. `detail` carries the click count, so a double click
arrives as a click whose `detail` is 2.

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

- `protected _appElement: AppElement | null = null`
- `protected _built: boolean = false`
- `get closestApp(): AppElement | null`
- `get closestEntity(): EntityBaseElement | null`
- `get enabled(): boolean` · `set enabled(value: boolean)`
- `get entity(): Entity | null`
- `get name(): string` · `set name(value: string)`
- `get position(): Vec3` · `set position(value: Vec3)`
- `get rotation(): Vec3` · `set rotation(value: Vec3)`
- `get scale(): Vec3` · `set scale(value: Vec3)`
- `get tags(): string[]` · `set tags(value: string[])`
- `protected _onBuilt(): void`
- `protected _onEntityDestroy(entity: Entity): void`
- `protected _onReady(): void`
- `protected _registerEntity(entity: Entity): void`
- `protected _resetReady(): void`
- `protected _unregisterEntity(entity: Entity): void`
- `protected _updateInlineHandler(name: string, value: string | null): void`
- `ready(): Promise<EntityElement>`
