@minecraft
    Preparing search index...

    Class Camera

    Contains methods relating to the active camera for the specified player.

    Index

    Properties

    isValid: boolean

    Returns whether the Camera is valid to access and use. A Camera is considered valid when the owning Player of the Camera is loaded and valid itself.

    Methods

    • Beta World mutation

      Parameters

      • OptionalattachCameraOptions: CameraAttachOptions

        Options for the entity the camera is attaching to. Contains the entity identifier and optional entity location.

      Returns void

      Attaches the camera to a non-player entity.

      This function can throw errors.

    • World mutation

      Returns void

      Clears the active camera for the specified player. Causes the specified players to end any in-progress camera perspectives, including any eased camera motions, and return to their normal perspective.

      This function can throw errors.

    • World mutation

      Parameters

      • OptionalfadeCameraOptions: CameraFadeOptions

        Additional options around camera fade operations.

      Returns void

      Begins a camera fade transition. A fade transition is a full-screen color that fades-in, holds, and then fades-out.

      This function can throw errors.

    • Beta World mutation

      Parameters

      • cameraPreset: string

        Identifier of a camera preset file defined within JSON.

      • easeOptions: EaseOptions

        Options to ease the camera from the previous camera to the current one.

      Returns void

      Sets the current active camera with easing.

      Throws when easing to minecraft:first_person presets currently without the experimental cameras toggle enabled.

    • World mutation

      Parameters

      • cameraPreset: string

        Identifier of a camera preset file defined within JSON.

      • OptionaleaseOptions: EaseOptions

        Options to ease the camera back to its original position and rotation.

      Returns void

      Sets the current active camera for the specified player and resets the position and rotation to the values defined in the JSON.

      This function can throw errors.