Jump to content

Trying to create a bow to shoot two arrows


brettski111

Recommended Posts

We would like a custom bow we created to shoot two arrows.  I have it working kind of and am looking for some assistance. 

 

To create the custom bow, I used the vanilla code as a template.  With a single arrow the bow appears to work just fine.  To shoot a second arrow, I added a second entity arrow throughout the bow code and spawn it in the the if (!par2World.isRemote) section. 

 

When I shoot the bow at a tree, both arrow shoot from the bow and two arrows stick into the tree.

 

When I shoot the bow at a cow, one arrow hits the cow and the other bounces off and sticks into the ground facing me. 

 

I am able to pick up both arrows, though I just noticed only one arrow is decremented from my inventory.  It does appear that both arrows are doing damage. 

 

At this point I assume I have gone about this the wrong way.  I appreciate any suggestion to improve this mod.

 

Kind regards,

 

brettski111

Link to comment
Share on other sites

The second one bounces off because there's a hurt delay on all mobs: when they take damage they become invulnerable for about a second.  During this time other attacks will do no damage (and arrows will bounce off).

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

Messing around with Utility Mobs for my own purposes, I mucked about with Toast's custom arrow class to allow multiple arrows to hit a single target.

 

That would also work.

 

Duplicate the arrow, then when it deals damage just set the entity's hurtTime (hurtResistanceTime?) to 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

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.