mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-31 22:22:49 +00:00
SPIGOT-7383: Add EntityDamageEvent.DamageCause#KILL and EntityDamageEvent.DamageCause#WORLD_BORDER
This commit is contained in:
parent
1687ea8f71
commit
950f83e3f7
1 changed files with 14 additions and 1 deletions
|
@ -8,6 +8,7 @@ import java.util.EnumMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.WorldBorder;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.Cancellable;
|
import org.bukkit.event.Cancellable;
|
||||||
|
@ -260,6 +261,18 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable {
|
||||||
*/
|
*/
|
||||||
public enum DamageCause {
|
public enum DamageCause {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Damage caused by /kill command
|
||||||
|
* <p>
|
||||||
|
* Damage: {@link Float#MAX_VALUE}
|
||||||
|
*/
|
||||||
|
KILL,
|
||||||
|
/**
|
||||||
|
* Damage caused by the World Border
|
||||||
|
* <p>
|
||||||
|
* Damage: {@link WorldBorder#getDamageAmount()}
|
||||||
|
*/
|
||||||
|
WORLD_BORDER,
|
||||||
/**
|
/**
|
||||||
* Damage caused when an entity contacts a block such as a Cactus,
|
* Damage caused when an entity contacts a block such as a Cactus,
|
||||||
* Dripstone (Stalagmite) or Berry Bush.
|
* Dripstone (Stalagmite) or Berry Bush.
|
||||||
|
@ -356,7 +369,7 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable {
|
||||||
* Damage caused by committing suicide.
|
* Damage caused by committing suicide.
|
||||||
* <p>
|
* <p>
|
||||||
* <b>Note:</b> This is currently only used by plugins, default commands
|
* <b>Note:</b> 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.
|
||||||
* <p>
|
* <p>
|
||||||
* Damage: variable
|
* Damage: variable
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue