Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:
- бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
- маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
- приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
- обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.
Спасибо!
фикс? бьет бьет потом дамаг урезает и бан фанац
Java:
package ru.work.modules.module.combat;
import com.google.common.eventbus.Subscribe;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.entity.player.PlayerAbilities;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.SwordItem;
import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket;
import net.minecraft.util.hit.EntityHitResult;
import net.minecraft.util.hit.HitResult;
import ru.work.events.event.EventTick;
import ru.work.modules.api.Category;
import ru.work.modules.api.Module;
import ru.work.modules.api.ModuleInfo;
import ru.work.utils.friend.FriendPackage;
@ModuleInfo(name = "TriggerBot", desc = "Автоматически атакует цели в прицеле", category = Category.COMBAT)
public class TriggerBot extends Module {
private double currentFallDistance = 0.078;
private long lastAttackTime = 0;
private int attackCounter = 0;
private boolean wasSprintingBeforeAttack = false;
private boolean criticalsOnly = true;
private boolean ignoreFriends = true;
private int attackDelay = 100;
private float cooldownThreshold = 0.9F;
private boolean swordOnly = true;
@Subscribe
public void onTick(EventTick event) {
ClientPlayerEntity localPlayer = mc.player;
if (localPlayer == null) {
return;
}
HitResult crosshairTarget = mc.crosshairTarget;
if (crosshairTarget != null && crosshairTarget.getType() == HitResult.Type.ENTITY) {
Entity targetEntity = ((EntityHitResult) crosshairTarget).getEntity();
if (canAttack(localPlayer) &&
canPerformAttack(localPlayer) &&
isValidTarget(targetEntity, ignoreFriends) &&
isHoldingSword(localPlayer)) {
attackCrosshairTarget(localPlayer);
lastAttackTime = System.currentTimeMillis();
}
}
}
private boolean isHoldingSword(ClientPlayerEntity localPlayer) {
if (!swordOnly) {
return true;
}
ItemStack mainHandItem = localPlayer.getMainHandStack();
ItemStack offHandItem = localPlayer.getOffHandStack();
boolean mainHandHasSword = !mainHandItem.isEmpty() && mainHandItem.getItem() instanceof SwordItem;
boolean offHandHasSword = !offHandItem.isEmpty() && offHandItem.getItem() instanceof SwordItem;
return mainHandHasSword || offHandHasSword;
}
private void attackCrosshairTarget(ClientPlayerEntity localPlayer) {
boolean shouldUseCriticals = shouldUseCriticals(localPlayer);
boolean isSprinting = localPlayer.isSprinting();
if (shouldUseCriticals && isSprinting) {
wasSprintingBeforeAttack = true;
localPlayer.setSprinting(false);
localPlayer.networkHandler.sendPacket(new ClientCommandC2SPacket(localPlayer, ClientCommandC2SPacket.Mode.STOP_SPRINTING));
}
MinecraftClient.getInstance().doAttack();
attackCounter++;
if (shouldUseCriticals && wasSprintingBeforeAttack) {
localPlayer.networkHandler.sendPacket(new ClientCommandC2SPacket(localPlayer,
ClientCommandC2SPacket.Mode.START_SPRINTING));
localPlayer.setSprinting(true);
wasSprintingBeforeAttack = false;
}
}
private boolean canAttack(ClientPlayerEntity localPlayer) {
float cooldownProgress = localPlayer.getAttackCooldownProgress(0.5F);
long timeSinceLastAttack = System.currentTimeMillis() - lastAttackTime;
return cooldownProgress >= cooldownThreshold && timeSinceLastAttack >= attackDelay;
}
private boolean canPerformAttack(ClientPlayerEntity localPlayer) {
if (isInSpecialCondition(localPlayer)) {
return true;
}
if (criticalsOnly) {
return canPerformCriticalHit(localPlayer);
}
return true;
}
private boolean isInSpecialCondition(ClientPlayerEntity localPlayer) {
boolean isBlind = localPlayer.hasStatusEffect(StatusEffects.BLINDNESS);
boolean isSwimming = localPlayer.isSwimming() ||
(localPlayer.isTouchingWater() && localPlayer.isSubmergedInWater() && localPlayer.isOnGround());
return isBlind || isSwimming;
}
private boolean shouldUseCriticals(ClientPlayerEntity localPlayer) {
if (isInSpecialCondition(localPlayer)) {
return false;
}
return criticalsOnly;
}
private boolean canPerformCriticalHit(ClientPlayerEntity localPlayer) {
PlayerAbilities localPlayerAbilities = localPlayer.getAbilities();
boolean hasMovementRestrictions = localPlayer.hasStatusEffect(StatusEffects.LEVITATION)
|| localPlayer.isInLava()
|| localPlayer.isClimbing()
|| localPlayerAbilities.flying;
if (hasMovementRestrictions) {
return false;
}
return localPlayer.fallDistance >= currentFallDistance && !localPlayer.isOnGround();
}
private boolean isValidTarget(Entity entity, boolean ignoreFriends) {
if (!(entity instanceof LivingEntity)) {
return false;
}
LivingEntity livingEntity = (LivingEntity) entity;
if (livingEntity.isDead() || livingEntity.getHealth() <= 0) {
return false;
}
if (FriendPackage.isFriend(entity.getName().getString())) {
return false;
}
if (entity == mc.player) {
return false;
}
if (ignoreFriends && entity instanceof PlayerEntity) {
}
return true;
}
@Override
public void onEnable() {
super.onEnable();
lastAttackTime = 0;
attackCounter = 0;
wasSprintingBeforeAttack = false;
}
@Override
public void onDisable() {
super.onDisable();
wasSprintingBeforeAttack = false;
}
}