/camera

Jump to navigation Jump to search
This feature is exclusive to Bedrock Edition and Minecraft Education.
 

Modifies player's camera view.

Syntax[edit | edit source]

/camera <players: target> ...
  • ... clear
  • ... fade ...
    • ... color <red: int> <green: int> <blue: int>
    • ... time <fadeInSeconds: float> <holdSeconds: float> <fadeOutSeconds: float> ...
      • ... color <red: int> <green: int> <blue: int>
  • ... remove_target
  • ... set <preset: string> ...
    • ... [default: default]
    • ... ease <easeTime: float> <easeType: Easing> ...
      • ... [default: default]
      • ... facing ...
        • ... <lookAtEntity: target>
        • ... <lookAtPosition: x y z>
      • ... pos <position: x y z> ...
        • ... facing ...
          • ... <lookAtEntity: target>
          • ... <lookAtPosition: x y z>
        • ... rot <xRot: value> <yRot: value>
      • ... rot <xRot: value> <yRot: value>
    • ... entity_offset <xEntityOffset: float> <yEntityOffset: float> <zEntityOffset: float>
    • ... facing ...
      • ... <lookAtEntity: target>
      • ... <lookAtPosition: x y z>
    • ... pos <position: x y z> ...
      • ... facing ...
        • ... <lookAtEntity: target>
        • ... <lookAtPosition: x y z>
      • ... rot <xRot: value> <yRot: value>
    • ... rot <xRot: value> <yRot: value> ...
      • ... entity_offset <xEntityOffset: float> <yEntityOffset: float> <zEntityOffset: float>
      • ... view_offset <xViewOffset: float> <yViewOffset: float> ...
        • ... entity_offset <xEntityOffset: float> <yEntityOffset: float> <zEntityOffset: float>
    • ... view_offset <xViewOffset: float> <yViewOffset: float> ...
      • ... entity_offset <xEntityOffset: float> <yEntityOffset: float> <zEntityOffset: float>
  • ... target_entity <entity: target> ...
    • ... target_center_offset <xTargetCenterOffset: float> <yTargetCenterOffset: float> <zTargetCenterOffset: float>
Syntax displayed in various ways

Arguments[edit | edit source]

This section is missing information about: something that needs to be specified.
 
Please expand the section to include this information. Further details may exist on the talk page.

players: target: CommandSelector<Player>

Specifies the player that the camera will be modified.
Must be a player name or a target selector.

red: int: int, green: int: int, and blue: int: int

Specifies the camera RGB color.
Must be a [Int]32-bit integer number (from -2147483648 (-231) to 2147483647 (231-1) ). And must be between 0 and 255.

fadeInSeconds: float: float, holdSeconds: float: float, and fadeOutSeconds: float: float

Specifies the camera fade in, hold, and fade out duration.
Must be a [Float]Single-precision floating-point number (from -(2-2-23)×2127 (≈-3.4×1038) to (2-2-23)2×127 (≈3.4×1038) ). And must be between 0.0 and 10.0 (seconds).

preset: string: basic_string

[more information needed]
A camera view/preset.
Must be one of the following:
  • minecraft:free — Free View.
  • minecraft:first_person — First Person View.
  • minecraft:third_person — Third Person View Back.
  • minecraft:third_person_front — Third Person View Front.
  • minecraft:follow_orbit — Surround around the target entity or coordinates.
  • minecraft:fixed_boom — Fixed boom view.

easeTime: float: float

Specifies the duration of the camera smooth transition.
Must be a [Float]Single-precision floating-point number (from -(2-2-23)×2127 (≈-3.4×1038) to (2-2-23)2×127 (≈3.4×1038) ).

easeType: Easing: enum

Specifies an easing function/type to use for the camera.
Must be one of linear, spring, in_quad, out_quad, in_out_quad, in_cubic, out_cubic, in_out_cubic, in_quart, out_quart, in_out_quart, in_quint, out_quint, in_out_quint, in_sine, out_sine, in_out_sine, in_expo, out_expo, in_out_expo, in_circ, out_circ, in_out_circ, in_bounce, out_bounce, in_out_bounce, in_back, out_back, in_out_back, in_elastic, out_elastic, and in_out_elastic.

default: default: basic_string

[more information needed]
Must be a string. And it must be a single word that has no space or a double-quoted string (When quoted, \ can be used to escape characters).

lookAtEntity: target: CommandSelector<Actor>

Specifies the entity to make the camera facing to.
Must be a player name or a target selector.

lookAtPosition: x y z: CommandPositionFloat

Specifies the coordinates to make the camera facing to.
Must be three-dimensional coordinates with single-precision floating-point number elements. Accepts tilde and caret notations.

position: x y z: CommandPosition

Specifies the camera position.
Must be a three-dimensional coordinates composed of <X>, <Y> and <Z>, each of which must be a single-precision floating-point number or tilde and caret notation.

xRot: value: RelativeFloat and yRot: value: RelativeFloat

Specifies the camera rotation.
Must be a [Float] float. Accepts tilde notation.

xViewOffset: float: RelativeFloat and yViewOffset: float: RelativeFloat

Specifies the offset of the camera.
Must be a [Float] float. Accepts tilde notation.

xEntityOffset: float: RelativeFloat, yEntityOffset: float: RelativeFloat and zEntityOffset: float: RelativeFloat

Specifies the offset of the camera from an entity.
Must be a [Float] float. Accepts tilde notation.

entity: target: CommandSelector<Actor>

Specifies the entity to focus the camera on.
Must be a player name or a target selector.

xTargetCenterOffset: float: RelativeFloat, yTargetCenterOffset: float: RelativeFloat, and zTargetCenterOffset: float: RelativeFloat

Specifies the offset of the camera from the center of a focused/targeted entity.
Must be a [Float] float. Accepts tilde notation.

Result[edit | edit source]

CommandTriggerBedrock Edition
Anythe arguments are not specified correctly Unparseable
players: target fails to resolve to one or more online players Failed
/camera ... facing ...lookAtEntity: target fails to resolve to an entity (named player must be online)
AnyOtherwiseSuccessful

Output[edit | edit source]

CommandEditionSituationSuccess Count
AnyBedrock EditionOn fail0
On successThe number of players who are selected

Examples[edit | edit source]

This section is missing information about: something that needs to be specified.
 
Please expand the section to include this information. Further details may exist on the talk page.
"Over Shoulder View" implemented by /camera
  • Set yourself to last for 5 seconds, The easing mode is in_out_circ, Rotate minecraft:free (Free View) camera view 90 degrees around the X-axis in 5 grids above the current position:
/camera @s set minecraft:free ease 5 in_out_circ pos ~ ~5 ~ rot 90 0
  • Clear All players' camera effect:
/camera @a clear
  • Set the camera of 2 seconds fade in, last for 1 second, fade out 3 seconds, and color pure white for random players:
/camera @r fade time 2 1 3 color 255 255 255
/execute as @p at @s run camera @s set minecraft:free ease 0.25 in_out_quad pos ^-2 ^2 ^-4 facing ^ ^ ^5

History[edit | edit source]

[hide]Bedrock Edition
??Added /camera as a developer command.
1.20.0
Experiment
Experimental Cameras
Preview 1.20.0.22/camera is now behind the "Experimental Cameras" experimental toggle.
1.20.10
Experiment
Experimental Cameras
Preview 1.20.10.20Added example:example_player_listener camera preset.
The color fade values are now integers between 0 and 255 instead of 0.0 to 1.0.
The camera fade in, hold, and fade out duration must be between 0.0 and 10.0 seconds.
Preview 1.20.10.23Added facing option.
Added example:example_player_effects camera preset.
1.20.30Preview 1.20.20.22/camera is now available without using the "Experimental Cameras" experimental toggle.
Removed example:example_free, example:example_player_effects, and example:example_player_listener camera presets.
1.21.20
Experiment
Creator Cameras: New Third-Person Presets
Preview 1.21.10.20Added view_offset option behind the "Creator Cameras: New Third-Person Presets" experimental toggle.
Added minecraft:follow_orbit camera preset behind the "Creator Cameras: New Third-Person Presets" experimental toggle.
1.21.20
Experiment
Creator Cameras: Focus Target Camera
Preview 1.21.20.23Added new subcommands for /camera behind the "Creator Cameras: Focus Target Camera" experimental toggle.
1.21.40
Experiment
Creator Cameras: New Third-Person Presets
Preview 1.21.40.20Added the entity_offset parameter to the command behind the "Creator Cameras: New Third-Person Presets" experimental toggle.
1.21.40Preview 1.21.40.22entity_offset parameter and minecraft:follow_orbit camera preset are now available without using the "Creator Cameras: New Third-Person Presets" experimental toggle.
1.21.50
Experiment
Creator Cameras: New Third Person Presets
Preview 1.21.50.20Added minecraft:fixed_boom camera preset behind the "Creator Cameras: New Third Person Presets" experimental toggle.
1.21.50Releaseview_offset parameter is now available without using the "Creator Cameras: New Third-Person Presets" experimental toggle.
1.21.60Preview 1.21.60.25The changes in 1.21.20.23 is now available without using the "Creator Cameras: Focus Target Camera" experimental toggle.

Navigation[edit | edit source]