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

Detecting tnt damage to a block. I'd like to be able to detect and cancel it on specific blocks.

I'm not looking for the code.

Just a general idea on if and which forge event i should look at to figure it out

 

Thanks

Thing that is more important, and kinda want to ask it here. How can a block detect an explosion (creeper, tnt, ghast,etc) and "absorb" or nullify the dmg/destruction. There is a flower in Botania that will absorb the force of a tnt blast and turn it into power.

 

Is that just checking for an event? or is there a way for the block to "detect" an explosion and cancel it out?

The fuse field in EntityTNTPrimed is public, so you can check to see how much more time is left (when time runs out it is explosion).  I can't find an obvious event, but you can use a tick event (or onUpdate if you have a custom tile entity that is acting like the Botania flower you mentioned) in which you can look for any EntityTNT around and then check the fuse value.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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.