Jump to content

[1.8] proyectile Arrow head Shoot, get precise position where arrow hits Mob


Recommended Posts

Posted

 

 

 

 

 

 

 

 

 

Good days

this is mi mod

http://www.curse.com/mc-mods/minecraft/228033-mercenarymod

 

lately i been working in mi arrows and 45bullts

and i wanna make the hits on the head of an entity critical (Damagex2)

 

i learn i could get the aparently heigth of a mod whith

float mheigth = mob.getHeigth();

 

the code is not exact becose im not in the computer whith the code

 

using the mob heigth i decide than  if an arrow hits in 1/5 upper part of mobheigth then its headShoot and do damage x2

 

and whits begin the trouble how do i know the exact heigth of the arrow when reach the hiting box from a mob

 

first try

using in the OnUpdate() method  when the arrow does the damage, i ask for the value of

this.posY() andcompare it to mob.getHeigth();

but fail cos the value of this.posY() only updates once every tick but most of the times the arrow reach the target in less than a tick so the resulting  value is the same arrow starting posY 

 

 

second try

using maths i could calculate  the heigt of the player crosshair at the position of the mob, but this in unuseful becose arrows move in Parabolic Motion and the starting position of the arrow is not the eyesigth of the player so

lets say i aim the player crosshair to the head of a zombye at 10meters like 30feets and i  shoot an arrow at the fully strength of 2.0F, the cross hair aim to the zombyes head but the arrow hits at their legs so this cannot be consider  for a head shoot

 

thirth try

lets say i get the arrow heigth at the distance of the target entity using  math from the Parabolic Motion of Projectiles but at how is equivalent the 2.0F streng of the arrow , but im pretty sure its not to  2m per second  the other thing is the gravity value from the minecraft world  ¿9.8 blocks per second

 

 

some help some ideas ?

 

thanks for reading .

 

 

 

 

 

 

 

 

 

Posted

using in the OnUpdate() method  when the arrow does the damage, i ask for the value of

this.posY() andcompare it to mob.getHeigth();

but fail cos the value of this.posY() only updates once every tick but most of the times the arrow reach the target in less than a tick so the resulting  value is the same arrow starting posY 

 

This is the only and proper way to do this.

 

only updates once every tick but most of the times the arrow reach the target in less than a tick

 

There is nothing "less than a tick".

Hits are calculated every tick onUpdate() by making little box around arrow and checking if the box touches some entity - if yes - checking if that entity can be hit and performing damage.

 

You need to get height of arrow and compare it to entity's eye height. Obviosly you need to grab brackets like [eyeHeigh - 0.2, eyeHeight + 0.2].

1.7.10 is no longer supported by forge, you are on your own.

Posted

your rigth but

nop dont ge it

 

public void onUpdate() {
	super.onUpdate();

	System.out.println("updatetick="+updatetick);
	System.out.println("arrowHeigth="+this.posY);
	updatetick ++;
}

 

and I shoot to the sky

 

