diff options
author | Alexander Harkness <me@bearbin.net> | 2015-06-13 12:59:07 +0200 |
---|---|---|
committer | Alexander Harkness <me@bearbin.net> | 2015-06-13 12:59:07 +0200 |
commit | ce93cfc34c85ef34e7a7d52b65fccfe9dcaf7537 (patch) | |
tree | ade44b9828d0146d673901fb2a7e40b026c1fd9e /MCServer/Plugins/APIDump/Hooks/OnKilled.lua | |
parent | NetherPortalScanner: Fixed type conversion warnings. (diff) | |
parent | Added documentation for HOOK_KILLED (diff) | |
download | cuberite-ce93cfc34c85ef34e7a7d52b65fccfe9dcaf7537.tar cuberite-ce93cfc34c85ef34e7a7d52b65fccfe9dcaf7537.tar.gz cuberite-ce93cfc34c85ef34e7a7d52b65fccfe9dcaf7537.tar.bz2 cuberite-ce93cfc34c85ef34e7a7d52b65fccfe9dcaf7537.tar.lz cuberite-ce93cfc34c85ef34e7a7d52b65fccfe9dcaf7537.tar.xz cuberite-ce93cfc34c85ef34e7a7d52b65fccfe9dcaf7537.tar.zst cuberite-ce93cfc34c85ef34e7a7d52b65fccfe9dcaf7537.zip |
Diffstat (limited to 'MCServer/Plugins/APIDump/Hooks/OnKilled.lua')
-rw-r--r-- | MCServer/Plugins/APIDump/Hooks/OnKilled.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/MCServer/Plugins/APIDump/Hooks/OnKilled.lua b/MCServer/Plugins/APIDump/Hooks/OnKilled.lua new file mode 100644 index 000000000..2eaf23904 --- /dev/null +++ b/MCServer/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 +} |