hytopia
Version:
The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.
62 lines (31 loc) • 1.56 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [server](./server.md) > [DefaultPlayerEntity](./server.defaultplayerentity.md)
## DefaultPlayerEntity class
Represents the default player model entity.
**Signature:**
```typescript
export default class DefaultPlayerEntity extends PlayerEntity
```
**Extends:** [PlayerEntity](./server.playerentity.md)
## Remarks
The default player entity extends the [PlayerEntity](./server.playerentity.md) class, uses the default player model, and assigns a DefaultPlayerEntityController. This entity is the most commonly used player controlled entity in games. It automatically handles things like managing player visual customizations and cosmetics, and more. If you want to change the default model used, you can override all of the defaults, including the modelUri, but you must ensure that the model used has the same animation names and anchor points as the default player model in order to prevent unexpected behavior.
## Example
```typescript
const playerEntity = new DefaultPlayerEntity({ player });
playerEntity.spawn(world, { x: 0, y: 10, z: 0 });
```
## Constructors
<table><thead><tr><th>
Constructor
</th><th>
Modifiers
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
[(constructor)(options)](./server.defaultplayerentity._constructor_.md)
</td><td>
</td><td>
Constructs a new instance of the `DefaultPlayerEntity` class
</td></tr>
</tbody></table>