[23:11:14] [Client thread/INFO]: [CHAT] Player28 has just earned the achievement [Taking Inventory]
[23:11:23] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=0
[23:11:23] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=69.52000000327826
[23:11:23] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=1
[23:11:23] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=75.23358706154791
[23:11:23] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=0
[23:11:23] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=69.52000000327826
[23:11:23] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=2
[23:11:23] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=80.84003830297883
[23:11:23] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=1
[23:11:23] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=75.11943529452965
[23:11:23] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=2
[23:11:23] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=80.61287628552385
[23:11:23] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=3
[23:11:23] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=86.34042508471765
[23:11:23] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=3
[23:11:23] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=86.00138291825259
[23:11:23] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=4
[23:11:23] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=91.73580805034982
[23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=4
[23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=91.28600453529778
[23:11:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=5
[23:11:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=97.02723723703498
[23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=5
[23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=96.46777998582554
[23:11:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=6
[23:11:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=102.21575218157123
[23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=6
[23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=101.54773773052023
[23:11:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=7
[23:11:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=107.3023820253986
[23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=7
[23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=106.52689594546916
[23:11:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=8
[23:11:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=112.28814561855252
[23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=8
[23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=111.40626262500851
[23:11:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=9
[23:11:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=117.17405162257779
[23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=9
[23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=116.18683568354066
[23:11:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=10
[23:11:24] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:342]: arrowHeigth=121.96109861241338
[23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:341]: updatetick=10
[23:11:24] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenaria

 

 

 

 

But

this goes In the part that does the damage when the arrows hits something

 

						
float mobHealth = mob.getHealth();
					float mobMaxHealth = mob.getMaxHealth();

					if (headShootEnable){

						Double arrowHeigth = this.posY;
						Double mobHeigth = mob.height + mob.posY;
						Double mobposY = mob.posY;
						Double mobHead = mobHeigth - (mob.height /5);

						System.out.println("arrowHeigth"+arrowHeigth);
						System.out.println("mobHeigth"+mobHeigth);
						System.out.println("mobposY"+mobposY);
						System.out.println("mobHead"+mobHead);

						if (arrowHeigth >= mobHead)
						{
							System.out.println("HeadShoot");
						}

											}

 

and i put this in the constructor i use to shoot the arrow

//#########################################################################################################################3
// este es el methodo que uso para lanzar las flechas
public flechaMercenariaVainilla_entity(World worldIn, EntityLivingBase shooter, float p_i1756_3_, boolean vallesta) {
	super(worldIn);
	this.renderDistanceWeight = 10.0D;
	this.shootingEntity = shooter;

	this.thisId = this.getEntityId();
	this.shootingEntityId = shooter.getEntityId(); 


	if (shooter instanceof EntityPlayer) {
		this.canBePickedUp = 0;
	}

	this.setSize(0.5F, 0.5F);
	this.setLocationAndAngles(shooter.posX, shooter.posY + (double) shooter.getEyeHeight(), shooter.posZ, shooter.rotationYaw, shooter.rotationPitch);

	if (!vallesta) {
		this.posX -= (double) (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F);
		this.posZ -= (double) (MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * 0.16F);
	}
	this.posY -= 0.10000000149011612D;

	this.setPosition(this.posX, this.posY, this.posZ);
	this.motionX = (double) (-MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI));
	this.motionZ = (double) (MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI));
	this.motionY = (double) (-MathHelper.sin(this.rotationPitch / 180.0F * (float) Math.PI));
	this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, p_i1756_3_ * 1.5F, 1.0F);

	Double arrowHeigth = this.posY;
	System.out.println("inicial arrowHeigth"+arrowHeigth);

}
//#########################################################################################################################3

 

 

shooting to visual head
[23:27:58] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:158]: inicial arrowHeigth70.52000000327826
[23:27:58] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:158]: inicial arrowHeigth70.52000000327826
[23:27:58] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:659]: arrowHeigth70.52000000327826
[23:27:58] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:660]: mobHeigth70.95000004768372
[23:27:58] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:661]: mobposY69.0
[23:27:58] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:662]: mobHead70.56000003218651

shooting to the belly of the same mob
[23:28:02] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:158]: inicial arrowHeigth70.52000000327826
[23:28:02] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:158]: inicial arrowHeigth70.52000000327826
[23:28:02] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:659]: arrowHeigth70.52000000327826
[23:28:02] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:660]: mobHeigth70.95000004768372
[23:28:02] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:661]: mobposY69.0
[23:28:02] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:662]: mobHead70.56000003218651

shooting to their feets
[23:28:06] [Client thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:158]: inicial arrowHeigth70.52000000327826
[23:28:06] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:158]: inicial arrowHeigth70.52000000327826
[23:28:06] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:659]: arrowHeigth70.52000000327826
[23:28:06] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:660]: mobHeigth70.95000004768372
[23:28:06] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:661]: mobposY69.0
[23:28:06] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:662]: mobHead70.56000003218651

 

this value arrowHeigth  70.52000000327826 is the same value than the initial arrow heigth 

there must be something reseting this value but whaever it does just when hits something

 

is late tired  twomorrow i shall continue

 

Thanks for the tip

 

 

Posted

this morning i realize something and make the custom arrow class full of system outs

 

 

Strength 2.0F

[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:161]: inicial arrowHeigth10.520000003278255
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:162]: inicial pitch-0.22247742
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:163]: inicial Yaw90.17516
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:164]: Fuerza inicial2.0
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:352]: 


[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:353]: updatetick=0
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:354]: worldIn=false
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: arrowHeigth=10.520000003278255

[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: arrowX=0.5300112784265364
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:358]: arrowZ=2.651967810608937
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:352]: 


[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:353]: updatetick=1
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:354]: worldIn=false
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: arrowHeigth=10.508269451717808

[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: arrowX=3.55101266101769
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:358]: arrowZ=2.6427318662823307
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:352]: 


[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:353]: updatetick=2
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:354]: worldIn=false
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: arrowHeigth=10.446656204816037

[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: arrowX=6.541804058593446
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:358]: arrowZ=2.6335882813109097
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:352]: 


[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:353]: updatetick=3
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:354]: worldIn=false
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: arrowHeigth=10.335659089050635

[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: arrowX=9.502687570715853
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:358]: arrowZ=2.624536132102003
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:352]: 


[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:353]: updatetick=4
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:354]: worldIn=false
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: arrowHeigth=10.175771942639278

[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: arrowX=12.433962275954222
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:358]: arrowZ=2.6155745042988574
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:352]: 


[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:353]: updatetick=5
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:354]: worldIn=false
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: arrowHeigth=9.967483665422174

[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: arrowX=15.335924262095023
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:358]: arrowZ=2.6067024926882785
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:352]: 


[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:353]: updatetick=6
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:354]: worldIn=false
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: arrowHeigth=9.71127826824579

[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: arrowX=18.208866656049683
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:358]: arrowZ=2.597919201109195
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:352]: 


[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:353]: updatetick=7
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:354]: worldIn=false
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: arrowHeigth=9.407634921852747

[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: arrowX=21.053079653463307
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:358]: arrowZ=2.5892237423621385
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:352]: 


[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:353]: updatetick=8
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:354]: worldIn=false
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: arrowHeigth=9.057028005282808

[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: arrowX=23.868850548027325
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:358]: arrowZ=2.580615238119626
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:352]: 


[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:353]: updatetick=9
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:354]: worldIn=false
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: arrowHeigth=8.659927153789862

[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: arrowX=26.656463760498987
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:358]: arrowZ=2.572092818837442
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:352]: 


[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:353]: updatetick=10
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:354]: worldIn=false
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: arrowHeigth=8.216797306279739

[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: arrowX=29.416200867430682
[08:45:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:358]: arrowZ=2.5636556236668033

 

strength 10F

[09:21:52] [server thread/WARN]: Can't keep up! Did the system time change, or is the server overloaded? Running 2349ms behind, skipping 46 tick(s)
[09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:164]: inicial arrowHeigth10.520000003278255
[09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:165]: inicial pitch0.0
[09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:166]: inicial Yaw90.148315
[09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:<init>:167]: Fuerza inicial10.0
[09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:355]: 


[09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: updatetick=0
[09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: worldIn=false
[09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:359]: arrowHeigth=10.520000003278255

[09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:360]: arrowX=0.5468684833476746
[09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:361]: arrowZ=2.6330270612907856
[09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:355]: 


[09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: updatetick=1
[09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: worldIn=false
[09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:359]: arrowHeigth=10.520000003278255

[09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:360]: arrowX=15.546818415446063
[09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:361]: arrowZ=2.594198216154918
[09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:355]: 


[09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:356]: updatetick=2
[09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:357]: worldIn=false
[09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:359]: arrowHeigth=10.470000002533197

[09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:360]: arrowX=30.396768991274136
[09:22:05] [server thread/INFO] [sTDOUT]: [mercenarymod.items.arcos.flechaMercenariaVainilla_entity:onUpdate:361]: arrowZ=2.5557576591001085
[09:22:08] [server thread/INFO]: Saving and pausing game...

 

 

 

i create a plain world and build to columns one in the exactly x0 z2  and other at the east in x30 z2 and shoot from the one to the other

so at  Strength 2.0F (fuerza 2.0F) the arrow has an average  speed of  2,89385233 blocks / per tick

and gravity is like −0,23032027 blocks / per tick

 

at Strength 10F

speed  like 14,997032667  blocks / per tick

gravity  −0,025 blocks / per tick

 

so fuck up this shit gravity is not constan depends on the strength  so no Parabolic Motion is usable

thirth try is  a fail

 

four try

witchcraft i gonna need witchcraft to solve this

 

Posted

i get something

 

				float mobHealth = mob.getHealth();
					float mobMaxHealth = mob.getMaxHealth();

					if (headShootEnable) {

						boolean HS = true;

						// dont heatShoot anything whith more health than a witch

						if (mobHealth > 26.0F) {
							HS = false;
						}

						float mobHeigth = mob.height;

						// dont heatShoot anything to Small like pigs or childs
						if (mobHeigth < 1.0F) {
							HS = false;
						}

						if (HS) {
							Double mobposY = mob.posY;
							Double mobHead = ( mobposY + mobHeigth ) - (mob.height / 5);

							Double nextPosX = this.posX + this.motionX;
							Double nextPosY = this.posY + this.motionY;
							Double nextPosZ = this.posZ + this.motionZ;

							double longitud0 = (double) MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);

							float angulo = (float) ((Math.atan(this.motionY / longitud0) * -1) * 180.0D / Math.PI); 
							double mobdX = this.posX - mob.posX;
							double mobdZ = this.posZ - mob.posZ;

							double longitud1 = (double) MathHelper.sqrt_double((mobdX * mobdX) + (mobdZ * mobdZ));

							// tang(x) * CA = CO
							double altura = (Math.tan(Math.toRadians(angulo)) * -1) * longitud1;

							double alturax = (altura + this.posY);

							// System.out.println("alturax="+alturax);

							if (alturax >= mobHead) {
								System.out.println("HeadShoot");
								damageM = damageM * 1.5F;

							}

						}

					}


					if (damageM > 26.1F)
					{
						damageM = 26.1F;
					}

 

i make this an gonna test it

if i dont like it i repost the question

for now itake it like solved

 

Thanks

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.

Announcements



×
×
  • Create New...

Important Information

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