TheKingElessar Posted June 7, 2019 Share Posted June 7, 2019 I'm trying to spawn an entity, in this example EvokerFangs, and have it be rotated. I can set its yaw (turning left/right) fine, but not its pitch (up/down). Since rotationPitch is a field I assume it's possible. Here's my code: EntityEvokerFangs toSpawn = new EntityEvokerFangs(senderWorld); // senderWorld is a world retrieved from the context of a packet toSpawn.setPosition(message.x, message.y, message.z); toSpawn.rotationPitch = 45F; System.out.println("Pitch: " + toSpawn.rotationPitch); // Prints 45 toSpawn.rotationYaw = 45F; System.out.println("Yaw: " + toSpawn.rotationYaw); // Prints 45 senderWorld.spawnEntity(toSpawn); // Spawned with a 45 yaw but not picth What's going on here? Quote Link to comment Share on other sites More sharing options...
TheKingElessar Posted June 9, 2019 Author Share Posted June 9, 2019 (edited) I don't know what the forum's opinion on bumping topics is, but if anyone has any insight on this I'd appreciate it! Edited June 9, 2019 by TheKingElessar Quote Link to comment Share on other sites More sharing options...
Cadiboo Posted June 9, 2019 Share Posted June 9, 2019 I would recommend using the debugger to track down where the value gets reset Quote About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme) Link to comment Share on other sites More sharing options...
TheKingElessar Posted June 10, 2019 Author Share Posted June 10, 2019 Alright, I figured out what it was. An Entity's rotationPitch field controls the pitch of the entity's head, not the entire body. EntityEvokerFangs don't have a head; therefore, there wasn't any pitch to set, so I wasn't seeing any change. So, in order for me to do what I'm trying to do, I'm going to have to do a bunch of rendering stuff to rotate an entire entity. That should be fun. If anybody has any suggestions on changing the pitch of an entire entity, feel free to send them my way! Quote Link to comment Share on other sites More sharing options...
Alpvax Posted June 14, 2019 Share Posted June 14, 2019 On 6/10/2019 at 2:40 AM, TheKingElessar said: If anybody has any suggestions on changing the pitch of an entire entity, feel free to send them my way! Try looking into elytra, sleeping and death. All of those involve the entity "lying down" Quote Link to comment Share on other sites More sharing options...
TheKingElessar Posted June 14, 2019 Author Share Posted June 14, 2019 5 hours ago, Alpvax said: Try looking into elytra, sleeping and death. All of those involve the entity "lying down" Yeah, I got what I wanted working by changing how it was rendered, but it suddenly occurred to me yesterday that I could look into the "Dinnerbone" nametag code. I'll take a look at those things! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.