1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-03-25 00:07:36 +01:00

Call EntityPushedByEntityAttackEvent for Mace AoE ()

This commit is contained in:
Pedro 2025-03-12 07:13:47 -03:00 committed by GitHub
parent 102c8bbc54
commit f0388e2f38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,3 +15,12 @@
ServerLevel serverLevel = (ServerLevel)attacker.level();
attacker.setDeltaMovement(attacker.getDeltaMovement().with(Direction.Axis.Y, 0.01F));
if (attacker instanceof ServerPlayer serverPlayer) {
@@ -139,7 +_,7 @@
double knockbackPower = getKnockbackPower(attacker, livingEntity, vec3);
Vec3 vec31 = vec3.normalize().scale(knockbackPower);
if (knockbackPower > 0.0) {
- livingEntity.push(vec31.x, 0.7F, vec31.z);
+ livingEntity.push(vec31.x, 0.7F, vec31.z, attacker); // Paper - Add EntityKnockbackByEntityEvent and EntityPushedByEntityAttackEvent
if (livingEntity instanceof ServerPlayer serverPlayer) {
serverPlayer.connection.send(new ClientboundSetEntityMotionPacket(serverPlayer));
}