<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.sasgaming.net/index.php?action=history&amp;feed=atom&amp;title=Minecraft%3ARotation</id>
	<title>Minecraft:Rotation - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sasgaming.net/index.php?action=history&amp;feed=atom&amp;title=Minecraft%3ARotation"/>
	<link rel="alternate" type="text/html" href="https://wiki.sasgaming.net/index.php?title=Minecraft:Rotation&amp;action=history"/>
	<updated>2026-06-10T12:17:31Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://wiki.sasgaming.net/index.php?title=Minecraft:Rotation&amp;diff=139363&amp;oldid=prev</id>
		<title>SyncBot: Sync: updated from Minecraft</title>
		<link rel="alternate" type="text/html" href="https://wiki.sasgaming.net/index.php?title=Minecraft:Rotation&amp;diff=139363&amp;oldid=prev"/>
		<updated>2026-06-06T11:11:04Z</updated>

		<summary type="html">&lt;p&gt;Sync: updated from Minecraft&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:11, 6 June 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Cleanup|&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Use citation templates instead of raw reference URLs, and &lt;/del&gt;rewrite phrases in the second person.}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Cleanup| rewrite phrases in the second person.}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:Perspectives.svg|thumb|Perspectives]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[File:Perspectives.svg|thumb|Perspectives]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Rotation&amp;#039;&amp;#039;&amp;#039; (also known as &amp;#039;&amp;#039;&amp;#039;perspective&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;viewpoint&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;viewing angle&amp;#039;&amp;#039;&amp;#039;) is the direction an [[Minecraft:entity]] is facing. Rotation in &amp;#039;&amp;#039;Minecraft&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;Y-rotation&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;yaw&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;X-rotation&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;declination&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;pitch&amp;#039;&amp;#039;&amp;#039;, each affecting the directions of the body and the head of the entity. For entities without heads, they can sometimes rotate entirely around the X-axis. The &amp;quot;X&amp;quot; and &amp;quot;Y&amp;quot; refers to the axis about which they rotate. Rotation can limit what a [[Minecraft:mob]] or [[Minecraft:player]] can see, but other entities (e.g. [[Minecraft:boats]] and [[Minecraft:item frames]]) also have a rotation.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Rotation&amp;#039;&amp;#039;&amp;#039; (also known as &amp;#039;&amp;#039;&amp;#039;perspective&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;viewpoint&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;viewing angle&amp;#039;&amp;#039;&amp;#039;) is the direction an [[Minecraft:entity]] is facing. Rotation in &amp;#039;&amp;#039;Minecraft&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;Y-rotation&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;yaw&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;X-rotation&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;declination&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;pitch&amp;#039;&amp;#039;&amp;#039;, each affecting the directions of the body and the head of the entity. For entities without heads, they can sometimes rotate entirely around the X-axis. The &amp;quot;X&amp;quot; and &amp;quot;Y&amp;quot; refers to the axis about which they rotate. Rotation can limit what a [[Minecraft:mob]] or [[Minecraft:player]] can see, but other entities (e.g. [[Minecraft:boats]] and [[Minecraft:item frames]]) also have a rotation.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>SyncBot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sasgaming.net/index.php?title=Minecraft:Rotation&amp;diff=125913&amp;oldid=prev</id>
		<title>SyncBot: Sync: new page from Minecraft</title>
		<link rel="alternate" type="text/html" href="https://wiki.sasgaming.net/index.php?title=Minecraft:Rotation&amp;diff=125913&amp;oldid=prev"/>
		<updated>2026-05-19T11:17:13Z</updated>

		<summary type="html">&lt;p&gt;Sync: new page from Minecraft&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Cleanup|Use citation templates instead of raw reference URLs, and rewrite phrases in the second person.}}&lt;br /&gt;
[[File:Perspectives.svg|thumb|Perspectives]]&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Rotation&amp;#039;&amp;#039;&amp;#039; (also known as &amp;#039;&amp;#039;&amp;#039;perspective&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;viewpoint&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;viewing angle&amp;#039;&amp;#039;&amp;#039;) is the direction an [[Minecraft:entity]] is facing. Rotation in &amp;#039;&amp;#039;Minecraft&amp;#039;&amp;#039; consists of &amp;#039;&amp;#039;&amp;#039;Y-rotation&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;yaw&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;X-rotation&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;declination&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;pitch&amp;#039;&amp;#039;&amp;#039;, each affecting the directions of the body and the head of the entity. For entities without heads, they can sometimes rotate entirely around the X-axis. The &amp;quot;X&amp;quot; and &amp;quot;Y&amp;quot; refers to the axis about which they rotate. Rotation can limit what a [[Minecraft:mob]] or [[Minecraft:player]] can see, but other entities (e.g. [[Minecraft:boats]] and [[Minecraft:item frames]]) also have a rotation.&lt;br /&gt;
&lt;br /&gt;
== Representation ==&lt;br /&gt;
&lt;br /&gt;
=== Entity hitbox ===&lt;br /&gt;
{{main|Hitbox#Entity hitboxes}}&lt;br /&gt;
[[File:Temperate Frog (hitbox).png|thumb|300px|A frog&amp;#039;s perspective can be seen as a blue line in the debug renderer.]]&lt;br /&gt;
Rotation is visualized by {{cd|[[Minecraft:Debug renderer#entity_hitboxes|entity_hitboxes]]}} debug renderer as a long blue tint placed in-line with the (red) eye height hitbox and shows which direction the entities are looking.&lt;br /&gt;
&lt;br /&gt;
=== Entity format ===&lt;br /&gt;
{{main|Entity format}}&lt;br /&gt;
&lt;br /&gt;
Rotation is internally represented with two float values in degrees.&lt;br /&gt;
* Y-rotation varies from -180&amp;amp;deg; (facing due north) to -90&amp;amp;deg; (facing due east) to 0&amp;amp;deg; (facing due south) to +90&amp;amp;deg; (facing due west) to +180&amp;amp;deg; (facing due north again).&lt;br /&gt;
* For X-rotation, horizontal is 0&amp;amp;deg;, with positive values looking downward and negative values looking upward. It does not exceed positive or negative 90&amp;amp;deg;.&lt;br /&gt;
&lt;br /&gt;
== Debug screen ==&lt;br /&gt;
{{main|Debug screen}}&lt;br /&gt;
[[File:Facing Debug.png|thumb|&amp;#039;&amp;#039;Facing&amp;#039;&amp;#039; in the [[Debug screen]]]]&lt;br /&gt;
&lt;br /&gt;
With &amp;lt;kbd&amp;gt;F3&amp;lt;/kbd&amp;gt; + &amp;lt;kbd&amp;gt;B&amp;lt;/kbd&amp;gt;, the rotation of all entities show up as a blue beam.&lt;br /&gt;
&lt;br /&gt;
The player&amp;#039;s own rotation can be seen in the [[Minecraft:debug screen]] under &amp;#039;&amp;#039;Facing&amp;#039;&amp;#039;. First the cardinal direction and axis are mentioned, followed by the two angles for direction and head tilt.&lt;br /&gt;
&lt;br /&gt;
== Y-rotation (Yaw Angle) ==&lt;br /&gt;
A change in the Y-rotation angle changes the direction it is facing, to the left or right of its direction of motion.&amp;lt;ref&amp;gt;{{cite|url=https://en.wikipedia.org/wiki/Yaw_(rotation)|title=Yaw (rotation)|website=Wikipedia}}&amp;lt;/ref&amp;gt; They are represented in the [[Minecraft:debug screen]] correct to 1 decimal place. (The X and Z coordinates are represented correct to 3 decimal places.)&lt;br /&gt;
&lt;br /&gt;
Here, &amp;quot;anticlockwise angle from +X in a 2D system&amp;quot; is thought of as anything in (-180&amp;amp;deg;, 180&amp;amp;deg;], or -180&amp;amp;deg; &amp;lt; x ≤ 180&amp;amp;deg;, where x is one of the angles.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Y-rotation angle ranges based on the cardinal directions&lt;br /&gt;
!Cardinal&lt;br /&gt;
Directions&lt;br /&gt;
!Towards the axis&lt;br /&gt;
!Y-rotation angle range&lt;br /&gt;
(ranges inclusive, follows anticlockwise direction)&lt;br /&gt;
!Range of anticlockwise angle from +X in a 2D system &lt;br /&gt;
(ranges inclusive, anticlockwise direction)&lt;br /&gt;
|-&lt;br /&gt;
|North&lt;br /&gt;
|negative Z&lt;br /&gt;
| -135.1&amp;amp;deg; to 135.0&amp;amp;deg; (135.0&amp;amp;deg;..180.0&amp;amp;deg; ∪ -179.9&amp;amp;deg;..-135.1&amp;amp;deg;)&lt;br /&gt;
|45.1&amp;amp;deg; to 135.0&amp;amp;deg;&lt;br /&gt;
|-&lt;br /&gt;
|South&lt;br /&gt;
|positive Z&lt;br /&gt;
|44.9&amp;amp;deg; to -45.0&amp;amp;deg;&lt;br /&gt;
| -134.9&amp;amp;deg; to -45.0&amp;amp;deg;&lt;br /&gt;
|-&lt;br /&gt;
|East&lt;br /&gt;
|positive X&lt;br /&gt;
| -45.1&amp;amp;deg; to -135.0&amp;amp;deg;&lt;br /&gt;
| -44.9&amp;amp;deg; to 45.0&amp;amp;deg; &lt;br /&gt;
|-&lt;br /&gt;
|West&lt;br /&gt;
|negative X&lt;br /&gt;
|134.9&amp;amp;deg; to 45.0&amp;amp;deg;&lt;br /&gt;
|135.1&amp;amp;deg; to -135.0&amp;amp;deg;&lt;br /&gt;
|}&lt;br /&gt;
[[File:Yaw-angles.svg|thumb|Diagram mapping Y-rotation angles to [[w:Clock_position|clock positions]] and [[Minecraft:w:Cardinal_direction|cardinal directions]], along with the bounding angles (all inclusive) for each cardinal direction. Referred to as a yaw table in this article|alt=Diagram of a clock mapping yaw angles on a clock, highlighting the different cardinal directions in alternating black and white colours. The bounding angles are written on a white box in a black background.]]&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Y-rotation angles based on the clock positions&lt;br /&gt;
!Clock&lt;br /&gt;
Positions&lt;br /&gt;
!Y-rotation angle&lt;br /&gt;
!Anticlockwise angle from +X in a 2D system&lt;br /&gt;
|-&lt;br /&gt;
|1 o&amp;#039;clock&lt;br /&gt;
| -150.0&amp;amp;deg;&lt;br /&gt;
|60.0&amp;amp;deg;&lt;br /&gt;
|-&lt;br /&gt;
|2 o&amp;#039;clock&lt;br /&gt;
| -120.0&amp;amp;deg;&lt;br /&gt;
|30.0&amp;amp;deg;&lt;br /&gt;
|-&lt;br /&gt;
|3 o&amp;#039;clock&lt;br /&gt;
| -90.0&amp;amp;deg;&lt;br /&gt;
|0.0&amp;amp;deg;&lt;br /&gt;
|-&lt;br /&gt;
|4 o&amp;#039;clock&lt;br /&gt;
| -60.0&amp;amp;deg;&lt;br /&gt;
| -30.0&amp;amp;deg;&lt;br /&gt;
|-&lt;br /&gt;
|5 o&amp;#039;clock&lt;br /&gt;
| -30.0&amp;amp;deg;&lt;br /&gt;
| -60.0&amp;amp;deg;&lt;br /&gt;
|-&lt;br /&gt;
|6 o&amp;#039;clock&lt;br /&gt;
|[[Minecraft:w:IEEE_754#Signed_zero|-0.0&amp;amp;deg;]]&lt;br /&gt;
| -90.0&amp;amp;deg;&lt;br /&gt;
|-&lt;br /&gt;
|7 o&amp;#039;clock&lt;br /&gt;
|30.0&amp;amp;deg;&lt;br /&gt;
| -120.0&amp;amp;deg;&lt;br /&gt;
|-&lt;br /&gt;
|8 o&amp;#039;clock&lt;br /&gt;
|60.0&amp;amp;deg;&lt;br /&gt;
| -150.0&amp;amp;deg;&lt;br /&gt;
|-&lt;br /&gt;
|9 o&amp;#039;clock&lt;br /&gt;
|90.0&amp;amp;deg;&lt;br /&gt;
|180.0&amp;amp;deg;&lt;br /&gt;
|-&lt;br /&gt;
|10 o&amp;#039;clock&lt;br /&gt;
|120.0&amp;amp;deg;&lt;br /&gt;
|150.0&amp;amp;deg;&lt;br /&gt;
|-&lt;br /&gt;
|11 o&amp;#039;clock&lt;br /&gt;
|150.0&amp;amp;deg;&lt;br /&gt;
|120.0&amp;amp;deg;&lt;br /&gt;
|-&lt;br /&gt;
|12 o&amp;#039;clock&lt;br /&gt;
|180.0&amp;amp;deg;&lt;br /&gt;
|90.0&amp;amp;deg;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Algorithm for the Y-rotation angle ==&lt;br /&gt;
=== Explanation ===&lt;br /&gt;
The angle transformation to get the correct Y-rotation angle will not only require rotating the Y-rotation circle, but also reflecting the yaw table horizontally or vertically through the diameter.&lt;br /&gt;
&lt;br /&gt;
==== Initial and Desired ====&lt;br /&gt;
[[File:Initial.png|alt=A semicircle in Minecraft, placed in a valley using spruce logs and jungle place. Orientation is like a dome.|thumb|This is the upper half of a normal circle with the actual angles written. Compare this picture to the one given above. We want to get the angles written as the Y-rotation angle. ]]Think of this part as the top half of a semicircle standing on the +X axis. It will be rotated for getting the outputs as in the yaw table (and we will check if we need to flip). &lt;br /&gt;
[[File:Desired.png|alt=A semicircle in Minecraft, placed in a valley using spruce logs and jungle planks. Orientation is towards the left. Mirror of the &amp;quot;Semicircle rotated by minus 90 degrees&amp;quot; image.|thumb|The desired angles we want. The 180 degree part is above the 0 degree part, and the semicircle is in a C-like orientation.]]&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+What we want&lt;br /&gt;
!Initial angle&lt;br /&gt;
(+X axis, anticlockwise)&lt;br /&gt;
!Desired angle&lt;br /&gt;
(Corresponding Y-rotation angle)&lt;br /&gt;
!Orientation&lt;br /&gt;
!Desired position in the semicircle&lt;br /&gt;
|-&lt;br /&gt;
|0°&lt;br /&gt;
| -90°&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; |Towards the left&lt;br /&gt;
|Bottom&lt;br /&gt;
|-&lt;br /&gt;
|90°&lt;br /&gt;
|180°&lt;br /&gt;
|Left&lt;br /&gt;
|-&lt;br /&gt;
|180°&lt;br /&gt;
|90°&lt;br /&gt;
|Top&lt;br /&gt;
|}&lt;br /&gt;
[[File:Adding90.png|alt=Semicircle rotated by plus 90 degrees, orientation of the semicircle is towards the left.|thumb|Semicircle rotated by +90°.]]&lt;br /&gt;
&lt;br /&gt;
==== Adding 90° ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Initial angle&lt;br /&gt;
(+X axis, anticlockwise)&lt;br /&gt;
!Final angle&lt;br /&gt;
(Corresponding Y-rotation angle)&lt;br /&gt;
!Orientation&lt;br /&gt;
!Final position in the semicircle&lt;br /&gt;
|-&lt;br /&gt;
|0°&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;90&amp;#039;&amp;#039;°&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; |Towards the left&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Top&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|90°&lt;br /&gt;
|180°&lt;br /&gt;
|Left&lt;br /&gt;
|-&lt;br /&gt;
|180°&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;-90°&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Bottom&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Reflecting the semicircle along the (imaginary) horizontal diameter will produce the desired angles (Top will be changed to bottom and vice-versa).&lt;br /&gt;
[[File:Subtract90.png|alt=Semicircle rotated by minus 90 degrees, orientation of the semicircle is towards the right.|thumb|Semicircle rotated by -90°.]]&lt;br /&gt;
&lt;br /&gt;
==== Subtracting 90° ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Initial angle&lt;br /&gt;
(+X axis, anticlockwise)&lt;br /&gt;
!Final angle&lt;br /&gt;
(Corresponding Y-rotation angle)&lt;br /&gt;
!Orientation&lt;br /&gt;
!Final position in the semicircle&lt;br /&gt;
|-&lt;br /&gt;
|0°&lt;br /&gt;
| -90°&lt;br /&gt;
| rowspan=&amp;quot;3&amp;quot; |&amp;#039;&amp;#039;&amp;#039;Towards the right&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|Bottom&lt;br /&gt;
|-&lt;br /&gt;
|90°&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;0&amp;#039;&amp;#039;°&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Right&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
|180°&lt;br /&gt;
|90°&lt;br /&gt;
|Top&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Reflecting the semicircle along the vertical diameter will produce the desired angles (Right will be changed to left and vice-versa).&lt;br /&gt;
&lt;br /&gt;
=== Wrapping back ===&lt;br /&gt;
For the yaw, the range is (-180&amp;amp;deg;, 180&amp;amp;deg;], which means that anything greater than the absolute value of 180 degrees must be wrapped back inside the yaw table. However, after the angle transformations, all the angles beyond the range will have to be wrapped. &lt;br /&gt;
&lt;br /&gt;
There can be many more approaches for wrapping other than the ones stated below. &lt;br /&gt;
&lt;br /&gt;
==== Approach 1: Using the modulus ====&lt;br /&gt;
Required: the size and the minimum and the maximum values.&lt;br /&gt;
&lt;br /&gt;
The size is 360&amp;amp;deg; because the whole circle is being considered.&lt;br /&gt;
&lt;br /&gt;
Therefore,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;\begin{align} -190 \equiv 170 \pmod{360} \\ 181 \equiv -179 \pmod{360} \end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In various programming languages, the mod(a, n) operator is used. When exactly one of the operands is negative, the basic definition breaks down, and programming languages differ in how these values are defined.&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Modulo&amp;lt;/ref&amp;gt; Here, n = 360. Therefore, &amp;#039;a&amp;#039; should be changed to a positive value before performing the modulo operation.&lt;br /&gt;
&lt;br /&gt;
==== Approach 2: Adding or subtracting by 360 degrees ====&lt;br /&gt;
360 degrees is a full revolution. Moving by positive or negative 360 degrees is the same thing as not moving inside the orbit.&lt;br /&gt;
&lt;br /&gt;
Thus, we can use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;f(x) = \begin{cases} &lt;br /&gt;
x - 360 , &amp;amp; \text{if }x &amp;gt; 180 \\ &lt;br /&gt;
x + 360, &amp;amp; \text{if }x \leq -180 \\&lt;br /&gt;
x, &amp;amp; \text{otherwise}\end{cases}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This has been achieved using the following code in JavaScript:&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
angle = -360 * Math.sign(angle) + angle;&lt;br /&gt;
if (angle === -180)&lt;br /&gt;
    return &amp;quot;180.0&amp;quot;;&lt;br /&gt;
return angle;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;Here, angle is the variable x.&lt;br /&gt;
&lt;br /&gt;
=== The final code ===&lt;br /&gt;
Here is the final code in JavaScript. There are two coordinates here, namely (xcurrent, zcurrent) and (xdest, zdest).&amp;lt;ref&amp;gt;https://github.com/FlyingSaturn/yawcalc/blob/main/script.js&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;javascript&amp;quot;&amp;gt;function getYawAngle(xcurrent, zcurrent, xdest, zdest) {&lt;br /&gt;
&lt;br /&gt;
  // z is negated here (equivalent to -(zdest - zcurrent))&lt;br /&gt;
  let slope = Math.atan2(zcurrent - zdest, xdest - xcurrent) * (180 / Math.PI);&lt;br /&gt;
&lt;br /&gt;
  slope += 90;   // Adding 90 degrees&lt;br /&gt;
  slope *= -1;   // Reflecting along the horizontal diameter&lt;br /&gt;
&lt;br /&gt;
  // Wrap into the (-180, 180] range (Approach 2)&lt;br /&gt;
  if (Math.abs(slope) &amp;gt; 180) {&lt;br /&gt;
    slope = -360 * Math.sign(slope) + slope;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  // Round to a single decimal place&lt;br /&gt;
  slope = Math.round(slope * 10) / 10;&lt;br /&gt;
&lt;br /&gt;
  // Mimic the Java special‑case string outputs&lt;br /&gt;
  if (slope === 0)       return &amp;quot;-0.0&amp;quot;;&lt;br /&gt;
  if (slope === -180)    return &amp;quot;180.0&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  // Default path – always keep one decimal digit like Java’s “‑123.4”&lt;br /&gt;
  return slope.toFixed(1);&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;The function in Approach 2 has not been replicated one-to-one.&lt;br /&gt;
&lt;br /&gt;
== Place blocks ==&lt;br /&gt;
The viewing angle affects the placement of some blocks: depending on how the player look, for example, a [[Minecraft:banner]] or a [[Minecraft:sign]] rotated accordingly. The viewing angle also plays a role when placing [[Minecraft:stairs]] or [[Minecraft:scaffolding]].&lt;br /&gt;
&lt;br /&gt;
== Target selection ==&lt;br /&gt;
Target selection properties allow entities to be selected that have a specific viewing angle:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|y_rotation&lt;br /&gt;
|Viewing angle&lt;br /&gt;
|-&lt;br /&gt;
|x_rotation&lt;br /&gt;
|Head tilt angle&lt;br /&gt;
|}&lt;br /&gt;
Angle ranges are specified with two points, e.g. B. &amp;lt;code&amp;gt;43..47&amp;lt;/code&amp;gt;.&lt;br /&gt;
 /title @a[y_rotation=&amp;lt;view angle&amp;gt;] actionbar {&amp;quot;text&amp;quot;:&amp;quot;View direction (compass direction)&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
 /title @a[x_rotation=&amp;lt;nowiki&amp;gt;&amp;lt;head tilt angle&amp;gt;] actionbar {&amp;quot;text&amp;quot;:&amp;quot;head tilt (up)&amp;quot;}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
Examples of the cardinal directions:&lt;br /&gt;
 /execute if entity @p[y_rotation=135..-135] run say North&lt;br /&gt;
 /execute if entity @p[y_rotation=-135..-45] run say East&lt;br /&gt;
 /execute if entity @p[y_rotation=-45..45] run say South&lt;br /&gt;
 /execute if entity @p[y_rotation=45..135] run say West&lt;br /&gt;
&lt;br /&gt;
== Save perspective ==&lt;br /&gt;
Blinking angles can be read out and saved in a score: To do this, create a score target for the direction and the inclination.&lt;br /&gt;
 /scoreboard objectives add direction dummy &amp;quot;viewing angle direction&amp;quot; &lt;br /&gt;
 /scoreboard objectives add tilt dummy &amp;quot;viewing angle inclination&amp;quot;&lt;br /&gt;
Then, read out the direction and inclination using the command &amp;lt;code&amp;gt;/data&amp;lt;/code&amp;gt; and save them in the respective score.&lt;br /&gt;
 /execute as @a store result score @s direction run data get entity @s Rotation[0]&lt;br /&gt;
 /execute as @a store result score @s tilt run data get entity @s Rotation[1]&lt;br /&gt;
&lt;br /&gt;
== Set perspective ==&lt;br /&gt;
The commands {{cmd|teleport}} and {{cmd|rotate}} can be used to set the perspective of entities. The entities can move freely after teleportation if they have AI, but they start with the fixed viewing angle.&lt;br /&gt;
&lt;br /&gt;
Additionally, all entities except players can be realigned using the command {{cmd|data}} via the property &amp;lt;code&amp;gt;Rotation&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Viewpoint coordinates ==&lt;br /&gt;
{{Main|Coordinates#Local_coordinates}}&lt;br /&gt;
Circumflexes (&amp;lt;code&amp;gt;^&amp;lt;/code&amp;gt;) allow the position to be determined depending on the rotation of an entity.&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
{{Empty section}}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
{{reflist}}&lt;br /&gt;
&lt;br /&gt;
== Navigation ==&lt;br /&gt;
{{Navbox gameplay}}&lt;br /&gt;
[[Minecraft:de:Blickwinkel]]&lt;br /&gt;
[[Minecraft:pt:Rotação]]&lt;br /&gt;
[[Minecraft:zh:朝向]]&lt;/div&gt;</summary>
		<author><name>SyncBot</name></author>
	</entry>
</feed>