How to modify the explosion pattern of a tnt?

Started by Gizmodod on Sat, 11/26/2022 - 06:10

Topic category: Help with modding (Java Edition)

Last seen on 05:37, 27. Jan 2023
Joined Mar 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How to modify the explosion pattern of a tnt?
Sat, 11/26/2022 - 06:11 (edited)

Hello,

 

I've been looking for a way to do it for quite a while now, but I can't find it, so I'm making this post.

 

I'd like to pass an explosion like this:

 

to a more realistic explosion like this:

 

I thank you in advance, if you know how to help me to create this type of explosion with MCreator (I am using MCreator 2022.3).

 

Edited by Gizmodod on Sat, 11/26/2022 - 06:11
Last seen on 22:18, 30. Jan 2023
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You won't actually be able…
Mon, 01/02/2023 - 17:22

You won't actually be able to make a custom explosion for this, but you can do this with a custom procedure. Use the 'Search for Block in 6*6 box' procedure preset, get rid of the 'found' variable, and set the range to the desired size of the explosion. The procedure will check every block in the desired range. (The block it is currently checking is always at sx, sy, and sz, the offset from the center of where the procedure is executed.) 

The basic idea is that if the block is within a certain range, and is breakable, destroy it. I don't remember the exact math you need to do for spheres; but essentially, if the sx, sy, or sz of the block is a certain distance from the center, (x, y, z), destroy it. If it's within another range, (the edge of the explosion), give it a random chance of being destroyed. This will allow you to make a roughly spherical crater.

...It isn't quite that simple; you'll need a way to determine the blast resistance of different materials, a way to shield materials behind blast resistant blocks, and a means of generating explosion particles; but that's the basic idea.