Jump to content

Recommended Posts

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

Posted

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?

Posted

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

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