hytopia 0.14.49 → 0.14.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/docs/server.audio.md +1 -1
  2. package/docs/server.audio.setattachedtoentity.md +4 -0
  3. package/docs/server.audio.setposition.md +5 -1
  4. package/docs/server.audiomanager.unregisteraudio.md +4 -0
  5. package/docs/server.audiomanager.unregisterentityattachedaudios.md +4 -0
  6. package/docs/server.baseentitycontroller.attach.md +6 -0
  7. package/docs/server.baseentitycontroller.despawn.md +7 -1
  8. package/docs/server.baseentitycontroller.detach.md +7 -1
  9. package/docs/server.baseentitycontroller.md +1 -1
  10. package/docs/server.baseentitycontroller.spawn.md +7 -1
  11. package/docs/server.baseentitycontroller.tick.md +8 -0
  12. package/docs/server.baseentitycontroller.tickwithplayerinput.md +8 -2
  13. package/docs/server.blocktyperegistry.registergenericblocktype.md +4 -0
  14. package/docs/server.chunklattice.clear.md +6 -0
  15. package/docs/server.chunklattice.getorcreatechunk.md +6 -2
  16. package/docs/server.chunklattice.initializeblocks.md +7 -1
  17. package/docs/server.chunklattice.md +1 -1
  18. package/docs/server.chunklattice.setblock.md +7 -1
  19. package/docs/server.collider.addtosimulation.md +6 -0
  20. package/docs/server.collider.removefromsimulation.md +4 -0
  21. package/docs/server.collider.setoncollision.md +4 -0
  22. package/docs/server.collider.setscale.md +4 -0
  23. package/docs/server.defaultplayerentity._constructor_.md +10 -1
  24. package/docs/server.defaultplayerentity.md +1 -1
  25. package/docs/server.defaultplayerentitycontroller.attach.md +10 -0
  26. package/docs/server.defaultplayerentitycontroller.md +4 -0
  27. package/docs/server.defaultplayerentitycontroller.spawn.md +6 -0
  28. package/docs/server.defaultplayerentitycontroller.tickwithplayerinput.md +10 -0
  29. package/docs/server.entity._constructor_.md +6 -1
  30. package/docs/server.entity.despawn.md +10 -0
  31. package/docs/server.entity.md +8 -2
  32. package/docs/server.entity.setmodelhiddennodes.md +4 -0
  33. package/docs/server.entity.setmodelscale.md +6 -0
  34. package/docs/server.entity.setmodelshownnodes.md +4 -0
  35. package/docs/server.entity.spawn.md +14 -0
  36. package/docs/server.entity.startmodelloopedanimations.md +1 -1
  37. package/docs/server.entity.startmodeloneshotanimations.md +3 -1
  38. package/docs/server.entity.stopallmodelanimations.md +5 -1
  39. package/docs/server.entity.stopmodelanimations.md +1 -1
  40. package/docs/server.entitymanager.getentitychildren.md +5 -1
  41. package/docs/server.entitymanager.getplayerentitiesbyplayer.md +2 -2
  42. package/docs/server.entitymanager.md +1 -1
  43. package/docs/server.particleemitter.setattachedtoentity.md +4 -0
  44. package/docs/server.particleemitter.spawn.md +4 -0
  45. package/docs/server.pathfindingentitycontroller.md +4 -0
  46. package/docs/server.pathfindingentitycontroller.pathfind.md +14 -2
  47. package/docs/server.persistencemanager.getglobaldata.md +6 -0
  48. package/docs/server.player.disconnect.md +4 -0
  49. package/docs/server.player.joinworld.md +1 -1
  50. package/docs/server.playercamera.reset.md +4 -0
  51. package/docs/server.playercamera.setmodelhiddennodes.md +4 -0
  52. package/docs/server.playercamera.setmodelshownnodes.md +4 -0
  53. package/docs/server.playerentity._constructor_.md +6 -1
  54. package/docs/server.playerentity.md +1 -1
  55. package/docs/server.rigidbody.addtosimulation.md +4 -0
  56. package/docs/server.rigidbody.removefromsimulation.md +4 -0
  57. package/docs/server.rigidbody.setrotation.md +4 -0
  58. package/docs/server.sceneui.load.md +4 -0
  59. package/docs/server.sceneui.md +1 -1
  60. package/docs/server.sceneui.setattachedtoentity.md +4 -0
  61. package/docs/server.sceneui.setposition.md +5 -1
  62. package/docs/server.sceneuimanager.unloadentityattachedsceneuis.md +4 -0
  63. package/docs/server.simpleentitycontroller.face.md +6 -2
  64. package/docs/server.simpleentitycontroller.jump.md +9 -1
  65. package/docs/server.simpleentitycontroller.md +5 -1
  66. package/docs/server.simpleentitycontroller.move.md +8 -2
  67. package/docs/server.simpleentitycontroller.spawn.md +4 -0
  68. package/docs/server.simpleentitycontroller.stopface.md +4 -0
  69. package/docs/server.simpleentitycontroller.stopmove.md +5 -1
  70. package/docs/server.simulation.getcontactmanifolds.md +1 -1
  71. package/docs/server.startserver.md +2 -0
  72. package/docs/server.world.loadmap.md +8 -0
  73. package/docs/server.worldmanager.createworld.md +4 -0
  74. package/docs/server.worldmanager.getdefaultworld.md +4 -0
  75. package/package.json +1 -1
  76. package/server.api.json +67 -67
  77. package/server.d.ts +403 -40
  78. package/server.mjs +1 -1
@@ -597,7 +597,7 @@ Sets the playback rate of the audio.
597
597
 
598
598
  </td><td>
599
599
 
600
- Sets the position of the audio. Will detach from entity if attached.
600
+ Sets the position of the audio.
601
601
 
602
602
 
603
603
  </td></tr>
@@ -51,3 +51,7 @@ The entity to attach the Audio to.
51
51
 
52
52
  void
53
53
 
54
+ ## Remarks
55
+
56
+ \*\*Clears position:\*\* Setting an attached entity clears any previously set `position`<!-- -->. Audio can be entity-attached or position-based, not both.
57
+
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## Audio.setPosition() method
6
6
 
7
- Sets the position of the audio. Will detach from entity if attached.
7
+ Sets the position of the audio.
8
8
 
9
9
  **Signature:**
10
10
 
@@ -51,3 +51,7 @@ The position in the world.
51
51
 
52
52
  void
53
53
 
54
+ ## Remarks
55
+
56
+ \*\*Detaches from entity:\*\* Setting a position clears any `attachedToEntity`<!-- -->. Audio can be position-based or entity-attached, not both.
57
+
@@ -51,3 +51,7 @@ The audio instance to pause and unregister.
51
51
 
52
52
  void
53
53
 
54
+ ## Remarks
55
+
56
+ \*\*Pauses audio:\*\* Calls `audio.pause()` before removing from the manager.
57
+
@@ -51,3 +51,7 @@ The entity to pause and unregister audio instances for.
51
51
 
52
52
  void
53
53
 
54
+ ## Remarks
55
+
56
+ \*\*Pauses all:\*\* Calls `unregisterAudio()` for each attached audio, which pauses them.
57
+
@@ -51,3 +51,9 @@ The entity to attach the controller to.
51
51
 
52
52
  void
53
53
 
54
+ ## Remarks
55
+
56
+ \*\*Called by:\*\* `Entity` constructor when a controller is provided in options.
57
+
58
+ \*\*Super call:\*\* Call `super.attach(entity)` to emit the `ATTACH` event.
59
+
@@ -42,7 +42,7 @@ entity
42
42
 
43
43
  </td><td>
44
44
 
45
- The entity to despawn.
45
+ The entity being despawned.
46
46
 
47
47
 
48
48
  </td></tr>
@@ -51,3 +51,9 @@ The entity to despawn.
51
51
 
52
52
  void
53
53
 
54
+ ## Remarks
55
+
56
+ \*\*Called by:\*\* `Entity.despawn()` after `detach()` is called.
57
+
58
+ \*\*Super call:\*\* Call `super.despawn(entity)` to emit the `DESPAWN` event.
59
+
@@ -42,7 +42,7 @@ entity
42
42
 
43
43
  </td><td>
44
44
 
45
- The entity to detach.
45
+ The entity being detached.
46
46
 
47
47
 
48
48
  </td></tr>
@@ -51,3 +51,9 @@ The entity to detach.
51
51
 
52
52
  void
53
53
 
54
+ ## Remarks
55
+
56
+ \*\*Called by:\*\* `Entity.despawn()` before `despawn()` is called.
57
+
58
+ \*\*Super call:\*\* Call `super.detach(entity)` to emit the `DETACH` event.
59
+
@@ -119,7 +119,7 @@ Override this method to handle entity movements based on your entity controller.
119
119
 
120
120
  </td><td>
121
121
 
122
- Override this method to handle entity movements based on player input for your entity controller. This is called every tick by a PlayerEntity with a entity controller.
122
+ Override this method to handle entity movements based on player input for your entity controller.
123
123
 
124
124
 
125
125
  </td></tr>
@@ -42,7 +42,7 @@ entity
42
42
 
43
43
  </td><td>
44
44
 
45
- The entity to spawn.
45
+ The entity being spawned.
46
46
 
47
47
 
48
48
  </td></tr>
@@ -51,3 +51,9 @@ The entity to spawn.
51
51
 
52
52
  void
53
53
 
54
+ ## Remarks
55
+
56
+ \*\*Called by:\*\* `Entity.spawn()` after the entity is added to the physics simulation.
57
+
58
+ \*\*Super call:\*\* Call `super.spawn(entity)` to emit the `SPAWN` event.
59
+
@@ -42,6 +42,8 @@ entity
42
42
 
43
43
  </td><td>
44
44
 
45
+ The entity being ticked.
46
+
45
47
 
46
48
  </td></tr>
47
49
  <tr><td>
@@ -65,3 +67,9 @@ The delta time in milliseconds since the last tick.
65
67
 
66
68
  void
67
69
 
70
+ ## Remarks
71
+
72
+ \*\*Called by:\*\* `Entity.tick()` every tick for non-environmental entities. For `PlayerEntity`<!-- -->, this is called after `tickWithPlayerInput()`<!-- -->.
73
+
74
+ \*\*Super call:\*\* Call `super.tick(entity, deltaTimeMs)` to emit the `TICK` event.
75
+
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## BaseEntityController.tickWithPlayerInput() method
6
6
 
7
- Override this method to handle entity movements based on player input for your entity controller. This is called every tick by a PlayerEntity with a entity controller.
7
+ Override this method to handle entity movements based on player input for your entity controller.
8
8
 
9
9
  **Signature:**
10
10
 
@@ -42,7 +42,7 @@ entity
42
42
 
43
43
  </td><td>
44
44
 
45
- The entity to tick.
45
+ The player entity being ticked.
46
46
 
47
47
 
48
48
  </td></tr>
@@ -99,3 +99,9 @@ The delta time in milliseconds since the last tick.
99
99
 
100
100
  void
101
101
 
102
+ ## Remarks
103
+
104
+ \*\*Called by:\*\* `PlayerEntity.tick()` every tick when `isTickWithPlayerInputEnabled` is true. Called before `tick()`<!-- -->.
105
+
106
+ \*\*Super call:\*\* Call `super.tickWithPlayerInput(...)` to emit the `TICK_WITH_PLAYER_INPUT` event.
107
+
@@ -53,3 +53,7 @@ The options for the block type.
53
53
 
54
54
  The registered block type.
55
55
 
56
+ ## Remarks
57
+
58
+ \*\*Creates anonymous class:\*\* Internally creates an anonymous class extending `BlockType` with the provided options, then calls `registerBlockType()`<!-- -->.
59
+
@@ -15,3 +15,9 @@ clear(): void;
15
15
 
