Thornack Posted April 12, 2016 Share Posted April 12, 2016 Hi Everyone, So I have been developing a system where I have items that launch projectiles. I want these items to work for both the player and mobs. They work perfectly fine for the player atm but for the mob the projectiles are launched at the incorrect lookvector. I noticed that the client and server values for the look vector are not in sync. How does minecraft sync them up? Quote Link to comment Share on other sites More sharing options...
Thornack Posted April 12, 2016 Author Share Posted April 12, 2016 So it seems that for mobs the throwable heading is incorrect if you calculate it the way that EntityThrowable calculates it. The way around this was to instead use the entitites look vector.x (y and z) coordinates inside the setThrowableHeading method to calculate the correct heading after you create an instance of your EntityThrowable. EntityRangedAttackBase distanceAttack = new EntityRangedAttack(world, entityUsingAttackItem).setType(attackType).setAreaOfEffectRadius(damageRadius); distanceAttack.setBaseDamageForProjectileAttack(baseDmg); distanceAttack.setThrowableHeading(entityUsingAttackItem.getLookVec().xCoord, entityUsingAttackItem.getLookVec().yCoord + 0.1, entityUsingAttackItem.getLookVec().zCoord, 1.5F, 1.0F); 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.