Skip to main content

Triggers and events

On Damage​

event.damage

The mob took damage from something other than an entity

OutTypeWhat it is
EventEntityDamageEventStores data for damage events
CancelledBooleanGets the cancellation state of this event.
CauseDamage CauseGets the cause of the damage.
DamageNumberGets the raw amount of damage caused by the event
EntityEntityReturns the Entity involved in this event
Entity TypeEntity TypeGets the EntityType of the Entity involved in this event.
Final DamageNumberGets the amount of damage caused by the event after all damage reduction is applied.

Goes on with: Next

On Damage By Entity​

event.damage_by_entity

The mob took damage from an entity that is not a player, or from what such an entity shot or set off

OutTypeWhat it is
EventEntityDamageByEntityEventCalled when an entity is damaged by an entity
CancelledBooleanGets the cancellation state of this event.
CauseDamage CauseGets the cause of the damage.
CriticalBooleanShows this damage instance was critical.
DamageNumberGets the raw amount of damage caused by the event
DamagerEntityReturns the entity that damaged the defender.
EntityEntityReturns the Entity involved in this event
Entity TypeEntity TypeGets the EntityType of the Entity involved in this event.
Final DamageNumberGets the amount of damage caused by the event after all damage reduction is applied.
AttackerEntityThe entity behind it: a player who shot an arrow counts, not the arrow; missing when none

Goes on with: Next

On Damage By Player​

event.damage_by_player

The mob took damage from a player, or from what a player shot or set off

OutTypeWhat it is
EventEntityDamageByEntityEventCalled when an entity is damaged by an entity
CancelledBooleanGets the cancellation state of this event.
CauseDamage CauseGets the cause of the damage.
CriticalBooleanShows this damage instance was critical.
DamageNumberGets the raw amount of damage caused by the event
DamagerEntityReturns the entity that damaged the defender.
EntityEntityReturns the Entity involved in this event
Entity TypeEntity TypeGets the EntityType of the Entity involved in this event.
Final DamageNumberGets the amount of damage caused by the event after all damage reduction is applied.
AttackerEntityThe entity behind it: a player who shot an arrow counts, not the arrow; missing when none

Goes on with: Next

On Death​

event.death

The mob died

OutTypeWhat it is
EventEntityDeathEventThrown whenever a LivingEntity dies
CancelledBooleanGets the cancellation state of this event.
Death SoundSoundGet the sound that the entity makes when dying
Death Sound CategorySoundCategoryGet the sound category that the death sound should play in
Death Sound PitchFloatGet the pitch that the death sound will play with.
Death Sound VolumeFloatGet the volume that the death sound will play at.
Dropped ExpIntegerGets how much EXP should be dropped from this death.
DropsList<Item>Gets all the items which will drop when the entity dies
EntityLiving EntityReturns the Entity involved in this event
Entity TypeEntity TypeGets the EntityType of the Entity involved in this event.
Revive HealthNumberGet the amount of health that the entity should revive with after cancelling the event.
AttackerEntityThe entity behind it: a player who shot an arrow counts, not the arrow; missing when none

Goes on with: Next

On Explode​

event.explode

The mob explodes

OutTypeWhat it is
EventEntityExplodeEventCalled when an entity explodes interacting with blocks.
CancelledBooleanGets the cancellation state of this event.
EntityEntityReturns the Entity involved in this event
Entity TypeEntity TypeGets the EntityType of the Entity involved in this event.
Explosion ResultExplosionResultReturns the result of the explosion if it is not cancelled.
LocationLocationReturns the location where the explosion happened.
YieldFloatReturns the percentage of blocks to drop from this explosion

Goes on with: Next

On Explosion Prime​

event.explosion_prime

The mob is about to explode

OutTypeWhat it is
EventExplosionPrimeEventCalled when an entity has made a decision to explode.
CancelledBooleanGets the cancellation state of this event.
EntityEntityReturns the Entity involved in this event
Entity TypeEntity TypeGets the EntityType of the Entity involved in this event.
FireBooleanGets whether this explosion will create fire or not
RadiusFloatGets the radius of the explosion

Goes on with: Next

On Extension Damage​

event.extension_damage

The entity riding or carrying the mob took damage; cancelling it also keeps the damage from being passed on to the mob

