SPIGOT-6779: Fix LivingEntity#attack for Player entities
This commit is contained in:
parent
747a73ec92
commit
376edf4fe5
@ -651,7 +651,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
|||||||
Preconditions.checkArgument(target != null, "target == null");
|
Preconditions.checkArgument(target != null, "target == null");
|
||||||
Preconditions.checkState(!getHandle().generation, "Cannot attack during world generation");
|
Preconditions.checkState(!getHandle().generation, "Cannot attack during world generation");
|
||||||
|
|
||||||
getHandle().attackEntity(((CraftEntity) target).getHandle());
|
if (getHandle() instanceof EntityHuman) {
|
||||||
|
((EntityHuman) getHandle()).attack(((CraftEntity) target).getHandle());
|
||||||
|
} else {
|
||||||
|
getHandle().attackEntity(((CraftEntity) target).getHandle());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user