[SPIGOT-619] setYaw() yields no result Created: 26/Feb/15  Updated: 19/May/17  Resolved: 23/Nov/16

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: PikaMug Assignee: md_5
Resolution: Fixed Votes: 4
Labels: 1.8, bukkit, entity, spigot
Environment:

Tested with slimes on Win7 and CentOS


Attachments: File YawTest.jar    
Issue Links:
Duplicate
is duplicated by SPIGOT-3253 Entities ignoring yaw when teleported Resolved

 Description   

This seems to be a long-standing issue. When the body rotation (yaw) of a monster entity (and possibly other entities) is set, it does not update in-game. Several forum suggestions include teleporting the entity after setYaw(), setting yaw before spawning the entity, and using NMS code, all with limited or no results. Same result with /summon command.

Sources:
(Best example) http://www.spigotmc.org/threads/direction-yaw-and-pitch-not-working.50972/
http://www.spigotmc.org/threads/set-body-rotation-of-a-livingentity.46377/
https://bukkit.org/threads/setting-yaw-doesnt-do-anything.71451/
https://bukkit.org/threads/entitys-yaw.316961/



 Comments   
Comment by PikaMug [ 14/Apr/15 ]

Thanks md_5!

The easy solution is to enable it with NoAI:0, set the yaw, then disable again. However, this is counter-intuitive and causes a slight visual delay in the rotation.

Comment by Tarkan Nielsen [ 13/Apr/15 ]

The problem here is that we'd like to be able to rotate the NoAI mobs, which isn't currently possible in Spigot (I however know that NoAI mobs work as intended in Vanilla).

I feel that this is a problem due to the fact that even using the inbuilt command to summon a NoAI mob (which I believe is /summon <EntityType>

{NoAI:1}

, which works flawlessly in vanilla) should set the yaw of the player using the command, however, this is not the case, what ends up happening instead is rather a fixed yaw which if I recall correctly is facing south.

I'd greatly appreciate if you were to re-consider this bug due to the fact that it breaks a functionality that is present in Vanilla and encourages developers into using "hacky" methods such as manipulating packets to trick the client into thinking the entity is facing the given way, just to work around this silly bug.

Comment by md_5 [ 12/Apr/15 ]

I tested your plugin (after removing the NoAI part) and the slime rotates as expected.

Comment by PikaMug [ 12/Apr/15 ]

Still an issue on CraftBukkit version git-Spigot-2f787bd-501372f (MC: 1.8.3)

Comment by PikaMug [ 13/Mar/15 ]

Thanks, noted. Attempt #2 should work, though, correct?

Comment by md_5 [ 13/Mar/15 ]

Attempt #1 will never work btw, since location handles are not reflective of the entities location.

Comment by PikaMug [ 13/Mar/15 ]

I've attached a 1.8.3 test jar which tries to set a Slime's yaw using two methods to no avail.

Source: https://github.com/FlyingPikachu/YawTest/blob/master/YawTest/src/me/happypikachu/YawTest/PlayerListener.java

To test, left-click a block to place a Slime above it, then right-click a BLOCK (not the Slime, or Air per SPIGOT-410).

Generated at Mon Apr 21 21:30:34 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.