players.lua 315 B

123456789101112
  1. local message = function(msg)
  2. core.log("action", "[callbacks] "..msg)
  3. core.chat_send_all(msg)
  4. end
  5. core.register_on_punchplayer(function(player, hitter, time_from_last_punch, tool_capabilities, dir, damage)
  6. if not hitter then
  7. message("Player "..player:get_player_name().." punched without hitter.")
  8. end
  9. end)