From 192986747c068d80d7c92e227d045d7b601be711 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Mon, 12 Jun 2023 08:17:04 +1000 Subject: [PATCH] SPIGOT-7383: Add EntityDamageEvent.DamageCause#KILL and EntityDamageEvent.DamageCause#WORLD_BORDER By: Doc --- .../bukkit/event/entity/EntityDamageEvent.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/paper-api/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java index 6241f31e73..4773f537de 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java @@ -8,6 +8,7 @@ import java.util.EnumMap; import java.util.Map; import java.util.Objects; import org.bukkit.Material; +import org.bukkit.WorldBorder; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; import org.bukkit.event.Cancellable; @@ -260,6 +261,18 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable { */ public enum DamageCause { + /** + * Damage caused by /kill command + *

+ * Damage: {@link Float#MAX_VALUE} + */ + KILL, + /** + * Damage caused by the World Border + *

+ * Damage: {@link WorldBorder#getDamageAmount()} + */ + WORLD_BORDER, /** * Damage caused when an entity contacts a block such as a Cactus, * Dripstone (Stalagmite) or Berry Bush. @@ -356,7 +369,7 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable { * Damage caused by committing suicide. *

* Note: This is currently only used by plugins, default commands - * like /minecraft:kill use {@link #VOID} to damage players. + * like /minecraft:kill use {@link #KILL} to damage players. *

* Damage: variable */