Topic category: Help with Minecraft modding (Java Edition)
I'm not sure what I'm doing wrong. I want a new entity to replace an existing entity (mainly to change the model) in a procedure, and I want the new entity to spawn with the same direction as the old one. So this is what I use (an example, spawning sheep is not my goal):
However, the yaw seems to be ignored, since the sheep always spawn with the yaw of 0, as seen here:
https://files.catbox.moe/0mvdwg.mp4
Any idea what I can do about this? I've tried converting between radians and degrees, but doing some print-to-chat testing makes me think that shouldn't be necessary anyway. Also, it seems like if a mob is stationary and looks around, rotating its whole model (NOT just the head), its yaw doesn't seem to change until it starts moving again? At least, that's what I got from printing a mob's yaw into chat (which would almost always happen twice at once for some reason, with strangely different values too).
Looks like the problem is elsewhere, I don't know if it's either an MCreator bug or Forge bug, but the yaw parameter in setLocationAndAngles seems to be ignored entirely. Using the "Spawn at xyz" function without specifiable rotation uses world.getRandom().nextFloat() * 360F to spawn the entity with a random yaw, but it always spawns with 0 anyway.
you actually need to set rotationYawHead instead of rotationYaw to spawn with a rotation
Just through quick testing that seems to work, thanks! By the way, what use is there then for the yaw argument in SetLocationAndAngles when it seems to be ignored?
I suppose this might be a good feature suggestion idea for MCreator.
that yaw works when the entity is already spawned.