Add entity knockback API

This commit is contained in:
MelnCat 2022-10-16 12:10:17 -07:00
parent 7224eecfb1
commit 95a2e4ed32

View file

@ -1146,4 +1146,12 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
throw new UnsupportedOperationException("Cannot set the hurt direction on a non player");
}
// Paper end - hurt direction API
// Paper start - knockback API
@Override
public void knockback(final double strength, final double directionX, final double directionZ) {
Preconditions.checkArgument(strength > 0, "Knockback strength must be > 0");
this.getHandle().knockback(strength, directionX, directionZ);
};
// Paper end - knockback API
}