Jump to content

[1.7.x] Rotate Entities on spawn [UNSOLVED] :(


deenkayros

Recommended Posts

Hello,

 

I need to spawn an entity with the face always in front to the player but trying this code doesn't works:

 

 

 

    EntityBritch Logger = new EntityBritch(player.worldObj);

    Logger.setLocationAndAngles(event.x + 0.5D, event.y - 1, event.z + 0.5D, player.attackedAtYaw, 0.0F);

    player.worldObj.spawnEntityInWorld(Logger);

 

 

 

I mean the entity spawn correctly but with the face always to the same direction ... what am I doing wrong?

 

thank you.

Link to comment
Share on other sites

player.rotationYaw + 180 ?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

player.rotationYaw + 180 ?

 

yes but it isnt the player, it's a custom mob entity with model class. in summary i tried the follows solutions without success:

 

 

 

    EntityLoggyBritch Logger = new EntityLoggyBritch(player.worldObj);

    Logger.setLocationAndAngles(event.x + 0.5D, event.y - 1, event.z + 0.5D, 180.0F, 0.0F);

    player.worldObj.spawnEntityInWorld(Logger);

                                ....

    Logger.rotationYaw = 180.0F;

                                ....

    Logger.rotationYaw = player.rotationYaw + 180.0F;

 

 

 

Link to comment
Share on other sites

Logger.setAngles(180, 0); ?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

setAngles applies to the body, setRotationYawHead only affects the head, as indicated by the method name.

 

If that's not working, then it's clearly being changed by something else later.  Double check your updateTick method.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

setAngles applies to the body, setRotationYawHead only affects the head, as indicated by the method name.

 

If that's not working, then it's clearly being changed by something else later.  Double check your updateTick method.

 

nope, it doesn't works.

 

I think it's changed by the model class but setRotationYawHead is enough for me ..., thank you

Link to comment
Share on other sites

 

Why are you using

attackedAtYaw

? Use the correct values and it will work.

 

I tried to spawn also a Vanilla entity but same problem:

 

myYawVar = 90.0F;
EntityZombie eZombie = new EntityZombie(myPlayer.worldObj);
eZombie.setLocationAndAngles(X, Y, Z, myYawVar, 0.0F);
myPlayer.worldObj.spawnEntityInWorld(eZombie);
eZombie.rotationYaw = myYawVar;

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.