mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-15 04:05:50 -07:00
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:
@@ -1,6 +1,9 @@
|
||||
package org.bukkit.entity;
|
||||
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.damage.DamageSource;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
@@ -15,14 +18,24 @@ public interface Damageable extends Entity {
|
||||
void damage(double amount);
|
||||
|
||||
/**
|
||||
* Deals the given amount of damage to this entity, from a specified
|
||||
* entity.
|
||||
* Deals the given amount of damage to this entity from a specified
|
||||
* {@link Entity}.
|
||||
*
|
||||
* @param amount Amount of damage to deal
|
||||
* @param source Entity which to attribute this damage from
|
||||
* @param amount amount of damage to deal
|
||||
* @param source entity to which the damage should be attributed
|
||||
*/
|
||||
void damage(double amount, @Nullable Entity source);
|
||||
|
||||
/**
|
||||
* Deals the given amount of damage to this entity from a specified
|
||||
* {@link DamageSource}.
|
||||
*
|
||||
* @param amount amount of damage to deal
|
||||
* @param damageSource source to which the damage should be attributed
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
void damage(double amount, @NotNull DamageSource damageSource);
|
||||
|
||||
/**
|
||||
* Gets the entity's health from 0 to {@link #getMaxHealth()}, where 0 is dead.
|
||||
*
|
||||
|
Reference in New Issue
Block a user