[1.7.10] Help needed with understanding EntityArrowObject

Recommended Posts

Hey,

I am making a class which is extension for ranged weapons classes in my mod.

The main reason why I want to do that is better and faster weapons coding.

Now I am trying to change a reloading time off weapons. Just simply code the number double number of seconds to reload.

I stucked on creating new EntityArrow object when the player stops using item.

`EntityArrow entityarrow = new EntityArrow(par2World, par3EntityPlayer, (float) (f * 2.0F * 4/3));`

I dont know what is the third parameter. In my forge dev build there isnt any desc of that method and its parameters.

It could be a start speed of an arrow or sth like this but I am not sure. What could be the units if so. Meters per second wheter other?

Share on other sites

Look at ItemBow and see what it passes as the 3rd argument.

Maker of the Craft++ mod.

Share on other sites

I did it but it didnt help.

```float f = (float)j / 20.0F;
f = (f * f + f * 2.0F) / 3.0F;

if ((double)f < 0.1D)
{
return;
}

if (f > 1.0F)
{
f = 1.0F;
}

EntityArrow entityarrow = new EntityArrow(p_77615_2_, p_77615_3_, f * 2.0F);
```

Float f seems to be an amount of seconds of bow pulling(int j is a tick amount)

I dont understand that code:  f = (f * f + f * 2.0F) / 3.0F;

Than there are 2 ifs. First looks if the f isnt too small, second isnt too big. So it probably could be a 0-1 relation of max bow pulling.

I can add that changing 3rd parameter changes speed of arrows. Problem is what are the units.

Share on other sites

Hi

Based on the code in setThrowableHeading(), it appears to be the initial speed of the arrow, probably in metres per tick.

-TGG

Share on other sites

Thanks, but next I need to be sure that if I put 10F for par3 it would be 10m/tick.

Share on other sites

Well then - try it and see

Put a system.out.println({position}) in the arrow's tick update (don't forget that it will run on both client and server), and you will be able to calculate the distance per tick very easily.

-TGG

Share on other sites

Greate idea. I will try and reply.

I was wrong. That par3 is strange.

If I put there 2F speed seems to be 4m/tick

When 4F it seems to be from 4 to 6.

Can sb tries to get know what are those par3 and how to set correctly speed??

Mayby I have too much lags and speed isnt corectly shown in console.

@Edit

Ok, now I am 100% sure that par3 is speed

par3 is preaty strange argument. The unit of it is meter per tick, but we must / our speed by 1.5 to make it correct in the balistic code.

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.

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

×   Pasted as rich text.   Restore formatting

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

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

• Posts

• Remove Oculus from your server
• Crashed minecraft in server, help pls https://drive.google.com/file/d/1xC0s7Si3FDOYBGLzsIWbtoNcTzdxurY7/view?usp=sharing
• I have noticed recently that in the tags, beginner, intermediate and advanced are all missing. Is there a reason for this?
• Could some fixed code be given for the item? I am still not sure what to do regarding the weapon.  (Sorry if it is a bit much to ask for).
• The Minecraft Launcher refuses to open. I click the icon on my taskbar, nothing loads. I have used Task Manager and the launcher is running, but the window just won't open. Does anyone have any suggestions on how to fix it?  NOTE: The legacy launcher works completely fine, it is just the "new" launcher that has an issue.

• Who's Online (See full list)

×

• Activity

×
• Create New...