Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

How Can you Make TNT not Destroy Blocks?


  • Please log in to reply
5 replies to this topic

#1

virtualpiccolo

Posted 27 May 2013 - 03:11 PM

I am creating a map where I want TNT to explode without breaking any blocks but damaging people (like a creeper when the gamerule doMobGriefing is off.) I also don't want to use water for the TNT.

Register or log in to remove.

#2

craftyismyname

Posted 27 May 2013 - 03:51 PM

Hmmm... Sorry. I'm afraid there's no other way but using water. Sometimes in Minecraft Pocket Edition Survival Mode, when you detonate TNT, it will sometimes not do any damage to the terrain but damage the health from players. That can work (if you have an iPad, iPhone, iPod Touch, or Android).

So it only works in Pocket Edition. Would that answer your question?

#3

Mobius_Peverell
  • Location: Your local Swamp Biome
  • Minecraft: Mobius_Peverell

Posted 28 May 2013 - 09:15 PM

You could encase it in obsidian or bedrock.  I'm almost certain that it will still damage players.

#4

WillDaBeast509

Posted 28 May 2013 - 09:22 PM

I assume since you posted this in the mods discussion section, you're looking for a way to do this by modifying code? The other two answers didn't attest to that, so I thought I'd ask.

Anyway, in the EntityPrimedTNT class, look for where it calls the World method createExplosion. One of those parameters will be a boolean which says whether or not the explosion will do terrain damage. Set it to false and you'll be good to go.

If you weren't looking to modify code, sorry that doesn't help, but you're also in the wrong section :)
Posted Image

#5

egef
    egef

    Out of the Water

  • Members
  • 4 posts

Posted 30 January 2014 - 02:13 AM

View PostWillDaBeast509, on 28 May 2013 - 09:22 PM, said:

I assume since you posted this in the mods discussion section, you're looking for a way to do this by modifying code? The other two answers didn't attest to that, so I thought I'd ask.

Anyway, in the EntityPrimedTNT class, look for where it calls the World method createExplosion. One of those parameters will be a boolean which says whether or not the explosion will do terrain damage. Set it to false and you'll be good to go.

If you weren't looking to modify code, sorry that doesn't help, but you're also in the wrong section Posted Image
and where are those files?

#6

jcm2606
    jcm2606

    Lapis Lazuli Collector

  • Members
  • 1021 posts
  • Location: Australia

Posted 31 January 2014 - 10:31 AM

View Postegef, on 30 January 2014 - 02:13 AM, said:

and where are those files?
Look in the source. Also, don't respond to threads that have died, it can annoy some users.
Derpin da herp.