summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/APIDump/Hooks/OnKilling.lua
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-11-23 21:26:24 +0100
committermadmaxoft <github@xoft.cz>2013-11-23 21:27:02 +0100
commitd9dc241e6fe669585d7c0b13d55818a22e1c76bc (patch)
tree0eed0d711eb4ff851e43f84bf6cb8f7cf3435cde /MCServer/Plugins/APIDump/Hooks/OnKilling.lua
parentDocumented sqlite functions. Used: http://lua.sqlite.org/index.cgi/doc/tip/doc/lsqlite3.wiki#sqlite3_functions (diff)
downloadcuberite-d9dc241e6fe669585d7c0b13d55818a22e1c76bc.tar
cuberite-d9dc241e6fe669585d7c0b13d55818a22e1c76bc.tar.gz
cuberite-d9dc241e6fe669585d7c0b13d55818a22e1c76bc.tar.bz2
cuberite-d9dc241e6fe669585d7c0b13d55818a22e1c76bc.tar.lz
cuberite-d9dc241e6fe669585d7c0b13d55818a22e1c76bc.tar.xz
cuberite-d9dc241e6fe669585d7c0b13d55818a22e1c76bc.tar.zst
cuberite-d9dc241e6fe669585d7c0b13d55818a22e1c76bc.zip
Diffstat (limited to 'MCServer/Plugins/APIDump/Hooks/OnKilling.lua')
-rw-r--r--MCServer/Plugins/APIDump/Hooks/OnKilling.lua33
1 files changed, 33 insertions, 0 deletions
diff --git a/MCServer/Plugins/APIDump/Hooks/OnKilling.lua b/MCServer/Plugins/APIDump/Hooks/OnKilling.lua
new file mode 100644
index 000000000..8ec1cfe2e
--- /dev/null
+++ b/MCServer/Plugins/APIDump/Hooks/OnKilling.lua
@@ -0,0 +1,33 @@
+return
+{
+ HOOK_KILLING =
+ {
+ CalledWhen = "A player or a mob is dying.",
+ DefaultFnName = "OnKilling", -- also used as pagename
+ Desc = [[
+ This hook is called whenever a {{cPawn|pawn}}'s (a player's or a mob's) health reaches zero. This
+ means that the pawn is about to be killed, unless a plugin "revives" them by setting their health
+ back to a positive value.</p>
+ <p>
+ FIXME: There is no HOOK_KILLED notification hook yet; this is deliberate because HOOK_KILLED has
+ been recently renamed to HOOK_KILLING, and plugins need to be updated. Once updated, the HOOK_KILLED
+ notification will be implemented.
+ ]],
+ Params =
+ {
+ { Name = "Victim", Type = "{{cPawn}}", Notes = "The player or mob that is about to be killed" },
+ { Name = "Killer", Type = "{{cEntity}}", Notes = "The entity that has caused the victim to lose the last point of health. May be nil for environment damage" },
+ },
+ Returns = [[
+ If the function returns false or no value, MCServer calls other plugins with this event. If the
+ function returns true, no other plugin is called for this event.</p>
+ <p>
+ In either case, the victim's health is then re-checked and if it is greater than zero, the victim is
+ "revived" with that health amount. If the health is less or equal to zero, the victim is killed.
+ ]],
+ }, -- HOOK_KILLING
+}
+
+
+
+