Minecraft:Commands/camera: Difference between revisions
More actions
Remove broken links to missing pages |
Fix template calls: add MC/ prefix |
||
| Line 1: | Line 1: | ||
{{ | {{MC/Distinguish|Commands/camerashake}} | ||
{{Exclusive|Bedrock|Education}} | {{MC/Exclusive|Bedrock|Education}} | ||
{{Infobox command | {{Infobox command | ||
| name = camera | | name = camera | ||
| Line 158: | Line 158: | ||
== Arguments == | == Arguments == | ||
{{ | {{MC/Info needed section}} | ||
{{ | {{MC/Argument|be=1|players: target|CommandSelector<Player>}} | ||
: Specifies the player that the camera will be modified. | : Specifies the player that the camera will be modified. | ||
: {{ | : {{MC/Arg desc|be=CommandSelector<Player>}} | ||
{{ | {{MC/Argument|be=1|entity: target|CommandSelector<Actor>}} | ||
: Specifies the entity to which the camera will be attached. | : Specifies the entity to which the camera will be attached. | ||
: {{ | : {{MC/Arg desc|be=CommandSelector<Actor>}} | ||
{{ | {{MC/Argument|be=1|red: int|int}}, {{MC/Argument|be=1|green: int|int}}, and {{MC/Argument|be=1|blue: int|int}} | ||
: Specifies the camera RGB color. | : Specifies the camera RGB color. | ||
: {{ | : {{MC/Arg desc|be=int}} And must be between 0 and 255 (inclusive). | ||
{{ | {{MC/Argument|be=1|fadeInSeconds: float|float}}, {{MC/Argument|be=1|holdSeconds: float|float}}, and {{MC/Argument|be=1|fadeOutSeconds: float|float}} | ||
: Specifies the camera fade in, hold, and fade out duration, the unit is seconds. | : Specifies the camera fade in, hold, and fade out duration, the unit is seconds. | ||
: {{ | : {{MC/Arg desc|be=float}} And must be between 0.0 and 10.0 (inslusive). | ||
{{ | {{MC/Argument|be=1|fov_value: float|float}} | ||
: Specifies the camera FOV. | : Specifies the camera FOV. | ||
: {{ | : {{MC/Arg desc|be=float}} Due to game restrictions, the actual valid values range is between 30 and 110 (inslusive). | ||
{{ | {{MC/Argument|be=1|fovEaseTime: float|float}} | ||
: Specifies the duration of the camera FOV smooth transition (seconds), the default is 0. | : Specifies the duration of the camera FOV smooth transition (seconds), the default is 0. | ||
: {{ | : {{MC/Arg desc|be=float}} | ||
{{ | {{MC/Argument|be=1|fovEaseType: Easing|enum}} | ||
: Specifies an easing function/type to use for the camera FOV, the default is {{ | : Specifies an easing function/type to use for the camera FOV, the default is {{MC/Cd|linear}}. | ||
: Must be one of {{ | : Must be one of {{MC/Cd|d=and|in_back|in_bounce|in_circ|in_cubic|in_elastic|in_expo|in_out_back|in_out_bounce|in_out_circ|in_out_cubic|in_out_elastic|in_out_expo|in_out_quad|in_out_quart|in_out_quint|in_out_sine|in_quad|in_quart|in_quint|in_sine|linear|out_back|out_bounce|out_circ|out_cubic|out_elastic|out_expo|out_quad|out_quart|out_quint|out_sine|spring}}. | ||
{{ | {{MC/Argument|be=1|name: string|basic_string}} | ||
: Specifies the spline ID. Only valid when using {{ | : Specifies the spline ID. Only valid when using {{MC/Cd|minecraft:free}} preset. | ||
: {{ | : {{MC/Arg desc|be=basic_string}} | ||
{{ | {{MC/Argument|be=1|preset: string|basic_string}} | ||
: {{ | : {{MC/Info needed}} | ||
: A camera view/preset. | : A camera view/preset. | ||
: Must be one of the following: | : Must be one of the following: | ||
| Line 204: | Line 204: | ||
:* <code>minecraft:third_person_front</code> — Third Person View Front. | :* <code>minecraft:third_person_front</code> — Third Person View Front. | ||
{{ | {{MC/Argument|be=1|easeTime: float|float}} | ||
: Specifies the duration of the camera smooth transition (seconds). Only valid when using {{ | : Specifies the duration of the camera smooth transition (seconds). Only valid when using {{MC/Cd|minecraft:free}} preset. | ||
: {{ | : {{MC/Arg desc|be=float}} | ||
{{ | {{MC/Argument|be=1|easeType: Easing|enum}} | ||
: Specifies an easing function/type to use for the camera. Only valid when using {{ | : Specifies an easing function/type to use for the camera. Only valid when using {{MC/Cd|minecraft:free}} preset. | ||
: Must be one of {{ | : Must be one of {{MC/Cd|d=and|in_back|in_bounce|in_circ|in_cubic|in_elastic|in_expo|in_out_back|in_out_bounce|in_out_circ|in_out_cubic|in_out_elastic|in_out_expo|in_out_quad|in_out_quart|in_out_quint|in_out_sine|in_quad|in_quart|in_quint|in_sine|linear|out_back|out_bounce|out_circ|out_cubic|out_elastic|out_expo|out_quad|out_quart|out_quint|out_sine|spring}}. | ||
{{ | {{MC/Argument|be=1|default: default|enum}} | ||
: Specifies change the position and facing of free view to the default value (camera position (0,0,0), rotation <code>xRot</code>=0, <code>yRot</code>=0) {{ | : Specifies change the position and facing of free view to the default value (camera position (0,0,0), rotation <code>xRot</code>=0, <code>yRot</code>=0) {{MC/Info needed|The default position and facing are not stable and are set to correspond to the position and facing pointed to in the json file. The find that what caused this instability by is needed}}. Only valid when using <code>minecraft:free</code> preset. | ||
: Must be <code>default</code>. | : Must be <code>default</code>. | ||
{{ | {{MC/Argument|be=1|lookAtEntity: target|CommandSelector<Actor>}} | ||
: Specifies the entity to make the camera facing to. Only valid when using <code>minecraft:free</code> preset. | : Specifies the entity to make the camera facing to. Only valid when using <code>minecraft:free</code> preset. | ||
: {{ | : {{MC/Arg desc|be=CommandSelector<Actor>}} | ||
{{ | {{MC/Argument|be=1|lookAtPosition: x y z|CommandPositionFloat}} | ||
: Specifies the coordinates to make the camera facing to. Only valid when using <code>minecraft:free</code> preset. | : Specifies the coordinates to make the camera facing to. Only valid when using <code>minecraft:free</code> preset. | ||
: {{ | : {{MC/Arg desc|be=CommandPositionFloat}} | ||
{{ | {{MC/Argument|be=1|position: x y z|CommandPosition}} | ||
: Specifies the camera position. Only valid when using <code>minecraft:free</code> preset. | : Specifies the camera position. Only valid when using <code>minecraft:free</code> preset. | ||
: {{ | : {{MC/Arg desc|be=CommandPosition}} | ||
{{ | {{MC/Argument|be=1|xRot: value|RelativeFloat}} | ||
: Specifies the camera vertical rotation. Under using <code>minecraft:follow_orbit</code> preset, will also modified the player's facing. | : Specifies the camera vertical rotation. Under using <code>minecraft:follow_orbit</code> preset, will also modified the player's facing. | ||
: {{ | : {{MC/Arg desc|be=RelativeFloat}} And must be between -90 and 0 (inslusive). | ||
{{ | {{MC/Argument|be=1|yRot: value|RelativeFloat}} | ||
: Specifies the camera horizontal rotation. Under using <code>minecraft:follow_orbit</code> preset, will also modified the player's facing. | : Specifies the camera horizontal rotation. Under using <code>minecraft:follow_orbit</code> preset, will also modified the player's facing. | ||
: {{ | : {{MC/Arg desc|be=RelativeFloat}} | ||
{{ | {{MC/Argument|be=1|xViewOffset: float|Float}} and {{MC/Argument|be=1|yViewOffset: float|Float}} | ||
: Specifies the offset of the camera. Only valid when using <code>minecraft:follow_orbit</code> preset. | : Specifies the offset of the camera. Only valid when using <code>minecraft:follow_orbit</code> preset. | ||
: {{ | : {{MC/Arg desc|be=Float}} And must be between -64 and 64 (inslusive). | ||
{{ | {{MC/Argument|be=1|xEntityOffset: float|Float}}, {{MC/Argument|be=1|yEntityOffset: float|Float}}, and {{MC/Argument|be=1|zEntityOffset: float|Float}} | ||
: Specifies the offset of the camera from an entity. Only valid when using <code>minecraft:follow_orbit</code> preset. | : Specifies the offset of the camera from an entity. Only valid when using <code>minecraft:follow_orbit</code> preset. | ||
: {{ | : {{MC/Arg desc|be=Float}} And must be between -64 and 64 (inslusive). | ||
{{ | {{MC/Argument|be=1|entity: target|CommandSelector<Actor>}} | ||
: Specifies the entity to focus the camera on. Only valid when using <code>minecraft:free</code> preset. | : Specifies the entity to focus the camera on. Only valid when using <code>minecraft:free</code> preset. | ||
: {{ | : {{MC/Arg desc|be=CommandSelector<Actor>}} | ||
{{ | {{MC/Argument|be=1|xTargetCenterOffset: float|Float}}, {{MC/Argument|be=1|yTargetCenterOffset: float|Float}}, and {{MC/Argument|be=1|zTargetCenterOffset: float|Float}} | ||
: Specifies the offset of the camera from the center of a focused/targeted entity. Only valid when using <code>minecraft:free</code> preset. | : Specifies the offset of the camera from the center of a focused/targeted entity. Only valid when using <code>minecraft:free</code> preset. | ||
: {{ | : {{MC/Arg desc|be=Float}} | ||
== Result == | == Result == | ||
| Line 262: | Line 262: | ||
== Output == | == Output == | ||
{{Output table|onlybe=1}} | {{MC/Output table|onlybe=1}} | ||
{{Output table|edition=be|On fail|0}} | {{MC/Output table|edition=be|On fail|0}} | ||
{{Output table|On success|The number of players who are selected}} | {{MC/Output table|On success|The number of players who are selected}} | ||
{{Output table}} | {{MC/Output table}} | ||
== Examples == | == Examples == | ||
{{ | {{MC/Info needed section}} | ||
[[File:Over Shoulder Camera.jpg|thumb|"Over Shoulder View" implemented by {{ | [[File:Over Shoulder Camera.jpg|thumb|"Over Shoulder View" implemented by {{MC/Cmd|camera|link=none}}]] | ||
* Set yourself to last for 5 seconds, The easing mode is <code>in_out_circ</code>, Rotate <code>minecraft:free</code> (Free View) camera view 90 degrees around the X-axis in 5 grids above the current position: | * Set yourself to last for 5 seconds, The easing mode is <code>in_out_circ</code>, Rotate <code>minecraft:free</code> (Free View) camera view 90 degrees around the X-axis in 5 grids above the current position: | ||
| Line 277: | Line 277: | ||
* Fade a random player's camera to white in 2 seconds, last for 1 second, and fade out for 3 seconds: | * Fade a random player's camera to white in 2 seconds, last for 1 second, and fade out for 3 seconds: | ||
:: <code>/camera @r fade time 2 1 3 color 255 255 255</code> | :: <code>/camera @r fade time 2 1 3 color 255 255 255</code> | ||
* Cooperate with the {{ | * Cooperate with the {{MC/Cmd|execute}} command, assign "Over Shoulder View" for nearest players (Must be executed in repeating command block): | ||
:: <code>/execute as @p at @s run camera @s set minecraft:free ease 0.25 in_out_quad pos ^-2 ^2 ^-4 facing ^ ^ ^5</code> | :: <code>/execute as @p at @s run camera @s set minecraft:free ease 0.25 in_out_quad pos ^-2 ^2 ^-4 facing ^ ^ ^5</code> | ||
== History == | == History == | ||
{{HistoryTable | {{HistoryTable | ||
|{{HistoryLine|bedrock}} | |{{MC/HistoryLine|bedrock}} | ||
|{{HistoryLine||?|dev=?|Added {{ | |{{HistoryLine||?|dev=?|Added {{MC/Cmd|camera|link=none}} as a developer command.}} | ||
|{{HistoryLine||1.20.0|exp=Experimental Cameras|dev=Preview 1.20.0.22|{{ | |{{HistoryLine||1.20.0|exp=Experimental Cameras|dev=Preview 1.20.0.22|{{MC/Cmd|camera|link=none}} is now behind the "Experimental Cameras" experimental toggle.}} | ||
|{{HistoryLine||1.20.10|exp=Experimental Cameras|dev=Preview 1.20.10.20|Added <code>example:example_player_listener</code> camera preset. | |{{MC/HistoryLine||1.20.10|exp=Experimental Cameras|dev=Preview 1.20.10.20|Added <code>example:example_player_listener</code> camera preset. | ||
|The color fade values are now integers between 0 and 255 instead of 0.0 to 1.0. | |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.}} | |The camera fade in, hold, and fade out duration must be between 0.0 and 10.0 seconds.}} | ||
|{{HistoryLine|||dev=Preview 1.20.10.23|Added <code>facing</code> option. | |{{MC/HistoryLine|||dev=Preview 1.20.10.23|Added <code>facing</code> option. | ||
|Added <code>example:example_player_effects</code> camera preset.}} | |Added <code>example:example_player_effects</code> camera preset.}} | ||
|{{HistoryLine||1.20.30|dev=Preview 1.20.20.22|{{ | |{{HistoryLine||1.20.30|dev=Preview 1.20.20.22|{{MC/Cmd|camera|link=none}} is now available without using the "Experimental Cameras" experimental toggle. | ||
|Removed <code>example:example_free</code>, <code>example:example_player_effects</code>, and <code>example:example_player_listener</code> camera presets.}} | |Removed <code>example:example_free</code>, <code>example:example_player_effects</code>, and <code>example:example_player_listener</code> camera presets.}} | ||
|{{HistoryLine||1.21.20|exp=Creator Cameras: New Third-Person Presets|dev=Preview 1.21.10.20|Added <code>view_offset</code> option. | |{{MC/HistoryLine||1.21.20|exp=Creator Cameras: New Third-Person Presets|dev=Preview 1.21.10.20|Added <code>view_offset</code> option. | ||
|Added <code>minecraft:follow_orbit</code> camera preset.}} | |Added <code>minecraft:follow_orbit</code> camera preset.}} | ||
|{{HistoryLine||1.21.20|exp=Creator Cameras: Focus Target Camera|dev=Preview 1.21.20.22|Added {{ | |{{HistoryLine||1.21.20|exp=Creator Cameras: Focus Target Camera|dev=Preview 1.21.20.22|Added {{MC/Cd|d=and|remove_target|target_center_offset|target_entity}} option.}} | ||
|{{HistoryLine||1.21.40|exp=Creator Cameras: New Third-Person Presets|dev=Preview 1.21.40.20|Added {{ | |{{HistoryLine||1.21.40|exp=Creator Cameras: New Third-Person Presets|dev=Preview 1.21.40.20|Added {{MC/Cd|entity_offset}} option.}} | ||
|{{HistoryLine||1.21.40|dev=Preview 1.21.40.22|{{ | |{{HistoryLine||1.21.40|dev=Preview 1.21.40.22|{{MC/Cd|entity_offset}} and {{MC/Cd|view_offset}} option and <code>minecraft:follow_orbit</code> camera preset are now available without using the "Creator Cameras: New Third-Person Presets" experimental toggle.}} | ||
|{{HistoryLine||1.21.50|exp=Creator Cameras: New Third Person Presets|dev=Preview 1.21.50.20|Added <code>minecraft:fixed_boom</code> camera preset.}} | |{{MC/HistoryLine||1.21.50|exp=Creator Cameras: New Third Person Presets|dev=Preview 1.21.50.20|Added <code>minecraft:fixed_boom</code> camera preset.}} | ||
|{{HistoryLine||1.21.50|dev=Release|{{ | |{{HistoryLine||1.21.50|dev=Release|{{MC/Cd|view_offset}} option is now available without using the "Creator Cameras: New Third-Person Presets" experimental toggle.}} | ||
|{{HistoryLine||1.21.60|dev=Preview 1.21.60.25|The changes in 1.21.20.22 is now available without using the "Creator Cameras: Focus Target Camera" experimental toggle.}} | |{{MC/HistoryLine||1.21.60|dev=Preview 1.21.60.25|The changes in 1.21.20.22 is now available without using the "Creator Cameras: Focus Target Camera" experimental toggle.}} | ||
|{{HistoryLine||1.21.70|dev=Preview 1.21.70.24|{{ | |{{HistoryLine||1.21.70|dev=Preview 1.21.70.24|{{MC/Cd|minecraft:fixed_boom}} camera preset is now available without using the "Creator Cameras: New Third Person Presets" experimental toggle.}} | ||
|{{HistoryLine||1.21.80|dev=Preview 1.21.80.25|exp=Experimental Creator Camera Features|Added {{ | |{{HistoryLine||1.21.80|dev=Preview 1.21.80.25|exp=Experimental Creator Camera Features|Added {{MC/Cd|minecraft:control_scheme_camera}} camera preset.}} | ||
|{{HistoryLine||1.21.100|dev=Preview 1.21.100.20|exp=Experimental Creator Camera Features|Added {{ | |{{HistoryLine||1.21.100|dev=Preview 1.21.100.20|exp=Experimental Creator Camera Features|Added {{MC/Cd|fov_clear}} and {{MC/Cd|fov_set}} option, Used to Control the camera FOV.}} | ||
|{{HistoryLine|||dev=Preview 1.21.100.23|Added parameter that used to control the camera easing for {{ | |{{HistoryLine|||dev=Preview 1.21.100.23|Added parameter that used to control the camera easing for {{MC/Cd|fov_clear}} and {{MC/Cd|fov_set}} option.}} | ||
|{{HistoryLine||1.21.120|dev=Preview 1.21.120.24|exg=Experimental Creator Camera Features|Added {{ | |{{HistoryLine||1.21.120|dev=Preview 1.21.120.24|exg=Experimental Creator Camera Features|Added {{MC/Cd|d=pretty|attach_to_entity|detach_from_entity}} option, Used to attach or detach the camera to an entity.}} | ||
|{{HistoryLine||26.0|dev=Preview 26.0.27|exg=Experimental Creator Camera Features|Added {{ | |{{HistoryLine||26.0|dev=Preview 26.0.27|exg=Experimental Creator Camera Features|Added {{MC/Cd|d=pretty|play_spline}} option, Used to play an spline from behavior packs.}} | ||
}} | }} | ||
| Line 313: | Line 313: | ||
== Navigation == | == Navigation == | ||
{{Navbox commands}} | {{MC/Navbox commands}} | ||
de:Befehl/camera | de:Befehl/camera | ||
Latest revision as of 20:08, 9 April 2026
Template:Hatnote Script error: No such module "Exclusive". Template:Infobox command
Modifies player's camera view.
Syntax
/camera <players: target> ...... attach_to_entity <entity: target>... clear... detach_from_entity... fade ...... color <red: int> <green: int> <blue: int>... time <fadeInSeconds: float> <holdSeconds: float> <fadeOutSeconds: float> ...... [color <red: int> <green: int> <blue: int>]
... fov_clear [fovEaseTime: float] [fovEaseType: Easing]... fov_set <fov_value: float> [fovEaseTime: float] [fovEaseType: Easing]... play_spline <name: string>... 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
Simplified tree: camera <players: target> ...... attach_to_entity <entity: target>... clear... detach_from_entity... fade ...... color <red: int> <green: int> <blue: int>... time <fadeInSeconds: float> <holdSeconds: float> <fadeOutSeconds: float> [color <red: int> <green: int> <blue: int>]
... fov_clear [fovEaseTime: float] [fovEaseType: Easing]... fov_set <fov_value: float> [fovEaseTime: float] [fovEaseType: Easing]... play_spline <name: string>... remove_target... set <preset: string> ...... [default: default]... ease <easeTime: float> <easeType: Easing> ...... [default: default]... facing <lookAtEntity: target>... facing <lookAtPosition: x y z>... pos <position: x y z> ...... [facing <lookAtEntity: target>]... facing <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>... facing <lookAtPosition: x y z>... pos <position: x y z> ...... [facing <lookAtEntity: target>]... facing <lookAtPosition: x y z>... rot <xRot: value> <yRot: value>
... rot <xRot: value> <yRot: value> [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>]
Minimised tree: 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> [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>]
Maximised: camera <players: target> attach_to_entity <entity: target>camera <players: target> clearcamera <players: target> detach_from_entitycamera <players: target> fadecamera <players: target> fade color <red: int> <green: int> <blue: int>camera <players: target> fade time <fadeInSeconds: float> <holdSeconds: float> <fadeOutSeconds: float>camera <players: target> fade time <fadeInSeconds: float> <holdSeconds: float> <fadeOutSeconds: float> color <red: int> <green: int> <blue: int>camera <players: target> remove_targetcamera <players: target> set <preset: string> [default: default]camera <players: target> set <preset: string> ease <easeTime: float> <easeType: Easing> [default: default]camera <players: target> set <preset: string> ease <easeTime: float> <easeType: Easing> facing <lookAtEntity: target>camera <players: target> set <preset: string> ease <easeTime: float> <easeType: Easing> facing <lookAtPosition: x y z>camera <players: target> set <preset: string> ease <easeTime: float> <easeType: Easing> pos <position: x y z>camera <players: target> set <preset: string> ease <easeTime: float> <easeType: Easing> pos <position: x y z> facing <lookAtEntity: target>camera <players: target> set <preset: string> ease <easeTime: float> <easeType: Easing> pos <position: x y z> facing <lookAtPosition: x y z>camera <players: target> set <preset: string> ease <easeTime: float> <easeType: Easing> pos <position: x y z> rot <xRot: value> <yRot: value>camera <players: target> set <preset: string> ease <easeTime: float> <easeType: Easing> rot <xRot: value> <yRot: value>camera <players: target> set <preset: string> entity_offset <xEntityOffset: float> <yEntityOffset: float> <zEntityOffset: float>camera <players: target> set <preset: string> facing <lookAtEntity: target>camera <players: target> set <preset: string> facing <lookAtPosition: x y z>camera <players: target> set <preset: string> pos <position: x y z>camera <players: target> set <preset: string> pos <position: x y z> facing <lookAtEntity: target>camera <players: target> set <preset: string> pos <position: x y z> facing <lookAtPosition: x y z>camera <players: target> set <preset: string> pos <position: x y z> rot <xRot: value> <yRot: value>camera <players: target> set <preset: string> rot <xRot: value> <yRot: value>camera <players: target> set <preset: string> rot <xRot: value> <yRot: value> entity_offset <xEntityOffset: float> <yEntityOffset: float> <zEntityOffset: float>camera <players: target> set <preset: string> rot <xRot: value> <yRot: value> view_offset <xViewOffset: float> <yViewOffset: float>camera <players: target> set <preset: string> rot <xRot: value> <yRot: value> view_offset <xViewOffset: float> <yViewOffset: float> entity_offset <xEntityOffset: float> <yEntityOffset: float> <zEntityOffset: float>camera <players: target> set <preset: string> view_offset <xViewOffset: float> <yViewOffset: float>camera <players: target> set <preset: string> view_offset <xViewOffset: float> <yViewOffset: float> entity_offset <xEntityOffset: float> <yEntityOffset: float> <zEntityOffset: float>camera <players: target> target_entity <entity: target>camera <players: target> target_entity <entity: target> target_center_offset <xTargetCenterOffset: float> <yTargetCenterOffset: float> <zTargetCenterOffset: float>
Arguments
- REDIRECT Template:Incomplete section
players: target: CommandSelector<Player>
- Specifies the player that the camera will be modified.
- {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|inapplicability}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
entity: target: CommandSelector<Actor>
- Specifies the entity to which the camera will be attached.
- {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|inapplicability}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
red: int: int, green: int: int, and blue: int: int
- Specifies the camera RGB color.
- {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|integer}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}} And must be between 0 and 255 (inclusive).
fadeInSeconds: float: float, holdSeconds: float: float, and fadeOutSeconds: float: float
- Specifies the camera fade in, hold, and fade out duration, the unit is seconds.
- {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|float}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}} And must be between 0.0 and 10.0 (inslusive).
fov_value: float: float
- Specifies the camera FOV.
- {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|float}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}} Due to game restrictions, the actual valid values range is between 30 and 110 (inslusive).
fovEaseTime: float: float
- Specifies the duration of the camera FOV smooth transition (seconds), the default is 0.
- {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|float}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
fovEaseType: Easing: enum
- Specifies an easing function/type to use for the camera FOV, the default is
- REDIRECT Template:Code
- Must be one of
- REDIRECT Template:Code
name: string: basic_string
- Specifies the spline ID. Only valid when using
- REDIRECT Template:Code
Template:Redr preset.
- {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|string}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
preset: string: basic_string
-
<more information needed></more information needed> - A camera view/preset.
- Must be one of the following:
minecraft:control_scheme_camera— Control scheme camera.Template:OnlyExperimentalminecraft:first_person— First Person View.minecraft:fixed_boom— Fixed boom view's orbit camera.minecraft:follow_orbit— Orbit camera.minecraft:free— Free View.minecraft:third_person— Third Person View Back.minecraft:third_person_front— Third Person View Front.
easeTime: float: float
- Specifies the duration of the camera smooth transition (seconds). Only valid when using
- REDIRECT Template:Code
Template:Redr preset.
- {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|float}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
easeType: Easing: enum
- Specifies an easing function/type to use for the camera. Only valid when using
- REDIRECT Template:Code
Template:Redr preset.
- Must be one of
- REDIRECT Template:Code
default: default: enum
- Specifies change the position and facing of free view to the default value (camera position (0,0,0), rotation
xRot=0,yRot=0) <more information needed></more information needed>. Only valid when usingminecraft:freepreset. - Must be
default.
lookAtEntity: target: CommandSelector<Actor>
- Specifies the entity to make the camera facing to. Only valid when using
minecraft:freepreset. - {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|inapplicability}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
lookAtPosition: x y z: CommandPositionFloat
- Specifies the coordinates to make the camera facing to. Only valid when using
minecraft:freepreset. - {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|vec3}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
position: x y z: CommandPosition
- Specifies the camera position. Only valid when using
minecraft:freepreset. - {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|block_pos}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
xRot: value: RelativeFloat
- Specifies the camera vertical rotation. Under using
minecraft:follow_orbitpreset, will also modified the player's facing. - {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|relativefloat}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}} And must be between -90 and 0 (inslusive).
yRot: value: RelativeFloat
- Specifies the camera horizontal rotation. Under using
minecraft:follow_orbitpreset, will also modified the player's facing. - {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|relativefloat}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
xViewOffset: float: Float and yViewOffset: float: Float
- Specifies the offset of the camera. Only valid when using
minecraft:follow_orbitpreset. - {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|float}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}} And must be between -64 and 64 (inslusive).
xEntityOffset: float: Float, yEntityOffset: float: Float, and zEntityOffset: float: Float
- Specifies the offset of the camera from an entity. Only valid when using
minecraft:follow_orbitpreset. - {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|float}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}} And must be between -64 and 64 (inslusive).
entity: target: CommandSelector<Actor>
- Specifies the entity to focus the camera on. Only valid when using
minecraft:freepreset. - {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|inapplicability}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
xTargetCenterOffset: float: Float, yTargetCenterOffset: float: Float, and zTargetCenterOffset: float: Float
- Specifies the offset of the camera from the center of a focused/targeted entity. Only valid when using
minecraft:freepreset. - {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|float}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
Result
Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table
Output
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On fail}}{{#vardefine:output1-{{#var:output-table-lines}}|0}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-editions-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-{{#var:output-editions-num}}|be}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|1}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|The number of players who are selected}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}
Examples
- REDIRECT Template:Incomplete section
- Set yourself to last for 5 seconds, The easing mode is
in_out_circ, Rotateminecraft: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 effects:
/camera @a clear
- Fade a random player's camera to white in 2 seconds, last for 1 second, and fade out for 3 seconds:
/camera @r fade time 2 1 3 color 255 255 255
- Cooperate with the
- REDIRECT Template:Command
Template:Redr command, assign "Over Shoulder View" for nearest players (Must be executed in repeating command block):
/execute as @p at @s run camera @s set minecraft:free ease 0.25 in_out_quad pos ^-2 ^2 ^-4 facing ^ ^ ^5
History
External links
de:Befehl/camera ja:コマンド/camera pt:Comandos/camera zh:命令/camera