Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

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.

  • Author

Should do the job, thank you.

Although it would be GREAT to get a hook for that, just for future uses :b

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

  • 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)

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

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

  • 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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.