mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-22 23:15:36 +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");
|
throw new UnsupportedOperationException("Cannot set the hurt direction on a non player");
|
||||||
}
|
}
|
||||||
// Paper end - hurt direction API
|
// 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…
Add table
Reference in a new issue