16
16
  void
17
17
 
18
+ ## Remarks
19
+
20
+ \*\*Removes colliders:\*\* All block type colliders are removed from the physics simulation.
21
+
22
+ \*\*Emits events:\*\* Emits `REMOVE_CHUNK` for each chunk before clearing.
23
+
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## ChunkLattice.getOrCreateChunk() method
6
6
 
7
- Get the chunk for a given global coordinate.
7
+ Get the chunk for a given global coordinate, creating it if it doesn't exist.
8
8
 
9
9
  **Signature:**
10
10
 
@@ -51,5 +51,9 @@ The global coordinate of the chunk to get.
51
51
 
52
52
  [Chunk](./server.chunk.md)
53
53
 
54
- The chunk at the given global coordinate or undefined if not found.
54
+ The chunk at the given global coordinate (created if needed).
55
+
56
+ ## Remarks
57
+
58
+ \*\*Creates chunk:\*\* If the chunk doesn't exist, creates a new one and emits `ADD_CHUNK`<!-- -->.
55
59
 
@@ -44,7 +44,7 @@ blocks
44
44
 
45
45
  </td><td>
46
46
 
47
- The blocks to initialize.
47
+ The blocks to initialize, keyed by block type id.
48
48
 
49
49
 
50
50
  </td></tr>
@@ -53,3 +53,9 @@ The blocks to initialize.
53
53
 
54
54
  void
55
55
 
56
+ ## Remarks
57
+
58
+ \*\*Clears first:\*\* Calls `clear()` before initializing, removing all existing blocks and colliders.
59
+
60
+ \*\*Collider optimization:\*\* Creates one collider per block type with all placements combined. Voxel colliders have their states combined for efficient neighbor collision detection.
61
+
@@ -209,7 +209,7 @@ Get the chunk that contains the given global coordinate.
209
209
 
210
210
  </td><td>
211
211
 
212
- Get the chunk for a given global coordinate.
212
+ Get the chunk for a given global coordinate, creating it if it doesn't exist.
213
213
 
214
214
 
215
215
  </td></tr>
@@ -74,7 +74,7 @@ blockRotation
74
74
 
75
75
  </td><td>
76
76
 
77
- _(Optional)_
77
+ _(Optional)_ The rotation of the block.
78
78
 
79
79
 
80
80
  </td></tr>
@@ -83,3 +83,9 @@ _(Optional)_
83
83
 
84
84
  void
85
85
 
86
+ ## Remarks
87
+
88
+ \*\*Collider updates:\*\* Manages physics colliders automatically. For voxel block types, updates the existing collider. For trimesh block types, recreates the entire collider.
89
+
90
+ \*\*Removes previous:\*\* If replacing an existing block, removes it from its collider first. If the previous block type has no remaining blocks, its collider is removed from simulation.
91
+
@@ -67,3 +67,9 @@ _(Optional)_ The parent rigid body of the collider.
67
67
 
68
68
  void
69
69
 
70
+ ## Remarks
71
+
72
+ \*\*Parent linking:\*\* Links the collider to the parent rigid body if provided.
73
+
74
+ \*\*Collision callback:\*\* Applies any configured `onCollision` callback.
75
+
@@ -15,3 +15,7 @@ removeFromSimulation(): void;
15
15
 
16
16
  void
17
17
 
18
+ ## Remarks
19
+
20
+ \*\*Parent unlinking:\*\* Unlinks from parent rigid body if attached.
21
+
@@ -51,3 +51,7 @@ The on collision callback for the collider.
51
51
 
52
52
  void
53
53
 
54
+ ## Remarks
55
+
56
+ \*\*Auto-enables events:\*\* Automatically enables/disables collision events based on whether callback is set.
57
+
@@ -49,3 +49,7 @@ scale
49
49
 
50
50
  void
51
51
 
52
+ ## Remarks
53
+
54
+ \*\*Ratio-based:\*\* Uses ratio-based scaling relative to current scale, not absolute dimensions. Also scales `relativePosition` proportionally.
55
+
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## DefaultPlayerEntity.(constructor)
6
6
 
