Начинающий
- Статус
- Оффлайн
- Регистрация
- 18 Июн 2022
- Сообщения
- 323
- Реакции
- 14
Самая простая Аура для 1.8.9/1.12.2
JavaScript:
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
public class AutoAttackMod {
private Minecraft mc;
public AutoAttackMod() {
mc = Minecraft.getMinecraft();
}
public void onUpdate() {
EntityPlayerSP player = mc.thePlayer;
if (player != null && player.worldObj != null) {
for (Object entity : player.worldObj.loadedEntityList) {
if (entity instanceof EntityLivingBase && entity != player) {
EntityLivingBase target = (EntityLivingBase) entity;
if (target.getDistanceToEntity(player) <= 5 && player.canEntityBeSeen(target)) {
lookAtEntity(target);
player.swingItem();
mc.playerController.attackEntity(player, target);
}
}
}
}
}
private void lookAtEntity(EntityLivingBase entity) {
double d0 = entity.posX - mc.thePlayer.posX;
double d1 = entity.posY + entity.getEyeHeight() - (mc.thePlayer.posY + mc.thePlayer.getEyeHeight());
double d2 = entity.posZ - mc.thePlayer.posZ;
double d3 = MathHelper.sqrt_double(d0 * d0 + d2 * d2);
float yaw = (float) (Math.atan2(d2, d0) * 180.0D / Math.PI) - 90.0F;
float pitch = (float) (-(Math.atan2(d1, d3) * 180.0D / Math.PI));
mc.thePlayer.rotationYaw = yaw;
mc.thePlayer.rotationPitch = pitch;
}
}
Последнее редактирование: