Fix AFK attack damage ticks

This commit is contained in:
2024-07-28 22:50:03 -07:00
parent 4a01e0b078
commit 35c062f186

View File

@@ -25,7 +25,7 @@ public class EntityDamageListener implements Listener {
if (damageEvent.getDamager() instanceof Player attacker) {
attacker.sendMessage("%s%sLncvrtBox %s%s» %sYou can't attack AFK players!".formatted(GOLD, BOLD, GRAY, BOLD, RESET));
player.sendMessage("%s%sLncvrtBox %s%s» %s%s tried to attack you while you were AFK!".formatted(GOLD, BOLD, GRAY, BOLD, RESET, attacker.getName()));
if (attacker.getNoDamageTicks() == 0) {
if (attacker.getNoDamageTicks() <= 10) {
attacker.damage(0.0001);
attacker.setVelocity(attacker.getLocation().toVector().subtract(player.getLocation().toVector()).normalize().setY(0.5).multiply(0.5));
}