Posted November 25, 201410 yr 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.
November 25, 201410 yr Author Why are you using attackedAtYaw ? Use the correct values and it will work. surely, but if i put "180.0F" or "90.0F" anyway it spawns always with yaw value equal to 0. why?
November 25, 201410 yr 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.
November 25, 201410 yr Author 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;
November 25, 201410 yr 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.
November 25, 201410 yr Author Logger.setAngles(180, 0); ? yes something similar: Logger.setRotationYawHead(180.0F); works!! but the body wont rotate
November 25, 201410 yr 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.
November 25, 201410 yr Author 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
November 26, 201410 yr Author 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;
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.