mirror of
https://github.com/luanti-org/luanti.git
synced 2025-12-22 14:45:27 +01:00
Add more information in PlayerHPChangeReason (#16024)
1) Add `node` and `node_pos` field for the `drown` field (analog to `node_damage` type) 2) Add `custom_type` field to allow a standardized way to report more details of the HP change 3) Make `builtin` report a `custom_type` for the HP changes caused by the `/kill` command and `core.do_item_eat` 4) Move the documentation of `PlayerHPChangeReason` to its own section 5) Fill in missing information of said documentation
This commit is contained in:
@@ -1348,7 +1348,7 @@ local function handle_kill_command(killer, victim)
|
||||
core.log("action", string.format("%s killed %s", killer, victim))
|
||||
end
|
||||
-- Kill victim
|
||||
victimref:set_hp(0)
|
||||
victimref:set_hp(0, {type="set_hp", custom_type="__builtin:kill_command"})
|
||||
return true, S("@1 has been killed.", victim)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user