7
- Constructs a new instance of the `DefaultPlayerEntity` class
7
+ Creates a new DefaultPlayerEntity instance.
8
8
 
9
9
  **Signature:**
10
10
 
@@ -42,6 +42,15 @@ options
42
42
 
43
43
  </td><td>
44
44
 
45
+ The options for the default player entity.
46
+
45
47
 
46
48
  </td></tr>
47
49
  </tbody></table>
50
+
51
+ ## Remarks
52
+
53
+ \*\*Auto-assigned defaults:\*\* A `DefaultPlayerEntityController` is automatically created and assigned. Default `modelLoopedAnimations` are `['idle_lower', 'idle_upper']`<!-- -->. All defaults can be overridden via options.
54
+
55
+ \*\*Cosmetics on spawn:\*\* When spawned, player cosmetics (hair, skin, equipped items) are fetched asynchronously and applied. Child entities are created for hair and equipped cosmetic items.
56
+
@@ -54,7 +54,7 @@ Description
54
54
 
55
55
  </td><td>
56
56
 
57
- Constructs a new instance of the `DefaultPlayerEntity` class
57
+ Creates a new DefaultPlayerEntity instance.
58
58
 
59
59
 
60
60
  </td></tr>
@@ -51,3 +51,13 @@ The entity to attach the controller to.
51
51
 
52
52
  void
53
53
 
54
+ ## Remarks
55
+
56
+ \*\*Wraps `applyImpulse`<!-- -->:\*\* The entity's `applyImpulse` method is wrapped to track external velocities separately from internal movement. External impulses decay over time when grounded.
57
+
58
+ \*\*Locks rotations:\*\* Calls `entity.lockAllRotations()` to prevent physics from rotating the entity. Rotation is set explicitly by the controller based on camera orientation.
59
+
60
+ \*\*Enables CCD:\*\* Enables continuous collision detection on the entity.
61
+
62
+ \*\*Swimming detection:\*\* Registers a `BLOCK_COLLISION` listener to detect liquid blocks and manage swimming state, gravity scale, and animations.
63
+
@@ -17,6 +17,10 @@ export default class DefaultPlayerEntityController extends BaseEntityController
17
17
 
18
18
  This class extends [BaseEntityController](./server.baseentitycontroller.md) and implements the default movement, platforming, jump, swimming, and other basic logic for the default player entity. We recommend you extend this class if you'd like to implement additional logic on top of the DefaultPlayerEntityController implementation.
19
19
 
20
+ <h2>Coordinate System &amp; Model Orientation</h2>
21
+
22
+ HYTOPIA uses \*\*-Z as forward\*\*. Models must be authored with their front facing -Z. A yaw of 0 means facing -Z. The controller rotates the entity based on camera yaw and movement direction, always orienting the entity's -Z axis in the intended facing direction.
23
+
20
24
  ## Example
21
25
 
22
26
 
@@ -51,3 +51,9 @@ The entity that is spawned.
51
51
 
52
52
  void
53
53
 
54
+ ## Remarks
55
+
56
+ \*\*Creates colliders:\*\* Adds two child colliders to the entity: - `groundSensor`<!-- -->: Cylinder sensor below entity for ground/platform detection and landing animations - `wallCollider`<!-- -->: Capsule collider for wall collision with zero friction
57
+
58
+ \*\*Collider sizes scale:\*\* Collider dimensions scale proportionally with `entity.height`<!-- -->.
59
+
@@ -99,3 +99,13 @@ The delta time in milliseconds since the last tick.
99
99
 
100
100
  void
101
101
 
