Skip to content

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.

camera.reset(viewer: PlayerTarget): Promise<ActionResult>
Name Type Description
viewer PlayerTarget The player.

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.

gamemodes/my-mode.ts
import { camera, commands } from "nativemp";
commands.register("camreset", async (player) => { await camera.reset(player); });