Skip to content
Snippets Groups Projects
Forked from Illuna-Minetest / minetest_game
Source project has a limited visibility.
  • Auke Kok's avatar
    098ea0d1
    TNT: Allow mods to override entity physics. · 098ea0d1
    Auke Kok authored
    Introduces an `on_blast(luaobj, damage)` callback that mods can attach
    to an entity def. The function will get called with the damage that
    TNT would make.
    
    The function should return three values:
    
      bool do_damage, bool do_knockback, table drops
    
    do_damage allows the mod to tell the TNT code to perform damage on
    the entity for the mod. The mod code should not do anything with
    the entity HP. The entity should not be immortal. If false, then
    the entity will not be damaged by the TNT mod.
    
    do_knockback allows the mod to tell the TNT mod to perform an
    entity knockback effect. If false, no knockback effect is applied
    to the entity.
    
    the drops table is a list of items to drop. It may be nil. E.g. {
    "wool:red" }.
    
    I've documented both on_blast() API methods in game_api.txt. It is
    a better place than lua_api.txt.
    098ea0d1
    History
    TNT: Allow mods to override entity physics.
    Auke Kok authored
    Introduces an `on_blast(luaobj, damage)` callback that mods can attach
    to an entity def. The function will get called with the damage that
    TNT would make.
    
    The function should return three values:
    
      bool do_damage, bool do_knockback, table drops
    
    do_damage allows the mod to tell the TNT code to perform damage on
    the entity for the mod. The mod code should not do anything with
    the entity HP. The entity should not be immortal. If false, then
    the entity will not be damaged by the TNT mod.
    
    do_knockback allows the mod to tell the TNT mod to perform an
    entity knockback effect. If false, no knockback effect is applied
    to the entity.
    
    the drops table is a list of items to drop. It may be nil. E.g. {
    "wool:red" }.
    
    I've documented both on_blast() API methods in game_api.txt. It is
    a better place than lua_api.txt.