aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/rosegoldaddons/features/NecronAimbot.java
diff options
context:
space:
mode:
authorRoseGoldIsntGay <yoavkau@gmail.com>2021-11-13 23:48:21 +0200
committerRoseGoldIsntGay <yoavkau@gmail.com>2021-11-13 23:48:21 +0200
commit471894a91cf02f42282f677472eb8bf07f270d5c (patch)
treed2b5fb6f1fb90c42236f9560214164f514197d1a /src/main/java/rosegoldaddons/features/NecronAimbot.java
parent6f69d1e1aff688bf2f5ca34754640eed5102b045 (diff)
downloadRGA-471894a91cf02f42282f677472eb8bf07f270d5c.tar.gz
RGA-471894a91cf02f42282f677472eb8bf07f270d5c.tar.bz2
RGA-471894a91cf02f42282f677472eb8bf07f270d5c.zip
2.2.0
Diffstat (limited to 'src/main/java/rosegoldaddons/features/NecronAimbot.java')
-rw-r--r--src/main/java/rosegoldaddons/features/NecronAimbot.java40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/main/java/rosegoldaddons/features/NecronAimbot.java b/src/main/java/rosegoldaddons/features/NecronAimbot.java
new file mode 100644
index 0000000..59e1493
--- /dev/null
+++ b/src/main/java/rosegoldaddons/features/NecronAimbot.java
@@ -0,0 +1,40 @@
+package rosegoldaddons.features;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.boss.EntityWither;
+import net.minecraft.entity.monster.EntityEnderman;
+import net.minecraftforge.client.event.RenderWorldLastEvent;
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
+import rosegoldaddons.Main;
+import rosegoldaddons.utils.RenderUtils;
+import rosegoldaddons.utils.RotationUtils;
+
+import java.awt.*;
+import java.util.Random;
+
+public class NecronAimbot {
+ @SubscribeEvent
+ public void renderWorld(RenderWorldLastEvent event) {
+ if (!Main.necronAimbot) return;
+ Entity necron = getClosestWither();
+ if (necron == null) return;
+ RenderUtils.drawEntityBox(necron, Color.RED, true, event.partialTicks);
+ RotationUtils.faceEntity(necron);
+ }
+
+ private static Entity getClosestWither() {
+ Entity necron = null;
+ Double closest = Double.valueOf(9999);
+ for (Entity entity1 : (Minecraft.getMinecraft().theWorld.loadedEntityList)) {
+ if (entity1 instanceof EntityWither && !(((EntityWither) entity1).getHealth() == 0)) {
+ double dist = entity1.getDistanceSq(Minecraft.getMinecraft().thePlayer.posX, Minecraft.getMinecraft().thePlayer.posY, Minecraft.getMinecraft().thePlayer.posZ);
+ if (dist < closest) {
+ closest = dist;
+ necron = entity1;
+ }
+ }
+ }
+ return necron;
+ }
+}