OutTypeWhat it is
EventEntityDamageEventStores data for damage events
CancelledBooleanGets the cancellation state of this event.
CauseDamage CauseGets the cause of the damage.
DamageNumberGets the raw amount of damage caused by the event
EntityEntityReturns the Entity involved in this event
Entity TypeEntity TypeGets the EntityType of the Entity involved in this event.
Final DamageNumberGets the amount of damage caused by the event after all damage reduction is applied.
AttackerEntityThe entity behind it: a player who shot an arrow counts, not the arrow; missing when none

Goes on with: Next

On Extension Death​

event.extension_death

The entity riding or carrying the mob died

OutTypeWhat it is
EventEntityDeathEventThrown whenever a LivingEntity dies
CancelledBooleanGets the cancellation state of this event.
Death SoundSoundGet the sound that the entity makes when dying
Death Sound CategorySoundCategoryGet the sound category that the death sound should play in
Death Sound PitchFloatGet the pitch that the death sound will play with.
Death Sound VolumeFloatGet the volume that the death sound will play at.
Dropped ExpIntegerGets how much EXP should be dropped from this death.
DropsList<Item>Gets all the items which will drop when the entity dies
EntityLiving EntityReturns the Entity involved in this event
Entity TypeEntity TypeGets the EntityType of the Entity involved in this event.
Revive HealthNumberGet the amount of health that the entity should revive with after cancelling the event.

Goes on with: Next

On Hit​

event.hit

The mob damaged another entity, directly or with what it shot or set off

OutTypeWhat it is
EventEntityDamageByEntityEventCalled when an entity is damaged by an entity
CancelledBooleanGets the cancellation state of this event.
CauseDamage CauseGets the cause of the damage.
CriticalBooleanShows this damage instance was critical.
DamageNumberGets the raw amount of damage caused by the event
DamagerEntityReturns the entity that damaged the defender.
EntityEntityReturns the Entity involved in this event
Entity TypeEntity TypeGets the EntityType of the Entity involved in this event.
Final DamageNumberGets the amount of damage caused by the event after all damage reduction is applied.
AttackerEntityThe entity behind it: a player who shot an arrow counts, not the arrow; missing when none

Goes on with: Next

On Kill​

event.kill

The mob killed an entity or player; Victim narrows it to players or other entities

OutTypeWhat it is
EventEntityDeathEventThrown whenever a LivingEntity dies
CancelledBooleanGets the cancellation state of this event.
Death SoundSoundGet the sound that the entity makes when dying
Death Sound CategorySoundCategoryGet the sound category that the death sound should play in
Death Sound PitchFloatGet the pitch that the death sound will play with.
Death Sound VolumeFloatGet the volume that the death sound will play at.
Dropped ExpIntegerGets how much EXP should be dropped from this death.
DropsList<Item>Gets all the items which will drop when the entity dies
EntityLiving EntityReturns the Entity involved in this event
Entity TypeEntity TypeGets the EntityType of the Entity involved in this event.
Revive HealthNumberGet the amount of health that the entity should revive with after cancelling the event.

Goes on with: Next

On Projectile Hit​

event.projectile_hit

A projectile launched by the mob hit something

OutTypeWhat it is
EventProjectileHitEventCalled when a projectile hits an object
CancelledBooleanGets the cancellation state of this event.
EntityProjectileReturns the Entity involved in this event
Entity TypeEntity TypeGets the EntityType of the Entity involved in this event.
Hit BlockBlockGets the block that was hit, if it was a block that was hit.
Hit Block FaceBlockFaceGets the block face that was hit, if it was a block that was hit and the face was provided in the event.
Hit EntityEntityGets the entity that was hit, if it was an entity that was hit.

Goes on with: Next

On Projectile Shoot​

event.projectile_shoot

The mob launched a projectile

OutTypeWhat it is
EventProjectileLaunchEventCalled when a projectile is launched.
CancelledBooleanGets the cancellation state of this event.
EntityProjectileReturns the Entity involved in this event
Entity TypeEntity TypeGets the EntityType of the Entity involved in this event.
LocationLocationGets the location at which the entity is spawning.

Goes on with: Next

On Target Change​

event.target_change

The mob gets or loses a target

