camera.reset
Ends a camera view from camera.setFixed or
camera.attach: the player has their own camera again, and
playerViewEnded follows. It does not end spectating; use
players.stopSpectating for that.
Signature
Section titled “Signature”camera.reset(viewer: PlayerTarget): Promise<ActionResult>Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
viewer |
PlayerTarget |
The player. |
Returns
Section titled “Returns”A promise of an ActionResult: applied once the player has their own camera, rejected
with a code (spectating-active while they spectate, player-not-found), or timeout after 21 seconds without an answer.
Example
Section titled “Example”import { camera, commands } from "nativemp";
commands.register("camreset", async (player) => { await camera.reset(player); });