Jump to content

[1.13.2] Spawned entity uses rotationYaw but not rotationPitch


TheKingElessar

Recommended Posts

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?

Link to comment
Share on other sites

I would recommend using the debugger to track down where the value gets reset

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.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

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!

Link to comment
Share on other sites

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"

Link to comment
Share on other sites

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!
 

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.