OutTypeWhat it is
EventEntityTargetLivingEntityEventCalled when an Entity targets a LivingEntity and can only target LivingEntity's.
CancelledBooleanGets the cancellation state of this event.
EntityEntityReturns the Entity involved in this event
Entity TypeEntity TypeGets the EntityType of the Entity involved in this event.
ReasonTargetReasonReturns the reason for the targeting
TargetLiving EntityGet the entity that this is targeting.

Goes on with: Next

On Teleport​

event.teleport

The mob teleports

OutTypeWhat it is
EventEntityTeleportEventThrown when a non-player entity is teleported from one location to another.
CancelledBooleanGets the cancellation state of this event.
EntityEntityReturns the Entity involved in this event
Entity TypeEntity TypeGets the EntityType of the Entity involved in this event.
FromLocationGets the location that this entity moved from
ToLocationGets the location that this entity moved to

Goes on with: Next

Mutate EntityDamage​

event_data.entity_damage.mutate

Changes the properties of a EntityDamage that are given, the others stay as they are, and gives every property's value after the change

InTypeWhat it is
EntityDamageEntityDamageEventStores data for damage events
Damage (optional)NumberSets the raw amount of damage caused by the event.

Goes on with: Next

Mutate EntityDeath​

event_data.entity_death.mutate

Changes the properties of a EntityDeath that are given, the others stay as they are, and gives every property's value after the change

InTypeWhat it is
EntityDeathEntityDeathEventThrown whenever a LivingEntity dies
Death Sound (optional)SoundSet the sound that the entity makes when dying
Death Sound Category (optional)SoundCategorySet the sound category that the death sound should play in.
Death Sound Pitch (optional)FloatSet the pitch that the death sound should play with.
Death Sound Volume (optional)FloatSet the volume the death sound should play at.
Dropped Exp (optional)IntegerSets how much EXP should be dropped from this death.
Revive Health (optional)NumberSet the amount of health that the entity should revive with after cancelling the event.
Should Play Death Sound (optional)BooleanSet whether the death sound should play when the entity dies.

Goes on with: Next

Mutate EntityExplode​

event_data.entity_explode.mutate

Changes the properties of a EntityExplode that are given, the others stay as they are, and gives every property's value after the change

InTypeWhat it is
EntityExplodeEntityExplodeEventCalled when an entity explodes interacting with blocks.
Yield (optional)FloatSets the percentage of blocks to drop from this explosion

Goes on with: Next

Mutate EntityTarget​

event_data.entity_target.mutate

Changes the properties of a EntityTarget that are given, the others stay as they are, and gives every property's value after the change

InTypeWhat it is
EntityTargetEntityTargetEventCalled when a creature targets or untargets another entity
Target (optional)EntitySet the entity that you want the mob to target instead.

Goes on with: Next

Mutate EntityTeleport​

event_data.entity_teleport.mutate

Changes the properties of a EntityTeleport that are given, the others stay as they are, and gives every property's value after the change

InTypeWhat it is
EntityTeleportEntityTeleportEventThrown when a non-player entity is teleported from one location to another.
From (optional)LocationSets the location that this entity moved from
To (optional)LocationSets the location that this entity moved to

Goes on with: Next

Mutate Event​

cancellable.mutate

Changes the properties of a Event that are given, the others stay as they are, and gives every property's value after the change

InTypeWhat it is
EventCancellableA type characterizing events that may be cancelled by a plugin or the server.
Cancelled (optional)BooleanSets the cancellation state of this event.
OutTypeWhat it is
CancelledBooleanGets the cancellation state of this event.

Goes on with: Next

Mutate ExplosionPrime​

event_data.explosion_prime.mutate

Changes the properties of a ExplosionPrime that are given, the others stay as they are, and gives every property's value after the change

InTypeWhat it is
ExplosionPrimeExplosionPrimeEventCalled when an entity has made a decision to explode.
Fire (optional)BooleanSets whether this explosion will create fire or not
Radius (optional)FloatSets the radius of the explosion

Goes on with: Next

Read Event​

cancellable.read

Reads the properties of a Event

InTypeWhat it is
EventCancellableA type characterizing events that may be cancelled by a plugin or the server.
OutTypeWhat it is
CancelledBooleanGets the cancellation state of this event.