From 63db0445960f43cbab7e90ade6fe1d294a21a641 Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 26 Dec 2018 08:00:00 +1100 Subject: [PATCH] Add API to get / set base arrow damage --- .../org/bukkit/craftbukkit/entity/CraftArrow.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java index 516269eaa9..8aa1eebbfb 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java @@ -26,6 +26,17 @@ public class CraftArrow extends AbstractProjectile implements Arrow { return getHandle().knockbackStrength; } + @Override + public double getDamage() { + return getHandle().getDamage(); + } + + @Override + public void setDamage(double damage) { + Preconditions.checkArgument(damage >= 0, "Damage must be positive"); + getHandle().setDamage(damage); + } + public boolean isCritical() { return getHandle().isCritical(); }