102
+ ## Remarks
103
+
104
+ \*\*Rotation (-Z forward):\*\* Sets entity rotation based on camera yaw. A yaw of 0 faces -Z. Movement direction offsets (WASD/joystick) are added to camera yaw to determine facing. Models must be authored with their front facing -Z.
105
+
106
+ \*\*Child entities:\*\* If `entity.parent` is set, only emits the event and returns early. Movement logic is skipped for child entities.
107
+
108
+ \*\*Input cancellation:\*\* If `autoCancelMouseLeftClick` is true (default), `input.ml` is set to `false` after processing to prevent repeated triggers.
109
+
110
+ \*\*Animations:\*\* Automatically manages idle, walk, run, jump, swim, and interact animations based on movement state and input.
111
+
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## Entity.(constructor)
6
6
 
7
- Constructs a new instance of the `Entity` class
7
+ Creates a new Entity instance.
8
8
 
9
9
  **Signature:**
10
10
 
@@ -47,3 +47,8 @@ The options for the entity.
47
47
 
48
48
  </td></tr>
49
49
  </tbody></table>
50
+
51
+ ## Remarks
52
+
53
+ \*\*Controller attachment:\*\* If `controller` is provided, `controller.attach(this)` is called during construction (before spawn).
54
+
@@ -15,3 +15,13 @@ despawn(): void;
15
15
 
16
16
  void
17
17
 
18
+ ## Remarks
19
+
20
+ \*\*Cascading:\*\* Recursively despawns all child entities first (depth-first).
21
+
22
+ \*\*Controller:\*\* Calls `controller.detach()` then `controller.despawn()` if attached.
23
+
24
+ \*\*Cleanup:\*\* Automatically unregisters attached audios, despawns attached particle emitters, and unloads attached scene UIs from their respective managers.
25
+
26
+ \*\*Simulation:\*\* Removes from physics simulation.
27
+
@@ -19,6 +19,12 @@ export default class Entity extends RigidBody implements protocol.Serializable
19
19
 
20
20
  Entities are highly configurable and controllable. All entities are created from a .gltf model asset and allow full control of their rigid body and attached collider dynamics.
21
21
 
22
+ <h2>Coordinate System</h2>
23
+
24
+ HYTOPIA uses a right-handed coordinate system where: - \*\*+X\*\* is right - \*\*+Y\*\* is up - \*\*-Z\*\* is forward (identity orientation)
25
+
26
+ Models should be authored with their front/forward facing the \*\*-Z axis\*\*. When an entity has identity rotation (0,0,0,1 quaternion or yaw=0), it faces -Z.
27
+
22
28
  <h2>Events</h2>
23
29
 
24
30
  This class is an EventRouter, and instances of it emit events with payloads listed under [EntityEventPayloads](./server.entityeventpayloads.md)
@@ -77,7 +83,7 @@ Description
77
83
 
78
84
  </td><td>
79
85
 
80
- Constructs a new instance of the `Entity` class
86
+ Creates a new Entity instance.
81
87
 
82
88
 
83
89
  </td></tr>
@@ -997,7 +1003,7 @@ Starts a oneshot animation for the entity, blending with other animations curren
997
1003
 
998
1004
  </td><td>
999
1005
 
1000
- Stops all looped and oneshot animations for the entity, optionally excluded the provided animations from stopping.
1006
+ Stops all looped and oneshot animations for the entity, optionally excluding the provided animations from stopping.
1001
1007
 
1002
1008
 
1003
1009
  </td></tr>
@@ -51,3 +51,7 @@ The nodes to hide on the entity's model.
51
51
 
52
52
  void
53
53
 
54
+ ## Remarks
55
+
56
+ \*\*Replaces, not merges:\*\* This replaces all hidden nodes, not adds to them. To add nodes, include existing hidden nodes in the array.
57
+
@@ -51,3 +51,9 @@ The scale of the entity's model. Can be a vector or a number for uniform scaling
51
51
 
52
52
  void
53
53
 
54
+ ## Remarks
55
+
56
+ \*\*Collider scaling is relative:\*\* Colliders are scaled by the ratio of new/old scale, not set to absolute values. Example: scaling from 1 to 2 doubles collider size; scaling from 2 to 4 also doubles it.
57
+
58
+ \*\*Reference equality check:\*\* Uses `===` to compare with current scale, so passing the same object reference will early return even if values changed. Always pass a new object.
59
+
@@ -51,3 +51,7 @@ The nodes to show on the entity's model.
51
51
 
