diff options
author | madmaxoft <github@xoft.cz> | 2013-10-17 15:20:44 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-10-17 15:20:44 +0200 |
commit | 36f6ffaadf552913df5201ca2273dfea4a18ab55 (patch) | |
tree | d3a2acdb7a036a3d1c7efc9aa01ec56bc0fc4fd9 /MCServer/Plugins | |
parent | APIDump: Documented HOOK_UPDATING_SIGN. (diff) | |
download | cuberite-36f6ffaadf552913df5201ca2273dfea4a18ab55.tar cuberite-36f6ffaadf552913df5201ca2273dfea4a18ab55.tar.gz cuberite-36f6ffaadf552913df5201ca2273dfea4a18ab55.tar.bz2 cuberite-36f6ffaadf552913df5201ca2273dfea4a18ab55.tar.lz cuberite-36f6ffaadf552913df5201ca2273dfea4a18ab55.tar.xz cuberite-36f6ffaadf552913df5201ca2273dfea4a18ab55.tar.zst cuberite-36f6ffaadf552913df5201ca2273dfea4a18ab55.zip |
Diffstat (limited to '')
-rw-r--r-- | MCServer/Plugins/APIDump/APIDesc.lua | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua index cb28b5486..7698552e0 100644 --- a/MCServer/Plugins/APIDump/APIDesc.lua +++ b/MCServer/Plugins/APIDump/APIDesc.lua @@ -3051,6 +3051,30 @@ end; ]], }, -- HOOK_SPAWNING_MONSTER + HOOK_TAKE_DAMAGE = + { + CalledWhen = "An {{cEntity|entity}} is taking any kind of damage", + DefaultFnName = "OnTakeDamage", -- also used as pagename + Desc = [[ + This hook is called when any {{cEntity}} descendant, such as a {{cPlayer|player}} or a + {{cMonster|mob}}, takes any kind of damage. The plugins may modify the amount of damage or effects + with this hook by editting the {{TakeDamageInfo}} object passed.</p> + <p> + This hook is called after the final damage is calculated, including all the possible weapon + {{cEnchantments|enchantments}}, armor protection and potion effects. + ]], + Params = + { + { Name = "Receiver", Type = "{{cEntity}} descendant", Notes = "The entity taking damage" }, + { Name = "TDI", Type = "{{TakeDamageInfo}}", Notes = "The damage type, cause and effects. Plugins may modify this object to alter the final damage applied." }, + }, + Returns = [[ + If the function returns false or no value, other plugins' callbacks are called and then the server + applies the final values from the TDI object to Receiver. If the function returns true, no other + callbacks are called, and no damage nor effects are applied. + ]], + }, -- HOOK_TAKE_DAMAGE + HOOK_UPDATING_SIGN = { CalledWhen = "Before the sign text is updated. Plugin may modify the text / refuse.", |