- Выберите загрузчик игры
- Fabric
Счетчик урона для тх выводит в чат сколько дамага было нанесено по entity
Java:
package thunder.hack.features.modules.misc;
import thunder.hack.features.modules.Module;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.text.Text;
public class HurtScore extends Module {
private Entity targetEntity;
private float lastHP;
public HurtScore() {
super("HurtScore", Category.MISC);
}
@Override
public void onUpdate() {
if (mc.player == null || mc.world == null) return;
Entity target = mc.targetedEntity;
if (target instanceof LivingEntity Liv) {
if (targetEntity != target) {
targetEntity = target;
lastHP = Liv.getHealth();
}
float YretraHealth = Liv.getHealth();
if (YretraHealth < lastHP) {
float damage = lastHP - YretraHealth;
if (damage > 0) {
String message = "§6Нанесено урона: §c" + String.format("%.1f", damage) + " §6по " + Liv.getDisplayName().getString();
mc.player.sendMessage(Text.literal(message), false);
}
lastHP = YretraHealth;
}
}
}
}
Последнее редактирование:
