summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-06-13 12:50:54 +0200
committerarchshift <admin@archshift.com>2014-06-17 20:39:22 +0200
commita37d5410b4486dd95692076e3da0368a4ed23577 (patch)
tree1c788b84e0d51c89e24bf53c026b42992cbc4937 /MCServer/Plugins
parentAdded the OnEntityAddEffect hook. (diff)
downloadcuberite-a37d5410b4486dd95692076e3da0368a4ed23577.tar
cuberite-a37d5410b4486dd95692076e3da0368a4ed23577.tar.gz
cuberite-a37d5410b4486dd95692076e3da0368a4ed23577.tar.bz2
cuberite-a37d5410b4486dd95692076e3da0368a4ed23577.tar.lz
cuberite-a37d5410b4486dd95692076e3da0368a4ed23577.tar.xz
cuberite-a37d5410b4486dd95692076e3da0368a4ed23577.tar.zst
cuberite-a37d5410b4486dd95692076e3da0368a4ed23577.zip
Diffstat (limited to '')
-rw-r--r--MCServer/Plugins/APIDump/Hooks/OnEntityAddEffect.lua34
1 files changed, 34 insertions, 0 deletions
diff --git a/MCServer/Plugins/APIDump/Hooks/OnEntityAddEffect.lua b/MCServer/Plugins/APIDump/Hooks/OnEntityAddEffect.lua
new file mode 100644
index 000000000..423a2200b
--- /dev/null
+++ b/MCServer/Plugins/APIDump/Hooks/OnEntityAddEffect.lua
@@ -0,0 +1,34 @@
+return
+{
+ HOOK_ENTITY_ADD_EFFECT =
+ {
+ CalledWhen = "An entity effect is about to get added to an entity.",
+ DefaultFnName = "OnEntityAddEffect", -- also used as pagename
+ Desc = [[
+ This hook is called whenever an entity effect is about to be added to an entity. The plugin may
+ disallow the addition by returning true.</p>
+ <p>Note that this hook only fires for adding the effect, but not for the actual effect application. See
+ also the {{OnEntityRemoveEffect|HOOK_ENTITY_REMOVE_EFFECT}} for notification about effects expiring /
+ removing, and {{OnEntityApplyEffect|HOOK_ENTITY_APPLY_EFFECT}} for the actual effect application to the
+ entity.
+ ]],
+ Params =
+ {
+ { Name = "Entity", Type = "{{cEntity}}", Notes = "The entity to which the effect is about to be added" },
+ { Name = "EffectType", Type = "number", Notes = "The type of the effect to be added. One of the effXXX constants." },
+ { Name = "EffectDuration", Type = "number", Notes = "The duration of the effect to be added, in ticks." },
+ { Name = "EffectIntensity", Type = "number", Notes = "The intensity (level) of the effect to be added. " },
+ { Name = "Originator", Type = "{{cEntity}}", Notes = "The entity who originated the effect (threw the potion, the cavespider that used poison bite, etc.) May be nil if there's no originator associated with the effect. " },
+ { Name = "DistanceModifier", Type = "number", Notes = "The modifier for the effect intensity, based on distance. Used mainly for splash potions." },
+ },
+ Returns = [[
+ If the plugin returns true, the effect will not be added and none of the remaining hook handlers will
+ be called. If the plugin returns false, MCServer calls all the remaining hook handlers and finally
+ the effect is added to the entity.
+ ]],
+ }, -- HOOK_EXECUTE_COMMAND
+}
+
+
+
+