52
52
  void
53
53
 
54
+ ## Remarks
55
+
56
+ \*\*Replaces, not merges:\*\* This replaces all shown nodes, not adds to them. To add nodes, include existing shown nodes in the array.
57
+
@@ -83,3 +83,17 @@ _(Optional)_ The optional rotation to spawn the entity with.
83
83
 
84
84
  void
85
85
 
86
+ ## Remarks
87
+
88
+ \*\*Rotation default:\*\* If no rotation is provided, entity spawns with identity rotation facing -Z. For Y-axis rotation (yaw): `{ x: 0, y: sin(yaw/2), z: 0, w: cos(yaw/2) }`<!-- -->. Yaw 0 = facing -Z.
89
+
90
+ \*\*Auto-collider creation:\*\* If no colliders are provided, a default collider is auto-generated from the model bounds (or block half extents). Set `modelPreferredShape` to `ColliderShape.NONE` to disable.
91
+
92
+ \*\*Collision groups:\*\* Colliders with default collision groups are auto-assigned based on `isEnvironmental` and `isSensor` flags. Environmental entities don't collide with blocks or other environmental entities.
93
+
94
+ \*\*Event enabling:\*\* Collision/contact force events are auto-enabled on colliders if listeners are registered for `BLOCK_COLLISION`<!-- -->, `ENTITY_COLLISION`<!-- -->, `BLOCK_CONTACT_FORCE`<!-- -->, or `ENTITY_CONTACT_FORCE` prior to spawning.
95
+
96
+ \*\*Controller:\*\* If a controller is attached, `controller.spawn()` is called after the entity is added to the physics simulation.
97
+
98
+ \*\*Parent handling:\*\* If `parent` was set in options, `setParent()` is called after spawn with the provided position/rotation.
99
+
@@ -53,5 +53,5 @@ void
53
53
 
54
54
  ## Remarks
55
55
 
56
- This method will be ignored and do nothing if the entity is a block entity.
56
+ \*\*Deduplication:\*\* If an animation is already in the looped set, it won't be re-added or restarted. The event only emits if at least one new animation is added.
57
57
 
@@ -53,5 +53,7 @@ void
53
53
 
54
54
  ## Remarks
55
55
 
56
- This method will be ignored and do nothing if the entity is a block entity.
56
+ \*\*No deduplication:\*\* Unlike `startModelLoopedAnimations`<!-- -->, this always emits the event even if the animation is already playing. This allows restarting oneshot animations.
57
+
58
+ \*\*Tracking:\*\* Oneshot animations are tracked internally to prevent packet spam from `stopModelAnimations()` but are not serialized for new player joins (they're transient).
57
59
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## Entity.stopAllModelAnimations() method
6
6
 
7
- Stops all looped and oneshot animations for the entity, optionally excluded the provided animations from stopping.
7
+ Stops all looped and oneshot animations for the entity, optionally excluding the provided animations from stopping.
8
8
 
9
9
  **Signature:**
10
10
 
@@ -51,3 +51,7 @@ _(Optional)_ The animations to exclude from being stopped.
51
51
 
52
52
  void
53
53
 
54
+ ## Remarks
55
+
56
+ \*\*Delegates to `stopModelAnimations`<!-- -->:\*\* Collects animations from both looped and oneshot sets (minus exclusions), then calls `stopModelAnimations()` once.
57
+
@@ -53,5 +53,5 @@ void
53
53
 
54
54
  ## Remarks
55
55
 
56
- This method will be ignored and do nothing if the entity is a block entity.
56
+ \*\*Removes from both sets:\*\* Stops animations from both looped and oneshot tracking sets.
57
57
 
@@ -51,5 +51,9 @@ The entity to get the children for.
51
51
 
52
52
  [Entity](./server.entity.md)<!-- -->\[\]
53
53
 
54
- All child entities of the entity.
54
+ All direct child entities of the entity.
55
+
56
+ ## Remarks
57
+
58
+ \*\*Direct children only:\*\* Returns only immediate children, not recursive descendants.
55
59
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## EntityManager.getPlayerEntitiesByPlayer() method
6
6
 
7
- Gets all spawned entities in the world assigned to the provided player.
7
+ Gets all spawned player entities in the world assigned to the provided player.
8
8
 
9
9
  **Signature:**
10
10
 
@@ -51,5 +51,5 @@ The player to get the entities for.
51
51
 
52
52
  [PlayerEntity](./server.playerentity.md)<!-- -->\[\]
53
53
 
54
- All spawned entities in the world assigned to the player.
54
+ All spawned player entities in the world assigned to the player.
55
55
 
@@ -206,7 +206,7 @@ Gets all child entities of an entity.
206
206
 
207
207
  </td><td>
208
208
 
209
- Gets all spawned entities in the world assigned to the provided player.
209
+ Gets all spawned player entities in the world assigned to the provided player.
210
210
 
211
211
 
212
212
  </td></tr>
@@ -51,3 +51,7 @@ The entity to attach the ParticleEmitter to.
51
51
 
52
52
  void
53
53
 
54
+ ## Remarks
55
+
56
+ Clears any set position (mutual exclusivity).
57
+
@@ -51,3 +51,7 @@ The world to spawn the ParticleEmitter in.
51
51
 
52
52
  void
53
53
 
54
+ ## Remarks
55
+
56
+ \*\*Requires spawned entity:\*\* If attached to an entity, the entity must be spawned first.
57
+
@@ -17,6 +17,10 @@ export default class PathfindingEntityController extends SimpleEntityController
17
17
 
18
18
  This class implements pathfinding using the A\* algorithm. Pathfinding when frequently called can cause performance issues, use it sparingly. The .pathfind() method should only need to be called once in nearly all cases when attempting to move an entity to a target coordinate.
19
19
 
20
+ <h2>Coordinate System &amp; Model Orientation</h2>
21
+
22
+ HYTOPIA uses \*\*-Z as forward\*\*. Models must be authored with their front facing -Z. The pathfinding controller automatically calls `face()` to orient the entity's -Z axis toward each waypoint as it moves.
23
+
20
24
  ## Constructors
21
25
 
22
26
  <table><thead><tr><th>
@@ -58,7 +58,7 @@ number
58
58
 
59
59
  </td><td>
60
60
 
61
- The speed of the entity.
61
+ The speed of the entity (blocks per second).
62
62
 
63
63
 
64
64
  </td></tr>
@@ -83,5 +83,17 @@ _(Optional)_ The pathfinding options.
83
83
 
84
84
  boolean
85
85
 
86
- Whether the path was found.
86
+ Whether a path was found.
87
+
88
+ ## Remarks
89
+
90
+ \*\*Synchronous return:\*\* Path calculation happens synchronously. Returns `true` if a path was found, `false` if no path exists or calculation was aborted.
91
+
92
+ \*\*Auto-starts movement:\*\* If a path is found, movement begins immediately using the inherited `move()`<!-- -->, `face()`<!-- -->, and `jump()` methods from `SimpleEntityController`<!-- -->.
93
+
94
+ \*\*Auto-facing (-Z forward):\*\* Automatically calls `face()` for each waypoint, orienting the entity's -Z axis toward the next waypoint. Models must be authored with their front facing -Z.
95
+
96
+ \*\*A\* algorithm:\*\* Uses A\* pathfinding with configurable `maxJump`<!-- -->, `maxFall`<!-- -->, and `verticalPenalty`<!-- -->. Path calculation is capped by `maxOpenSetIterations` (default 200) to prevent blocking.
97
+
98
+ \*\*Waypoint progression:\*\* Entity moves through calculated waypoints sequentially. Each waypoint has a timeout (`waypointTimeoutMs`<!-- -->) after which it's skipped if not reached.
87
99