SPIGOT-7300, #829: Add new DamageSource API providing enhanced information about entity damage

By: Doc <nachito94@msn.com>
Also-by: 2008Choco <hawkeboyz2@hotmail.com>
This commit is contained in:
Bukkit/Spigot
2024-02-11 09:54:21 +11:00
parent e46e33f5e2
commit f9381f1dc4
13 changed files with 467 additions and 27 deletions

View File

@@ -0,0 +1,26 @@
package org.bukkit.damage;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.ApiStatus;
/**
* A means of damage scaling with respect to the server's difficulty.
*/
@ApiStatus.Experimental
public enum DamageScaling {
/**
* Damage is not scaled.
*/
NEVER,
/**
* Damage is scaled only when the
* {@link DamageSource#getCausingEntity() causing entity} is not a
* {@link Player}.
*/
WHEN_CAUSED_BY_LIVING_NON_PLAYER,
/**
* Damage is always scaled.
*/
ALWAYS;
}