mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
Add entity knockback API
This commit is contained in:
parent
7224eecfb1
commit
95a2e4ed32
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue