diff options
author | Mattes D <github@xoft.cz> | 2015-08-26 10:58:51 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2015-09-05 22:01:21 +0200 |
commit | dac97826f7d0c9b9135c1a08c4d5f16b61494bd1 (patch) | |
tree | ec17a9703fe734956e4f151cb5306befc4fd7571 /Server/Plugins/APIDump/Hooks/OnEntityAddEffect.lua | |
parent | Merge pull request #2459 from cuberite/fixes (diff) | |
download | cuberite-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/OnEntityAddEffect.lua')
-rw-r--r-- | Server/Plugins/APIDump/Hooks/OnEntityAddEffect.lua | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Server/Plugins/APIDump/Hooks/OnEntityAddEffect.lua b/Server/Plugins/APIDump/Hooks/OnEntityAddEffect.lua new file mode 100644 index 000000000..155abc41b --- /dev/null +++ b/Server/Plugins/APIDump/Hooks/OnEntityAddEffect.lua @@ -0,0 +1,33 @@ +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 = "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, Cuberite calls all the remaining hook handlers and finally + the effect is added to the entity. + ]], + }, -- HOOK_EXECUTE_COMMAND +} + + + + |