summaryrefslogtreecommitdiffstats
path: root/Server/Plugins/APIDump/Hooks/OnKilled.lua
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-08-26 10:58:51 +0200
committerMattes D <github@xoft.cz>2015-09-05 22:01:21 +0200
commitdac97826f7d0c9b9135c1a08c4d5f16b61494bd1 (patch)
treeec17a9703fe734956e4f151cb5306befc4fd7571 /Server/Plugins/APIDump/Hooks/OnKilled.lua
parentMerge pull request #2459 from cuberite/fixes (diff)
downloadcuberite-dac97826f7d0c9b9135c1a08c4d5f16b61494bd1.tar
cuberite-dac97826f7d0c9b9135c1a08c4d5f16b61494bd1.tar.gz
cuberite-dac97826f7d0c9b9135c1a08c4d5f16b61494bd1.tar.bz2
cuberite-dac97826f7d0c9b9135c1a08c4d5f16b61494bd1.tar.lz
cuberite-dac97826f7d0c9b9135c1a08c4d5f16b61494bd1.tar.xz
cuberite-dac97826f7d0c9b9135c1a08c4d5f16b61494bd1.tar.zst
cuberite-dac97826f7d0c9b9135c1a08c4d5f16b61494bd1.zip
Diffstat (limited to 'Server/Plugins/APIDump/Hooks/OnKilled.lua')
-rw-r--r--Server/Plugins/APIDump/Hooks/OnKilled.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/Server/Plugins/APIDump/Hooks/OnKilled.lua b/Server/Plugins/APIDump/Hooks/OnKilled.lua
new file mode 100644
index 000000000..9289b8f35
--- /dev/null
+++ b/Server/Plugins/APIDump/Hooks/OnKilled.lua
@@ -0,0 +1,22 @@
+return
+{
+ HOOK_KILLED =
+ {
+ CalledWhen = "A player or a mob died.",
+ DefaultFnName = "OnKilled",
+ Desc = [[
+ This hook is called whenever player or a mob dies. It can be used to change the death message.
+ ]],
+ Params =
+ {
+ { Name = "Victim", Type = "{{cEntity}}", Notes = "The player or mob that died" },
+ { Name = "TDI", Type = "{{TakeDamageInfo}}", Notes = "Informations about the death" },
+ { Name = "DeathMessage", Type = "string", Notes = "The default death message. An empty string if the victim is not a player" },
+ },
+ Returns = [[
+ The function may return two values. The first value is a boolean specifying whether other plugins should be called. If it is true, the other plugins won't get notified of the death. If it is false, the other plugins will get notified.</p>
+ <p>The second value is a string containing the death message. If the victim is a player, this death message is broadcasted instead of the default death message. If it is empty, no death message is broadcasted. If it is nil, the message is left unchanged. If the victim is not a player, the death message is never broadcasted.</p>
+ <p>In either case, the victim is dead.
+ ]],
+ }, -- HOOK_KILLED
+}