Jump to content

[1.8] ArrowCollideWithBlockEvent?


Failender

Recommended Posts

On WorldTickEvent get the list of all arrows in the world. For each arrow, create a new NBT tag compound, call the arrow's write entity to NBT method, then check if the byte tag inGround in your NBT compound equals 1. If it is, do whatever you want. Warning: your code will run always when the arrow is in the ground.

Maker of the Craft++ mod.

Link to comment
Share on other sites

Gotcha.

 

Something like was suggested might work.  I did something like that in the past.

 

Its been awhile since I did this, but I think there is an arrow loose or spawn event.  I'll look around tonight for my mod that uses it.  Anytime that happens, I add the arrow to a list where i'm tracking the age of the arrow once it is in the ground.

 

I iterate through the list each tick and advance the time if it meets my criteria.  After a short time, I make it go poof.

 

I created this for some NPC's I made that shot a lot of arrows.  They lag from the 1000's of arrows hanging around too long was ugly.

Long time Bukkit & Forge Programmer

Happy to try and help

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.