Minecraft:Commands/camera: Difference between revisions
More actions
Sync: updated from Minecraft |
Sync: updated from Minecraft |
||
| Line 302: | Line 302: | ||
|{{HistoryLine||1.20.30|dev=Preview 1.20.20.22|{{cmd|camera|link=none}} is now available without using the "Experimental Cameras" [[Minecraft:experimental]] toggle. | |{{HistoryLine||1.20.30|dev=Preview 1.20.20.22|{{cmd|camera|link=none}} is now available without using the "Experimental Cameras" [[Minecraft: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.20.30|dev=Preview 1.20.30.24|Fixed the issue that last one overrides the previous one when excuting multiple camera commands at the same tick | |{{HistoryLine||1.20.30|dev=Preview 1.20.30.24|Fixed the issue that last one overrides the previous one when excuting multiple camera commands at the same tick<ref>{{bug|MCPE-173524|||F}}</ref>.}} | ||
|{{HistoryLine||1.21.20|exp=Creator Cameras: New Third-Person Presets|dev=Preview 1.21.10.20|Added the <code>view_offset</code> option. | |{{HistoryLine||1.21.20|exp=Creator Cameras: New Third-Person Presets|dev=Preview 1.21.10.20|Added the <code>view_offset</code> option. | ||
|Added the <code>minecraft:follow_orbit</code> camera preset.}} | |Added the <code>minecraft:follow_orbit</code> camera preset.}} | ||
Revision as of 11:08, 29 October 2026
Template:Distinguish Template: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
- Specifies the player that the camera will be modified.
- Template:Arg desc
- Specifies the entity to which the camera will be attached.
- Template:Arg desc
Template:Argument, Template:Argument, and Template:Argument
- Specifies the camera RGB color.
- Template:Arg desc And must be between 0 and 255 (inclusive).
- The overlay becomes completely opaque after fades in,, and cannot specify the translucent value. The color is unchanged during a fade period, the color given by the new command is ignored.
- When omitting
color, the default is 0, 0, 0, i.e. black.
Template:Argument, Template:Argument, and Template:Argument
- Specifies the camera fade in, hold, and fade out duration, the unit is seconds.
- Template:Arg desc And must be between 0.0 and 10.0 (inclusive).
When there is already a fade playing, the new command merges with it: the fade-in time takes the faster of the both, the fade-out start and end time takes the later of the both, transparency starts from the current value, the color takes the one being played. <ref name="camera-fade">Camera System Introduction,sections "Combining fades" and "Limitations on fades",Microsoft Learn。</ref>
Durations of three phases of a single command do not exceed 10 seconds each, the total duration after merging can exceed 10 seconds. When the sum of three phases are less than 0.5 seconds, extend the hold phase to make up for 0.5 seconds.
When omitting time, the default is 1, 0.5, 1.
- Specifies the camera FOV.
- Template:Arg desc Due to game restrictions, the actual valid values range is between 30 and 110 (inslusive).
- Specifies the duration of the camera FOV smooth transition (seconds), the default is 0.
- Template:Arg desc
- Specifies an easing function/type to use for the camera FOV, the default is Template:Cd.
- Must be one of Template:Cd.
- Specifies the spline ID. Only valid when using Template:Cd preset.
- Template:Arg desc
- Template:Info 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.
- Specifies the duration of the camera smooth transition (seconds). Only valid when using Template:Cd preset.
- Template:Arg desc
- Specifies an easing function/type to use for the camera. Only valid when using Template:Cd preset.
- Must be one of Template:Cd.
- Specifies change the position and facing of free view to the default value (camera position (0,0,0), rotation
xRot=0,yRot=0) Template:Info needed. Only valid when usingminecraft:freepreset. - Must be
default.
- Specifies the entity to make the camera facing to. Only valid when using
minecraft:freepreset. - Template:Arg desc
- Specifies the coordinates to make the camera facing to. Only valid when using
minecraft:freepreset. - Template:Arg desc
- Specifies the camera position. Only valid when using
minecraft:freepreset. - Template:Arg desc
- Specifies the camera vertical rotation. Under using
minecraft:follow_orbitpreset, will also modified the player's facing. - Template:Arg desc And must be between -90 and 0 (inslusive).
- Specifies the camera horizontal rotation. Under using
minecraft:follow_orbitpreset, will also modified the player's facing. - Template:Arg desc
Template:Argument and Template:Argument
- Specifies the offset of the camera. Only valid when using
minecraft:follow_orbitpreset. - Template:Arg desc And must be between -64 and 64 (inslusive).
Template:Argument, Template:Argument, and Template:Argument
- Specifies the offset of the camera from an entity. Only valid when using
minecraft:follow_orbitpreset. - Template:Arg desc And must be between -64 and 64 (inslusive).
- Specifies the entity to focus the camera on. Only valid when using
minecraft:freepreset. - Template:Arg desc
Template:Argument, Template:Argument, and Template:Argument
- Specifies the offset of the camera from the center of a focused/targeted entity. Only valid when using
minecraft:freepreset. - Template:Arg desc
Result
Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table
Output
Template:Output table Template:Output table Template:Output table Template:Output table
Examples
- 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 Template:Cmd command, assign "Over Shoulder View" for nearest players (Must be executed in Minecraft: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
- Used to hide teleportation, first fade, then move the player:
/camera @a fade time 0.5 0.5 0.5/tp @a 100 64 100
History
References
External links
Minecraft:de:Befehl/camera Minecraft:ja:コマンド/camera Minecraft:pt:Comandos/camera Minecraft:zh:命令/camera