Add supplier overload for Entity.damage(...)
import java.util.Optional;
import java.util.UUID;
import java.util.function.Predicate;
+import java.util.function.Supplier;
/**
* An entity is a Minecraft entity.
@@ -313,6 +314,17 @@ default boolean transferToWorld(World world) {
*/
void remove();
+ /**
+ * Damages this {@link Entity} with the given {@link DamageSource}.
+ *
+ * @param damage The damage to deal
+ * @param damageSource The cause of the damage
+ * @return True if damaging the entity was successful
+ */
+ default boolean damage(double damage, Supplier<? extends DamageSource> damageSource) {
+ return this.damage(damage, damageSource.get());
+ }
+
/**
* Damages this {@link Entity} with the given {@link DamageSource}.
*
