Posted August 3, 201510 yr Is there something like an ArrowCollideWithBlockEvent? I searched a lot, and only found events whenever the Player starts or Stop using the block, but noone indicating a hit on a block with an arrow
August 3, 201510 yr 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.
August 3, 201510 yr Author Should do the job, thank you. Although it would be GREAT to get a hook for that, just for future uses :b
August 3, 201510 yr What are you trying to do when it impacts a block? Might be easier to tackle from that direction. Long time Bukkit & Forge Programmer Happy to try and help
August 3, 201510 yr Author Im doing a minigame where you can use diamond blocks as walls, so when they get hit they downgrade to iron and then vanish after another hit (I dont want to use a customblock even if I could just override the collide method there and have it done)
August 3, 201510 yr 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
August 3, 201510 yr I did say it was like the other one. Just give you some more info. Long time Bukkit & Forge Programmer Happy to try and help
August 3, 201510 yr Author Everything works just fine. Problem right now is that I dont know how to get the block the block is stick to.. Any help given?
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.