- Listener function prototype
function(mob,source,cause) - Parameters:
- mob :
Entity
Dead entity object. - source :
Entity
The entity object that dealt the last damage (may beNull). - cause :
Integer
Cause of injury
- mob :
- Intercept event: cannot be intercepted.
Note that when the player dies, in addition to triggering onPlayerDie event, this event will also be triggered once.
-
Listener function prototype
function(mob,source,damage,cause) -
Parameters:
- mob :
Entity
The damaged entity. - source :
Entity
The entity that dealt the damage (may beNull). - damage :
Integer
The amount of damage dealt. - cause :
ActorDamageCause
Cause of injury
- mob :
-
Intercept events: function returns
false
Here are values of ActorDamageCause:
ActorDamageCause ENUM |
Value |
|---|---|
ActorDamageCause.None |
-1 |
ActorDamageCause.Override |
0 |
ActorDamageCause.Contact |
1 |
ActorDamageCause.EntityAttack |
2 |
ActorDamageCause.Projectile |
3 |
ActorDamageCause.Suffocation |
4 |
ActorDamageCause.Fall |
5 |
ActorDamageCause.Fire |
6 |
ActorDamageCause.FireTick |
7 |
ActorDamageCause.Lava |
8 |
ActorDamageCause.Drowning |
9 |
ActorDamageCause.BlockExplosion |
10 |
ActorDamageCause.EntityExplosion |
11 |
ActorDamageCause.Void |
12 |
ActorDamageCause.SelfDestruct |
13 |
ActorDamageCause.Magic |
14 |
ActorDamageCause.Wither |
15 |
ActorDamageCause.Starve |
16 |
ActorDamageCause.Anvil |
17 |
ActorDamageCause.Thorns |
18 |
ActorDamageCause.FallingBlock |
19 |
ActorDamageCause.Piston |
20 |
ActorDamageCause.FlyIntoWall |
21 |
ActorDamageCause.Magma |
22 |
ActorDamageCause.Fireworks |
23 |
ActorDamageCause.Lightning |
24 |
ActorDamageCause.Charging |
25 |
ActorDamageCause.Temperature |
26 |
ActorDamageCause.Freezing |
27 |
ActorDamageCause.Stalactite |
28 |
ActorDamageCause.Stalagmite |
29 |
ActorDamageCause.RamAttack |
30 |
ActorDamageCause.SonicBoom |
31 |
ActorDamageCause.Campfire |
32 |
ActorDamageCause.SoulCampfire |
33 |
ActorDamageCause.MaceSmash |
34 |
ActorDamageCause.All |
35 |
-
Listener function prototype
function(source,pos,radius,maxResistance,isDestroy,isFire) -
Parameters:
- source :
Entity
The entity object that caused the explosion. - pos :
FloatPos
The coordinates of the explosion. - radius :
Float
Blast radius. - maxResistance :
Float
The maximum resistance of blocks that will break. - isDestroy :
Boolean
Does the explosion destroy blocks. - isFire :
Boolean
Does the explosion produce flames.
- source :
-
Intercept events: function returns
false
-
Listener function prototype
function(typeName,pos) -
Parameters:
- typeName :
string
Entity Name - pos :
FloatPos
The coordinates of the spawn.
- typeName :
-
Intercept events: function returns
false
-
Listener function prototype
function(entity,pos) -
Parameters:
- entity:
Entity
The entity that spawned. - pos :
FloatPos
The coordinates of the spawn.
- entity:
-
Intercept events: cannot be intercepted.
You can use entity.despawn() or entity.remove() to intercept this event.
-
Listener function prototype
function(pos,axis) -
Parameters:
- pos :
IntPosThe portal block coordinates where the spawn attempt happened. - axis :
IntegerPortal axis enum value (0= Unknown,1= X,2= Z).
- pos :
-
Intercept events: function returns
false
- Listener function prototype
function(entity,source) - Parameters:
- entity:
Entity
The entity that was hit with a projectile. - source :
Entity
The projecticle entity (like arrows).
- entity:
- Intercept event: cannot be intercepted.
-
Listener function prototype
function(witherBoss,AAbb,aaBB) -
Parameters:
- witherBoss:
Entity
The Wither entity object. - AAbb:
IntPosThe area that the wither will destroy (box), the A coordinate of the diagonal point. - aaBB:
IntPosThe area that the wither will destroy (box), the B coordinate of the diagonal point.
- witherBoss:
-
Intercept events: function returns
false
Note that this event does not include wither explosion damage.
- Listener function prototype
function(entity1,entity2) - Parameters:
- entity1 :
Entity
The entity that is riding the other entity. - entity2 :
Entity
The entity that is being ridden.
- entity1 :
- Intercept events: function returns
false
Note: Riding includes minecart, boat, horse, pig, etc.
- Listener function prototype
function(entity,pressurePlate) - Parameters:
- entity :
Entity
The entity that stepped on the plate. - pressurePlate :
Block
The pressed pressure plate block.
- entity :
- Intercept events: function returns
false
Note: When a creature steps on a pressure plate, this event will be triggered repeatedly.
-
Listener function prototype
function(shooter,type) -
Parameters:
- shooter :
Entity
The entity that fired the projectile. - type :
String
Projectile Standard Type Name.
- shooter :
-
Intercept events: function returns
false
Note: Projectiles known to be intercepted are eggs, ender pearls, snowballs, tridents, arrows, and fishing rods (fish hooks).
-
Listener function prototype
function(shooter,entity) -
Parameters:
- shooter :
Entity
The entity that created the projectile. - entity :
Entity
The projectile entity object being created.
- shooter :
-
Intercept event: cannot be intercepted.
!!! warning This event is only available in 0.9.6 and later versions.
- Listener function prototype
function(npc,pl,cmd) - Parameters:
- npc :
Entity
The NPC entity that executed the command. - pl :
Player
The player that triggered the execution of the NPC command. - cmd :
String
The command being executed by NPCs. If there are multiple commands, they are separated by;.
- npc :
- Intercept events: function returns
false
-
Listener function prototype
function(as,pl,slot) -
Parameters:
- as:
Entity
Manipulated Armor Stand entity object. - pl :
Player
The player that manipulated the armor stand. - slot :
NumberEquipment slot number.
- as:
-
Intercept events: function returns
false
-
Listener function prototype
function(uniqueId,entity) -
Parameters:
- uniqueId:
StringUnique identifer of the pre-transformed entity. - entity :
EntityThe transformed entity.
- uniqueId:
-
Intercept event: cannot be intercepted.
Note: This event is triggered when the TransformationComponent of the entity in Addons is activated, and is mostly
used for the interaction between the engine and the Addon. Only UniqueId is provided since the entity pointer before
the transition is destroyed quickly.
!!! warning This event is only available in 0.11.3 and later versions.
- Listener function prototype
function(entity, block, pos) - Parameters
- entity :
Entity
Enderman entity. - block :
Block
Pick up the Block - pos :
BlockPos
The coordinates of the block.
- entity :
- Intercept events: function returns
false