From 64c767ad8c8e9137b2793e5f3b93f1632184dfaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elias=20=C3=85str=C3=B6m?= Date: Sat, 18 Apr 2020 14:18:23 +0200 Subject: [PATCH] Make TNT behave like Minecraft TNT entities are now knocked back by explosions. When a TNT block becomes triggered by an explosion, its fuse time is set to a random value between 0.5 and 1.5 seconds. --- mods/ITEMS/mcl_tnt/init.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_tnt/init.lua b/mods/ITEMS/mcl_tnt/init.lua index 5f53afaf8..0ec2679b8 100644 --- a/mods/ITEMS/mcl_tnt/init.lua +++ b/mods/ITEMS/mcl_tnt/init.lua @@ -104,7 +104,8 @@ minetest.register_node("mcl_tnt:tnt", { groups = { dig_immediate = 3, tnt = 1, enderman_takable=1 }, mesecons = tnt_mesecons, on_blast = function(pos) - spawn_tnt(pos, "mcl_tnt:tnt") + local e = spawn_tnt(pos, "mcl_tnt:tnt") + e:get_luaentity().timer = tnt.BOOMTIMER - (0.5 + math.random()) return true end, _on_ignite = function(player, pointed_thing) @@ -133,6 +134,7 @@ local TNT = { -- Initial value for our timer timer = 0, blinktimer = 0, + tnt_knockback = true, blinkstatus = true,} function TNT:on_activate(staticdata)