EntityDeathEvent
Namespace Mc.Scripting.Events · Kind struct (ref)
public ref struct EntityDeathEvent : IEventA living entity died.
| Id | 32 |
| Key | mc:entity_death |
| Cancellable | no |
| Fired by the engine | yes |
| Field | Type | Handlers may write | Description |
|---|---|---|---|
Entity |
Entity |
no (readonly) | The entity. |
Killer |
Entity |
no (readonly) | The responsible entity (none if there is none). |
DamageType |
key.damage_type |
no (readonly) | The damage type key, e.g. minecraft:player_attack. |
Cause |
enum:DamageCause |
no (readonly) | The cause derived from the damage type. |
Constructors
Section titled “Constructors”| Member | Description |
|---|---|
EntityDeathEvent(Entity entity, Entity killer, int damageType, DamageCause cause) |
Creates the event (for firing it from a plugin; native code builds its own). |
Constructor
Section titled “Constructor”public EntityDeathEvent(Entity entity, Entity killer, int damageType, DamageCause cause)Creates the event (for firing it from a plugin; native code builds its own). Signature of API 1.0.
Parameters
| Name | Type | Description |
|---|---|---|
entity |
Entity |
|
killer |
Entity |
|
damageType |
int |
|
cause |
DamageCause |
Properties
Section titled “Properties”| Member | Description |
|---|---|
DamageCause Cause { get; } |
The cause derived from the damage type. |
string DamageType { get; } |
The damage type key, e.g. |
Entity Entity { get; } |
The entity. |
Entity Killer { get; } |
The responsible entity (none if there is none). |
static ushort CatalogueId { get; } |
Catalogue id (stable ABI). |
static bool IsCancellable { get; } |
Whether handlers can cancel the event. |
static string Key { get; } |
Registry key of the event. |
public DamageCause Cause { get; }The cause derived from the damage type.
DamageType
Section titled “DamageType”public string DamageType { get; }The damage type key, e.g. minecraft:player_attack. (a registry key such as “minecraft:damage”; resolved on first access).
Entity
Section titled “Entity”public Entity Entity { get; }The entity.
Killer
Section titled “Killer”public Entity Killer { get; }The responsible entity (none if there is none).
CatalogueId
Section titled “CatalogueId”public static ushort CatalogueId { get; }Catalogue id (stable ABI).
IsCancellable
Section titled “IsCancellable”public static bool IsCancellable { get; }Whether handlers can cancel the event.
public static string Key { get; }Registry key of the event.
See also
Section titled “See also”DamageCause · Entity · IEvent