UNPKG

hytopia

Version:

The HYTOPIA SDK makes it easy for developers to create massively multiplayer games using JavaScript or TypeScript.

113 lines (54 loc) 1.88 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [server](./server.md) &gt; [DefaultPlayerEntity](./server.defaultplayerentity.md) ## DefaultPlayerEntity class Represents the default player model entity. When to use: standard player avatars with built-in cosmetics and default controls. Do NOT use for: fully custom player rigs that don't match the default model's anchors/animations. **Signature:** ```typescript export default class DefaultPlayerEntity extends PlayerEntity ``` **Extends:** [PlayerEntity](./server.playerentity.md) ## Remarks Extends `PlayerEntity`<!-- -->, uses the default player model, and assigns `DefaultPlayerEntityController`<!-- -->. You can override defaults, but if you change `modelUri`<!-- -->, ensure the model has the same animation names and anchor points. ## Example ```typescript const playerEntity = new DefaultPlayerEntity({ player }); playerEntity.spawn(world, { x: 0, y: 10, z: 0 }); ``` \*\*Category:\*\* Entities ## 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> Creates a new DefaultPlayerEntity instance. </td></tr> </tbody></table> ## Properties <table><thead><tr><th> Property </th><th> Modifiers </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td> [cosmeticHiddenSlots](./server.defaultplayerentity.cosmetichiddenslots.md) </td><td> `readonly` </td><td> [PlayerCosmeticSlot](./server.playercosmeticslot.md)<!-- -->\[\] </td><td> The cosmetic slots that are hidden. \*\*Category:\*\* Entities </td></tr> </tbody></table>