├── AlertsBackend.java ├── ArmedAimbot.java ├── ArrayList.java ├── AutoChest.java ├── AutoHypixel.java ├── AutoSwapBW.java ├── AutoToss.java ├── BedPlates.java ├── ChatCmds.java ├── CustomAC.java ├── DamageTags.java ├── Denicker.java ├── HalloweenSim.java ├── HitSelect.java ├── IRC.java ├── JumpReset.java ├── LagRange.java ├── LegitScaffold.java ├── NoDropSwords.java ├── QuickMaths.java ├── Quickbuy.java ├── README.md ├── Requeue.java ├── TpStickRequeue.java ├── bed_defenses.json ├── bps.java ├── cops.java ├── dcbot.java ├── duels.java ├── hotkeys.java ├── itemAlerts.java ├── lazify.java ├── nickbot.java ├── session.java └── zombies.java /AlertsBackend.java: -------------------------------------------------------------------------------- 1 | /* 2 | loadstring: load - "https://raw.githubusercontent.com/PugrillaDev/Raven-Scripts/refs/heads/main/AlertsBackend.java" 3 | Example Usage 4 | 5 | Renders an alert with the title "Title" and a "Hello World" message for 10 seconds. 6 | When clicked, it will send "/bedwars" in the chat. 7 | This script is designed to be a resource for you to utilize, so you must run this code from another script. 8 | 9 | List> alerts = new ArrayList<>(); 10 | 11 | void addAlert(String title, String message, int duration, String command) { 12 | Map alert = new HashMap<>(4); 13 | alert.put("title", title); 14 | alert.put("message", message); 15 | alert.put("duration", duration); 16 | alert.put("command", command); 17 | alerts.add(alert); 18 | } 19 | 20 | void onPreUpdate() { 21 | if (!alerts.isEmpty() && !bridge.has("pugalert")) { 22 | bridge.add("pugalert", alerts.remove(0)); 23 | } 24 | } 25 | 26 | void onEnable() { 27 | addAlert("Title", "Hello World", 10000, "/bedwars"); 28 | } 29 | 30 | 31 | Additionally, you could send an alert with a distinct phrase such as "5749387394743989". 32 | Then simply look for that message in an outgoing C01 packet to trigger another function instead of sending a message in chat. 33 | Now when the alert is clicked, it will call the trigger function in a separate script. 34 | 35 | Script 1: 36 | 37 | void onEnable() { 38 | addAlert("Title", "Hello World", 10000, "5749387394743989"); 39 | } 40 | 41 | Script 2: 42 | 43 | void trigger() { 44 | client.chat("/bedwars"); 45 | } 46 | 47 | boolean onPacketSent(CPacket packet) { 48 | if (packet instanceof C01) { 49 | C01 c01 = (C01) packet; 50 | if (c01.message.equals("5749387394743989")) { 51 | trigger(); 52 | return false; 53 | } 54 | } 55 | } 56 | */ 57 | 58 | List> alerts = new ArrayList<>(); 59 | int themeColor; 60 | float scale = 1; 61 | float animateIn = 100; 62 | float animateOut = 100; 63 | float animateClick = 25; 64 | float animateHover = 100; 65 | float lineWidth = 2.5f; 66 | boolean clicking = false; 67 | boolean lastclicking = false; 68 | int[] displaySize; 69 | float[] mousePosition; 70 | float[] lastClickPosition; 71 | 72 | void onLoad() { 73 | modules.registerSlider("Theme", "", 197, 0, 360, 1); 74 | modules.registerSlider("Scale", "", 1.0, 0.5, 1.5, 0.1); 75 | modules.registerSlider("Line Width", "", 2.5, 0.1, 5, 0.1); 76 | modules.registerSlider("Animate In", "ms", 100, 0, 2000, 10); 77 | modules.registerSlider("Animate Out", "ms", 100, 0, 2000, 10); 78 | bridge.remove("pugalert"); 79 | } 80 | 81 | @SuppressWarnings("unchecked") 82 | void onPostMotion() { 83 | long now = client.time(); 84 | Color color = Color.getHSBColor((float) modules.getSlider(scriptName, "Theme") / 360f, 1f, 1f); 85 | themeColor = (255 << 24) | (color.getRed() << 16) | (color.getGreen() << 8) | color.getBlue(); 86 | scale = (float) modules.getSlider(scriptName, "Scale"); 87 | displaySize = client.getDisplaySize(); 88 | animateIn = (float) modules.getSlider(scriptName, "Animate In"); 89 | animateOut = (float) modules.getSlider(scriptName, "Animate Out"); 90 | lineWidth = (float) modules.getSlider(scriptName, "Line Width") * scale; 91 | lastclicking = clicking; 92 | clicking = keybinds.isMouseDown(0); 93 | 94 | int[] size = client.getDisplaySize(); 95 | float guiScale = size[2]; 96 | int[] mp = keybinds.getMousePosition(); 97 | mousePosition = new float[]{ mp[0] / guiScale, size[1] - (mp[1] / guiScale) }; 98 | 99 | if (clicking && !lastclicking) { 100 | lastClickPosition = new float[]{ mousePosition[0], mousePosition[1] }; 101 | } 102 | 103 | Map alert = (Map) bridge.get("pugalert"); 104 | if (alert != null) { 105 | bridge.remove("pugalert"); 106 | String title = (String) alert.get("title"); 107 | String message = (String) alert.get("message"); 108 | Integer duration = (Integer) alert.get("duration"); 109 | 110 | if (title != null && message != null && duration != null) { 111 | String command = (String) alert.getOrDefault("command", ""); 112 | 113 | Map alertData = new HashMap<>(); 114 | alertData.put("title", title); 115 | alertData.put("message", message); 116 | alertData.put("command", command); 117 | alertData.put("added", now); 118 | alertData.put("animationStart", now); 119 | alertData.put("duration", duration + (int) animateIn); 120 | alertData.put("originalDuration", duration + (int) animateIn); 121 | alertData.put("removing", false); 122 | alertData.put("hoverState", false); 123 | alertData.put("startHover", -1L); 124 | alertData.put("stopHover", -1L); 125 | alertData.put("clicking", false); 126 | alertData.put("clickStart", -1L); 127 | alerts.add(alertData); 128 | } 129 | } 130 | 131 | for (Map alertData : alerts) { 132 | boolean isHovered = (boolean) alertData.get("hoverState"); 133 | boolean isClicking = (boolean) alertData.get("clicking"); 134 | alertData.put("lastClicking", isClicking); 135 | if (isHovered && clicking && !isClicking) { 136 | alertData.put("clicking", true); 137 | alertData.put("clickStart", now); 138 | } else if (!clicking && isClicking) { 139 | alertData.put("clicking", false); 140 | alertData.put("clickStart", now); 141 | } 142 | } 143 | } 144 | 145 | void onRenderTick(float partialTicks) { 146 | if (alerts.isEmpty()) return; 147 | 148 | boolean empty = client.getScreen().isEmpty(); 149 | long now = client.time(); 150 | float offsetY = 0; 151 | float maxSlideOffsetY = 0; 152 | boolean foundRemoving = false; 153 | 154 | for (Iterator> iterator = alerts.iterator(); iterator.hasNext();) { 155 | Map alertData = iterator.next(); 156 | boolean removing = (boolean) alertData.get("removing"); 157 | int alertDurationMillis = (int) alertData.get("duration"); 158 | String command = (String) alertData.get("command"); 159 | 160 | if (alertDurationMillis <= 0) { 161 | alertData.put("removing", true); 162 | if (!removing) alertData.put("animationStart", now); 163 | removing = true; 164 | foundRemoving = true; 165 | } 166 | 167 | long animationStart = (long) alertData.get("animationStart"); 168 | float animationProgress; 169 | if (removing) { 170 | animationProgress = (now - animationStart) / animateOut; 171 | if (animationProgress >= 1f) { 172 | iterator.remove(); 173 | continue; 174 | } 175 | animationProgress = 1f - animationProgress; 176 | } else { 177 | animationProgress = Math.min((now - animationStart) / animateIn, 1f); 178 | } 179 | 180 | float progress = animationProgress < 0.5 181 | ? 2 * animationProgress * animationProgress 182 | : -1 + (4 - 2 * animationProgress) * animationProgress; 183 | 184 | String title = (String) alertData.get("title"); 185 | String message = (String) alertData.get("message"); 186 | 187 | float maxWidth = (float) Math.max(render.getFontWidth(title), render.getFontWidth(message)) * scale; 188 | float scaledFontHeight = render.getFontHeight() * scale; 189 | float padding = 5 * scale; 190 | float width = maxWidth + padding * 2; 191 | float height = scaledFontHeight * 2 + padding * 2 + (3 * scale); 192 | 193 | float endX = displaySize[0] - width - padding; 194 | float currentX = (displaySize[0] + width) - ((displaySize[0] + width) - endX) * progress; 195 | float startY = displaySize[1] - height - padding - offsetY; 196 | float currentY = startY; 197 | 198 | if (removing) { 199 | float removeProgress = (1f - progress); 200 | currentX = endX + (width + padding) * removeProgress; 201 | currentY = startY + (displaySize[1] - startY - padding) * removeProgress; 202 | maxSlideOffsetY = Math.max(maxSlideOffsetY, (height + padding) * removeProgress); 203 | } else if (foundRemoving) { 204 | currentY += maxSlideOffsetY; 205 | } 206 | 207 | boolean isHovered = !empty && mousePosition[0] >= currentX && mousePosition[0] <= currentX + width && 208 | mousePosition[1] >= currentY && mousePosition[1] <= currentY + height; 209 | 210 | long lastCheck = (long) alertData.getOrDefault("lastCheck", now); 211 | long elapsed = now - lastCheck; 212 | if (!isHovered) alertDurationMillis -= elapsed; 213 | alertData.put("duration", alertDurationMillis); 214 | alertData.put("lastCheck", now); 215 | 216 | if (isHovered && !(boolean) alertData.get("hoverState")) { 217 | alertData.put("hoverState", true); 218 | alertData.put("startHover", now); 219 | } else if (!isHovered && (boolean) alertData.get("hoverState")) { 220 | alertData.put("hoverState", false); 221 | alertData.put("stopHover", now); 222 | } 223 | 224 | long startHover = (long) alertData.get("startHover"); 225 | long stopHover = (long) alertData.get("stopHover"); 226 | 227 | int lineColor; 228 | if (isHovered) { 229 | if (startHover > 0) { 230 | float hoverProgress = Math.min(1f, (now - startHover) / animateHover); 231 | lineColor = interpolateColor(0xFF000000, themeColor, hoverProgress); 232 | } else { 233 | lineColor = themeColor; 234 | } 235 | } else { 236 | if (stopHover > 0) { 237 | float hoverProgress = Math.min(1f, (now - stopHover) / animateHover); 238 | lineColor = interpolateColor(themeColor, 0xFF000000, hoverProgress); 239 | } else { 240 | lineColor = 0xFF000000; 241 | } 242 | } 243 | 244 | float clickScale = 1f; 245 | if (!command.isEmpty() && lastClickPosition != null && 246 | lastClickPosition[0] >= currentX && lastClickPosition[0] <= currentX + width && 247 | lastClickPosition[1] >= currentY && lastClickPosition[1] <= currentY + height) { 248 | 249 | boolean isClicking = (boolean) alertData.get("clicking"); 250 | boolean lastClicking = (boolean) alertData.get("lastClicking"); 251 | 252 | if (!isClicking && lastClicking && isHovered) { 253 | client.chat(command); 254 | alertData.put("clicking", false); 255 | alertData.put("lastClicking", false); 256 | } 257 | 258 | if (isClicking) { 259 | long clickStart = (long) alertData.get("clickStart"); 260 | float clickProgress = Math.min(1f, (now - clickStart) / animateClick); 261 | clickScale = 1f - 0.02f * clickProgress; 262 | } else if (alertData.containsKey("clickStart") && (long) alertData.get("clickStart") > 0) { 263 | long clickStart = (long) alertData.get("clickStart"); 264 | float clickProgress = Math.min(1f, (now - clickStart) / animateClick); 265 | clickScale = 0.98f + 0.02f * clickProgress; 266 | } 267 | } 268 | 269 | float adjustedScale = scale * clickScale; 270 | float adjustedLineWidth = lineWidth * clickScale; 271 | float adjustedWidth = width * clickScale; 272 | float adjustedHeight = height * clickScale; 273 | float adjustedX = currentX + (width - adjustedWidth) / 2; 274 | float adjustedY = currentY + (height - adjustedHeight) / 2; 275 | 276 | // background 277 | render.blur.prepare(); 278 | render.rect(adjustedX - adjustedScale, adjustedY, adjustedX + adjustedWidth - adjustedScale, adjustedY + adjustedHeight, -1); 279 | render.blur.apply(2, 3); 280 | render.rect(adjustedX, adjustedY, adjustedX + adjustedWidth, adjustedY + adjustedHeight, 0x80000000); 281 | 282 | // progress bar 283 | float timeRemaining = Math.max(0, alertDurationMillis); 284 | float progressBarWidth = adjustedWidth * (timeRemaining / ((Number) alertData.get("originalDuration")).floatValue()); 285 | render.line2D(adjustedX, adjustedY + adjustedHeight, adjustedX + progressBarWidth, adjustedY + adjustedHeight, adjustedLineWidth, themeColor); 286 | render.line2D(adjustedX + progressBarWidth, adjustedY + adjustedHeight, adjustedX + adjustedWidth, adjustedY + adjustedHeight, adjustedLineWidth, lineColor); 287 | 288 | // outlines 289 | render.line2D(adjustedX, adjustedY, adjustedX, adjustedY + adjustedHeight, adjustedLineWidth, lineColor); 290 | render.line2D(adjustedX + adjustedWidth, adjustedY, adjustedX + adjustedWidth, adjustedY + adjustedHeight, adjustedLineWidth, lineColor); 291 | render.line2D(adjustedX, adjustedY, adjustedX + adjustedWidth, adjustedY, adjustedLineWidth, lineColor); 292 | 293 | // text 294 | render.text2d(title, adjustedX + padding * clickScale, adjustedY + padding * clickScale, adjustedScale, themeColor, true); 295 | render.text2d(message, adjustedX + padding * clickScale, adjustedY + scaledFontHeight * clickScale + padding * 2 * clickScale, adjustedScale, themeColor, true); 296 | 297 | offsetY += height + padding; 298 | } 299 | } 300 | 301 | int interpolateColor(int startColor, int endColor, float progress) { 302 | int startA = (startColor >> 24) & 0xFF, startR = (startColor >> 16) & 0xFF, startG = (startColor >> 8) & 0xFF, startB = startColor & 0xFF; 303 | int endA = (endColor >> 24) & 0xFF, endR = (endColor >> 16) & 0xFF, endG = (endColor >> 8) & 0xFF, endB = endColor & 0xFF; 304 | int interpolatedA = (int) (startA + (endA - startA) * progress); 305 | int interpolatedR = (int) (startR + (endR - startR) * progress); 306 | int interpolatedG = (int) (startG + (endG - startG) * progress); 307 | int interpolatedB = (int) (startB + (endB - startB) * progress); 308 | return (interpolatedA << 24) | (interpolatedR << 16) | (interpolatedG << 8) | interpolatedB; 309 | } -------------------------------------------------------------------------------- /ArmedAimbot.java: -------------------------------------------------------------------------------- 1 | /* 2 | aimbot for armed bedwars dreams mode 3 | loadstring: load - "https://raw.githubusercontent.com/PugrillaDev/Raven-Scripts/refs/heads/main/ArmedAimbot.java" 4 | */ 5 | 6 | int targetColor = new Color(255, 0, 0).getRGB(); 7 | int predictionTicks = 1; 8 | int aim = 0; 9 | float serverYaw, serverPitch; 10 | Entity target = null; 11 | Vec3 aimPoint = null; 12 | boolean sentAlready = false; 13 | HashSet ignoreBlocks = new HashSet<>(Arrays.asList( 14 | "wall_sign", 15 | "torch", 16 | "air", 17 | "ladder", 18 | "wheat", 19 | "fire", 20 | "water", 21 | "grass", 22 | "double_plant", 23 | "tallgrass" 24 | )); 25 | HashSet guns = new HashSet<>(Arrays.asList( 26 | "golden_hoe", 27 | "stone_hoe", 28 | "diamond_hoe", 29 | "flint_and_steel", 30 | "iron_hoe", 31 | "wooden_hoe" 32 | )); 33 | 34 | double hitboxScale = 1.3; 35 | double width = 0.6 * hitboxScale; 36 | double height = 1.8 * hitboxScale; 37 | double halfWidth = width / 2d; 38 | double halfHeight = height / 2d; 39 | 40 | void onEnable() { 41 | serverYaw = client.getPlayer().getYaw(); 42 | serverPitch = client.getPlayer().getPitch(); 43 | } 44 | 45 | void onLoad() { 46 | modules.registerButton("Hold Right Click", true); 47 | modules.registerButton("Spin Bot", false); 48 | modules.registerSlider("Prediction", " ticks", 3, 0, 10, 1); 49 | } 50 | 51 | void onPreMotion(PlayerState s) { 52 | if (!client.getScreen().isEmpty() || getBedwarsStatus() != 3) return; 53 | String targetName = target != null ? target.getName() : ""; 54 | target = null; 55 | aimPoint = null; 56 | Entity player = client.getPlayer(); 57 | ItemStack heldItem = player.getHeldItem(); 58 | String itemName = heldItem != null ? heldItem.name : ""; 59 | int durability = heldItem != null ? heldItem.durability : 1; 60 | int maxDurability = heldItem != null ? heldItem.maxDurability : 1; 61 | int ticksExisted = player.getTicksExisted(); 62 | predictionTicks = (int) modules.getSlider(scriptName, "Prediction") + 1; 63 | 64 | boolean manual = modules.getButton(scriptName, "Hold Right Click"); 65 | boolean doAiming = durability == maxDurability && guns.contains(itemName) && (!manual || (manual && keybinds.isMouseDown(1))); 66 | 67 | if (!doAiming) { 68 | aim = 0; 69 | return; 70 | } 71 | 72 | List closest = getClosestEntities(4); 73 | for (Entity p : closest) { 74 | Object[] hit = canHitEntity(p); 75 | boolean successful = Boolean.parseBoolean(hit[0].toString()); 76 | if (!successful) continue; 77 | target = p; 78 | aimPoint = (Vec3) hit[1]; 79 | break; 80 | } 81 | 82 | String newTargetName = target != null ? target.getName() : ""; 83 | if (target == null || !targetName.equals(newTargetName)) { 84 | aim = 0; 85 | } 86 | 87 | float[] rotations = new float[]{ player.getYaw(), player.getPitch() }; 88 | if (target != null) rotations = getRotations(aimPoint); 89 | 90 | int scaleFactor = (int) Math.floor(serverYaw / 360); 91 | float unwrappedYaw = rotations[0] + 360 * scaleFactor; 92 | if (unwrappedYaw < serverYaw - 180) { 93 | unwrappedYaw += 360; 94 | } else if (unwrappedYaw > serverYaw + 180) { 95 | unwrappedYaw -= 360; 96 | } 97 | 98 | float deltaYaw = unwrappedYaw - serverYaw; 99 | float deltaPitch = rotations[1] - serverPitch; 100 | 101 | if (target != null) { 102 | s.yaw = serverYaw + (Math.abs(deltaYaw) >= 0.1 ? deltaYaw : 0); 103 | s.pitch = serverPitch + (Math.abs(deltaPitch) >= 0.1 ? deltaPitch : 0); 104 | 105 | if (aim++ > 0 && !sentAlready && durability == maxDurability) { 106 | client.sendPacketNoEvent(new C08(heldItem, new Vec3(-1, -1, -1), 255, new Vec3(0.0, 0.0, 0.0))); 107 | } 108 | } else if (modules.getButton(scriptName, "Spin Bot")) { 109 | s.yaw = (float) util.randomDouble(-180, 180); 110 | s.pitch = (float) util.randomDouble(-90, 90); 111 | } 112 | } 113 | 114 | boolean onMouse(int button, boolean state) { 115 | if (!modules.getButton(scriptName, "Hold Right Click")) return true; 116 | if (button != 1 || !state) return true; 117 | 118 | Entity player = client.getPlayer(); 119 | ItemStack heldItem = player.getHeldItem(); 120 | String itemName = heldItem != null ? heldItem.name : ""; 121 | 122 | return !guns.contains(itemName); 123 | } 124 | 125 | void onRenderTick(float partialTicks) { 126 | if (target == null || !render.isInView(target)) return; 127 | double scale = partialTicks; 128 | int size = client.getDisplaySize()[2]; 129 | 130 | Vec3 screen = render.worldToScreen(aimPoint.x, aimPoint.y, aimPoint.z, size, partialTicks); 131 | 132 | if (screen.z >= 0 && screen.z < 1.0003684d) { 133 | double crosshairSize = 3; 134 | double startX = screen.x - crosshairSize; 135 | double endX = screen.x + crosshairSize; 136 | double startY = screen.y - crosshairSize; 137 | double endY = screen.y + crosshairSize; 138 | 139 | render.line2D(startX, screen.y, endX, screen.y, 3.0f, targetColor); 140 | render.line2D(screen.x, startY, screen.x, endY, 3.0f, targetColor); 141 | } 142 | } 143 | 144 | boolean onPacketSent(CPacket packet) { 145 | if (packet.name.startsWith("C05") || packet.name.startsWith("C06")) { 146 | C03 c03 = (C03) packet; 147 | serverYaw = c03.yaw; 148 | serverPitch = c03.pitch; 149 | } else if (packet instanceof C08) { 150 | sentAlready = true; 151 | } 152 | return true; 153 | } 154 | 155 | void onPostMotion() { 156 | sentAlready = false; 157 | } 158 | 159 | List getClosestEntities(int amount) { 160 | Entity player = client.getPlayer(); 161 | Vec3 p = player.getPosition(); 162 | String myTeam = player.getNetworkPlayer() != null ? player.getNetworkPlayer().getDisplayName().substring(0, 2) : player.getDisplayName().substring(0, 2); 163 | 164 | List entityDistances = new ArrayList<>(); 165 | for (Entity entity : world.getPlayerEntities()) { 166 | String d = entity.getDisplayName(); 167 | char u = entity.getUUID().charAt(14); 168 | if (entity == player || entity.getNetworkPlayer() == null || (u != '4' && u != '1') || d.startsWith(myTeam) || (entity.isInvisible() && d.startsWith(util.colorSymbol + "c") && !d.contains(" "))) continue; 169 | double distanceSq = p.distanceToSq(entity.getPosition()); 170 | entityDistances.add(new Object[]{entity, distanceSq}); 171 | } 172 | 173 | entityDistances.sort(Comparator.comparingDouble(o -> (double) o[1])); 174 | 175 | List closestEntities = new ArrayList<>(); 176 | for (int i = 0; i < Math.min(amount, entityDistances.size()); i++) { 177 | closestEntities.add((Entity) entityDistances.get(i)[0]); 178 | } 179 | 180 | return closestEntities; 181 | } 182 | 183 | double interpolate(double current, double old, double scale) { 184 | return old + (current - old) * scale; 185 | } 186 | 187 | Object[] canHitEntity(Entity p) { 188 | double range = getCurrentWeaponRange(); 189 | if (range == 0 || p.getPosition().distanceTo(client.getPlayer().getPosition()) > range) return new Object[] { false }; 190 | 191 | Vec3[] boundingBox = getPredictedBoundingBox(p); 192 | Vec3 pos = boundingBox[0].offset(halfWidth, 0, halfWidth); 193 | 194 | Vec3[] offsets = { 195 | new Vec3(0, 2, 0), 196 | new Vec3(halfWidth, halfHeight, 0), 197 | new Vec3(0, halfHeight, halfWidth), 198 | new Vec3(-halfWidth, halfHeight, 0), 199 | new Vec3(0, halfHeight, -halfWidth), 200 | new Vec3(0, height, 0), 201 | new Vec3(0, 0, 0) 202 | }; 203 | 204 | for (Vec3 offset : offsets) { 205 | Vec3 targetPos = pos.offset(offset.x, offset.y, offset.z); 206 | if (isRaycastHit(targetPos, boundingBox, range)) { 207 | return new Object[] { true, targetPos }; 208 | } 209 | } 210 | 211 | return new Object[] { false }; 212 | } 213 | 214 | boolean isRaycastHit(Vec3 targetPos, Vec3[] boundingBox, double range) { 215 | float[] rots = getRotations(targetPos); 216 | List path = raycastPath(range, rots[0], rots[1], 0.2); 217 | for (Vec3 pos : path) { 218 | Block block = world.getBlockAt(pos); 219 | if (isWithinBoundingBox(pos, boundingBox)) return true; 220 | if (ignoreBlocks.contains(block.name)) continue; 221 | return false; 222 | } 223 | return false; 224 | } 225 | 226 | double getCurrentWeaponRange() { 227 | ItemStack item = client.getPlayer().getHeldItem(); 228 | if (item == null || !guns.contains(item.name)) return 0; 229 | 230 | for (String t : item.getTooltip()) { 231 | String ts = util.strip(t); 232 | if (!ts.contains("Range: ")) continue; 233 | double range = Double.parseDouble(ts.split("Range: ")[1]); 234 | return range; 235 | } 236 | 237 | return 0; 238 | } 239 | 240 | Vec3[] getPredictedBoundingBox(Entity p) { 241 | Vec3 position = p.getPosition(); 242 | Vec3 lposition = p.getLastPosition(); 243 | Vec3 motion = position.offset(-lposition.x, -lposition.y, -lposition.z); 244 | 245 | boolean inAir = world.getBlockAt(position).name.equals("air"); 246 | if (inAir) { 247 | motion.x *= 0.91; 248 | motion.z *= 0.91; 249 | } 250 | 251 | Vec3 predictedPosition = position.offset(motion.x * predictionTicks, motion.y * (predictionTicks / 4), motion.z * predictionTicks); 252 | Vec3[] boundingBox = { predictedPosition.offset(-halfWidth, 0, -halfWidth), predictedPosition.offset(halfWidth, height, halfWidth) }; 253 | return boundingBox; 254 | } 255 | 256 | List raycastPath(double distance, float yaw, float pitch, double step) { 257 | List positions = new ArrayList<>(); 258 | 259 | double yawRad = Math.toRadians(yaw); 260 | double pitchRad = Math.toRadians(pitch); 261 | 262 | double dirX = -Math.sin(yawRad) * Math.cos(pitchRad); 263 | double dirY = -Math.sin(pitchRad); 264 | double dirZ = Math.cos(yawRad) * Math.cos(pitchRad); 265 | 266 | Entity player = client.getPlayer(); 267 | Vec3 startPos = player.getPosition().offset(0, player.getEyeHeight(), 0); 268 | 269 | for (double i = 0; i <= distance; i += step) { 270 | positions.add(new Vec3(startPos.x + dirX * i, startPos.y + dirY * i, startPos.z + dirZ * i)); 271 | } 272 | 273 | return positions; 274 | } 275 | 276 | boolean isWithinBoundingBox(Vec3 position, Vec3[] boundingBox) { 277 | Vec3 min = boundingBox[0]; 278 | Vec3 max = boundingBox[1]; 279 | 280 | return (position.x >= min.x && position.x <= max.x) && 281 | (position.y >= min.y && position.y <= max.y) && 282 | (position.z >= min.z && position.z <= max.z); 283 | } 284 | 285 | float[] getRotations(Vec3 point) { 286 | Entity player = client.getPlayer(); 287 | Vec3 pos = player.getPosition().offset(0, player.getEyeHeight(), 0); 288 | double x = point.x - pos.x; 289 | double y = point.y - pos.y; 290 | double z = point.z - pos.z; 291 | double dist = Math.sqrt(x * x + z * z); 292 | float yaw = (float) Math.toDegrees(Math.atan2(z, x)) - 90f; 293 | float pitch = (float) Math.toDegrees(-Math.atan2(y, dist)); 294 | 295 | yaw = ((yaw % 360) + 360) % 360; 296 | if (yaw > 180) { 297 | yaw -= 360; 298 | } 299 | 300 | return new float[]{ yaw, pitch }; 301 | } 302 | 303 | int getBedwarsStatus() { 304 | List sidebar = world.getScoreboard(); 305 | if (sidebar == null) { 306 | if (world.getDimension().equals("The End")) { 307 | return 0; 308 | } 309 | return -1; 310 | } 311 | 312 | int size = sidebar.size(); 313 | if (size < 7) return -1; 314 | 315 | if (!util.strip(sidebar.get(0)).startsWith("BED WARS")) { 316 | return -1; 317 | } 318 | 319 | String lobbyId = util.strip(sidebar.get(1)).split(" ")[1]; 320 | if (lobbyId.charAt(lobbyId.length() - 1) == ']') { 321 | lobbyId = lobbyId.split(" ")[0]; 322 | } 323 | 324 | if (lobbyId.charAt(0) == 'L') { 325 | return 1; 326 | } 327 | 328 | if (util.strip(sidebar.get(5)).startsWith("R Red:") && util.strip(sidebar.get(6)).startsWith("B Blue:")) { 329 | return 3; 330 | } 331 | 332 | String six = util.strip(sidebar.get(6)); 333 | if (six.equals("Waiting...") || six.startsWith("Starting in")) { 334 | return 2; 335 | } 336 | 337 | return -1; 338 | } -------------------------------------------------------------------------------- /AutoChest.java: -------------------------------------------------------------------------------- 1 | /* 2 | automatically stores/takes resources from your chest/enderchest in bedwars 3 | loadstring: load - "https://raw.githubusercontent.com/PugrillaDev/Raven-Scripts/refs/heads/main/AutoChest.java" 4 | */ 5 | 6 | int delayTicks, inChestDelay; 7 | boolean foundAllItemsInInventory, foundAllItemsInChest, foundItemsInChest, foundItemsInInventory; 8 | 9 | void onLoad() { 10 | modules.registerButton("Automatic", false); 11 | modules.registerButton("Stop When Finished", true); 12 | modules.registerSlider("Delay", "ms", 50, 0, 1000, 50); 13 | modules.registerButton("Iron", true); 14 | modules.registerButton("Gold", true); 15 | modules.registerButton("Diamonds", true); 16 | modules.registerButton("Emeralds", true); 17 | 18 | modules.registerKey("Inventory To Chest", 0); 19 | modules.registerKey("Chest To Inventory", 0); 20 | } 21 | 22 | void onPreUpdate() { 23 | if (delayTicks > 0) delayTicks--; 24 | 25 | if (!client.getScreen().equals("GuiChest") || !inventory.getChest().endsWith("Chest") || getBedwarsStatus() != 3) { 26 | inChestDelay = 2; 27 | foundItemsInInventory = foundItemsInChest = foundAllItemsInChest = foundAllItemsInInventory = false; 28 | return; 29 | } 30 | 31 | if (inChestDelay > 0 && --inChestDelay != 0) return; 32 | 33 | boolean automatic = modules.getButton(scriptName, "Automatic"); 34 | boolean stopWhenDone = modules.getButton(scriptName, "Stop When Finished"); 35 | int delay = (int) (modules.getSlider(scriptName, "Delay") / 50); 36 | 37 | HashSet items = new HashSet<>(); 38 | if (modules.getButton(scriptName, "Iron")) items.add("iron_ingot"); 39 | if (modules.getButton(scriptName, "Gold")) items.add("gold_ingot"); 40 | if (modules.getButton(scriptName, "Diamonds")) items.add("diamond"); 41 | if (modules.getButton(scriptName, "Emeralds")) items.add("emerald"); 42 | 43 | Map inv = createCustomInventory(); 44 | int chestSize = inventory.getChestSize(); 45 | boolean clicked = false; 46 | 47 | boolean invToChestKey = modules.getKeyPressed(scriptName, "Inventory To Chest"); 48 | boolean chestToInvKey = modules.getKeyPressed(scriptName, "Chest To Inventory"); 49 | 50 | if ((automatic && !foundItemsInChest && !foundAllItemsInInventory) || (invToChestKey && delayTicks == 0)) { 51 | for (int i = chestSize; i < inv.size(); i++) { 52 | ItemStack item = inv.get(i); 53 | if (item == null || !items.contains(item.name)) continue; 54 | inventory.click(i, 0, 1); 55 | clicked = true; 56 | delayTicks = delay; 57 | foundItemsInInventory = true; 58 | if (delay > 0) break; 59 | } 60 | 61 | if (stopWhenDone && !clicked && foundItemsInInventory) { 62 | foundAllItemsInInventory = true; 63 | } 64 | } 65 | 66 | clicked = false; 67 | 68 | if ((automatic && !foundItemsInInventory && !foundAllItemsInChest) || (chestToInvKey && delayTicks == 0)) { 69 | for (int i = 0; i < chestSize; i++) { 70 | ItemStack item = inv.get(i); 71 | if (item == null || !items.contains(item.name)) continue; 72 | inventory.click(i, 1, 1); 73 | clicked = true; 74 | delayTicks = delay; 75 | foundItemsInChest = true; 76 | if (delay > 0) break; 77 | } 78 | 79 | if (stopWhenDone && !clicked && foundItemsInChest) { 80 | foundAllItemsInChest = true; 81 | } 82 | } 83 | } 84 | 85 | Map createCustomInventory() { 86 | Map inv = new HashMap<>(); 87 | String screen = client.getScreen(); 88 | int inventorySize = inventory.getSize() - 4, slot = 0; 89 | 90 | if (screen.equals("GuiInventory")) { 91 | for (int i = 0; i < 5; i++) { 92 | inv.put(slot++, null); 93 | } 94 | 95 | Entity player = client.getPlayer(); 96 | for (int i = 3; i >= 0; i--) { 97 | inv.put(slot++, player.getArmorInSlot(i)); 98 | } 99 | } 100 | 101 | if (screen.equals("GuiChest") && !inventory.getChest().isEmpty()) { 102 | int chestSize = inventory.getChestSize(); 103 | for (int i = 0; i < chestSize; i++) { 104 | inv.put(slot++, inventory.getStackInChestSlot(i)); 105 | } 106 | } 107 | 108 | for (int i = 9; i < inventorySize + 9; i++) { 109 | inv.put(slot++, inventory.getStackInSlot(i % inventorySize)); 110 | } 111 | 112 | return inv; 113 | } 114 | 115 | int getBedwarsStatus() { 116 | List sidebar = world.getScoreboard(); 117 | if (sidebar == null) { 118 | if (world.getDimension().equals("The End")) { 119 | return 0; 120 | } 121 | return -1; 122 | } 123 | 124 | int size = sidebar.size(); 125 | if (size < 7) return -1; 126 | 127 | if (!util.strip(sidebar.get(0)).startsWith("BED WARS")) { 128 | return -1; 129 | } 130 | 131 | String lobbyId = util.strip(sidebar.get(1)).split(" ")[1]; 132 | if (lobbyId.endsWith("]")) { 133 | lobbyId = lobbyId.split(" ")[0]; 134 | } 135 | 136 | if (lobbyId.startsWith("L")) { 137 | return 1; 138 | } 139 | 140 | if (util.strip(sidebar.get(5)).startsWith("R Red:") && util.strip(sidebar.get(6)).startsWith("B Blue:")) { 141 | return 3; 142 | } 143 | 144 | String six = util.strip(sidebar.get(6)); 145 | if (six.equals("Waiting...") || six.startsWith("Starting in")) { 146 | return 2; 147 | } 148 | 149 | return -1; 150 | } -------------------------------------------------------------------------------- /AutoHypixel.java: -------------------------------------------------------------------------------- 1 | void onLoad() { 2 | modules.registerDescription("Lobby Messages"); 3 | modules.registerButton("Disable lobby joins", true); 4 | modules.registerButton("Disable ticket machine", true); 5 | modules.registerButton("Claim Daily Rewards", true); 6 | } 7 | 8 | boolean onChat(String msg) { 9 | String stripped = util.strip(msg); 10 | String text = stripped.toLowerCase(); 11 | 12 | if (modules.getButton(scriptName, "Disable lobby joins") && filterLobbyJoin(stripped)) { 13 | return false; 14 | } 15 | 16 | if (modules.getButton(scriptName, "Disable ticket machine") && filterTicketMachine(stripped)) { 17 | return false; 18 | } 19 | 20 | if (modules.getButton(scriptName, "Claim Daily Rewards")) { 21 | handleReward(text); 22 | } 23 | 24 | return true; 25 | } 26 | 27 | boolean filterLobbyJoin(String msg) { 28 | return (msg.startsWith(" >>>") && msg.endsWith("lobby! <<<")) || (msg.startsWith("[") && msg.endsWith("lobby!")); 29 | } 30 | 31 | boolean filterTicketMachine(String msg) { 32 | return msg.contains(" has found a ") && (msg.contains(" COMMON ") || msg.contains(" RARE ") || msg.contains(" EPIC ") || msg.contains(" LEGENDARY ")); 33 | } 34 | 35 | void handleReward(String text) { 36 | text = text.toLowerCase(); 37 | int idx = text.indexOf("hypixel.net/claim-reward/"); 38 | if (idx == -1) return; 39 | 40 | int start = text.lastIndexOf("http", idx); 41 | int end = text.indexOf(" ", idx); 42 | if (start == -1) return; 43 | if (end == -1) end = text.length(); 44 | 45 | String rewardLink = text.substring(start, end).replace("https://hypixel.net/", "https://rewards.hypixel.net/"); 46 | 47 | int codeStart = rewardLink.lastIndexOf("/") + 1; 48 | String code = rewardLink.substring(codeStart); 49 | if (code.length() != 8) return; 50 | 51 | if (!rewardLink.startsWith("https://rewards.hypixel.net/claim-reward/")) return; 52 | 53 | client.async(() -> { 54 | try { 55 | long now = client.time(); 56 | client.print("&8[&cReward&8] &7Found reward link. Claiming..."); 57 | Request req1 = new Request("GET", rewardLink); 58 | req1.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36"); 59 | Response res1 = req1.fetch(); 60 | String html = res1.string(); 61 | 62 | String token = extractBetween(html, "window.securityToken = \"", "\""); 63 | String data = extractBetween(html, "window.appData = '", "';").replace("\\'", "'"); 64 | if (token.isEmpty() || data.isEmpty()) { 65 | client.print("&8[&cReward&8] &7Reward was already claimed or is invalid."); 66 | return; 67 | } 68 | 69 | String csrfCookie = ""; 70 | for (String[] h : res1.headers()) { 71 | if (h[0].equalsIgnoreCase("set-cookie") && h[1].startsWith("_csrf=")) { 72 | csrfCookie = h[1].split(";", 2)[0]; 73 | break; 74 | } 75 | } 76 | 77 | Json appData = Json.parse(data); 78 | List cards = appData.get("rewards").asArray(); 79 | 80 | Map rarityBonus = new HashMap<>(); 81 | rarityBonus.put("COMMON", 0); 82 | rarityBonus.put("RARE", 50); 83 | rarityBonus.put("EPIC", 150); 84 | rarityBonus.put("LEGENDARY", 500); 85 | 86 | String best = ""; 87 | double bestScore = -1; 88 | int index = 0; 89 | 90 | client.print("&8[&cReward&8] &7Rewards offered:"); 91 | for (int i = 0; i < cards.size(); i++) { 92 | Json c = cards.get(i); 93 | String gameType = c.has("gameType") ? c.get("gameType").asString() : ""; 94 | String type = c.has("reward") ? c.get("reward").asString() : "Unknown"; 95 | String rarity = c.has("rarity") ? c.get("rarity").asString() : "COMMON"; 96 | int amount = c.has("amount") ? c.get("amount").asInt() : 0; 97 | 98 | double score = 1; 99 | if (type.equals("adsense_token")) score = amount * 250; 100 | else if (type.equals("experience")) score = amount * 0.002; 101 | else if (type.equals("dust")) score = amount * 4; 102 | else if (type.equals("coins") || type.equals("tokens")) score = amount * 0.001; 103 | else if (type.equals("housing_package")) score = 10; 104 | 105 | if (!type.equals("coins") && !type.equals("tokens")) { 106 | score += rarityBonus.getOrDefault(rarity, 0); 107 | } 108 | 109 | String name = prettyReward(type); 110 | if (type.equals("housing_package")) name = prettyHousingBlock(c.get("package").asString()) + " " + name; 111 | if (!gameType.isEmpty()) name = prettyGameType(gameType) + " " + name; 112 | String displayRarity = prettyRarity(rarity); 113 | String msg = rarityColor(rarity) + displayRarity + "&7" + (amount > 0 ? " " + amount + "x " : " ") + name; 114 | 115 | client.print("&8[&cReward&8] " + msg); 116 | 117 | if (score > bestScore) { 118 | bestScore = score; 119 | best = msg; 120 | index = i; 121 | } 122 | } 123 | 124 | String claim = "https://rewards.hypixel.net/claim-reward/claim?id=" + appData.get("id").asString() + "&option=" + index + "&activeAd=" + appData.get("activeAd").asString() + "&_csrf=" + token; 125 | 126 | Request req2 = new Request("POST", claim); 127 | req2.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36"); 128 | if (!csrfCookie.isEmpty()) req2.addHeader("Cookie", csrfCookie); 129 | Response res2 = req2.fetch(); 130 | long finished = client.time(); 131 | 132 | if (res2 == null) { 133 | client.print("&8[&cReward&8] &7Failed to claim reward. Request timed out."); 134 | return; 135 | } 136 | 137 | int status = res2.code(); 138 | 139 | if (status == 200) { 140 | client.print("&8[&cReward&8] &7Claimed " + best + " &8(&c" + (finished - now) + "ms&8)"); 141 | } else if (status == 400) { 142 | client.print("&8[&cReward&8] &7Reward was already claimed. &8(&c" + (finished - now) + "ms&8)"); 143 | } else { 144 | client.print("&8[&cReward&8] &7Failed to claim reward. Status &c" + status); 145 | } 146 | } catch (Exception e) { 147 | client.print("&8[&cReward&8] &7Error while claiming reward: &c" + e); 148 | } 149 | }); 150 | } 151 | 152 | String extractBetween(String src, String a, String b) { 153 | int start = src.indexOf(a); 154 | if (start == -1) return ""; 155 | start += a.length(); 156 | int end = src.indexOf(b, start); 157 | if (end == -1) return ""; 158 | return src.substring(start, end); 159 | } 160 | 161 | String prettyRarity(String rarity) { 162 | if (rarity == null || rarity.isEmpty()) return "Common"; 163 | return rarity.substring(0, 1).toUpperCase() + rarity.substring(1).toLowerCase(); 164 | } 165 | 166 | String prettyReward(String raw) { 167 | Map rewardsData = new HashMap<>(); 168 | rewardsData.put("adsense_token", "Reward Token"); 169 | rewardsData.put("housing_package", "Housing Block"); 170 | rewardsData.put("dust", "Mystery Dust"); 171 | if (rewardsData.containsKey(raw)) return rewardsData.get(raw); 172 | String[] parts = raw.replace('_', ' ').split(" "); 173 | StringBuilder sb = new StringBuilder(); 174 | for (String part : parts) { 175 | if (part.length() > 0) { 176 | sb.append(Character.toUpperCase(part.charAt(0))).append(part.substring(1).toLowerCase()); 177 | } 178 | sb.append(" "); 179 | } 180 | return sb.toString().trim(); 181 | } 182 | 183 | String prettyHousingBlock(String raw) { 184 | Map housingData = new HashMap<>(); 185 | housingData.put("specialoccasion_reward_card_skull_red_treasure_chest", "Red Treasure Chest"); 186 | housingData.put("specialoccasion_reward_card_skull_gold_nugget", "Gold Nugget"); 187 | housingData.put("specialoccasion_reward_card_skull_pot_o'_gold", "Pot O' Gold"); 188 | housingData.put("specialoccasion_reward_card_skull_rubik's_cube", "Rubik's Cube"); 189 | housingData.put("specialoccasion_reward_card_skull_piggy_bank", "Piggy Bank"); 190 | housingData.put("specialoccasion_reward_card_skull_health_potion", "Health Potion"); 191 | housingData.put("specialoccasion_reward_card_skull_green_treasure_chest", "Green Treasure Chest"); 192 | housingData.put("specialoccasion_reward_card_skull_coin_bag", "Coin Bag"); 193 | housingData.put("specialoccasion_reward_card_skull_ornamental_helmet", "Ornamental Helmet"); 194 | housingData.put("specialoccasion_reward_card_skull_pocket_galaxy", "Pocket Galaxy"); 195 | housingData.put("specialoccasion_reward_card_skull_mystic_pearl", "Mystic Pearl"); 196 | housingData.put("specialoccasion_reward_card_skull_agility_potion", "Agility Potion"); 197 | housingData.put("specialoccasion_reward_card_skull_blue_treasure_chest", "Blue Treasure Chest"); 198 | housingData.put("specialoccasion_reward_card_skull_golden_chalice", "Golden Chalice"); 199 | housingData.put("specialoccasion_reward_card_skull_jewelery_box", "Jewelry Box"); 200 | housingData.put("specialoccasion_reward_card_skull_crown", "Crown"); 201 | housingData.put("specialoccasion_reward_card_skull_molten_core", "Molten Core"); 202 | housingData.put("specialoccasion_reward_card_skull_mana_potion", "Mana Potion"); 203 | if (housingData.containsKey(raw)) return housingData.get(raw); 204 | return raw.replace('_', ' ').toLowerCase(); 205 | } 206 | 207 | String prettyGameType(String raw) { 208 | Map gameTypes = new HashMap<>(); 209 | gameTypes.put("walls3", "Mega Walls"); 210 | gameTypes.put("quakecraft", "Quakecraft"); 211 | gameTypes.put("walls", "Walls"); 212 | gameTypes.put("paintball", "Paintball"); 213 | gameTypes.put("survival_games", "Blitz SG"); 214 | gameTypes.put("tntgames", "TNT Games"); 215 | gameTypes.put("vampirez", "VampireZ"); 216 | gameTypes.put("arcade", "Arcade"); 217 | gameTypes.put("arena", "Arena"); 218 | gameTypes.put("uhc", "UHC"); 219 | gameTypes.put("mcgo", "Cops and Crims"); 220 | gameTypes.put("battleground", "Warlords"); 221 | gameTypes.put("super_smash", "Smash Heroes"); 222 | gameTypes.put("gingerbread", "Turbo Kart Racers"); 223 | gameTypes.put("skywars", "SkyWars"); 224 | gameTypes.put("true_combat", "Crazy Walls"); 225 | gameTypes.put("speeduhc", "Speed UHC"); 226 | gameTypes.put("bedwars", "Bed Wars"); 227 | gameTypes.put("build_battle", "Build Battle"); 228 | gameTypes.put("murder_mystery", "Murder Mystery"); 229 | gameTypes.put("duels", "Duels"); 230 | gameTypes.put("legacy", "Classic"); 231 | return gameTypes.getOrDefault(raw.toLowerCase(), raw.replace('_', ' ').toLowerCase()); 232 | } 233 | 234 | String rarityColor(String rarity) { 235 | return rarity.equalsIgnoreCase("COMMON") ? "&f" : rarity.equalsIgnoreCase("RARE") ? "&9" : rarity.equalsIgnoreCase("EPIC") ? "&d" : rarity.equalsIgnoreCase("LEGENDARY") ? "&6" : "&f"; 236 | } -------------------------------------------------------------------------------- /AutoSwapBW.java: -------------------------------------------------------------------------------- 1 | Set blocks = new HashSet<>(Arrays.asList("wool", "planks", "log", "end_stone", "hardened_clay", "glass", "stained_hardened_clay", "stained_glass", "obsidian", "ladder", "sponge")); 2 | int lastSwapSlot = -1; 3 | int lastPlaceSlot = -1; 4 | ItemStack lastBlock; 5 | boolean placing; 6 | long lastSwap; 7 | 8 | void onPreUpdate() { 9 | if (!placing || inventory.getSlot() != lastPlaceSlot || lastBlock == null || !blocks.contains(lastBlock.name) || client.getPlayer().getHeldItem() != null) return; 10 | 11 | long now = client.time(); 12 | 13 | for (int slot = 8; slot >= 0; --slot) { 14 | if (slot == lastSwapSlot && now - lastSwap < 300) { 15 | continue; 16 | } 17 | ItemStack stack = inventory.getStackInSlot(slot); 18 | if (stack != null && stack.name.equals(lastBlock.name)) { 19 | inventory.setSlot(slot); 20 | lastSwap = now; 21 | lastSwapSlot = slot; 22 | break; 23 | } 24 | } 25 | } 26 | 27 | void onPostMotion() { 28 | placing = keybinds.isMouseDown(1); 29 | } 30 | 31 | boolean onPacketSent(CPacket packet) { 32 | if (packet instanceof C08) { 33 | C08 c08 = (C08) packet; 34 | if (c08.direction != 255 && c08.itemStack != null) { 35 | placing = true; 36 | lastBlock = c08.itemStack; 37 | lastPlaceSlot = inventory.getSlot(); 38 | } 39 | } 40 | return true; 41 | } -------------------------------------------------------------------------------- /AutoToss.java: -------------------------------------------------------------------------------- 1 | /* 2 | automatically tosses bedwars resources when enabled 3 | loadstring: load - "https://raw.githubusercontent.com/PugrillaDev/Raven-Scripts/refs/heads/main/AutoToss.java" 4 | */ 5 | 6 | int open = 0; 7 | int delayTicks = 0; 8 | 9 | void onLoad() { 10 | modules.registerSlider("Delay", " ticks", 0, 0, 10, 1); 11 | modules.registerButton("Iron", true); 12 | modules.registerButton("Gold", true); 13 | modules.registerButton("Diamonds", true); 14 | modules.registerButton("Emeralds", true); 15 | } 16 | 17 | void onEnable() { 18 | open = 0; 19 | delayTicks = 0; 20 | inventory.open(); 21 | } 22 | 23 | void onPreUpdate() { 24 | if (open++ >= 3) modules.disable(scriptName); 25 | if (!client.getScreen().equals("GuiInventory")) return; 26 | open = 0; 27 | if (--delayTicks > 0) return; 28 | 29 | Map inv = createCustomInventory(); 30 | HashSet tempitems = new HashSet<>(); 31 | if (modules.getButton(scriptName, "Iron")) tempitems.add("iron_ingot"); 32 | if (modules.getButton(scriptName, "Gold")) tempitems.add("gold_ingot"); 33 | if (modules.getButton(scriptName, "Diamonds")) tempitems.add("diamond"); 34 | if (modules.getButton(scriptName, "Emeralds")) tempitems.add("emerald"); 35 | 36 | for (Map.Entry entry : inv.entrySet()) { 37 | ItemStack item = entry.getValue(); 38 | if (item == null || !tempitems.contains(item.name)) continue; 39 | inventory.click(entry.getKey(), 1, 4); 40 | delayTicks = (int) modules.getSlider(scriptName, "Delay"); 41 | if (delayTicks > 0) return; 42 | } 43 | 44 | modules.disable(scriptName); 45 | client.closeScreen(); 46 | } 47 | 48 | Map createCustomInventory() { 49 | Map inv = new HashMap<>(); 50 | String screen = client.getScreen(); 51 | int inventorySize = inventory.getSize() - 4, slot = 0; 52 | 53 | if (screen.equals("GuiInventory")) { 54 | for (int i = 0; i < 5; i++) { 55 | inv.put(slot++, null); 56 | } 57 | 58 | Entity player = client.getPlayer(); 59 | for (int i = 3; i >= 0; i--) { 60 | inv.put(slot++, player.getArmorInSlot(i)); 61 | } 62 | } else if (screen.equals("GuiChest") && !inventory.getChest().isEmpty()) { 63 | int chestSize = inventory.getChestSize(); 64 | for (int i = 0; i < chestSize; i++) { 65 | inv.put(slot++, inventory.getStackInChestSlot(i)); 66 | } 67 | } 68 | 69 | for (int i = 9; i < inventorySize + 9; i++) { 70 | inv.put(slot++, inventory.getStackInSlot(i % inventorySize)); 71 | } 72 | 73 | return inv; 74 | } -------------------------------------------------------------------------------- /BedPlates.java: -------------------------------------------------------------------------------- 1 | /* 2 | renders the blocks covering a bed defense 3 | designed specifically for bedwars may not work properly in other gamemodes 4 | loadstring: load - "https://raw.githubusercontent.com/PugrillaDev/Raven-Scripts/refs/heads/main/BedPlates.java" 5 | */ 6 | 7 | Map> bedPositions = new ConcurrentHashMap<>(); 8 | Map searchedBlocks = new ConcurrentHashMap<>(); 9 | Map stacks = new HashMap<>(); 10 | HashSet yLevels = new HashSet<>(); 11 | boolean lastPressed; 12 | boolean display = true; 13 | boolean showCounters; 14 | int mode; 15 | HashSet invalid = new HashSet<>(Arrays.asList( 16 | "leaves", "water", "lava", 17 | "oak_leaves", "spruce_leaves", "birch_leaves", "jungle_leaves", "acacia_leaves", "dark_oak_leaves", // Leaves 18 | "torch", "redstone_torch", // Torches 19 | "wooden_slab", "stone_slab", "stone_slab2", "double_wooden_slab", "double_stone_slab", // Wooden slabs 20 | "fire", 21 | "bed", // Beds 22 | "piston", "sticky_piston", "piston_extension", // Pistons 23 | "log", "log2", 24 | "oak_stairs", "spruce_stairs", "birch_stairs", "jungle_stairs", "acacia_stairs", "dark_oak_stairs", "stone_stairs", "cobblestone_stairs", "brick_stairs", "stone_brick_stairs", "sandstone_stairs", "nether_brick_stairs", "quartz_stairs", "red_sandstone_stairs", // Stairs 25 | "redstone_wire", "daylight_sensor", // Redstone 26 | "wheat", "carrots", "potatoes", "beetroots", // Crops 27 | "farmland", 28 | "oak_door", "spruce_door", "birch_door", "jungle_door", "acacia_door", "dark_oak_door", // Doors 29 | "rails", "activator_rail", "detector_rail", "powered_rail", // Rails 30 | "ladder", "furnace", "chest", "trapped_chest", // Ladders and containers 31 | "sign", // Signs 32 | "dispenser", "dropper", // Redstone components 33 | "hopper", "lever", "pressure_plate", "button", // Redstone components 34 | "snow", // Snow 35 | "cactus", "sugar_cane", // Plants 36 | "jukebox", // Blocks 37 | "pumpkin", "jack_o_lantern", // Pumpkins 38 | "cake", 39 | "redstone_repeater", "redstone_comparator", // Redstone devices 40 | "trapdoor", 41 | "monster_egg", "stone_bricks", // Blocks 42 | "prismarine", "prismarine_bricks", "dark_prismarine", // Prismarine 43 | "sponge", 44 | "brown_mushroom_block", "red_mushroom_block", // Mushroom blocks 45 | "cobblestone_wall", // Walls 46 | "flower_pot", // Decoration 47 | "skull", // Heads 48 | "quartz_block", "quartz_pillar", "chiseled_quartz_block", // Quartz 49 | "anvil" // Utility 50 | )); 51 | 52 | int backgroundColor = new Color(37, 37, 43).getRGB(); 53 | int borderColor = new Color(52, 54, 59).getRGB(); 54 | double verticalOffset = 1; 55 | int maxDistance = 100; 56 | boolean autoScale; 57 | float scale = 1f; 58 | boolean alignTop; 59 | 60 | void onLoad() { 61 | modules.registerButton("Align Top Center", false); 62 | modules.registerButton("Auto Scale", true); 63 | modules.registerButton("Show Block Count", true); 64 | modules.registerSlider("Scale", "", 0.8, 0.1, 1.5, 0.1); 65 | modules.registerSlider("Render Distance", " blocks", 150, 10, 200, 1); 66 | modules.registerSlider("Y Offset", " blocks", 1, -10, 10, 0.5); 67 | modules.registerSlider("Mode", "", 0, new String[]{ "Static", "Toggle", "Hold" }); 68 | modules.registerKey("Keybind", 0); 69 | } 70 | 71 | ItemStack getStackFromName(String name) { 72 | return stacks.computeIfAbsent(name, key -> { 73 | try { 74 | if (name.equals("water")) return new ItemStack("water_bucket"); 75 | if (name.equals("lava")) return new ItemStack("lava_bucket"); 76 | if (name.equals("fire")) return new ItemStack("flint_and_steel"); 77 | return new ItemStack(key); 78 | } catch (Exception e) { 79 | return new ItemStack("barrier"); 80 | } 81 | }); 82 | } 83 | 84 | void onPreUpdate() { 85 | scale = (float) modules.getSlider(scriptName, "Scale"); 86 | maxDistance = (int) modules.getSlider(scriptName, "Render Distance"); 87 | verticalOffset = modules.getSlider(scriptName, "Y Offset"); 88 | autoScale = modules.getButton(scriptName, "Auto Scale"); 89 | alignTop = modules.getButton(scriptName, "Align Top Center"); 90 | mode = (int) modules.getSlider(scriptName, "Mode"); 91 | showCounters = modules.getButton(scriptName, "Show Block Count"); 92 | 93 | Entity player = client.getPlayer(); 94 | int ticks = player.getTicksExisted(); 95 | 96 | if (ticks % 20 == 0) { 97 | searchForBeds(); 98 | } 99 | 100 | if (ticks % 3 == 0) { 101 | findYLevels(); 102 | } 103 | 104 | if (ticks % 300 == 0) { 105 | searchedBlocks.clear(); 106 | } 107 | 108 | updateBeds(); 109 | } 110 | 111 | @SuppressWarnings("unchecked") 112 | void onRenderWorld(float partialTicks) { 113 | if (bedPositions.isEmpty()) return; 114 | float fontHeight = render.getFontHeight(); 115 | 116 | if (mode != 0) { 117 | boolean noGui = client.getScreen().isEmpty(); 118 | boolean keybindPressed = modules.getKeyPressed(scriptName, "Keybind"); 119 | 120 | if (mode == 1) { 121 | if (keybindPressed && !lastPressed) { 122 | display = !display; 123 | } 124 | } else { 125 | display = noGui && keybindPressed; 126 | } 127 | lastPressed = keybindPressed; 128 | if (!display) return; 129 | } 130 | 131 | List> sortedBedPositions = new ArrayList<>(bedPositions.values()); 132 | Collections.sort(sortedBedPositions, Comparator.comparingDouble(b -> (double)b.get("distance"))); 133 | Collections.reverse(sortedBedPositions); 134 | 135 | int size = client.getDisplaySize()[2]; 136 | gl.alpha(false); 137 | 138 | for (Map bedData : sortedBedPositions) { 139 | double distance = (double) bedData.get("distance"); 140 | double lastDistance = (double) bedData.getOrDefault("lastdistance", distance); 141 | double interpolatedDistance = lastDistance + (distance - lastDistance) * partialTicks; 142 | if (interpolatedDistance > maxDistance) continue; 143 | 144 | if (!(boolean)bedData.get("visible")) continue; 145 | 146 | Map layerCounts = (Map)bedData.getOrDefault("layers", Collections.emptyMap()); 147 | if (layerCounts.isEmpty()) continue; 148 | List layers = new ArrayList<>(layerCounts.keySet()); 149 | 150 | Vec3 position1 = (Vec3) bedData.get("position1"); 151 | Vec3 position2 = (Vec3) bedData.get("position2"); 152 | Vec3 bedPos = position1.offset( 153 | (position2.x - position1.x) / 2 + 0.5, 154 | verticalOffset, 155 | (position2.z - position1.z) / 2 + 0.5 156 | ); 157 | 158 | Vec3 screenPos = render.worldToScreen(bedPos.x, bedPos.y, bedPos.z, size, partialTicks); 159 | if (screenPos.z < 0 || screenPos.z >= 1.0003684d) continue; 160 | 161 | float currentScale = autoScale 162 | ? (float)Math.max(0, scale * (1 - interpolatedDistance / maxDistance)) 163 | : scale; 164 | float itemSize = 16 * currentScale; 165 | float itemPadding = 2 * currentScale; 166 | float boxSize = itemSize + itemPadding; 167 | float rectWidth = layers.size() * boxSize; 168 | float rectHeight = boxSize; 169 | 170 | float startX = (float)screenPos.x - rectWidth / 2f; 171 | float startY = alignTop 172 | ? (float)screenPos.y 173 | : (float)screenPos.y - rectHeight; 174 | float borderThickness = 3 * currentScale; 175 | 176 | render.roundedRect( 177 | startX - borderThickness, 178 | startY - borderThickness, 179 | startX + rectWidth + borderThickness, 180 | startY + rectHeight + borderThickness, 181 | borderThickness, 182 | backgroundColor 183 | ); 184 | 185 | for (int i = 0; i < layers.size(); i++) { 186 | String layer = layers.get(i); 187 | ItemStack stack = getStackFromName(layer); 188 | 189 | float itemX = startX + i * boxSize; 190 | float itemY = startY; 191 | 192 | render.roundedRect( 193 | itemX + itemPadding/4f, 194 | itemY + itemPadding/4f, 195 | itemX + boxSize - itemPadding/4f, 196 | itemY + boxSize - itemPadding/4f, 197 | 2f * currentScale, 198 | borderColor 199 | ); 200 | render.item(stack, itemX + itemPadding/2f, itemY + itemPadding/2f, currentScale); 201 | 202 | if (showCounters) { 203 | int count = layerCounts.getOrDefault(layer, 0); 204 | if (count > 1) { 205 | String txt = String.valueOf(count); 206 | float textScale = currentScale * 0.6f; 207 | float textWidth = render.getFontWidth(txt) + textScale; 208 | float textX = itemX + boxSize - itemPadding/2f - (textWidth * textScale); 209 | float textY = itemY + boxSize - itemPadding/2f - (fontHeight * textScale); 210 | gl.depth(false); 211 | render.text2d(txt, textX, textY, textScale, 0xFFFFFF, true); 212 | gl.depth(true); 213 | } 214 | } 215 | } 216 | } 217 | 218 | gl.alpha(true); 219 | } 220 | 221 | void onWorldJoin(Entity en) { 222 | if (en == client.getPlayer()) { 223 | yLevels.clear(); 224 | bedPositions.clear(); 225 | searchedBlocks.clear(); 226 | } 227 | } 228 | 229 | void updateBeds() { 230 | if (bedPositions.isEmpty()) return; 231 | 232 | Entity player = client.getPlayer(); 233 | Vec3 pos = render.getPosition(); 234 | Vec3 lastPos = render.getPosition(); 235 | 236 | client.async(() -> { 237 | for (Map bedData : bedPositions.values()) { 238 | Vec3 bedPos1 = (Vec3) bedData.get("position1"); 239 | Vec3 bedPos2 = (Vec3) bedData.get("position2"); 240 | 241 | double distance = pos.distanceTo(bedPos1); 242 | double lastDistance = lastPos.distanceTo(bedPos1); 243 | 244 | bedData.put("distance", distance); 245 | bedData.put("lastdistance", lastDistance); 246 | 247 | Block bedBlock = world.getBlockAt((int) bedPos1.x, (int) bedPos1.y, (int) bedPos1.z); 248 | boolean visible = bedBlock.name.equals("bed"); 249 | bedData.put("visible", visible); 250 | 251 | if (visible) { 252 | int delay = getDelay(distance); 253 | long lastCheck = (long) bedData.getOrDefault("lastcheck", 0L); 254 | 255 | if (client.time() > lastCheck + delay) { 256 | Map layers = getBedDefenseLayers(bedPos1, bedPos2); 257 | bedData.put("layers", layers); 258 | bedData.put("lastcheck", client.time()); 259 | } 260 | } 261 | } 262 | }); 263 | } 264 | 265 | int getDelay(double distance) { 266 | if (distance > 100) { 267 | return 4000; 268 | } else if (distance > 50) { 269 | return 3000; 270 | } else if (distance > 25) { 271 | return 2000; 272 | } else if (distance > 15) { 273 | return 1000; 274 | } else { 275 | return 1000; 276 | } 277 | } 278 | 279 | void searchForBeds() { 280 | if (yLevels.isEmpty()) return; 281 | List players = world.getPlayerEntities(); 282 | Vec3 myPos = client.getPlayer().getPosition(); 283 | 284 | client.async(() -> { 285 | for (Entity player : players) { 286 | if (player.getNetworkPlayer() == null) continue; 287 | 288 | Vec3 playerPos = player.getBlockPosition(); 289 | int startX = (int) playerPos.x - 20; 290 | int endX = (int) playerPos.x + 20; 291 | int startZ = (int) playerPos.z - 20; 292 | int endZ = (int) playerPos.z + 20; 293 | 294 | for (int yLevel : yLevels) { for (int x = startX; x <= endX; x++) { for (int z = startZ; z <= endZ; z++) { 295 | String blockKey = "1" + x + "," + yLevel + "," + z; 296 | if (searchedBlocks.containsKey(blockKey)) continue; 297 | 298 | Block block = world.getBlockAt(x, yLevel, z); 299 | if (!block.name.equals("bed")) continue; 300 | 301 | Block bedXPlus = world.getBlockAt(x + 1, yLevel, z); 302 | Block bedZPlus = world.getBlockAt(x, yLevel, z + 1); 303 | if (bedXPlus.name.equals("bed") || bedZPlus.name.equals("bed")) continue; 304 | 305 | Vec3 position1 = new Vec3(x, yLevel, z); 306 | Vec3 position2 = null; 307 | 308 | Block bedXMinus = world.getBlockAt(x - 1, yLevel, z); 309 | if (bedXMinus.name.equals("bed")) { 310 | position2 = new Vec3(x - 1, yLevel, z); 311 | } else { 312 | Block bedZMinus = world.getBlockAt(x, yLevel, z - 1); 313 | if (bedZMinus.name.equals("bed")) { 314 | position2 = new Vec3(x, yLevel, z - 1); 315 | } 316 | } 317 | 318 | Map bedData = new ConcurrentHashMap<>(); 319 | bedData.put("visible", true); 320 | bedData.put("distance", myPos.distanceTo(position1)); 321 | bedData.put("position1", position1); 322 | bedData.put("position2", position2 == null ? position1 : position2); 323 | 324 | Map layers = getBedDefenseLayers(position1, position2); 325 | bedData.put("layers", layers); 326 | bedData.put("lastcheck", client.time()); 327 | 328 | bedPositions.put(blockKey, bedData); 329 | searchedBlocks.put(blockKey, true); 330 | }}} 331 | } 332 | }); 333 | } 334 | 335 | void findYLevels() { 336 | List players = world.getPlayerEntities(); 337 | 338 | client.async(() -> { 339 | for (Entity player : players) { 340 | if (player.getNetworkPlayer() == null || player.getSwingProgress() == 0 || !player.isHoldingBlock()) continue; 341 | 342 | Vec3 playerPos = player.getBlockPosition(); 343 | 344 | int startX = (int) playerPos.x - 4; 345 | int endX = (int) playerPos.x + 4; 346 | int startY = (int) playerPos.y - 4; 347 | int endY = (int) playerPos.y + 4; 348 | int startZ = (int) playerPos.z - 4; 349 | int endZ = (int) playerPos.z + 4; 350 | 351 | for (int x = startX; x <= endX; x++) { for (int y = startY; y <= endY; y++) { for (int z = startZ; z <= endZ; z++) { 352 | String blockKey = "2" + x + "," + y + "," + z; 353 | if (searchedBlocks.containsKey(blockKey)) continue; 354 | 355 | Block block = world.getBlockAt(x, y, z); 356 | if (block.name.equals("bed")) { 357 | yLevels.add((int) Math.floor(y)); 358 | } 359 | 360 | searchedBlocks.put(blockKey, true); 361 | }}} 362 | } 363 | }); 364 | } 365 | 366 | Map getBedDefenseLayers(Vec3 position1, Vec3 position2) { 367 | boolean facingZ = Math.abs(position2.z - position1.z) > Math.abs(position2.x - position1.x); 368 | Vec3[] beds = { position1, position2 }; 369 | 370 | Map finalCounts = new HashMap<>(); 371 | int maxLayers = 5; 372 | int airLayersCount = 0; 373 | 374 | for (int layer = 1; layer <= maxLayers; layer++) { 375 | Map layerCounts = new HashMap<>(); 376 | int layerTotalBlocks = 0; 377 | int layerAirBlocks = 0; 378 | 379 | for (int bedPart = 0; bedPart < beds.length; bedPart++) { 380 | Vec3 bed = beds[bedPart]; 381 | int offset = (bedPart == 0 ? layer : -layer); 382 | 383 | Vec3 startPos = facingZ ? new Vec3(bed.x, bed.y, bed.z + offset) : new Vec3(bed.x + offset, bed.y, bed.z); 384 | 385 | for (int step1 = 0; step1 <= layer; step1++) { 386 | int yOffset = 0; 387 | for (int step2 = step1; step2 >= 0; step2--) { 388 | Vec3 pos1, pos2; 389 | if (facingZ) { 390 | pos1 = new Vec3(startPos.x - step2, startPos.y + yOffset, startPos.z - (bedPart == 0 ? step1 : -step1)); 391 | pos2 = new Vec3(startPos.x + step2, startPos.y + yOffset, startPos.z - (bedPart == 0 ? step1 : -step1)); 392 | } else { 393 | pos1 = new Vec3(startPos.x - (bedPart == 0 ? step1 : -step1), startPos.y + yOffset, startPos.z - step2); 394 | pos2 = new Vec3(startPos.x - (bedPart == 0 ? step1 : -step1), startPos.y + yOffset, startPos.z + step2); 395 | } 396 | 397 | String type1 = addBlockToCount(pos1, layerCounts); 398 | if ("air".equals(type1)) layerAirBlocks++; 399 | layerTotalBlocks++; 400 | 401 | if (!pos1.equals(pos2)) { 402 | String type2 = addBlockToCount(pos2, layerCounts); 403 | if ("air".equals(type2)) layerAirBlocks++; 404 | layerTotalBlocks++; 405 | } 406 | 407 | if (step2 > 0) yOffset++; 408 | } 409 | } 410 | } 411 | 412 | if (layerTotalBlocks == 0 || ((float) layerAirBlocks / layerTotalBlocks) > 0.2f) { 413 | if (++airLayersCount >= 2) break; 414 | continue; 415 | } 416 | 417 | for (Map.Entry e : layerCounts.entrySet()) { 418 | String blockType = e.getKey(); 419 | int count = e.getValue(); 420 | if (!"air".equals(blockType) && ((float) count / layerTotalBlocks) >= 0.2f) { 421 | finalCounts.merge(blockType, count, Integer::sum); 422 | } 423 | } 424 | } 425 | 426 | return finalCounts; 427 | } 428 | 429 | String addBlockToCount(Vec3 pos, Map blockCounts) { 430 | Block block = world.getBlockAt((int)Math.floor(pos.x), (int)Math.floor(pos.y), (int)Math.floor(pos.z)); 431 | String blockType = block.name + (block.variant != 0 && !invalid.contains(block.name) ? ":" + block.variant : ""); 432 | blockCounts.put(blockType, blockCounts.getOrDefault(blockType, 0) + 1); 433 | return blockType; 434 | } -------------------------------------------------------------------------------- /ChatCmds.java: -------------------------------------------------------------------------------- 1 | /* 2 | chat commands starting with '.' for toggling/editing modules 3 | loadstring: load - "https://raw.githubusercontent.com/PugrillaDev/Raven-Scripts/refs/heads/main/ChatCmds.java" 4 | */ 5 | 6 | String chatPrefix = "&7[&dR&7]&r "; 7 | 8 | boolean onPacketSent(CPacket packet) { 9 | if (!(packet instanceof C01)) return true; 10 | 11 | C01 c01 = (C01) packet; 12 | String message = c01.message.toLowerCase(); 13 | if (!message.startsWith(".")) return true; 14 | 15 | String[] parts = message.split(" "); 16 | if (parts.length < 1 || parts.length > 3) return false; 17 | 18 | String input = parts[0].substring(1).replace(" ", "-").toLowerCase(); 19 | if (input.isEmpty()) return false; 20 | 21 | if (parts[0].equals(".help") || parts[0].equals(".list")) { 22 | Map> categories = new HashMap<>(modules.getCategories()); 23 | categories.remove("profiles"); 24 | categories.remove("fun"); 25 | List modulesList = new ArrayList<>(); 26 | 27 | for (List mods : categories.values()) { 28 | modulesList.addAll(mods); 29 | } 30 | Collections.sort(modulesList, String.CASE_INSENSITIVE_ORDER); 31 | 32 | int page = 1; 33 | int items = 10; 34 | 35 | if (parts.length > 1) { 36 | try { 37 | page = Integer.parseInt(parts[1]); 38 | } catch (NumberFormatException e) { 39 | client.print(chatPrefix + "&eInvalid page number."); 40 | return false; 41 | } 42 | } 43 | 44 | int total = modulesList.size(); 45 | int pages = (total + items - 1) / items; 46 | 47 | if (page < 1 || page > pages) { 48 | client.print(chatPrefix + "&ePage out of range."); 49 | return false; 50 | } 51 | 52 | int start = (page - 1) * items; 53 | int end = Math.min(start + items, total); 54 | 55 | client.print(chatPrefix + "&eModules List (&3" + page + "&7/&3" + pages + "&e)"); 56 | for (int i = start; i < end; i++) { 57 | String name = modulesList.get(i); 58 | boolean enabled = modules.isEnabled(name); 59 | client.print(chatPrefix + "&7" + name + ": " + (enabled ? "&atrue" : "&cfalse")); 60 | } 61 | return false; 62 | } 63 | 64 | Map> categories = modules.getCategories(); 65 | String module = null; 66 | 67 | for (List modulesList : categories.values()) { 68 | for (String name : modulesList) { 69 | if (name.toLowerCase().replace(" ", "-").equals(input)) { 70 | module = name; 71 | break; 72 | } 73 | } 74 | if (module != null) break; 75 | } 76 | 77 | if (module == null) { 78 | client.print(chatPrefix + "&eModule not found."); 79 | return false; 80 | } 81 | 82 | if (parts.length == 2 && (parts[1].equalsIgnoreCase("list") || parts[1].equalsIgnoreCase("help"))) { 83 | Map settings = modules.getSettings(module); 84 | 85 | client.print(chatPrefix + "&b" + module + " settings:"); 86 | for (Map.Entry setting : settings.entrySet()) { 87 | String key = setting.getKey().toLowerCase().replace(" ", "-"); 88 | Object value = setting.getValue(); 89 | if (value == null) continue; 90 | String color; 91 | 92 | if (value instanceof Boolean) { 93 | color = ((Boolean) value) ? "&a" : "&c"; 94 | } else if (value instanceof Double) { 95 | color = "&e"; 96 | value = formatDoubleStr((Double) value); 97 | } else { 98 | color = "&7"; 99 | } 100 | 101 | client.print(chatPrefix + "&7" + key + ": " + color + value); 102 | } 103 | return false; 104 | } 105 | 106 | if (parts.length == 1) { 107 | boolean enabled = modules.isEnabled(module); 108 | if (enabled) { 109 | modules.disable(module); 110 | client.print(chatPrefix + "&7Disabled &c" + module); 111 | } else { 112 | modules.enable(module); 113 | client.print(chatPrefix + "&7Enabled &a" + module); 114 | } 115 | return false; 116 | } 117 | 118 | if (parts.length == 3) { 119 | String setting = parts[1].replace(" ", "-").toLowerCase(); 120 | String value = parts[2]; 121 | Map settings = modules.getSettings(module); 122 | 123 | String match = null; 124 | 125 | for (String key : settings.keySet()) { 126 | if (key.toLowerCase().replace(" ", "-").equals(setting)) { 127 | match = key; 128 | break; 129 | } 130 | } 131 | 132 | if (match == null) { 133 | client.print(chatPrefix + "&eInvalid setting name."); 134 | return false; 135 | } 136 | 137 | Object currentValue = settings.get(match); 138 | if (currentValue instanceof Boolean) { 139 | boolean newValue = value.equalsIgnoreCase("true"); 140 | modules.setButton(module, match, newValue); 141 | client.print(chatPrefix + "&7Set " + match + " to " + (newValue ? "&atrue" : "&cfalse")); 142 | } else if (currentValue instanceof Double) { 143 | double newValue = Double.parseDouble(value); 144 | modules.setSlider(module, match, newValue); 145 | client.print(chatPrefix + "&7Set " + match + " to " + "&e" + formatDoubleStr(newValue)); 146 | } else { 147 | client.print(chatPrefix + "&eInvalid value type."); 148 | } 149 | } 150 | 151 | return false; 152 | } 153 | 154 | String formatDoubleStr(double val) { 155 | return val == (long) val ? Long.toString((long) val) : Double.toString(val); 156 | } -------------------------------------------------------------------------------- /DamageTags.java: -------------------------------------------------------------------------------- 1 | /* 2 | damage indicators that float in the air 3 | broken in third person and shows in the gui, lazy to fix ask chef to add to the actual client dont ping me 4 | loadstring: load - "https://raw.githubusercontent.com/PugrillaDev/Raven-Scripts/refs/heads/main/DamageTags.java" 5 | */ 6 | 7 | Map playerHealth = new HashMap<>(); 8 | List> objects = new ArrayList<>(); 9 | int green = new Color(0, 255, 0).getRGB(), red = new Color(255, 0, 0).getRGB(), mode, colorMode; 10 | double yOffset, fadeDistance = 2.5, min = 0.7; 11 | float baseScale; 12 | long duration, fadeOutTime = 150; 13 | boolean showHealing, showDamage; 14 | 15 | void onLoad() { 16 | modules.registerButton("Show Healing", true); 17 | modules.registerButton("Show Damage", true); 18 | modules.registerSlider("Mode", "", 0, new String[]{ "Hearts", "Health Points"}); 19 | modules.registerSlider("Color", "", 0, new String[]{ "RAG", "Team"}); 20 | modules.registerSlider("Scale", "", 1, 0, 3, 0.1); 21 | modules.registerSlider("Duration", "s", 1.5, 0, 5, 0.1); 22 | modules.registerSlider("Y Offset", "", 1.8, -2, 3, 0.1); 23 | 24 | modules.registerButton("Depth", true); 25 | modules.registerButton("Box", true); 26 | modules.registerButton("Shadow", true); 27 | } 28 | 29 | void onPreUpdate() { 30 | yOffset = modules.getSlider(scriptName, "Y Offset"); 31 | mode = (int) modules.getSlider(scriptName, "Mode"); 32 | colorMode = (int) modules.getSlider(scriptName, "Color"); 33 | showHealing = modules.getButton(scriptName, "Show Healing"); 34 | showDamage = modules.getButton(scriptName, "Show Damage"); 35 | Vec3 me = render.getPosition(); 36 | long now = client.time(); 37 | 38 | for (Entity p : world.getPlayerEntities()) { 39 | String entityId = String.valueOf(p.entityId) + p.getUUID(); 40 | 41 | float hp = p.getHealth() + p.getAbsorption(); 42 | float health = hp / (mode == 0 ? 2 : 1); 43 | float lastHp = playerHealth.getOrDefault(entityId, hp); 44 | float lastHealth = lastHp / (mode == 0 ? 2 : 1); 45 | 46 | if (p.isDead()) continue; 47 | playerHealth.put(entityId, hp); 48 | 49 | if (p.getTicksExisted() < 2 || health == lastHealth || (!showDamage && health < lastHealth) || (!showHealing && health > lastHealth)) continue; 50 | 51 | float difference = health - lastHealth; 52 | String renderHealth; 53 | int color = health > lastHealth ? green : red; 54 | 55 | if (colorMode == 1) { 56 | String teamColorCode = p.getDisplayName().substring(0, 2); 57 | renderHealth = teamColorCode + formatDoubleStr(util.round((double) difference, 1)); 58 | } else { 59 | renderHealth = formatDoubleStr(util.round(Math.abs((double) difference), 1)); 60 | } 61 | 62 | if (renderHealth.endsWith("0")) continue; 63 | 64 | Vec3 position = p.getPosition().offset(0, yOffset, 0); 65 | 66 | Map object = new HashMap<>(); 67 | object.put("position", position); 68 | object.put("time", now); 69 | object.put("color", color); 70 | object.put("health", renderHealth); 71 | object.put("distance", position.distanceTo(me)); 72 | object.put("lastdistance", object.get("distance")); 73 | objects.add(object); 74 | } 75 | 76 | if (!objects.isEmpty()) { 77 | duration = (long) (modules.getSlider(scriptName, "Duration") * 1000); 78 | baseScale = (float) modules.getSlider(scriptName, "Scale"); 79 | 80 | for (Map object : objects) { 81 | object.put("lastdistance", object.get("distance")); 82 | Vec3 markerPosition = (Vec3) object.get("position"); 83 | double distance = me.distanceTo(markerPosition); 84 | object.put("distance", distance); 85 | } 86 | 87 | objects.sort((a, b) -> Double.compare((double) b.get("distance"), (double) a.get("distance"))); 88 | } 89 | } 90 | 91 | void onRenderWorld(float partialTicks) { 92 | long now = client.time(); 93 | int size = client.getDisplaySize()[2]; 94 | 95 | for (Iterator> it = objects.iterator(); it.hasNext();) { 96 | Map object = it.next(); 97 | long elapsed = now - (long) object.get("time"); 98 | 99 | if (elapsed > duration + fadeOutTime) { 100 | it.remove(); 101 | continue; 102 | } 103 | 104 | double distance = (double) object.get("distance"); 105 | if (distance > 25) continue; 106 | 107 | double lastDistance = (double) object.get("lastdistance"); 108 | double interpolatedDistance = lastDistance + (distance - lastDistance) * partialTicks; 109 | 110 | Vec3 position = (Vec3) object.get("position"); 111 | int color = (int) object.get("color"); 112 | String health = (String) object.get("health"); 113 | 114 | int alpha = 255; 115 | if (elapsed > duration) { 116 | double fadeFactor = 1 - ((double) (elapsed - duration) / fadeOutTime); 117 | alpha = (int) (230 * fadeFactor + 25); 118 | } 119 | 120 | if (alpha < 26) { 121 | it.remove(); 122 | continue; 123 | } 124 | 125 | if (interpolatedDistance < fadeDistance) { 126 | double scaledDistance = (interpolatedDistance - min) / (fadeDistance - min); 127 | int proximityAlpha = (int) (25 + (230 * Math.max(scaledDistance, 0))); 128 | alpha = Math.min(alpha, proximityAlpha); 129 | } 130 | 131 | color = (color & 0x00FFFFFF) | (alpha << 24); 132 | 133 | render.text3d(health, position, baseScale, modules.getButton(scriptName, "Shadow"), modules.getButton(scriptName, "Depth"), modules.getButton(scriptName, "Box"), color); 134 | } 135 | } 136 | 137 | void onWorldJoin(Entity en) { 138 | if (en == client.getPlayer()) { 139 | objects.clear(); 140 | playerHealth.clear(); 141 | } 142 | } 143 | 144 | String formatDoubleStr(double val) { 145 | return val == (long) val ? Long.toString((long) val) : Double.toString(val); 146 | } -------------------------------------------------------------------------------- /Denicker.java: -------------------------------------------------------------------------------- 1 | Set parsed = new HashSet<>(); 2 | Map noColorTicks = new HashMap<>(); 3 | 4 | void onLoad() { 5 | modules.registerButton("Show failed denicks", true); 6 | } 7 | 8 | void onPreUpdate() { 9 | for (NetworkPlayer nwp : world.getNetworkPlayers()) { 10 | String uuid = nwp.getUUID(); 11 | if (uuid.charAt(14) != '1') continue; 12 | 13 | String name = nwp.getName(); 14 | if (parsed.contains(name)) continue; 15 | 16 | boolean noColor = !nwp.getDisplayName().contains(util.colorSymbol); 17 | if (noColor) { 18 | int ticks = noColorTicks.merge(name, 1, Integer::sum); 19 | if (ticks < 200) continue; 20 | } 21 | 22 | parseSkinData(nwp, nwp.getSkinData()); 23 | parsed.add(name); 24 | noColorTicks.remove(name); 25 | } 26 | } 27 | 28 | void onWorldJoin(Entity e) { 29 | if (e != client.getPlayer()) return; 30 | parsed.clear(); 31 | noColorTicks.clear(); 32 | } 33 | 34 | void parseSkinData(NetworkPlayer nwp, String rawJson) { 35 | Json json = Json.parse(rawJson); 36 | 37 | if (!json.has("textures")) return; 38 | Json textures = json.get("textures"); 39 | 40 | if (!textures.has("SKIN")) return; 41 | Json skin = textures.get("SKIN"); 42 | 43 | if (!skin.has("url")) return; 44 | String hash = skin.get("url").asString().split("/")[4]; 45 | 46 | String displayName = cleanName(nwp.getDisplayName()); 47 | 48 | if (nicks.contains(hash) && modules.getButton(scriptName, "Show failed denicks")) { 49 | client.print("&8[&cDenicker&8] &r" + displayName + " &7is nicked."); 50 | return; 51 | } 52 | 53 | String name = json.has("profileName") ? json.get("profileName").asString() : ""; 54 | if (name.isEmpty()) return; 55 | 56 | client.print("&8[&cDenicker&8] &r" + displayName + " &7is nicked as &c" + name + "&7."); 57 | } 58 | 59 | String cleanName(String name) { 60 | while (name.matches(".*" + util.colorSymbol + "[0-9a-frk-o]$")) { 61 | name = name.substring(0, name.length() - 2); 62 | } 63 | return name.trim(); 64 | } 65 | 66 | HashSet nicks = new HashSet<>(Arrays.asList("4c7b0468044bfecacc43d00a3a69335a834b73937688292c20d3988cae58248d", "3b60a1f6d562f52aaebbf1434f1de147933a3affe0e764fa49ea057536623cd3", "19875bb4ac8e7e68c122fdf22bf99abeb4326b96c58ec21d4c5b64cc7a12a5", "dd2f967eee43908cda7854df9eb7263637573fd10e498dcdf5d60e9ebc80a1e5", "21c44f6b47eadd6720ddc1a14dc4502bd6ccee6542efb74e2b07adb65479cc5", "7162726e3b3a7f9c515749a18723ee4439dadd26c0d60e07dea0f2267c6f40a7", "10e62bc629872c7d91c2f2edb9643b7455e7238a8c9b4074f1c5312ef162ba22", "4336ff82b3d2d7b9081fec5adec2943329531c605b657c11b35231c13a0b8571", "173ec57a878e2b5b0922e34be6acac108372f34dace9871a894fe15ed8", "7f73526b1a9379be41301cfb74c55270186fbaca63df6949ce3d626e79304d92", "7d91aee3b51f3f8d92df52575e5755d97977dcdfb38e74488c613411829e32", "8e42e588e1d09ce03c79463e94a7664304f688caf4c617dbcbca64a635bbe79", "8f1f9b3919c879f4ec251871c19b20725bc76d657762b5ddfdf3a5ff4f82cb47", "989bc66d66ff0513507bcb7aa27f4e7e2af24337c4e7c4786c4630839966fdf7", "bdfc818d40b635bcd3d2e3d3b977651d0da0eea87f13847b99dc7bea3338b", "5841684ec6a1f8ba919046857dac9175514fef18a2c9395dc3e341b9f5e778ac", "211e121448c83125c945cd238dc4f4c5e9a320df5ee3c8c9ad3bb80c055db876", "3cce5c4d27979e98afea0d43acca8ebddc7e74a4e62480486e62ee3512", "68d98f9a56d4c0ab805c6805756171f4a2cdbf5fa8ce052a4bf4f86411fb080", "e2629467cf544e79ed148d3d3842876f2d8841898b4b2e6f60dfc1e02f1179f3", "6162abdfb5c7ace7d2caaabdc5d4fdfc32fb63f2a56db69f276167dffce41", "af336a55d17916836ce0ed102cbdb0fa6376544971301e0f28beb3899c649ff2", "1580729b12e1d6357e7eaa088fbf06ba2c8a2fb35b0ba4c5451937d3f134ca9", "1f72e604cdb4c49f7106b594ac87eff3ed6a1999255437241f57d28c45d103f", "542a699fe314b9f747eed89b9cae23fdefc27684f6c13dc4a29f5d057cc12d", "b2a4cd136505395a876113a800aa8ec15761ca3d945b57e0d0dcdcfeafd7a6d9", "907fcce8c3a8d337a6aff226847e3cc7c9bb6bd02f43be1b7c71b3dcd244e11", "62a6c3e6b8cbd4fbcb5866289642bb5b5a90dd16e2c28dc054c9d248943834f9", "173481eb7f2157a5ad79ec765d36be5736395b72ee519185e23f436ba15185", "9ad4ffb57819e7ff633f60b5901e44a3570573ad4d453075b72ae2cbd23c8a6d", "8c064476ed9de9ca437cf869127c61a945ea6c308e9b25e4a991bb252c6d754d", "9ddd647a59a93c23ce49cece35f7529985ee40d0ca7ead6a1e3fe0f97b286162", "c56ab25347aa70f406a85d221da104c5ff05d2a1866a1b57dc1ab4f5feb97", "7dcb1d264010bfac568d19e9baee3c2a2aaa729d6cf335b9cf62d2fb2f4c813", "fd22ca2c137a6ecf6a4366eb1f2c8a6b173220b295abc1ae13cedf93dabdbf3c", "7245bc1d62123b6f8c954cf08be76c9c0d23e778ca9843935a24782c8b2bab", "721d9bc16854e75bad69fc7529e3f4c82f32a4715f219697f413c67115a93", "e1aa418bd0b4f4d37d6853b7c577eac34034d2f64b6415ff653132f4ca66cd7", "c2159fdfe7ef9f12269e2791ebc5aca8e787506b28bfc69747ccf12671261afb", "8362ff7077a326747210c56031dc46a141f25454b27873395eda6483d55df", "6845756829b6bca516b5bf9251ae31c79cd6ddbc3c57f119370b0ccd8d6f5a1", "b77b40e51c7562e523efb0c0f94a616da97c1f485fd8b4a4ac9fb37561812", "48b34cc77a18dfa0ebb54f93c3c31779769f519f41b5153c1869aedec9965b2", "44d65b5b742333fa051b81b8365155618d4231becd9393283ec639b2f12b7f93", "dff36d1281f862f8841d2b84ce17c560e45cd0b3fd879c78c13d26b7c7f7cbfe", "1cdeb260f0b31796aca16be0c79ea0169b6f6542fef743c09c4238ad2114a49f", "1ab96446ecc368e4c685239fb6d14f7adbf337fb343da95285eec68dd79c4a", "7e9437c77b2529da8dbb0545f2898e9a2d12e667f8e6f69f051ced32acfde", "b5f0d648162c98c6ee9cb31c4e5cead456dd105a37f7ce8a7a09d384a47b8b2", "7f9712869fb1ffbd4905342aca6b7a4f5e47ee9ea7dae5e752c7b9e9bbcea", "5485ef7d262e19a65756ec94338777f93b16f64da2783189d0ee34b816b357", "869b276cbe44c4a5918beb106e625ae36f829e7c7bcdfad8b67565f48430b199", "243ad02c2f5bf1a4b8225a1f6243d507e707fda68237f2aa738467c956be10", "dd80f354e47a8b66bddb43ff38d972487aa1105d1eebdb7a26844c140d888e0", "32aba3b2955a782f0a3a37bfa9c4173919bdc4827c99bee5670169ec4e181dc", "c9939c9d2d9e5e5fb689b12d89e9edf08c915866b7661545fe46e88ab1551", "c61aec3d73110435b3c549f7bb70d4aa6d6e6c404590b34be63e6ab42c2946", "c96522d14a7a21f59fc2c66ef82fbe62263c9d7d064f823b7c1a614e409099", "5a75720a749dca3fee845d6d7e9b2234542f1a2d7d948f040c5ca3e493f5e4", "4a213a331b92693ec8f534f627803ac8492df0916b70a762e28aff6a5d8ea2", "c149f0fe3a696fad6fd6ad7858ff788b6d15129207b5f72b0d7d7f983e1b", "6c175165d75062a323c5865916162ce7eca5e6ac224440c8b0536c96530d33a", "acf665de64faf18cbfd1d13598fd4552566c878fbc3716f52587e2cbae44b9", "ff167fcbb98ecd6377905add5c15459e3fb815a0b7c9142e8037a818945630e", "3e8a56d37decce24f73e3e97e67812a2f5a1384a525f4c0e58cd3fdeffc38", "4d6e309a40b631ec6cb5be74e22b883da452f43acf4e834f43c1cb25c8f82a", "7417341979bb41714df892d4994d63347006be8bd7f2cfb65b826d2b21172", "fe74c2edd110608e523ce6b6b31f528cb38a122941ede2d68d61ba52bd6802e", "04426382d98452d90ef2cdb492af67853ca8542972595351acc6cbf88f51532", "c35dd24dc529b664504bfd3315b3fe8ca9c6c9b9fe1e84ce6aea216ef7bd3", "d2498d91a41fdb77f58c9da73073cc3f287b93ee12ccbfa6473d55019454b1d", "3fca4000b6c9b5c7d57f29245bb9ee00af282e351d697a44031d15a1384eb3e8", "f3e399b37b4fba7d2fd0ed14f8a6820131d6c9a355282704c59796f092677542", "1561ee2ea67346c667b4e96d85847b7b51372b605fe34ae046c8c0d0d2973d", "40f836d124597ab614e97ab9bae81bcfacfb9a5cb87b8ce9fc50e5ab93c53dae", "52ff1cf6537438f4aff7c2cdcdc84cca8f42f9aa264913827981ace5876f71", "8983c344fe3bb69d16caa51766a5bf371ec9075496a061334db9f9a44711", "76acbc4d98a2deab2b2b8e7798d5b9ae54e1d5710c9b0e93c243461405d4519", "b4c815e8e24ecc26ce18a35a938a5d8b6f96e9c8467841be37699d83e43d", "16b5b6a89aa283548411eef311b2ab46216a7b0538452b249386895b917cf2", "5ff1fd2453f6d85961de8976bce16c5d514e38ad7f846e99317ca4a3b5889", "1b144c7532ec233ffb5c52e69e3d98be12d52481fd5113703f21e1ec850b6", "64316ffd3ede6158b3eb421b97cbf9b82dd93e08d54b3f9f0105c75f134f89c", "b6966498a988780cd1dcf4ea059eeec6497fe14b95c32470bc6d99b17ff1", "b9ec71e4727fde6edef0d08f25561c4ba6eb21583fd9fae443e566c79d88e160", "3385c509e1b649552c750dc23c344d24d158df94f6d8532377a9b726462bc05b", "59f87bef785eddc72f2289b8482375266bc3ceed365c270c5ef7f835df39", "27d4d629ac756da03d894556535bcca033fdaf172e69cc772262b43918ede351", "af43feeb32559878e0561c87f8f35c9812973bf27661d874bf68bb569b333f45", "ef1f3805eb46853b22559404b373c54b12453c4882abf3dd7673f5869be4cd", "7265757c8a5a826f9e2b68e4631fee33e74dcbfcd9e4c744360186f4ff58fa1", "3bf9314d6f78711c93d895519bc620a8176819551dc1d498aea840f32cf0d917", "ae97b72b9972d5db2516ceda54c6837116c2c52e75763749de9949aaab95d0", "6512d4661323db375b829bf2e090f7c3a277f95d3a5613ae59a06d9a9a270", "bf948ef3d865729d4120179087c0323a4cb913119932aa620dd9accef7d528a", "bb9688ec3a8fb8f18887377bd5be94a56fafb267d870c0532c356cc35adc", "4097a9b1113fa753d37d613ab9e118f0d05d3f5276f965f6466bb25d313a0a9", "40952ce63957766d68819e9e033429db2f9a472b3646d856e8b839088de699f", "59c13c5c833d4205fb899fe6a329f136c5c67ce0dd86efb834684686ead2d", "762b16ce467a4096e188f9c12351e66fce8ef1e18b6e9788befe4666c68876", "80516a7b5faf2cc796650c51c167773ba8c8e73e94b10d96d3e9d827dd63c5", "5a956dc2631e54a3cb62d31390226b5cc052432fc7b9261da4bf6420f8d7e8", "156c183d1064d9d72e25de3945ef16483c15eb06b6c87396ab4ba1f8e9b6df", "1d387e3e5b89925ce6519cfb4378af11abed6e4b7ae3491f93048971a2e80e7", "8fcdcc72bfd5192d752d1a5eac7c11115c9aa43d574dfa85f99f2896c9b15", "b6557aa1aaf5fe97745da389ab69473ef9f5ec31960be2860a5c8bd6ed37", "a191322292ab595ff53c704b85f514f5b9f45470332ac2719eb85e92df4023", "93e15c711b3a37d5634a1b629cb9e43f793f297dd3369c2bdd9b4bba80fa6b", "489fd1a12c42e0fed383e9d23bacb95815fb752213849ddaa8b5893ac7eba24", "fbd1fa49884dacaed4cc4650d23bfea4dc7a89dce8d90a2e27acfb712e8f8", "daa35aa45c2d7092e359962e79d11842ed18ce499aacff22c5871662f7a69dd", "447374bbeadeaa36684d3f68eb46bed5b7d145a206d5a54b9c12382d6b1f9dce", "9c8f4d6466382820536e82842a162615c2e7d2316afc59264a9c3ede", "997eb6a7b37bc8924ed341a4a0a356112b620bbc121b5ce27e692a535d2df81", "adc9c2fd56f6698f5807012e4dd2e785e5efe1e6799b47cd1c3bdb1c05eda3c", "2d13cdd15b5673a27a63c04226e3b2b3639ac27fb853d1a146a239496da1ff", "238580ddf446509b4c84e829b39a8b2f72ab8cd649dca6886405dd2ad2dcd5", "241c4fdecb52afd81b24993b5a7e6c715f375d94f4eafab39a60bb2b5050e9", "d2447fe1ee25c2476525e78aa71bd2f56bdec3b5f829215650642563698d272", "f515cc3ace7a74afe76e41c117dace9f278b63c1829d30b246bd7d73584cf2", "9691b4eada776b725eb2a5fdda77af65b87ccfde6ccb76c75fbe4da347723", "344f6ae0fa81aadf8a2197e656cb8e696d18f12e2a87ab42c41b64b61c688", "6b76f913d7c02718c7cf9a8087db3dc246d9eb89febefd28abfd59226559548", "eed8565e62768584c3a933227e1747165dd86e3942a93f52e4285ba65cd2662", "8fee25beac53be9a196b5319e9887eaff50cb19a61ad5d88bb57fe431c8a8", "e32379103e70b548a716a1c8d477b611c44c6d1925e978f1164362f22564b9", "c8424766a87919285dd9f92e4c8868de558d87c739d76668b532f7c21a490", "ad369862824c34b9354edc9cb14832364dc74cf867863210c1a83dc3ebcd22c3", "a17d731aef41184853bafa292fa9f46c6c56912cdd1bb4cd43e53c88ba82cc6", "ff642bf35a3e622515bb1f20356534fc3f24316b3eb170f477f336ec26edf9d6", "dd222e15fa6d522d9bc3a674d1a9327bbee733b396246e40af1fce716bef9b", "7fd6bf7bc58c661dbef8b8896eb2ccd31229a3e8b09e54d769c1e46242348277", "4e5223efd125cba238eea12334f9e856718842281d7f865db3c6d577ed5e084", "689026f3bf84461b773a3e7915da121dde4a3371598a8431cd5e8951ea549", "80c86c1d62b71928d6251ef238434e226fa9fe3041964625d8a0e550d8f528", "d275c5282d3ce248ecec75b82a44c2e70497c76565c993618316ca12a1efb8a", "4c232f62387b2ac54c371beaaa0577fe7778a3c6954b34914c3e016b84f6f46", "2ecf8d5923446aba9eeef5a24848b84b20bbc37c80ca62e9e664375c24dc7077", "d5fab8a6fc9ec343f7ccecd86a0f5cc339d11a02c8fb0ba1ed5cb446d01ae0", "ddeb44d8f85ee1b918dcd231eb62887e2e2df63df8c91d11461111f710c9f2ac", "c25c40b36da47d6a982c86a319d6fe5e4916df411fbbf656451bd6049d6d179", "5fe8b3813cf0c55cdf2c97789735d62085767323cd9af8da804669592ac45f", "7cbe75103d02c10dd410fc5760139212fbeda8d91ee752e53e4674aecfa30", "35873a599e65596b99080d86f5b5ecfe162a8235a136bb4990fb8e2325965b", "f813e90a33dce8bca6a6c688683706498e1f2aaec8530c481c2a80faa82ddebc", "99a5daa3fe44c414ca8f4324c36bced2afe6d962a580842d8a36c5d9c1b8be0", "672d94becd9f61dec864a8232692fb1c54ff4676ade457ae6847f7d9d954a8d", "b0a74cd03493521b451cbf256775e93809a203672e837e0eb46c590e5f0928f", "f3a01fd5a6267170ff7c6526d3a9ee4ee4403e036955f902c9414c064d9449be", "bfd4e3b0527bd94824e530968f2281ce8e3dd9a3f6b73fb23e6cc15b7c79d2c", "4fda29ceab6ca457da30882493c5129287277895ebd3f244456126666a6", "79b7861ac71a511be1b88823549fbbbbc8a300dccc0e873322ea2a7859d686cc", "3debc1619533fe5f011783e43e526efad44bf49ace9e5ca10badd7f55e069", "dbc1c832b4919315df977aedc7ece84d9aabef8823cc9de5ceee5129b1728", "7a27c712e9446026aa38afd114d76cef0b96bdbfe58adbf73a9a9149684eac3", "b78e4089143163c32291d6365e715e1b42806a40784ff93b8737947c7687e9", "3a3d66c09223d0899b896487505fda388584941ec946534d2a9e277133fe02e", "1ae5861b10c43426dc4345aa49585d818886a1fa4599c8ada0b2fcbf69b81", "a7924326aca6415f34b017573996f333ad1c8db9bf46d4fa216493faafbc9fd", "62cc348490c1d2bf32daed40eae64bf812c3ba23abda3653a1335af6f2123b", "c9b2b946ab9aebc76084157641aceed34e83185d958fc2f225c2595c8171d6", "81895e92fc1552fe1dcd531f6775e1266146b75812c58795a1b0a3bef922b79f", "8569245371edff63a26913a972f2c44fbe41f75e42668a72599759cf452f3a", "2470257f2b1ea354f4a1c5e0e1ee207d162f669a83e440a913cd87f58f52ffd9", "1670d1f3de92402e51e780b2e6699dabbc79fb44dca1c273f5cbde64258aa", "dc3938ebca030fe937c77b9876d456e19e9b6588f3ee8ec993bace98ccae4e", "1ad471136cdf5e9dec7b30c841f2b9af1aab09b9f369fa24aa52a98f4b0afe1", "c828ea469bef8c84eee8e9abf66788c7991789d8f3a21ab460789a0b14884", "16c63d6591c8e7e3a1b8825e43bb8dc8ac561ab567a9cda57cf783031e0", "62604b8b7df3da89a0a85ed8152073da59f31774cdcfec66951edd572a72957", "4b28dc744eb31957b74a14bcfc2320b451f5b6859a158fd8bab28dd873f71b", "3d4a203011d23899e4f02065324b4c9e97228f2ab2cef1eb366c8edbaad26d", "b6ed84678adf2445348963fc343a6f44e8631a1d7fd25f377d824e9bde37e", "34f889c53b26a7b68569a51be9a5d17d3fca371df6dc615183e2b437530", "b7d33aa3cf94603b6bbaccdda885c33bdba3baf6f866b9c1dc64816cf47e7fa", "bd2730d152b782f5e6f26e5d22f49d3da81ada8cb193fecd37189a72b9a7c", "49e3bd98686d1146b9337c9652899a12f28fe59e42f123578e8981652510e5", "4c4d84cc6798da26511812353857e7630544ecbb93a7d9a5a44e0a8bddf3", "de915d709d818429c09838c6341ce6c4abf41e450def2dbb4c12adee5745fb", "f1d8494d382feb5e7434daa2fe553b4d6b51269717cd12309d331399efdbbd49", "c41043fb371ce1d6bc2b5e3c38c116177a71aba9c2e9511188f9e15955131", "a5e77eca3a8571b6ea72a2d1d41429323c610d35477191d5191faa9745d772", "f42d8249035be11d50ef8c2a947d1ffe3eb8d91989de5b27748190eb231295", "2e24edaf3df936127c1be1097bc798411719489a1652139ebd6f8dd21fda71b", "14ea486fef4c37c771f23968df9d47358111d3cac57c458c57b6a2c7dc9970", "7dc27a418be63cd1ece8d2daf106c5b369db846c6c141d2bde4d81c83eff", "f911f9329b391d8b6e30d55ab9f20608d620d682c9327514b5ab9d1b7ed360d3", "c0554e6189ce7ba79de273dcac358f2985771d3e3cec7ff8b4c953bf6d5c5", "f60648e541171fb69121794cc8894c3168ba841c897cbb457819172d9df3", "7c5aeae0e15227404b1f1c59c93e9ffce83c7433feb5649ecc2ddc1af6e2c7", "9960335e7981e3c82b03a59bce8aad04b893efc9928e825498199d59627079", "579a5713ed8affbfe8bbcd432def758ec4a31647db4f7dda4df7535a3fa0f58f", "7fb832fa27791731e34a1adaf6f59c1a95e6e5aa46d528f6c2975d668bc1", "cae2c0eb1730e11888e3f4dc133e9c5fd1434beb19b1616b026412fafc8e87", "7ca423e35c767d5844f8bb9a3c949710e8615847e3f6db117591ce53c30f9e1", "cf9de3c33c4b523248fc7dc23f18c551f1d2740cfeb162674aad031852e", "f4254838c33ea227ffca223dddaabfe0b0215f70da649e944477f44370ca6952", "fd41e45153cb159af3d2b3d0e4210969fc4a6402a327c5ab6d1f6981ceae7929", "6437c4b8eba97a3f79a49074d8c9c6c7ededabffe2896161256d426014f52dfc", "8b1ce430410e2416c1c0ae1ad2b91621e128b9c8a46e32dfee9a6e777eab6cf8", "1e1408a4152663ccd1169965eabd5815216913bf9f9374d499ed3160a562cef9", "e814f4ac1be28dd2ee5d6d297265d2efac52c36035a60bd919961914ea226ef", "8958ea6b50dbb139ec56c20fa3d61d4902c30d4ee234d8009180bd9c37f33708", "a7556d263c98a1d3b12236b56f613c516d91c755d4d7555eff0788da9c134f2f", "6e0b2d4281ad9a090037ef0985fc0667e43c4762c083d34daaa6cd05d5e53055", "7ae4fce4ecdfcf9e27e8723061fe43236ec937004cd0e016c7fd924587a34c5d", "adcebc4e9a583d84ee7083b5540b8de8499f9ed4e02619213219c2c6eb081821", "c6e4f799a1019320407a035ee54350b3a507523c7d5625f13b372a7b215402c9", "23c7a66adf72ebe7338b23a34e5bf02827433c805e8b63c2a19ed9617df26b2f", "81280cc515d765b001c9f628a4f488b1a910effd38bc24e0b5aa64252e68068", "2dc567c2c3ee555d22944a5d9238c3d27915f5076f5ced1687471afd0dc605d4", "fb44f9b19f45f1356f9c5c85ff2137018068e50c84ff0b2ae7d9ce0f33629d34", "52b273741996ce877d63a8651e94ba3c55fee196c34fd52b78c0aa06c5fd550", "48cc9961ec54f340f0d35239562d92748e92c6e2d6aa7aac884c414ae949618e", "a8485f852d273ab6223517c0d84c4c13f704ea5e40a7431c5012bb2e86250445", "8fba7e9fa894246022930de1320368d013544d6953f192c62561c1423bb44dd5", "3ef953f0f2d9bdc2d2156952d7aae3fb438216a47108cbf0a0348f26e018049b", "2ab3f698e25c02439c7b2dbd7b6648e2ecb3ddcc34e638ed4d116b0b409aeb25", "2585c58e856754f3d7e36f427caa95aab8ff19781a1ba645acb428e86452b5a0", "99e3b82da73910648899e454691e68f8d15f276dc9aab1435feff8a047948a40", "75867d2c0a93cc99e05a86d55637e7f47fef7c9f98a9e5158dc36dd1b414bd90", "b283088987c25b6153bbc1261864bc1764985dc4dd94bd5ebe040f598f7c4d59", "5b71b9a4ff7292f7c4955407a97acc93d2784620a53367117713bfa07d0909c2", "b1732d69af0612111e8f15ccc105013fe2ce08c4c65b65833b6456e4f01238ef", "519d503b6cd7565119361cf6b51ef8d294a951b4b512d2727f28b5cc9d784626", "d2da19710b8a4171ac9b17984dd95d042d92742d72a74ba40450d7494a24321", "1d9e8dafe7d87bb7cba7eb3d8d2d5bf58eab72ecdfdf9ecce3d1c03871c0")); -------------------------------------------------------------------------------- /HalloweenSim.java: -------------------------------------------------------------------------------- 1 | /* 2 | renders candy in hypixel halloween simulator 3 | loadstring: load - "https://raw.githubusercontent.com/PugrillaDev/Raven-Scripts/refs/heads/main/HalloweenSim.java" 4 | */ 5 | 6 | List skullList = new ArrayList<>(); 7 | int orange = new Color(255, 100, 0).getRGB(), 8 | green = Color.GREEN.getRGB(), 9 | yellow = Color.YELLOW.getRGB(), 10 | red = Color.RED.getRGB(); 11 | boolean sentPacket; 12 | double range; 13 | boolean looking = false; 14 | float serverYaw, serverPitch; 15 | 16 | void onEnable() { 17 | serverYaw = client.getPlayer().getYaw(); 18 | serverPitch = client.getPlayer().getPitch(); 19 | } 20 | 21 | void onLoad() { 22 | modules.registerButton("aura", false); 23 | modules.registerButton("rotations", false); 24 | modules.registerSlider("range", "", 5, 1, 10, 0.5); 25 | } 26 | 27 | void onPreMotion(PlayerState state) { 28 | if (!checkStatus()) return; 29 | 30 | Entity player = client.getPlayer(); 31 | double threshold = modules.getSlider(scriptName, "range") * 1.5; 32 | double reach = Math.pow(modules.getSlider(scriptName, "range"), 2); 33 | range = modules.getSlider(scriptName, "range"); 34 | 35 | Vec3 playerPos = player.getPosition(); 36 | playerPos.y += 1.62; 37 | sentPacket = false; 38 | skullList.clear(); 39 | boolean shouldRotate = modules.getButton(scriptName, "rotations"); 40 | 41 | for (TileEntity tileEntity : world.getTileEntities()) { 42 | if (!tileEntity.name.equals("skull")) continue; 43 | 44 | Object[] skullData = tileEntity.getSkullData(); 45 | if (skullData == null || skullData[2] == null) continue; 46 | 47 | Vec3 skullPosition = tileEntity.getPosition(); 48 | double distanceSq = playerPos.distanceToSq(skullPosition); 49 | 50 | if (modules.getButton(scriptName, "aura") && !sentPacket && distanceSq < reach) { 51 | if (Math.abs(playerPos.x - skullPosition.x) < threshold 52 | && Math.abs(playerPos.y - skullPosition.y) < threshold 53 | && Math.abs(playerPos.z - skullPosition.z) < threshold) { 54 | 55 | if (shouldRotate) { 56 | float[] rotations = getRotations(skullPosition); 57 | float unwrappedYaw = unwrapYaw(rotations[0]); 58 | 59 | float deltaYaw = unwrappedYaw - serverYaw; 60 | float deltaPitch = rotations[1] - serverPitch; 61 | 62 | state.yaw = serverYaw + (Math.abs(deltaYaw) >= 0.1 ? deltaYaw : 0); 63 | state.pitch = serverPitch + (Math.abs(deltaPitch) >= 0.1 ? deltaPitch : 0); 64 | 65 | if (!looking) { 66 | client.sendPacketNoEvent(new C08(player.getHeldItem(), skullPosition, 1, new Vec3(0.5, 0.5, 0.5))); 67 | looking = true; 68 | } else { 69 | looking = false; 70 | } 71 | } else { 72 | client.sendPacketNoEvent(new C08(player.getHeldItem(), skullPosition, 1, new Vec3(0.5, 0.5, 0.5))); 73 | } 74 | 75 | sentPacket = true; 76 | } 77 | } 78 | 79 | synchronized (skullList) { 80 | skullList.add(skullPosition); 81 | } 82 | } 83 | } 84 | 85 | void onRenderWorld(float partialTicks) { 86 | Vec3 playerPosition = client.getPlayer().getPosition(); 87 | 88 | synchronized (skullList) { 89 | for (Vec3 skullPosition : skullList) { 90 | int diffX = (int) Math.abs(skullPosition.x - playerPosition.x); 91 | int diffY = (int) Math.abs(skullPosition.y - playerPosition.y); 92 | int diffZ = (int) Math.abs(skullPosition.z - playerPosition.z); 93 | 94 | int color; 95 | if (diffX > 40 || diffY > 40 || diffZ > 40) { 96 | color = red; 97 | } else if (diffX > 20 || diffY > 20 || diffZ > 20) { 98 | color = orange; 99 | } else if (diffX > range || diffY > range || diffZ > range) { 100 | color = yellow; 101 | } else { 102 | color = green; 103 | } 104 | 105 | render.block(skullPosition, color, false, true); 106 | } 107 | } 108 | } 109 | 110 | void onWorldJoin(Entity entity) { 111 | if (entity == client.getPlayer()) { 112 | skullList.clear(); 113 | } 114 | } 115 | 116 | boolean onPacketSent(CPacket packet) { 117 | if (packet.name.startsWith("C05") || packet.name.startsWith("C06")) { 118 | C03 c03 = (C03) packet; 119 | serverYaw = c03.yaw; 120 | serverPitch = c03.pitch; 121 | } 122 | return true; 123 | } 124 | 125 | void onDisable() { 126 | skullList.clear(); 127 | } 128 | 129 | boolean checkStatus() { 130 | List sidebar = world.getScoreboard(); 131 | return sidebar != null && util.strip(sidebar.get(0)).startsWith("HALLOWEEN SIMULATOR"); 132 | } 133 | 134 | float[] getRotations(Vec3 point) { 135 | Entity player = client.getPlayer(); 136 | Vec3 pos = player.getPosition().offset(0, player.getEyeHeight(), 0); 137 | double x = point.x - pos.x; 138 | double y = point.y - pos.y; 139 | double z = point.z - pos.z; 140 | double dist = Math.sqrt(x * x + z * z); 141 | float yaw = (float) Math.toDegrees(Math.atan2(z, x)) - 90f; 142 | float pitch = (float) Math.toDegrees(-Math.atan2(y, dist)); 143 | 144 | yaw = ((yaw % 360) + 360) % 360; 145 | return new float[]{ yaw, pitch }; 146 | } 147 | 148 | float unwrapYaw(float yaw) { 149 | int scaleFactor = (int) Math.floor(serverYaw / 360); 150 | float unwrappedYaw = yaw + 360 * scaleFactor; 151 | 152 | if (unwrappedYaw < serverYaw - 180) { 153 | unwrappedYaw += 360; 154 | } else if (unwrappedYaw > serverYaw + 180) { 155 | unwrappedYaw -= 360; 156 | } 157 | return unwrappedYaw; 158 | } -------------------------------------------------------------------------------- /HitSelect.java: -------------------------------------------------------------------------------- 1 | boolean set; 2 | double val; 3 | boolean sprintState; 4 | 5 | void onLoad() { 6 | modules.registerSlider("Mode", "", 0, new String[]{"Prioritize Second Hit", "Prioritize Critical Hits", "Prioritize WTap Hits"}); 7 | } 8 | 9 | boolean onPacketSent(CPacket packet) { 10 | if (packet instanceof C0B) { 11 | C0B c0b = (C0B) packet; 12 | if (c0b.action.equals("START_SPRINTING")) { 13 | sprintState = true; 14 | } else if (c0b.action.equals("STOP_SPRINTING")) { 15 | sprintState = false; 16 | } 17 | } 18 | 19 | if (!(packet instanceof C02)) return true; 20 | 21 | C02 c02 = (C02) packet; 22 | if (c02.action == null || !c02.action.equals("ATTACK")) return true; 23 | 24 | Entity target = c02.entity; 25 | if (target == null || target.type == null || target.type.equals("EntityLargeFireball")) return true; 26 | Entity player = client.getPlayer(); 27 | 28 | int mode = (int) modules.getSlider(scriptName, "Mode"); 29 | boolean allowAttack = true; 30 | switch (mode) { 31 | case 0: 32 | allowAttack = prioritizeSecondHit(player, target); 33 | break; 34 | case 1: 35 | allowAttack = prioritizeCriticalHits(player); 36 | break; 37 | case 2: 38 | allowAttack = prioritizeWTapHits(player, sprintState); 39 | default: 40 | break; 41 | } 42 | 43 | return allowAttack; 44 | } 45 | 46 | boolean prioritizeSecondHit(Entity player, Entity target) { 47 | if (target.getHurtTime() != 0) return true; 48 | if (player.getHurtTime() <= player.getMaxHurtTime() - 1) return true; 49 | 50 | double distance = player.getPosition().distanceTo(target.getPosition()); 51 | if (distance < 2.5) return true; 52 | 53 | if (!isMovingTowards(target, player, 60)) return true; 54 | if (!isMovingTowards(player, target, 60)) return true; 55 | 56 | fixMotion(); 57 | return false; 58 | } 59 | 60 | boolean prioritizeCriticalHits(Entity player) { 61 | if (player.onGround() || player.getHurtTime() != 0) return true; 62 | 63 | double fallDistance = player.getFallDistance(); 64 | if (fallDistance > 0) return true; 65 | 66 | fixMotion(); 67 | return false; 68 | } 69 | 70 | boolean prioritizeWTapHits(Entity player, boolean sprinting) { 71 | if (player.isCollidedHorizontally()) return true; 72 | if (client.getForward() != 1) return true; 73 | if (sprinting) return true; 74 | 75 | fixMotion(); 76 | return false; 77 | } 78 | 79 | void fixMotion() { 80 | if (set) return; 81 | 82 | val = modules.getSlider("KeepSprint", "Slow %"); 83 | set = true; 84 | modules.enable("KeepSprint"); 85 | modules.setSlider("KeepSprint", "Slow %", 0); 86 | } 87 | 88 | void resetMotion() { 89 | if (set) { 90 | modules.setSlider("KeepSprint", "Slow %", val); 91 | modules.disable("KeepSprint"); 92 | set = false; 93 | val = 0; 94 | } 95 | } 96 | 97 | void onPostMotion() { 98 | resetMotion(); 99 | } 100 | 101 | boolean isMovingTowards(Entity source, Entity target, double angleThreshold) { 102 | Vec3 sourceCurrent = source.getPosition(); 103 | Vec3 sourceLast = source.getLastPosition(); 104 | Vec3 targetPosition = target.getPosition(); 105 | 106 | double motionX = sourceCurrent.x - sourceLast.x; 107 | double motionZ = sourceCurrent.z - sourceLast.z; 108 | 109 | double motionLength = Math.sqrt(motionX * motionX + motionZ * motionZ); 110 | if (motionLength == 0) return false; 111 | motionX /= motionLength; 112 | motionZ /= motionLength; 113 | 114 | double toTargetX = targetPosition.x - sourceCurrent.x; 115 | double toTargetZ = targetPosition.z - sourceCurrent.z; 116 | 117 | double toTargetLength = Math.sqrt(toTargetX * toTargetX + toTargetZ * toTargetZ); 118 | if (toTargetLength == 0) return false; 119 | toTargetX /= toTargetLength; 120 | toTargetZ /= toTargetLength; 121 | 122 | double dotProduct = (motionX * toTargetX) + (motionZ * toTargetZ); 123 | return dotProduct >= Math.cos(Math.toRadians(angleThreshold)); 124 | } -------------------------------------------------------------------------------- /IRC.java: -------------------------------------------------------------------------------- 1 | WebSocket w; 2 | List q = new ArrayList<>(); 3 | long l = 0, lr = 0; 4 | boolean rc = false; 5 | String P = "&6&lIRC&r", k, prefix; 6 | 7 | void onLoad() { 8 | modules.registerDescription("https://discord.gg/Y2BRdNcns2"); 9 | modules.registerDescription("Use /api-key with Dave H bot"); 10 | modules.registerDescription("Try /irc"); 11 | 12 | prefix = config.get("irc_prefix"); 13 | if (prefix == null || prefix.isEmpty() || prefix.length() > 1) { 14 | prefix = "-"; 15 | config.set("irc_prefix", prefix); 16 | } 17 | } 18 | 19 | void onEnable(){ 20 | k = config.get("irc_key"); 21 | if(k == null || k.isEmpty()){ 22 | client.print(P + " &7No API key found. Use &6/irc key &7to set it."); 23 | return; 24 | } 25 | if(w != null && w.isOpen()) return; 26 | c(); 27 | } 28 | 29 | void c(){ 30 | if(w != null){ w.close(false); w = null; } 31 | w = new WebSocket("wss://privatemethod.xyz/api/irc?key="+k){ 32 | public void onOpen(short s, String m){ rc = false; q.clear(); } 33 | public void onMessage(String m){ if(modules.isEnabled(scriptName)) mP(m); } 34 | public void onClose(int c, String rs, boolean rem){ 35 | client.print(P + " &7Disconnected."); 36 | rc = true; lr = client.time(); 37 | } 38 | }; 39 | w.connect(false); 40 | } 41 | 42 | boolean onPacketSent(CPacket p){ 43 | if(p instanceof C01){ 44 | C01 c = (C01)p; 45 | 46 | if(c.message.startsWith(prefix)){ 47 | q.add(c.message.substring(prefix.length())); 48 | return false; 49 | } 50 | 51 | if(!c.message.startsWith("/irc")) return true; 52 | String[] a = c.message.split(" ", 3); 53 | 54 | if(a.length <= 1){ 55 | String t = " &6IRC Commands &7", f = " &6Made by Pug &7"; 56 | String[] m = { 57 | "&6/irc key &7: Sets your IRC API key.", 58 | "&6/irc name &7: Sets your IRC username.", 59 | "&6/irc prefix &7: Sets the IRC message prefix." 60 | }; 61 | int mx = 0; 62 | String st = t.replaceAll("&[0-9a-fk-or]", ""), sf = f.replaceAll("&[0-9a-fk-or]", ""); 63 | for(String s : m) mx = Math.max(mx, render.getFontWidth(s.replaceAll("&[0-9a-fk-or]", ""))); 64 | mx = Math.max(mx, render.getFontWidth(st)); 65 | mx = Math.max(mx, render.getFontWidth(sf)); 66 | int ex = render.getFontWidth(" "), hw = mx + ex; 67 | int tp = hw - render.getFontWidth(st), fp = hw - render.getFontWidth(sf); 68 | int tsp = tp / 2, fsp = fp / 2; 69 | String hdr = "&7" + genPad('-', tsp) + t + genPad('-', tsp); 70 | if(tp % 2 != 0) hdr += "-"; 71 | client.print(P + " " + hdr); 72 | for(String s : m){ 73 | int lp = (mx - render.getFontWidth(s.replaceAll("&[0-9a-fk-or]", ""))) / 2; 74 | client.print(P + " " + genPad(' ', lp) + s); 75 | } 76 | String ftr = "&7" + genPad('-', fsp) + f + genPad('-', fsp); 77 | if(fp % 2 != 0) ftr += "-"; 78 | client.print(P + " " + ftr); 79 | return false; 80 | } 81 | 82 | String sub = a[1].trim().toLowerCase(); 83 | if(sub.equals("key")){ 84 | if(a.length < 3 || a[2].trim().isEmpty()){ 85 | client.print(P + " &7 Usage: &6/irc key "); 86 | return false; 87 | } 88 | k = a[2].trim(); 89 | if(config.set("irc_key", k)){ 90 | client.print(P + " &7API key updated. Connecting..."); 91 | c(); 92 | } else client.print(P + " &7Failed to save API key."); 93 | return false; 94 | } else if(sub.equals("name")){ 95 | if(a.length < 3 || a[2].trim().isEmpty()){ 96 | client.print(P + " &7Usage: &6/irc name "); 97 | return false; 98 | } 99 | sendIRC(1, a[2].trim()); 100 | return false; 101 | } else if(sub.equals("prefix")){ 102 | if(a.length < 3 || a[2].trim().isEmpty()){ 103 | client.print(P + " &7Usage: &6/irc prefix "); 104 | return false; 105 | } 106 | String newPrefix = a[2].trim(); 107 | 108 | if(newPrefix.length() > 1){ 109 | client.print(P + " &7Invalid prefix."); 110 | return false; 111 | } 112 | 113 | prefix = newPrefix; 114 | config.set("irc_prefix", prefix); 115 | client.print(P + " &7Prefix updated to: &6" + prefix); 116 | return false; 117 | } else { 118 | client.print(P + " &7Unknown subcommand: " + sub); 119 | return false; 120 | } 121 | } 122 | return true; 123 | } 124 | 125 | String genPad(char ch, int px){ 126 | StringBuilder sb = new StringBuilder(); 127 | int cw = render.getFontWidth(String.valueOf(ch)); 128 | int n = px / cw; 129 | for(int i = 0; i < n; i++) sb.append(ch); 130 | return sb.toString(); 131 | } 132 | 133 | void sendIRC(int id, String d){ 134 | if(w != null && w.isOpen()){ 135 | w.send("{\"id\":"+id+",\"data\":\""+e(d)+"\"}"); 136 | } 137 | } 138 | 139 | void mP(String m){ 140 | Json j = new Json(m); 141 | if(!j.exists()){ 142 | client.print(P + " &cInvalid JSON: " + m); 143 | return; 144 | } 145 | int id = Integer.parseInt(j.get("id", "-1")); 146 | String d = j.get("data", ""); 147 | if(id == 0) { 148 | Message ms = new Message(d); 149 | client.print(ms); 150 | } 151 | } 152 | 153 | void onPreUpdate(){ 154 | long t = client.time(); 155 | if(w != null && w.isOpen() && t - l > 1000 && !q.isEmpty()){ 156 | sendIRC(0, q.remove(0)); 157 | l = t; 158 | } 159 | if(rc && t - lr > 5000){ 160 | client.print(P + " &7Attempting to reconnect..."); 161 | lr = t; c(); 162 | } 163 | } 164 | 165 | String e(String s){ return s.replace("\\", "\\\\").replace("\"", "\\\""); } -------------------------------------------------------------------------------- /JumpReset.java: -------------------------------------------------------------------------------- 1 | /* 2 | 1.8 velocity bypass 3 | loadstring: load - "https://raw.githubusercontent.com/PugrillaDev/Raven-Scripts/refs/heads/main/JumpReset.java" 4 | */ 5 | 6 | boolean setJump, ignoreNext, aiming; 7 | int lastHurtTime; 8 | double lastFallDistance; 9 | 10 | void onLoad() { 11 | modules.registerSlider("Chance", "%", 100, 0, 100, 1); 12 | modules.registerButton("Mouse down", false); 13 | modules.registerButton("Moving forward", true); 14 | modules.registerButton("Aiming on player", true); 15 | } 16 | 17 | void onPreUpdate() { 18 | Entity player = client.getPlayer(); 19 | int hurtTime = player.getHurtTime(); 20 | boolean onGround = player.onGround(); 21 | 22 | if (onGround && lastFallDistance > 3 && !client.allowFlying()) ignoreNext = true; 23 | 24 | if (hurtTime > lastHurtTime) { 25 | boolean mouseDown = keybinds.isMouseDown(0) || !modules.getButton(scriptName, "Mouse down"); 26 | boolean aimingAt = aiming || !modules.getButton(scriptName, "Aiming on player"); 27 | boolean forward = keybinds.isKeyDown(keybinds.getKeyCode("forward")) || !modules.getButton(scriptName, "Moving forward"); 28 | if (!ignoreNext && onGround && aimingAt && forward && mouseDown && !player.isBurning() && util.randomDouble(0, 100) < modules.getSlider(scriptName, "Chance") && !hasBadEffect()) { 29 | keybinds.setPressed("jump", setJump = true); 30 | } 31 | ignoreNext = false; 32 | } 33 | 34 | lastHurtTime = hurtTime; 35 | lastFallDistance = player.getFallDistance(); 36 | } 37 | 38 | void onPostMotion() { 39 | if (setJump && !keybinds.isKeyDown(keybinds.getKeyCode("jump"))) { 40 | keybinds.setPressed("jump", setJump = false); 41 | } 42 | } 43 | 44 | boolean onPacketSent(CPacket packet) { 45 | if (packet instanceof C03) { 46 | C03 c03 = (C03) packet; 47 | if (c03.name.startsWith("C05") || c03.name.startsWith("C06")) { 48 | Object[] hit = client.raycastEntity(5, c03.yaw, c03.pitch); 49 | aiming = hit != null && "EntityOtherPlayerMP".equals(((Entity) hit[0]).type); 50 | } 51 | } 52 | return true; 53 | } 54 | 55 | boolean hasBadEffect() { 56 | for (Object[] effect : client.getPlayer().getPotionEffects()) { 57 | String name = (String) effect[1]; 58 | return "potion.jump".equals(name) || "potion.poison".equals(name) || "potion.wither".equals(name); 59 | } 60 | return false; 61 | } -------------------------------------------------------------------------------- /LagRange.java: -------------------------------------------------------------------------------- 1 | int disableTicks; 2 | Vec3 lastPosition; 3 | double closest; 4 | double startFallHeight; 5 | boolean toggle; 6 | 7 | void onLoad() { 8 | modules.registerSlider("Latency", "ms", 300, 0, 500, 50); 9 | modules.registerSlider("Activation Distance", " blocks", 13, 0, 20, 1); 10 | modules.registerSlider("Hurttime", "", 2, 0, 10, 1); 11 | modules.registerButton("Check Team", true); 12 | modules.registerButton("Check Ping", true); 13 | modules.registerButton("Check Weapon", true); 14 | modules.registerButton("Check Distance", true); 15 | modules.registerButton("Release on damage", true); 16 | modules.registerButton("Release on fall", true); 17 | modules.registerButton("Release on swap", false); 18 | modules.registerButton("Release when breaking", false); 19 | modules.registerButton("Swords", true); 20 | modules.registerButton("Stick", true); 21 | modules.registerButton("Fishing Rod", false); 22 | } 23 | 24 | void onPreUpdate() { 25 | disableTicks--; 26 | double boxSize = modules.getSlider(scriptName, "Activation Distance"); 27 | double latency = modules.getSlider(scriptName, "Latency"); 28 | if (latency != modules.getSlider("Fake Lag", "Packet delay")) { 29 | disableTicks = 10; 30 | modules.disable("Fake Lag"); 31 | modules.setSlider("Fake Lag", "Packet delay", latency); 32 | } 33 | 34 | Entity player = client.getPlayer(); 35 | Vec3 myPosition = player.getPosition(); 36 | boolean onGround = player.onGround(); 37 | 38 | if (player.getTicksExisted() % 5 == 0) { 39 | closest = -1; 40 | boolean checkTeams = modules.getButton(scriptName, "Check Team"); 41 | String team = ""; 42 | if (checkTeams) { 43 | String name = player.getNetworkPlayer() != null ? player.getNetworkPlayer().getDisplayName() : player.getDisplayName(); // Get nick on hypixel 44 | if (name.length() >= 2 && name.startsWith(util.colorSymbol)) { 45 | team = name.substring(0, 2); 46 | } 47 | } 48 | 49 | boolean checkPing = modules.getButton(scriptName, "Check Ping"); 50 | for (Entity p : world.getPlayerEntities()) { 51 | if (p == player) continue; 52 | 53 | NetworkPlayer nwp = p.getNetworkPlayer(); 54 | if (nwp == null || (checkPing && nwp.getPing() != 1)) continue; 55 | 56 | char uv = p.getUUID().charAt(14); 57 | if (uv != '4' && uv != '1') continue; 58 | 59 | if (checkTeams) { 60 | String displayName = p.getDisplayName(); 61 | if (!team.isEmpty() && displayName.startsWith(team)) continue; // If player's name has the same team color as our name 62 | } 63 | 64 | Vec3 position = p.getPosition(); 65 | if (Math.abs(position.x - myPosition.x) > boxSize || Math.abs(position.z - myPosition.z) > boxSize || Math.abs(position.y - myPosition.y) > boxSize) continue; // More efficient than pythagorean distance check 66 | 67 | double distanceSq = position.distanceToSq(myPosition); 68 | if (closest == -1 || distanceSq < closest) { 69 | closest = distanceSq; 70 | } 71 | } 72 | } 73 | 74 | ItemStack held = player.getHeldItem(); 75 | boolean correctHeldItem = !modules.getButton(scriptName, "Check Weapon"); 76 | if (!correctHeldItem) { 77 | boolean holdingWeapon = false; 78 | if (held != null) { 79 | holdingWeapon = held.type.equals("ItemSword") && modules.getButton(scriptName, "Swords") || 80 | held.name.equals("stick") && modules.getButton(scriptName, "Stick") || 81 | held.name.equals("fishing_rod") && modules.getButton(scriptName, "Fishing Rod"); // Weapon check 82 | } 83 | correctHeldItem = holdingWeapon; 84 | } 85 | 86 | toggle = correctHeldItem && disableTicks < 0 && client.getScreen().isEmpty() && closest != -1 && closest < boxSize * boxSize; 87 | 88 | if (player.getHurtTime() == player.getMaxHurtTime() - 1 && modules.getButton(scriptName, "Release on damage")) { // Check if you took damage 89 | disableTicks = 10; 90 | toggle = false; 91 | } 92 | 93 | if (lastPosition != null && !onGround && lastPosition.y > myPosition.y && myPosition.y > startFallHeight) { 94 | startFallHeight = myPosition.y; 95 | } else if (onGround && myPosition.y < startFallHeight) { 96 | if (startFallHeight - myPosition.y > 3 && modules.getButton(scriptName, "Release on fall") && !client.allowFlying()) { // Check if you took fall damage 97 | disableTicks = 5; 98 | toggle = false; 99 | } 100 | startFallHeight = -Double.MAX_VALUE; 101 | } 102 | lastPosition = myPosition; 103 | } 104 | 105 | void onPostMotion() { 106 | if (toggle) { 107 | modules.enable("Fake Lag"); 108 | } else { 109 | modules.disable("Fake Lag"); 110 | } 111 | } 112 | 113 | boolean onPacketSent(CPacket packet) { 114 | if (packet instanceof C02) { 115 | C02 c02 = (C02) packet; 116 | Entity entity = c02.entity; 117 | if (entity == null || c02.action == null || entity.type == null || entity.type.equals("EntityLargeFireball")) return true; 118 | 119 | if (c02.action.equals("ATTACK")) { 120 | if (entity.getHurtTime() <= modules.getSlider(scriptName, "Hurttime")) { 121 | disableTicks = 1; 122 | toggle = false; 123 | } 124 | if (modules.getButton(scriptName, "Check Distance") && entity.getPosition().distanceToSq(client.getPlayer().getPosition()) < 2.25) { 125 | disableTicks = 10; 126 | toggle = false; 127 | } 128 | } else { 129 | if (entity.getHurtTime() == 0) { 130 | disableTicks = 1; 131 | toggle = false; 132 | } 133 | } 134 | } else if (packet instanceof C09) { 135 | if (modules.getButton(scriptName, "Release on swap")) { 136 | disableTicks = 1; 137 | toggle = false; 138 | } 139 | } else if (packet instanceof C07) { 140 | if (modules.getButton(scriptName, "Release when breaking")) { 141 | C07 c07 = (C07) packet; 142 | if (c07.status.equals("ABORT_DESTROY_BLOCK") || c07.status.equals("STOP_DESTROY_BLOCK") || c07.status.equals("START_DESTROY_BLOCK")) { 143 | disableTicks = 1; 144 | toggle = false; 145 | } 146 | } 147 | } else if (packet instanceof C01) { 148 | disableTicks = 20; 149 | toggle = false; 150 | } 151 | 152 | return true; 153 | } -------------------------------------------------------------------------------- /LegitScaffold.java: -------------------------------------------------------------------------------- 1 | double HW = 0.3; 2 | double[][] CORNERS = {{ -HW, -HW }, { HW, -HW }, { -HW, HW }, { HW, HW }}; 3 | boolean sneakingFromScript; 4 | boolean placed; 5 | boolean forceRelease; 6 | int sneakJumpDelayTicks; 7 | int sneakJumpStartTick = -1; 8 | int unsneakDelayTicks; 9 | int unsneakStartTick = -1; 10 | 11 | void onLoad() { 12 | modules.registerSlider("Edge offset", " blocks", 0, 0, 0.3, 0.01); 13 | modules.registerSlider("Unsneak delay", "ms", 50, 50, 300, 5); 14 | modules.registerSlider("Sneak on jump", "ms", 0, 0, 500, 5); 15 | modules.registerButton("Sneak key pressed", false); 16 | modules.registerButton("Holding blocks", false); 17 | modules.registerButton("Looking down", false); 18 | modules.registerButton("Not moving forward", false); 19 | } 20 | 21 | void onPrePlayerInput(MovementInput m) { 22 | boolean manualSneak = isManualSneak(); 23 | boolean requireSneak = modules.getButton(scriptName, "Sneak key pressed"); 24 | 25 | if (manualSneak && !requireSneak) { 26 | resetUnsneak(); 27 | return; 28 | } 29 | 30 | if (requireSneak && (!manualSneak || (m.forward == 0 && m.strafe == 0))) { 31 | if (!manualSneak) resetUnsneak(); 32 | repressSneak(m); 33 | return; 34 | } 35 | 36 | Entity player = client.getPlayer(); 37 | if (modules.getButton(scriptName, "Not moving forward") && client.getForward() > 0 || 38 | modules.getButton(scriptName, "Looking down") && player.getPitch() < 70 || 39 | modules.getButton(scriptName, "Holding blocks") && !player.isHoldingBlock()) { 40 | if (requireSneak) { 41 | repressSneak(m); 42 | } 43 | return; 44 | } 45 | 46 | if (m.jump && player.onGround() && (m.forward != 0 || m.strafe != 0) && modules.getSlider(scriptName, "Sneak on jump") > 0) { 47 | if (!requireSneak || forceRelease) { 48 | sneakJumpStartTick = player.getTicksExisted(); 49 | double raw = modules.getSlider(scriptName, "Sneak on jump") / 50; 50 | int base = (int) raw; 51 | sneakJumpDelayTicks = base + (util.randomDouble(0, 1) < (raw - base) ? 1 : 0); 52 | pressSneak(m, true); 53 | return; 54 | } 55 | } 56 | 57 | Vec3 position = player.getPosition(); 58 | Simulation sim = Simulation.create(); 59 | if (client.isSneak()) { 60 | sim.setForward(m.forward / 0.3f); 61 | sim.setStrafe(m.strafe / 0.3f); 62 | sim.setSneak(false); 63 | } 64 | sim.tick(); 65 | Vec3 simPosition = sim.getPosition(); 66 | 67 | double edgeOffset = computeEdgeOffset(simPosition, position); 68 | if (Double.isNaN(edgeOffset)) { 69 | if (sneakingFromScript) tryReleaseSneak(m, true); 70 | return; 71 | } 72 | 73 | boolean shouldSneak = edgeOffset > modules.getSlider(scriptName, "Edge offset"); 74 | boolean shouldRelease = sneakingFromScript; 75 | 76 | if (shouldSneak) { 77 | pressSneak(m, true); 78 | } else if (shouldRelease) { 79 | tryReleaseSneak(m, true); 80 | } 81 | } 82 | 83 | boolean onPacketSent(CPacket packet) { 84 | if (packet instanceof C08) { 85 | C08 c08 = (C08) packet; 86 | if (c08.direction != 255 && sneakingFromScript && modules.getButton(scriptName, "Sneak key pressed")) { 87 | placed = true; 88 | } 89 | } 90 | return true; 91 | } 92 | 93 | void repressSneak(MovementInput m) { 94 | if (forceRelease && isManualSneak()) { 95 | keybinds.setPressed("sneak", true); 96 | m.sneak = true; 97 | } 98 | forceRelease = false; 99 | } 100 | 101 | void pressSneak(MovementInput m, boolean resetDelay) { 102 | m.sneak = true; 103 | sneakingFromScript = true; 104 | if (resetDelay) { 105 | unsneakStartTick = -1; 106 | } 107 | repressSneak(m); 108 | } 109 | 110 | void tryReleaseSneak(MovementInput m, boolean resetDelay) { 111 | int existed = client.getPlayer().getTicksExisted(); 112 | if (unsneakStartTick == -1 && sneakJumpStartTick == -1) { 113 | unsneakStartTick = existed; 114 | double raw = (modules.getSlider(scriptName, "Unsneak delay") - 50) / 50; 115 | int base = (int) raw; 116 | unsneakDelayTicks = base + (util.randomDouble(0, 1) < (raw - base) ? 1 : 0); 117 | } 118 | 119 | if (existed - sneakJumpStartTick < sneakJumpDelayTicks) { 120 | pressSneak(m, false); 121 | return; 122 | } 123 | if (existed - unsneakStartTick < unsneakDelayTicks) { 124 | pressSneak(m, false); 125 | return; 126 | } 127 | 128 | releaseSneak(m, resetDelay); 129 | } 130 | 131 | void releaseSneak(MovementInput m, boolean resetDelay) { 132 | if (!modules.getButton(scriptName, "Sneak key pressed")) { 133 | m.sneak = false; 134 | } 135 | else if (sneakingFromScript && isManualSneak() && (placed || !client.getPlayer().onGround())) { 136 | keybinds.setPressed("sneak", false); 137 | m.sneak = false; 138 | forceRelease = true; 139 | } 140 | else if (forceRelease) { 141 | m.sneak = false; 142 | } 143 | 144 | sneakingFromScript = placed = false; 145 | if (resetDelay) { 146 | resetUnsneak(); 147 | } 148 | } 149 | 150 | void resetUnsneak() { 151 | unsneakStartTick = sneakJumpStartTick = -1; 152 | } 153 | 154 | boolean isManualSneak() { 155 | return keybinds.isKeyDown(keybinds.getKeyCode("sneak")); 156 | } 157 | 158 | double computeEdgeOffset(Vec3 pos1, Vec3 pos2) { 159 | int floorY = (int)(pos1.y - 0.01); 160 | double best = Double.NaN; 161 | 162 | for (double[] c : CORNERS) { 163 | int bx = (int)Math.floor(pos2.x + c[0]); 164 | int bz = (int)Math.floor(pos2.z + c[1]); 165 | if (world.getBlockAt(bx, floorY, bz).name.equals("air")) continue; 166 | 167 | double offX = Math.abs(pos1.x - (bx + (pos1.x < bx + 0.5 ? 0 : 1))); 168 | double offZ = Math.abs(pos1.z - (bz + (pos1.z < bz + 0.5 ? 0 : 1))); 169 | boolean xDiff = (int)Math.floor(pos1.x) != bx; 170 | boolean zDiff = (int)Math.floor(pos1.z) != bz; 171 | 172 | double cornerDist; 173 | if (xDiff) { 174 | cornerDist = zDiff ? Math.max(offX, offZ) : offX; 175 | } else { 176 | cornerDist = zDiff ? offZ : 0; 177 | } 178 | 179 | best = Double.isNaN(best) ? cornerDist : Math.min(best, cornerDist); 180 | } 181 | 182 | return best; 183 | } -------------------------------------------------------------------------------- /NoDropSwords.java: -------------------------------------------------------------------------------- 1 | long firstDropTime = -1; 2 | 3 | void onLoad() { 4 | modules.registerSlider("Double Tap Delay", "ms", 350, 0, 500, 10); 5 | 6 | modules.registerButton("Wooden Sword", true); 7 | modules.registerButton("Stone Sword", true); 8 | modules.registerButton("Iron Sword", true); 9 | modules.registerButton("Golden Sword", true); 10 | modules.registerButton("Diamond Sword", true); 11 | } 12 | 13 | boolean onPacketSent(CPacket packet) { 14 | if (!(packet instanceof C07)) return true; 15 | 16 | C07 c07 = (C07) packet; 17 | if (!c07.status.startsWith("DROP_")) return true; 18 | 19 | ItemStack item = client.getPlayer().getHeldItem(); 20 | if (item == null) return true; 21 | 22 | String type = item.name; 23 | 24 | if (!type.endsWith("_sword") || !shouldBlock(type)) return true; 25 | 26 | long now = client.time(); 27 | int delay = (int) modules.getSlider(scriptName, "Double Tap Delay"); 28 | 29 | if (firstDropTime == -1 || now - firstDropTime > delay) { 30 | firstDropTime = now; 31 | return false; 32 | } 33 | 34 | firstDropTime = -1; 35 | return true; 36 | } 37 | 38 | boolean shouldBlock(String type) { 39 | switch (type) { 40 | case "wooden_sword": 41 | return modules.getButton(scriptName, "Wooden Sword"); 42 | case "stone_sword": 43 | return modules.getButton(scriptName, "Stone Sword"); 44 | case "iron_sword": 45 | return modules.getButton(scriptName, "Iron Sword"); 46 | case "golden_sword": 47 | return modules.getButton(scriptName, "Golden Sword"); 48 | case "diamond_sword": 49 | return modules.getButton(scriptName, "Diamond Sword"); 50 | default: 51 | return false; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /QuickMaths.java: -------------------------------------------------------------------------------- 1 | /* Solves the quickmaths message automatically in lobby/pit */ 2 | 3 | void onLoad() { 4 | modules.registerSlider("Delay", "ms", 1500, 0, 5000, 100); 5 | } 6 | 7 | String a = ""; 8 | void onPreUpdate() { 9 | if (!a.isEmpty()) { 10 | client.chat(a); 11 | a = ""; 12 | } 13 | } 14 | 15 | boolean onChat(String message) { 16 | String msg = util.strip(message); 17 | if (msg.startsWith("QUICK MATHS! Solve: ")) { 18 | client.print(message); 19 | String answer = solve(msg); 20 | client.print("&7[&aQM&7]&e " + msg.split(": ")[1] + " = &a" + answer); 21 | client.async(() -> { 22 | client.sleep((int) modules.getSlider(scriptName, "Delay")); 23 | a = answer; 24 | }); 25 | return false; 26 | } 27 | return true; 28 | } 29 | 30 | String solve(String expression) { 31 | expression = expression.replace("QUICK MATHS! Solve: ", "").replace("x", "*"); 32 | return formatAndRound(parse(expression)); 33 | } 34 | 35 | double parse(String expr) { 36 | char[] chars = expr.toCharArray(); 37 | int[] pos = { -1 }; 38 | int[] ch = { nextChar(chars, pos) }; 39 | 40 | double result = parseExpression(chars, pos, ch); 41 | if (pos[0] < chars.length) { 42 | return 0; 43 | } 44 | 45 | return result; 46 | } 47 | 48 | double parseExpression(char[] chars, int[] pos, int[] ch) { 49 | double x = parseTerm(chars, pos, ch); 50 | while (true) { 51 | if (eat(chars, pos, ch, '+')) { 52 | x += parseTerm(chars, pos, ch); 53 | } else if (eat(chars, pos, ch, '-')) { 54 | x -= parseTerm(chars, pos, ch); 55 | } else { 56 | return x; 57 | } 58 | } 59 | } 60 | 61 | double parseTerm(char[] chars, int[] pos, int[] ch) { 62 | double x = parseFactor(chars, pos, ch); 63 | while (true) { 64 | if (eat(chars, pos, ch, '*')) { 65 | x *= parseFactor(chars, pos, ch); 66 | } else if (eat(chars, pos, ch, '/')) { 67 | x /= parseFactor(chars, pos, ch); 68 | } else { 69 | return x; 70 | } 71 | } 72 | } 73 | 74 | double parseFactor(char[] chars, int[] pos, int[] ch) { 75 | if (eat(chars, pos, ch, '+')) return parseFactor(chars, pos, ch); 76 | if (eat(chars, pos, ch, '-')) return -parseFactor(chars, pos, ch); 77 | 78 | double x; 79 | int startPos = pos[0]; 80 | if (eat(chars, pos, ch, '(')) { 81 | x = parseExpression(chars, pos, ch); 82 | eat(chars, pos, ch, ')'); 83 | } else if ((ch[0] >= '0' && ch[0] <= '9') || ch[0] == '.') { 84 | while ((ch[0] >= '0' && ch[0] <= '9') || ch[0] == '.') { 85 | ch[0] = nextChar(chars, pos); 86 | } 87 | x = Double.parseDouble(new String(chars, startPos, pos[0] - startPos)); 88 | } else { 89 | return 0; 90 | } 91 | 92 | if (eat(chars, pos, ch, '^')) x = Math.pow(x, parseFactor(chars, pos, ch)); 93 | return x; 94 | } 95 | 96 | boolean eat(char[] chars, int[] pos, int[] ch, int charToEat) { 97 | while (ch[0] == ' ') ch[0] = nextChar(chars, pos); 98 | if (ch[0] == charToEat) { 99 | ch[0] = nextChar(chars, pos); 100 | return true; 101 | } 102 | return false; 103 | } 104 | 105 | int nextChar(char[] chars, int[] pos) { 106 | pos[0]++; 107 | return (pos[0] < chars.length) ? chars[pos[0]] : -1; 108 | } 109 | 110 | String formatAndRound(double num) { 111 | double roundedVal = Math.round(num * 100d) / 100d; 112 | return (roundedVal % 1 == 0) ? String.valueOf((int) roundedVal) : String.valueOf(roundedVal); 113 | } -------------------------------------------------------------------------------- /Quickbuy.java: -------------------------------------------------------------------------------- 1 | /* 2 | Allows you to buy items from the Bedwars quickbuy/diamond upgrades with keybinds 3 | loadstring: load - "https://raw.githubusercontent.com/PugrillaDev/Raven-Scripts/refs/heads/main/Quickbuy.java" 4 | */ 5 | 6 | Map itemDisplayNames = new HashMap<>(); 7 | Map locations = new HashMap<>(); 8 | Map purchases = new HashMap<>(); 9 | Map keyStates = new HashMap<>(); 10 | List items = new ArrayList<>(); 11 | List clickList = new ArrayList<>(); 12 | String[] slotNames = {util.color("&cDisabled"), "1", "2", "3", "4", "5", "6", "7", "8", "9"}; 13 | HashSet pickaxeTypes = new HashSet<>(Arrays.asList("wooden_pickaxe", "iron_pickaxe", "golden_pickaxe", "diamond_pickaxe")); 14 | HashSet axeTypes = new HashSet<>(Arrays.asList("wooden_axe", "stone_axe", "iron_axe", "diamond_axe")); 15 | 16 | void setupItems() { 17 | registerItem("wool", "Wool"); 18 | registerItem("stone_sword", "Stone Sword"); 19 | registerItem("iron_sword", "Iron Sword"); 20 | registerItem("golden_apple", "Golden Apple"); 21 | registerItem("fire_charge", "Fireball"); 22 | registerItem("tnt", "TNT"); 23 | registerItem("ender_pearl", "Ender Pearl"); 24 | 25 | registerItem("pickaxe", "Pickaxe"); 26 | registerItem("axe", "Axe"); 27 | registerItem("shears", "Shears"); 28 | registerItem("chainmail_boots", "Chainmail Armor"); 29 | registerItem("iron_boots", "Iron Armor"); 30 | 31 | registerItem("upg iron_sword", "Sharpness"); 32 | registerItem("upg iron_chestplate", "Protection"); 33 | registerItem("upg iron_pickaxe", "Mining Fatigue"); 34 | registerItem("upg golden_pickaxe", "Haste"); 35 | registerItem("upg diamond_boots", "Feather Falling"); 36 | 37 | registerItem("diamond_sword", "Diamond Sword"); 38 | registerItem("stick", "Knockback Stick"); 39 | registerItem("arrow", "Arrows"); 40 | registerItem("diamond_boots", "Diamond Armor"); 41 | } 42 | 43 | void registerItem(String item, String displayName) { 44 | itemDisplayNames.put(item, displayName); 45 | items.add(item); 46 | } 47 | 48 | void onLoad() { 49 | modules.registerSlider("Purchase Delay", "ms", 100, 100, 400, 50); 50 | setupItems(); 51 | for (String item : items) { 52 | String displayName = itemDisplayNames.get(item); 53 | modules.registerGroup(displayName); 54 | if (!item.startsWith("upg ")) { 55 | modules.registerSlider(displayName, displayName + " Quickslot", "", 0, slotNames); 56 | modules.registerButton(displayName, displayName + " Turbo", false); 57 | } 58 | modules.registerKey(displayName, displayName + " Keybind", 0); 59 | } 60 | } 61 | 62 | void onPreUpdate() { 63 | if (!client.getScreen().equals("GuiChest")) { 64 | locations.clear(); 65 | clickList.clear(); 66 | return; 67 | } 68 | 69 | Map inv = createCustomInventory(); 70 | int chestSize = inventory.getChestSize(); 71 | boolean isQuickBuy = inventory.getChest().equals("Quick Buy"); 72 | boolean isUpgrades = inventory.getChest().equals("Upgrades & Traps"); 73 | if (!isQuickBuy && !isUpgrades) return; 74 | 75 | long now = client.time(); 76 | for (String item : items) { 77 | String searchItem = item; 78 | if (isQuickBuy && item.startsWith("upg ")) continue; 79 | if (isUpgrades) { 80 | if (!item.startsWith("upg ")) continue; 81 | searchItem = item.substring(4); 82 | } 83 | 84 | HashSet itemTypes = null; 85 | if (isQuickBuy) { 86 | if (searchItem.equals("pickaxe")) 87 | itemTypes = pickaxeTypes; 88 | else if (searchItem.equals("axe")) 89 | itemTypes = axeTypes; 90 | } 91 | 92 | int start = isQuickBuy ? 18 : 9; 93 | int end = isQuickBuy ? chestSize - 9 : 27; 94 | for (int i = start; i < end; i++) { 95 | ItemStack stack = inv.get(i); 96 | if (stack == null) continue; 97 | if (itemTypes != null && !itemTypes.contains(stack.name)) continue; 98 | if (itemTypes == null && !stack.name.equals(searchItem)) continue; 99 | locations.put(item, i); 100 | break; 101 | } 102 | 103 | if (isQuickBuy && item.startsWith("upg ") || isUpgrades && !item.startsWith("upg ")) continue; 104 | 105 | String displayName = itemDisplayNames.get(item); 106 | boolean keyDown = modules.getKeyPressed(scriptName, displayName + " Keybind"); 107 | boolean lastKeyState = keyStates.getOrDefault(item, false); 108 | if (!keyDown) { 109 | keyStates.put(item, false); 110 | continue; 111 | } 112 | 113 | int hotbarSlot = (int) modules.getSlider(scriptName, displayName + " Quickslot") - 1; 114 | boolean turbo = !item.startsWith("upg ") && modules.getButton(scriptName, displayName + " Turbo"); 115 | long cooldown = item.startsWith("upg ") ? 300 : 90; 116 | long lastTime = purchases.getOrDefault(item, 0L); 117 | if (!turbo && lastKeyState) continue; 118 | if (now - lastTime < cooldown) continue; 119 | 120 | purchases.put(item, now); 121 | keyStates.put(item, true); 122 | clickItem(item, hotbarSlot); 123 | } 124 | 125 | if (client.getPlayer().getTicksExisted() % (int) (modules.getSlider(scriptName, "Purchase Delay") / 50) == 0) { 126 | if (!clickList.isEmpty()) { 127 | Integer[] click = clickList.remove(0); 128 | int slot = click[0]; 129 | int hotbarSlot = click[1]; 130 | if (hotbarSlot >= 0) { 131 | inventory.click(slot, hotbarSlot, 2); 132 | } else { 133 | inventory.click(slot, 0, 0); 134 | } 135 | } 136 | } 137 | } 138 | 139 | void clickItem(String itemName, int hotbarSlot) { 140 | Integer slot = locations.get(itemName); 141 | if (slot != null) { 142 | clickList.add(new Integer[]{slot, hotbarSlot}); 143 | } 144 | } 145 | 146 | Map createCustomInventory() { 147 | Map inv = new HashMap<>(); 148 | String screen = client.getScreen(); 149 | int inventorySize = inventory.getSize() - 4, slot = 0; 150 | 151 | if (screen.equals("GuiInventory")) { 152 | for (int i = 0; i < 5; i++) inv.put(slot++, null); 153 | Entity player = client.getPlayer(); 154 | for (int i = 3; i >= 0; i--) inv.put(slot++, player.getArmorInSlot(i)); 155 | } else if (screen.equals("GuiChest") && !inventory.getChest().isEmpty()) { 156 | int chestSize = inventory.getChestSize(); 157 | for (int i = 0; i < chestSize; i++) { 158 | inv.put(slot++, inventory.getStackInChestSlot(i)); 159 | } 160 | } 161 | 162 | for (int i = 9; i < inventorySize + 9; i++) { 163 | inv.put(slot++, inventory.getStackInSlot(i % inventorySize)); 164 | } 165 | 166 | return inv; 167 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This repository contains my collection of custom scripts for the client Raven BS designed to enhance and automate Minecraft gameplay. 2 | I develop and maintain all scripts located in this repository. 3 | I also manage all the documentation, which you can find here: [Raven Documentation](https://blowsy.gitbook.io/raven). 4 | If you always wish to have the latest update for any scripts here, please use a loadstring to the raw file on GitHub. 5 | -------------------------------------------------------------------------------- /Requeue.java: -------------------------------------------------------------------------------- 1 | /* Allows you to run the /rq command to instantly requeue 95% of hypixel gamemodes */ 2 | 3 | String mode = ""; 4 | int ticks = 0; 5 | boolean scoreboard = false, check = false; 6 | 7 | void onPreUpdate() { 8 | if (check && !scoreboard && world.getScoreboard() != null) scoreboard = true; 9 | if (scoreboard && ++ticks == 20) { 10 | client.chat("/locraw"); 11 | } 12 | } 13 | 14 | boolean onChat(String message) { 15 | String msg = util.strip(message); 16 | if (check && msg.startsWith("{")) { 17 | check = false; 18 | try { 19 | if (!msg.contains("REPLAY") && !msg.equals("{\"server\":\"limbo\"}")) mode = msg.split("mode\":\"")[1].split("\"")[0]; 20 | } catch (Exception e) {} 21 | client.log(msg); 22 | client.log(mode); 23 | return false; 24 | } 25 | return true; 26 | } 27 | 28 | boolean onPacketSent(CPacket packet) { 29 | if (packet instanceof C01) { 30 | C01 c01 = (C01) packet; 31 | if (!c01.message.equals("/rq")) return true; 32 | client.chat("/play " + mode); 33 | return false; 34 | } 35 | return true; 36 | } 37 | 38 | void onWorldJoin(Entity entity) { 39 | if (client.getPlayer() == entity) { 40 | scoreboard = false; 41 | check = true; 42 | ticks = 0; 43 | } 44 | } 45 | 46 | void onLoad() { 47 | scoreboard = false; 48 | check = true; 49 | ticks = 0; 50 | } -------------------------------------------------------------------------------- /TpStickRequeue.java: -------------------------------------------------------------------------------- 1 | /* This is a shitpost i made 2 years ago so don't complain that the code is bad */ 2 | 3 | int status = -1; 4 | int step = 0; 5 | int tpAimingTicks = 0; 6 | int attackingTicks = 0; 7 | int chestTicks = 0; 8 | int lastFavorite = 0; 9 | int stopLookingNOW = 0; 10 | float serverYaw, serverPitch; 11 | boolean clickedMap = false; 12 | boolean waiting = false; 13 | long lastUpdate = client.time(); 14 | long lastAttack = client.time(); 15 | Vec3 spawnPoint = new Vec3(-38, 72, 0); 16 | Map queueingCache = new HashMap<>(); 17 | 18 | void onLoad() { 19 | modules.registerSlider("Select Mode", "", 2, new String[] { "Solos", "Doubles", "Threes", "Fours" }); 20 | modules.registerSlider("Aim Delay", "ms", 250, 0, 3000, 50); 21 | } 22 | 23 | void onEnable() { 24 | Entity en = findQueueingNPC(); 25 | step = 0; 26 | clickedMap = false; 27 | serverYaw = client.getPlayer().getYaw(); 28 | serverPitch = client.getPlayer().getPitch(); 29 | } 30 | 31 | void onPostPlayerInput() { 32 | client.setForward(0); 33 | client.setStrafe(0); 34 | } 35 | 36 | void onPreMotion(PlayerState s) { 37 | long now = client.time(); 38 | status = getBedwarsStatus(); 39 | Entity player = client.getPlayer(); 40 | Vec3 myPosition = player.getPosition(); 41 | chestTicks++; 42 | 43 | String chest = inventory.getChest(); 44 | if (chest.equals("Play Bed Wars")) { 45 | step = 2; 46 | lastUpdate = now; 47 | } else if (chest.equals("Bed Wars " + getArmorStandName())) { 48 | step = 3; 49 | lastUpdate = now; 50 | } else if (step > 1 && client.getScreen().isEmpty()) { 51 | client.print("wtf is this"); 52 | step = 1; 53 | lastUpdate = now; 54 | } 55 | 56 | if (step == 0) { 57 | lastAttack = 0; 58 | if (status >= 2) { 59 | for (int i = 0; i < 100; i++) { 60 | client.chat("/"); 61 | } 62 | } else if (status == 1) { 63 | client.chat("/stuck"); 64 | } else { 65 | client.chat("/bedwars"); 66 | } 67 | step++; 68 | waiting = true; 69 | lastUpdate = now; 70 | } 71 | else if (step == 1) { 72 | if (waiting) { 73 | if (now - lastUpdate > 3000) { 74 | step--; 75 | waiting = false; 76 | return; 77 | } else if (myPosition.distanceTo(spawnPoint) > 3) { 78 | return; 79 | } 80 | waiting = false; 81 | tpAimingTicks = 0; 82 | } 83 | 84 | ItemStack item = player.getHeldItem(); 85 | if (item == null || !item.name.equals("blaze_rod")) { 86 | if (inventory.getStackInSlot(5) != null && !inventory.getStackInSlot(5).name.equals("blaze_rod")) { 87 | return; 88 | } 89 | inventory.setSlot(5); 90 | } 91 | 92 | Entity npc = findQueueingNPC(); 93 | if (npc == null) return; 94 | 95 | float[] rotations = getRotations(npc.getPosition()); 96 | 97 | int scaleFactor = (int) Math.floor(serverYaw / 360); 98 | float unwrappedYaw = rotations[0] + 360 * scaleFactor; 99 | if (unwrappedYaw < serverYaw - 180) { 100 | unwrappedYaw += 360; 101 | } else if (unwrappedYaw > serverYaw + 180) { 102 | unwrappedYaw -= 360; 103 | } 104 | 105 | float deltaYaw = unwrappedYaw - serverYaw; 106 | float deltaPitch = rotations[1] - serverPitch; 107 | 108 | if (--stopLookingNOW <= 0) { 109 | s.yaw = serverYaw + (Math.abs(deltaYaw) > 0.1 ? deltaYaw : 0); 110 | s.pitch = serverPitch + (Math.abs(deltaPitch) > 0.1 ? deltaPitch : 0); 111 | } else { 112 | attackingTicks = 0; 113 | tpAimingTicks = 0; 114 | return; 115 | } 116 | 117 | if (npc.getPosition().distanceToSq(myPosition) < 9) { 118 | tpAimingTicks = 0; 119 | 120 | if (++attackingTicks > 3 && now - lastAttack > 2000) { 121 | client.attack(npc); 122 | lastAttack = now; 123 | } 124 | } else { 125 | attackingTicks = 0; 126 | if (++tpAimingTicks > (int)(modules.getSlider(scriptName, "Aim Delay") / 50)) { 127 | client.sendPacketNoEvent(new C08(player.getHeldItem(), new Vec3(-1, -1, -1), 255, new Vec3(0.0, 0.0, 0.0))); 128 | } 129 | } 130 | } 131 | else if (step == 2) { 132 | if (now - lastUpdate > 1000) { 133 | step = 1; 134 | } 135 | 136 | if (!client.getScreen().equals("GuiChest") || chestTicks < 4) return; 137 | 138 | for (int i = 0; i < inventory.getChestSize(); i++) { 139 | ItemStack chestItem = inventory.getStackInChestSlot(i); 140 | if (chestItem == null || !chestItem.displayName.startsWith(util.colorSymbol + "aMap Selector")) continue; 141 | inventory.click(i, 0, 0); 142 | chestTicks = 0; 143 | break; 144 | } 145 | } else if (step == 3) { 146 | 147 | if (now - lastUpdate > 2000) { 148 | step = 1; 149 | } 150 | 151 | if (!client.getScreen().equals("GuiChest") || chestTicks < 5) return; 152 | 153 | List favorites = new ArrayList<>(); 154 | 155 | int generalFavorite = 0; 156 | for (int i = 0; i < inventory.getChestSize(); i++) { 157 | ItemStack chestItem = inventory.getStackInChestSlot(i); 158 | if (chestItem == null) continue; 159 | if (chestItem.displayName.startsWith(util.colorSymbol + "b")) { 160 | favorites.add(i); 161 | } else if (chestItem.displayName.startsWith(util.colorSymbol + "aRandom Map")) { 162 | generalFavorite = i; 163 | } 164 | } 165 | 166 | if (favorites.isEmpty()) { 167 | inventory.click(generalFavorite, 0, 0); 168 | closeScreen(); 169 | step = 1; 170 | lastUpdate = now; 171 | clickedMap = true; 172 | return; 173 | } 174 | 175 | int slot = favorites.get((favorites.indexOf(lastFavorite) + 1) % favorites.size()); 176 | if (favorites.size() == 1) slot = favorites.get(0); 177 | lastFavorite = slot; 178 | inventory.click(slot, 0, 0); 179 | clickedMap = true; 180 | closeScreen(); 181 | step = 1; 182 | lastUpdate = now; 183 | } 184 | } 185 | 186 | void onWorldJoin(Entity en) { 187 | if (clickedMap && en == client.getPlayer()) { 188 | modules.disable(scriptName); 189 | } 190 | } 191 | 192 | void onGuiUpdate(String name, boolean opened) { 193 | if (opened) { 194 | chestTicks = 0; 195 | } 196 | } 197 | 198 | boolean onPacketSent(CPacket packet) { 199 | if (packet.name.startsWith("C05") || packet.name.startsWith("C05")) { 200 | C03 c03 = (C03) packet; 201 | serverYaw = c03.yaw; 202 | serverPitch = c03.pitch; 203 | } 204 | return true; 205 | } 206 | 207 | Entity findQueueingNPC() { 208 | Entity player = client.getPlayer(); 209 | String armorStandName = getArmorStandName(); 210 | Vec3 cachedPosition = queueingCache.get(armorStandName); 211 | if (cachedPosition != null) { 212 | for (Entity p : world.getPlayerEntities()) { 213 | if (p == player) continue; 214 | if (p.getPosition().distanceToSq(cachedPosition) <= 2) { 215 | queueingCache.put(armorStandName, p.getPosition()); 216 | return p; 217 | } 218 | } 219 | } 220 | 221 | Entity armorStand = null; 222 | for (Entity as : world.getEntities()) { 223 | if (as.getName().contains(armorStandName)) { 224 | armorStand = as; 225 | break; 226 | } 227 | } 228 | 229 | if (armorStand == null) return null; 230 | Vec3 armorStandPosition = armorStand.getPosition(); 231 | 232 | for (Entity p : world.getPlayerEntities()) { 233 | if (p == player) continue; 234 | if (p.getPosition().distanceToSq(armorStandPosition) <= 2) { 235 | queueingCache.put(armorStandName, p.getPosition()); 236 | return p; 237 | } 238 | } 239 | 240 | return null; 241 | } 242 | 243 | String getArmorStandName() { 244 | int mode = (int) modules.getSlider(scriptName, "Select Mode"); 245 | 246 | switch (mode) { 247 | case 0: return "Solo"; 248 | case 1: return "Doubles"; 249 | case 2: return "3v3v3v3"; 250 | case 3: return "4v4v4v4"; 251 | } 252 | 253 | return "3v3v3v3"; 254 | } 255 | 256 | void closeScreen() { 257 | if (!client.getScreen().isEmpty()) { 258 | client.closeScreen(); 259 | } 260 | } 261 | 262 | float[] getRotations(Vec3 point) { 263 | Entity player = client.getPlayer(); 264 | Vec3 pos = player.getPosition().offset(0, player.getEyeHeight(), 0); 265 | double x = point.x - pos.x; 266 | double y = point.y - pos.y; 267 | double z = point.z - pos.z; 268 | double dist = Math.sqrt(x * x + z * z); 269 | float yaw = (float) Math.toDegrees(Math.atan2(z, x)) - 90f; 270 | float pitch = (float) Math.toDegrees(-Math.atan2(y, dist)); 271 | 272 | yaw = ((yaw % 360) + 360) % 360; 273 | if (yaw > 180) { 274 | yaw -= 360; 275 | } 276 | 277 | return new float[]{ yaw, pitch }; 278 | } 279 | 280 | int getBedwarsStatus() { 281 | List sidebar = world.getScoreboard(); 282 | if (sidebar == null) { 283 | if (world.getDimension().equals("The End")) { 284 | return 0; 285 | } 286 | return -1; 287 | } 288 | 289 | int size = sidebar.size(); 290 | if (size < 7) return -1; 291 | 292 | if (!util.strip(sidebar.get(0)).startsWith("BED WARS")) { 293 | return -1; 294 | } 295 | 296 | String lobbyId = util.strip(sidebar.get(1)).split(" ")[1]; 297 | if (lobbyId.charAt(lobbyId.length() - 1) == ']') { 298 | lobbyId = lobbyId.split(" ")[0]; 299 | } 300 | 301 | if (lobbyId.charAt(0) == 'L') { 302 | return 1; 303 | } 304 | 305 | if (util.strip(sidebar.get(5)).startsWith("R Red:") && util.strip(sidebar.get(6)).startsWith("B Blue:")) { 306 | return 3; 307 | } 308 | 309 | String six = util.strip(sidebar.get(6)); 310 | if (six.equals("Waiting...") || six.startsWith("Starting in")) { 311 | return 2; 312 | } 313 | 314 | return -1; 315 | } -------------------------------------------------------------------------------- /bed_defenses.json: -------------------------------------------------------------------------------- 1 | {"EndWoolCorners":[{"block":"end_stone","x":0,"y":0,"z":2},{"block":"wool","x":0,"y":0,"z":3},{"block":"wool","x":0,"y":0,"z":-2},{"block":"end_stone","x":0,"y":0,"z":-1},{"block":"wool","x":1,"y":0,"z":-1},{"block":"wool","x":1,"y":1,"z":-1},{"block":"wool","x":0,"y":1,"z":-1},{"block":"wool","x":-1,"y":0,"z":-1},{"block":"wool","x":-1,"y":1,"z":-1},{"block":"end_stone","x":-2,"y":0,"z":0},{"block":"end_stone","x":-2,"y":0,"z":1},{"block":"end_stone","x":-1,"y":0,"z":0},{"block":"end_stone","x":-1,"y":0,"z":1},{"block":"wool","x":-1,"y":1,"z":0},{"block":"wool","x":-1,"y":1,"z":1},{"block":"wool","x":-1,"y":0,"z":2},{"block":"end_stone","x":2,"y":0,"z":0},{"block":"end_stone","x":2,"y":0,"z":1},{"block":"end_stone","x":1,"y":0,"z":0},{"block":"end_stone","x":1,"y":0,"z":1},{"block":"wool","x":1,"y":1,"z":0},{"block":"wool","x":1,"y":1,"z":1},{"block":"wool","x":1,"y":0,"z":2},{"block":"end_stone","x":0,"y":1,"z":0},{"block":"end_stone","x":0,"y":1,"z":1},{"block":"wool","x":0,"y":2,"z":0},{"block":"wool","x":0,"y":2,"z":1},{"block":"wool","x":-1,"y":1,"z":2},{"block":"wool","x":1,"y":1,"z":2},{"block":"wool","x":0,"y":1,"z":2}],"EndWoolCorners2":[{"block":"end_stone","x":-2,"y":0,"z":0},{"block":"end_stone","x":-2,"y":0,"z":1},{"block":"end_stone","x":-1,"y":0,"z":0},{"block":"end_stone","x":-1,"y":0,"z":1},{"block":"end_stone","x":0,"y":0,"z":2},{"block":"end_stone","x":1,"y":0,"z":0},{"block":"end_stone","x":1,"y":0,"z":1},{"block":"end_stone","x":2,"y":0,"z":0},{"block":"end_stone","x":2,"y":0,"z":1},{"block":"end_stone","x":0,"y":1,"z":1},{"block":"end_stone","x":0,"y":1,"z":0},{"block":"end_stone","x":0,"y":0,"z":-1},{"block":"wool","x":1,"y":0,"z":-1},{"block":"wool","x":0,"y":1,"z":-1},{"block":"wool","x":0,"y":0,"z":-2},{"block":"wool","x":-1,"y":0,"z":-1},{"block":"wool","x":1,"y":1,"z":1},{"block":"wool","x":1,"y":1,"z":0},{"block":"wool","x":1,"y":1,"z":-1},{"block":"wool","x":0,"y":2,"z":1},{"block":"wool","x":0,"y":2,"z":0},{"block":"wool","x":-1,"y":1,"z":1},{"block":"wool","x":-1,"y":1,"z":0},{"block":"wool","x":-1,"y":1,"z":-1},{"block":"wool","x":-1,"y":0,"z":2},{"block":"wool","x":-1,"y":1,"z":2},{"block":"wool","x":0,"y":1,"z":2},{"block":"wool","x":1,"y":1,"z":2},{"block":"wool","x":1,"y":0,"z":2},{"block":"wool","x":0,"y":0,"z":3}],"EndGlassNoCorners":[{"block":"end_stone","x":0,"y":0,"z":2},{"block":"stained_glass","x":0,"y":0,"z":3},{"block":"stained_glass","x":-1,"y":0,"z":-1},{"block":"stained_glass","x":0,"y":0,"z":-2},{"block":"stained_glass","x":1,"y":0,"z":-1},{"block":"end_stone","x":0,"y":0,"z":-1},{"block":"end_stone","x":-2,"y":0,"z":0},{"block":"end_stone","x":-2,"y":0,"z":1},{"block":"end_stone","x":-1,"y":0,"z":0},{"block":"end_stone","x":-1,"y":0,"z":1},{"block":"end_stone","x":2,"y":0,"z":0},{"block":"end_stone","x":2,"y":0,"z":1},{"block":"end_stone","x":1,"y":0,"z":0},{"block":"end_stone","x":1,"y":0,"z":1},{"block":"stained_glass","x":-1,"y":1,"z":0},{"block":"stained_glass","x":-1,"y":1,"z":1},{"block":"stained_glass","x":-1,"y":0,"z":2},{"block":"stained_glass","x":0,"y":1,"z":-1},{"block":"stained_glass","x":1,"y":1,"z":0},{"block":"stained_glass","x":1,"y":1,"z":1},{"block":"stained_glass","x":1,"y":0,"z":2},{"block":"end_stone","x":0,"y":1,"z":0},{"block":"end_stone","x":0,"y":1,"z":1},{"block":"stained_glass","x":0,"y":2,"z":0},{"block":"stained_glass","x":0,"y":2,"z":1},{"block":"stained_glass","x":0,"y":1,"z":2}],"WoodWoolCorners":[{"block":"planks","x":-1,"y":0,"z":-1},{"block":"planks","x":-1,"y":0,"z":0},{"block":"planks","x":-1,"y":0,"z":1},{"block":"planks","x":-1,"y":0,"z":2},{"block":"planks","x":1,"y":0,"z":-1},{"block":"planks","x":1,"y":0,"z":0},{"block":"planks","x":1,"y":0,"z":1},{"block":"planks","x":1,"y":0,"z":2},{"block":"planks","x":0,"y":0,"z":2},{"block":"planks","x":0,"y":0,"z":3},{"block":"planks","x":0,"y":0,"z":-2},{"block":"planks","x":0,"y":0,"z":-1},{"block":"planks","x":0,"y":1,"z":-1},{"block":"planks","x":0,"y":1,"z":0},{"block":"planks","x":0,"y":1,"z":1},{"block":"planks","x":0,"y":1,"z":2},{"block":"wool","x":-2,"y":0,"z":0},{"block":"wool","x":-2,"y":0,"z":1},{"block":"wool","x":-1,"y":1,"z":-1},{"block":"wool","x":-1,"y":1,"z":0},{"block":"wool","x":-1,"y":1,"z":1},{"block":"wool","x":-1,"y":1,"z":2},{"block":"wool","x":0,"y":2,"z":0},{"block":"wool","x":0,"y":2,"z":1},{"block":"wool","x":1,"y":1,"z":-1},{"block":"wool","x":1,"y":1,"z":0},{"block":"wool","x":1,"y":1,"z":1},{"block":"wool","x":1,"y":1,"z":2},{"block":"wool","x":2,"y":0,"z":0},{"block":"wool","x":2,"y":0,"z":1}],"EndGlassWool":[{"block":"end_stone","x":-2,"y":0,"z":0},{"block":"end_stone","x":-2,"y":0,"z":1},{"block":"end_stone","x":-1,"y":0,"z":0},{"block":"end_stone","x":-1,"y":0,"z":1},{"block":"end_stone","x":0,"y":0,"z":2},{"block":"end_stone","x":1,"y":0,"z":0},{"block":"end_stone","x":1,"y":0,"z":1},{"block":"end_stone","x":2,"y":0,"z":0},{"block":"end_stone","x":2,"y":0,"z":1},{"block":"end_stone","x":0,"y":1,"z":1},{"block":"end_stone","x":0,"y":1,"z":0},{"block":"end_stone","x":0,"y":0,"z":-1},{"block":"stained_glass","x":1,"y":0,"z":-1},{"block":"stained_glass","x":0,"y":1,"z":-1},{"block":"stained_glass","x":0,"y":0,"z":-2},{"block":"stained_glass","x":-1,"y":0,"z":-1},{"block":"stained_glass","x":1,"y":1,"z":1},{"block":"stained_glass","x":1,"y":1,"z":0},{"block":"stained_glass","x":0,"y":2,"z":1},{"block":"stained_glass","x":0,"y":2,"z":0},{"block":"stained_glass","x":-1,"y":1,"z":1},{"block":"stained_glass","x":-1,"y":1,"z":0},{"block":"stained_glass","x":-1,"y":0,"z":2},{"block":"stained_glass","x":0,"y":1,"z":2},{"block":"stained_glass","x":1,"y":0,"z":2},{"block":"stained_glass","x":0,"y":0,"z":3},{"block":"wool","x":-3,"y":0,"z":0},{"block":"wool","x":-3,"y":0,"z":1},{"block":"wool","x":-2,"y":0,"z":2},{"block":"wool","x":-2,"y":1,"z":0},{"block":"wool","x":-2,"y":1,"z":1},{"block":"wool","x":-1,"y":1,"z":2},{"block":"wool","x":-1,"y":0,"z":3},{"block":"wool","x":0,"y":1,"z":3},{"block":"wool","x":0,"y":0,"z":4},{"block":"wool","x":1,"y":0,"z":3},{"block":"wool","x":1,"y":1,"z":2},{"block":"wool","x":2,"y":1,"z":0},{"block":"wool","x":2,"y":1,"z":1},{"block":"wool","x":2,"y":0,"z":2},{"block":"wool","x":3,"y":0,"z":0},{"block":"wool","x":3,"y":0,"z":1},{"block":"wool","x":1,"y":2,"z":0},{"block":"wool","x":1,"y":2,"z":1},{"block":"wool","x":0,"y":2,"z":2},{"block":"wool","x":-1,"y":2,"z":0},{"block":"wool","x":-1,"y":2,"z":1},{"block":"wool","x":-2,"y":0,"z":-1},{"block":"wool","x":-1,"y":0,"z":-2},{"block":"wool","x":0,"y":0,"z":-3},{"block":"wool","x":1,"y":0,"z":-2},{"block":"wool","x":2,"y":0,"z":-1},{"block":"wool","x":1,"y":1,"z":-1},{"block":"wool","x":0,"y":1,"z":-2},{"block":"wool","x":-1,"y":1,"z":-1},{"block":"wool","x":0,"y":2,"z":-1},{"block":"wool","x":0,"y":3,"z":0},{"block":"wool","x":0,"y":3,"z":1}]} -------------------------------------------------------------------------------- /bps.java: -------------------------------------------------------------------------------- 1 | List positions = new ArrayList<>(); 2 | int tickRange = 20; 3 | boolean showXZOnly = false; 4 | 5 | void onLoad() { 6 | modules.registerSlider("Tick Range", "", 20, 2, 50, 1); 7 | modules.registerButton("Show XZ Only", false); 8 | } 9 | 10 | void onPreUpdate() { 11 | Entity player = client.getPlayer(); 12 | Vec3 currentPos = player.getPosition(); 13 | positions.add(currentPos); 14 | tickRange = (int) modules.getSlider(scriptName, "Tick Range"); 15 | showXZOnly = modules.getButton(scriptName, "Show XZ Only"); 16 | while (positions.size() > tickRange) { 17 | positions.remove(0); 18 | } 19 | } 20 | 21 | void onRenderTick(float partialTicks) { 22 | if (positions.size() < 2 || !client.getScreen().isEmpty()) return; 23 | 24 | double totalDistanceXYZ = 0; 25 | double totalDistanceXZ = 0; 26 | 27 | for (int i = 1; i < positions.size(); i++) { 28 | Vec3 prev = positions.get(i - 1); 29 | Vec3 current = positions.get(i); 30 | 31 | totalDistanceXYZ += distanceXYZ(prev, current); 32 | totalDistanceXZ += distanceXZ(prev, current); 33 | } 34 | 35 | double averageBPS = totalDistanceXYZ / (positions.size() - 1) * 20; 36 | double horizontalBPS = totalDistanceXZ / (positions.size() - 1) * 20; 37 | int baseX = 1; 38 | int baseY = client.getDisplaySize()[1] - 1 - render.getFontHeight(); 39 | 40 | render.text2d("bps: " + util.round(averageBPS, 1), baseX, baseY, 1, 0xFFFFFF, true); 41 | if (showXZOnly) { 42 | render.text2d("hbps: " + util.round(horizontalBPS, 1), baseX, baseY - render.getFontHeight() - 1, 1, 0xFFFFFF, true); 43 | } 44 | } 45 | 46 | 47 | double distanceXYZ(Vec3 a, Vec3 b) { 48 | return Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2) + Math.pow(a.z - b.z, 2)); 49 | } 50 | 51 | double distanceXZ(Vec3 a, Vec3 b) { 52 | return Math.sqrt(Math.pow(a.x - b.x, 2) + Math.pow(a.z - b.z, 2)); 53 | } 54 | -------------------------------------------------------------------------------- /cops.java: -------------------------------------------------------------------------------- 1 | /* 2 | aimbot/anti recoil for hypixel cops n crims 3 | loadstring: load - "https://raw.githubusercontent.com/PugrillaDev/Raven-Scripts/refs/heads/main/cops.java" 4 | */ 5 | 6 | List targets = new ArrayList<>(); 7 | int targetColor = new Color(255, 0, 0).getRGB(), hitcolor = new Color(0, 255, 0).getRGB(); 8 | int predictionTicks = 1; 9 | float serverYaw, serverPitch; 10 | Entity target = null; 11 | Vec3 aimPoint = null; 12 | boolean sentAlready = false; 13 | HashSet ignoreBlocks = new HashSet<>(Arrays.asList( 14 | "wall_sign", 15 | "torch", 16 | "air", 17 | "ladder", 18 | "wheat", 19 | "planks", 20 | "coal_ore", 21 | "emerald_ore", 22 | "wooden_slab", 23 | "iron_ore", 24 | "stained_glass_pane", 25 | "diamond_ore", 26 | "iron_bars", 27 | "spruce_stairs", 28 | "fire" 29 | )); 30 | Map> recoilValues = new HashMap<>(); 31 | int recoil = 0, aim = 0, lastStackSize = 1, lastDurability = 100; 32 | String teamColor = ""; 33 | 34 | double hitboxScale = 1.0; 35 | double width = 0.6 * hitboxScale; 36 | double height = 1.8 * hitboxScale; 37 | double halfWidth = width / 2d; 38 | double halfHeight = height / 2d; 39 | 40 | void onEnable() { 41 | serverYaw = client.getPlayer().getYaw(); 42 | serverPitch = client.getPlayer().getPitch(); 43 | } 44 | 45 | void onLoad() { 46 | modules.registerButton("Hold Right Click", true); 47 | modules.registerButton("Spin Bot", false); 48 | modules.registerButton("Silent Aim", true); 49 | modules.registerButton("No Recoil", true); 50 | modules.registerSlider("Prediction Ticks", "", 3, 0, 10, 1); 51 | 52 | recoilValues.put("wooden_pickaxe", Arrays.asList( 53 | new Double[]{0.33, 12d}, 54 | new Double[]{0.33, 12d}, 55 | new Double[]{0.33, 12d}, 56 | new Double[]{0.33, 12d}, 57 | new Double[]{0.33, 12d}, 58 | new Double[]{0.33, 12d}, 59 | new Double[]{0.33, 12d}, 60 | new Double[]{0.33, 12d}, 61 | new Double[]{0.33, 12d}, 62 | new Double[]{0.29, 12d}, 63 | new Double[]{0.27, 12d}, 64 | new Double[]{0.25, 12d} 65 | )); 66 | 67 | recoilValues.put("stone_hoe", Arrays.asList( 68 | new Double[]{1.2, 5d}, 69 | new Double[]{1.2, 5d} 70 | )); 71 | 72 | recoilValues.put("iron_axe", Arrays.asList( 73 | new Double[]{1.53, 3d}, 74 | new Double[]{1.53, 3d} 75 | )); 76 | 77 | recoilValues.put("golden_pickaxe", Arrays.asList( 78 | new Double[]{0.82, 7d}, 79 | new Double[]{0.82, 7d}, 80 | new Double[]{0.82, 7d}, 81 | new Double[]{0.82, 7d}, 82 | new Double[]{0.82, 7d}, 83 | new Double[]{0.72, 7d} 84 | )); 85 | 86 | recoilValues.put("golden_shovel", Arrays.asList( 87 | new Double[]{1.0, 7d}, 88 | new Double[]{1.4, 7d}, 89 | new Double[]{1.2, 7d}, 90 | new Double[]{1.1, 7d}, 91 | new Double[]{0.62, 7d} 92 | )); 93 | } 94 | 95 | void onPreMotion(PlayerState s) { 96 | String targetName = target != null ? target.getName() : ""; 97 | target = null; 98 | aimPoint = null; 99 | Entity player = client.getPlayer(); 100 | ItemStack heldItem = player.getHeldItem(); 101 | String itemName = heldItem != null ? heldItem.name : ""; 102 | int stackSize = heldItem != null ? heldItem.stackSize : 1; 103 | int durability = heldItem != null ? heldItem.durability : 1; 104 | int maxDurability = heldItem != null ? heldItem.maxDurability : 1; 105 | int ticksExisted = player.getTicksExisted(); 106 | predictionTicks = (int) modules.getSlider(scriptName, "Prediction Ticks") + 1; 107 | 108 | if (ticksExisted % 20 == 0) { 109 | getTeamColor(); 110 | } 111 | 112 | if (!recoilValues.containsKey(itemName) || !player.onGround()) { 113 | recoil = aim = 0; 114 | return; 115 | } 116 | 117 | if (stackSize < lastStackSize || durability < lastDurability) { 118 | recoil++; 119 | } 120 | 121 | if (durability != lastDurability && durability > lastDurability) { 122 | recoil = 0; 123 | } 124 | 125 | lastStackSize = stackSize; 126 | lastDurability = durability; 127 | 128 | boolean manual = modules.getButton(scriptName, "Hold Right Click"); 129 | boolean doAiming = !manual || (manual && keybinds.isMouseDown(1)); 130 | 131 | if (doAiming) { 132 | List closest = getClosestEntities(3); 133 | for (Entity p : closest) { 134 | Object[] hit = canHitEntity(p); 135 | boolean successful = Boolean.parseBoolean(hit[0].toString()); 136 | if (!successful) continue; 137 | target = p; 138 | aimPoint = (Vec3) hit[1]; 139 | break; 140 | } 141 | 142 | String newTargetName = target != null ? target.getName() : ""; 143 | if (target == null || !targetName.equals(newTargetName)) { 144 | aim = 0; 145 | if (target == null) recoil = 0; 146 | } 147 | 148 | boolean silentAim = target != null && modules.getButton(scriptName, "Silent Aim"); 149 | float[] rotations = new float[]{ player.getYaw(), player.getPitch() }; 150 | if (silentAim) rotations = getRotations(aimPoint); 151 | 152 | if (modules.getButton(scriptName, "No Recoil")) { 153 | List recoilList = recoilValues.getOrDefault(itemName, new ArrayList<>()); 154 | int index = Math.min(recoilList.size(), recoil); 155 | 156 | if (index > 0) { 157 | Double[] recoilVals = recoilList.get(index - 1); 158 | rotations[1] += recoilVals[0].floatValue() * (float)Math.min(recoilVals[1].intValue(), recoil); 159 | //client.print("Value: " + recoilVals[0] + " Recoil: " + recoil); 160 | } 161 | } 162 | 163 | int scaleFactor = (int) Math.floor(serverYaw / 360); 164 | float unwrappedYaw = rotations[0] + 360 * scaleFactor; 165 | if (unwrappedYaw < serverYaw - 180) { 166 | unwrappedYaw += 360; 167 | } else if (unwrappedYaw > serverYaw + 180) { 168 | unwrappedYaw -= 360; 169 | } 170 | 171 | float deltaYaw = unwrappedYaw - serverYaw; 172 | float deltaPitch = rotations[1] - serverPitch; 173 | 174 | if (silentAim) { 175 | s.yaw = serverYaw + (Math.abs(deltaYaw) >= 0.1 ? deltaYaw : 0); 176 | s.pitch = serverPitch + (Math.abs(deltaPitch) >= 0.1 ? deltaPitch : 0); 177 | } 178 | 179 | if (target == null && modules.getButton(scriptName, "Spin Bot")) { 180 | s.yaw = (float) util.randomDouble(-180, 180); 181 | s.pitch = (float) util.randomDouble(-90, 90); 182 | } 183 | 184 | if (target != null && aim++ > 0 && !sentAlready && durability == maxDurability) { 185 | client.sendPacketNoEvent(new C08(heldItem, new Vec3(-1, -1, -1), 255, new Vec3(0.0, 0.0, 0.0))); 186 | } 187 | } else { 188 | recoil = aim = 0; 189 | } 190 | } 191 | 192 | boolean onMouse(int button, boolean state) { 193 | if (!modules.getButton(scriptName, "Hold Right Click")) return true; 194 | if (button != 1 || !state) return true; 195 | 196 | Entity player = client.getPlayer(); 197 | ItemStack heldItem = player.getHeldItem(); 198 | String itemName = heldItem != null ? heldItem.name : ""; 199 | 200 | return !recoilValues.containsKey(itemName); 201 | } 202 | 203 | void onRenderTick(float partialTicks) { 204 | if (target == null || !render.isInView(target)) return; 205 | double scale = partialTicks; 206 | int size = client.getDisplaySize()[2]; 207 | 208 | Vec3 screen = render.worldToScreen(aimPoint.x, aimPoint.y, aimPoint.z, size, partialTicks); 209 | 210 | if (screen.z >= 0 && screen.z < 1.0003684d) { 211 | double crosshairSize = 3; 212 | double startX = screen.x - crosshairSize; 213 | double endX = screen.x + crosshairSize; 214 | double startY = screen.y - crosshairSize; 215 | double endY = screen.y + crosshairSize; 216 | 217 | render.line2D(startX, screen.y, endX, screen.y, 3.0f, targetColor); 218 | render.line2D(screen.x, startY, screen.x, endY, 3.0f, targetColor); 219 | } 220 | } 221 | 222 | void onPostMotion() { 223 | sentAlready = false; 224 | } 225 | 226 | boolean onPacketSent(CPacket packet) { 227 | if (packet.name.startsWith("C05") || packet.name.startsWith("C06")) { 228 | C03 c03 = (C03) packet; 229 | serverYaw = c03.yaw; 230 | serverPitch = c03.pitch; 231 | } else if (packet instanceof C08) { 232 | sentAlready = true; 233 | } 234 | return true; 235 | } 236 | 237 | void getTeamColor() { 238 | List lines = world.getScoreboard(); 239 | if (lines.size() < 13) return; 240 | String line = lines.get(12); 241 | if (!line.contains("Team: ")) return; 242 | teamColor = line.split("Team: ")[1].substring(0, 2); 243 | } 244 | 245 | List getClosestEntities(int numberOfEntities) { 246 | Entity player = client.getPlayer(); 247 | 248 | List entityDistances = new ArrayList<>(); 249 | for (Entity entity : world.getPlayerEntities()) { 250 | if ((entity.getUUID().charAt(14) != '4' && entity.getUUID().charAt(14) != '1') || entity.isInvisible() || entity.getNetworkPlayer() == null || entity == player || entity.getDisplayName().startsWith(teamColor)) continue; 251 | double distanceSq = player.getPosition().distanceToSq(entity.getPosition()); 252 | entityDistances.add(new Object[]{entity, distanceSq}); 253 | } 254 | 255 | for (int i = 0; i < entityDistances.size() - 1; i++) { 256 | for (int j = 0; j < entityDistances.size() - i - 1; j++) { 257 | if ((double) entityDistances.get(j)[1] > (double) entityDistances.get(j + 1)[1]) { 258 | Object[] temp = entityDistances.get(j); 259 | entityDistances.set(j, entityDistances.get(j + 1)); 260 | entityDistances.set(j + 1, temp); 261 | } 262 | } 263 | } 264 | 265 | List closestEntities = new ArrayList<>(); 266 | for (int i = 0; i < Math.min(numberOfEntities, entityDistances.size()); i++) { 267 | closestEntities.add((Entity) entityDistances.get(i)[0]); 268 | } 269 | 270 | return closestEntities; 271 | } 272 | 273 | double interpolate(double current, double old, double scale) { 274 | return old + (current - old) * scale; 275 | } 276 | 277 | Object[] canHitEntity(Entity p) { 278 | Vec3[] boundingBox = getPredictedBoundingBox(p); 279 | Vec3 pos = boundingBox[0].offset(halfWidth, 0, halfWidth); 280 | 281 | Vec3[] offsets = { 282 | new Vec3(0, p.getEyeHeight(), 0), 283 | new Vec3(halfWidth, halfHeight, 0), 284 | new Vec3(0, halfHeight, halfWidth), 285 | new Vec3(-halfWidth, halfHeight, 0), 286 | new Vec3(0, halfHeight, -halfWidth), 287 | new Vec3(0, height, 0), 288 | new Vec3(0, 0, 0) 289 | }; 290 | 291 | for (Vec3 offset : offsets) { 292 | Vec3 targetPos = pos.offset(offset.x, offset.y, offset.z); 293 | if (isRaycastHit(targetPos, boundingBox)) { 294 | return new Object[] { true, targetPos }; 295 | } 296 | } 297 | 298 | return new Object[] { false }; 299 | } 300 | 301 | boolean isRaycastHit(Vec3 targetPos, Vec3[] boundingBox) { 302 | float[] rots = getRotations(targetPos); 303 | List path = raycastPath(100, rots[0], rots[1], 0.2); 304 | for (Vec3 pos : path) { 305 | Block block = world.getBlockAt(pos); 306 | if (isWithinBoundingBox(pos, boundingBox)) return true; 307 | if (ignoreBlocks.contains(block.name)) continue; 308 | return false; 309 | } 310 | return false; 311 | } 312 | 313 | Vec3[] getPredictedBoundingBox(Entity p) { 314 | Vec3 position = p.getPosition(); 315 | Vec3 lposition = p.getLastPosition(); 316 | Vec3 motion = position.offset(-lposition.x, -lposition.y, -lposition.z); 317 | 318 | boolean inAir = world.getBlockAt(position).name.equals("air"); 319 | if (inAir) { 320 | motion.x *= 0.91; 321 | motion.z *= 0.91; 322 | } 323 | 324 | Vec3 predictedPosition = position.offset(motion.x * predictionTicks, motion.y * (predictionTicks / 4), motion.z * predictionTicks); 325 | Vec3[] boundingBox = { predictedPosition.offset(-halfWidth, 0, -halfWidth), predictedPosition.offset(halfWidth, height, halfWidth) }; 326 | return boundingBox; 327 | } 328 | 329 | List raycastPath(double distance, float yaw, float pitch, double step) { 330 | List positions = new ArrayList<>(); 331 | 332 | double yawRad = Math.toRadians(yaw); 333 | double pitchRad = Math.toRadians(pitch); 334 | 335 | double dirX = -Math.sin(yawRad) * Math.cos(pitchRad); 336 | double dirY = -Math.sin(pitchRad); 337 | double dirZ = Math.cos(yawRad) * Math.cos(pitchRad); 338 | 339 | Entity player = client.getPlayer(); 340 | Vec3 startPos = player.getPosition().offset(0, player.getEyeHeight(), 0); 341 | 342 | for (double i = 0; i <= distance; i += step) { 343 | positions.add(new Vec3(startPos.x + dirX * i, startPos.y + dirY * i, startPos.z + dirZ * i)); 344 | } 345 | 346 | return positions; 347 | } 348 | 349 | boolean isWithinBoundingBox(Vec3 position, Vec3[] boundingBox) { 350 | Vec3 min = boundingBox[0]; 351 | Vec3 max = boundingBox[1]; 352 | 353 | return (position.x >= min.x && position.x <= max.x) && 354 | (position.y >= min.y && position.y <= max.y) && 355 | (position.z >= min.z && position.z <= max.z); 356 | } 357 | 358 | float[] getRotations(Vec3 point) { 359 | Entity player = client.getPlayer(); 360 | Vec3 pos = player.getPosition().offset(0, player.getEyeHeight(), 0); 361 | double x = point.x - pos.x; 362 | double y = point.y - pos.y; 363 | double z = point.z - pos.z; 364 | double dist = Math.sqrt(x * x + z * z); 365 | float yaw = (float) Math.toDegrees(Math.atan2(z, x)) - 90f; 366 | float pitch = (float) Math.toDegrees(-Math.atan2(y, dist)); 367 | 368 | yaw = ((yaw % 360) + 360) % 360; 369 | if (yaw > 180) { 370 | yaw -= 360; 371 | } 372 | 373 | return new float[]{ yaw, pitch }; 374 | } -------------------------------------------------------------------------------- /dcbot.java: -------------------------------------------------------------------------------- 1 | /* 2 | dcbot/infinite bblr bot for hypixel bedwars 3 | loadstring: load - "https://raw.githubusercontent.com/PugrillaDev/Raven-Scripts/refs/heads/main/dcbot.java" 4 | */ 5 | 6 | String prefix = "&7[&dR&7]&r "; 7 | Vec3 bedPosition = null; 8 | double bedDistance = 0; 9 | boolean disconnecting = false; 10 | int range = 20; 11 | int offset = 60; 12 | int tooFarRange = 100; 13 | String farmsg = util.color("&4YOU ARE FAR FROM YOUR BED"); 14 | int farwidth = render.getFontWidth(farmsg); 15 | String myTeamColor = "hmtghmn thjt"; 16 | String defaultColor = util.color("&7"); 17 | HashSet blacklistedItems = new HashSet<>(Arrays.asList( 18 | "ender_pearl" 19 | )); 20 | HashSet blacklistedEntities = new HashSet<>(Arrays.asList( 21 | "EntityEnderPearl" 22 | )); 23 | 24 | HashSet traps = new HashSet<>(Arrays.asList( 25 | "Alarm Trap was set off!", 26 | "Counter-Offensive Trap was set off!", 27 | "It's a trap! was set off!", 28 | "Miner Fatigue Trap was set off!" 29 | )); 30 | 31 | void onLoad() { 32 | modules.registerSlider("Range", "", 20, 5, 60, 1); 33 | modules.registerButton("Disconnect Far Away", false); 34 | modules.registerSlider("Far Away Range", "", 100, 50, 200, 1); 35 | modules.registerSlider("Far Away Y-Offset", "", 60, render.getFontHeight(), 500, 1); 36 | } 37 | 38 | boolean onChat(String message) { 39 | String msg = util.strip(message); 40 | boolean serverMessage = !msg.contains(":"); 41 | if (serverMessage) { 42 | if (msg.contains("Protect your bed and destroy the enemy beds.")) { 43 | client.async(() -> { 44 | client.sleep(4000); 45 | bedPosition = findBed(30); 46 | disconnecting = false; 47 | if (bedPosition != null) { 48 | client.print(prefix + "&aBed found."); 49 | } else { 50 | disconnect(); 51 | client.print(prefix + "&cFailed to find bed."); 52 | } 53 | }); 54 | } else if (disconnecting && ( 55 | msg.startsWith("A disconnect occurred in your connection") || 56 | msg.startsWith("Unknown command.") || 57 | msg.equals("disconnect.spam") || 58 | msg.startsWith("You are sending commands too fast!") 59 | )) { 60 | return false; 61 | } else if (traps.contains(msg)) { 62 | disconnect(); 63 | return true; 64 | } 65 | } 66 | return true; 67 | } 68 | 69 | void onPreUpdate() { 70 | offset = (int) modules.getSlider(scriptName, "Far Away Y-Offset"); 71 | if (bedPosition == null || getBedwarsStatus() != 3) return; 72 | 73 | range = (int) modules.getSlider(scriptName, "Range"); 74 | Entity player = client.getPlayer(); 75 | Vec3 m = player.getPosition(); 76 | double deltaX = m.x - bedPosition.x; 77 | double deltaZ = m.z - bedPosition.z; 78 | bedDistance = Math.abs(deltaX * deltaX + deltaZ * deltaZ); 79 | tooFarRange = (int) modules.getSlider(scriptName, "Far Away Range"); 80 | if (!client.allowFlying() && bedDistance >= tooFarRange * tooFarRange && modules.getButton(scriptName, "Disconnect Far Away")) { 81 | client.print(prefix + "&eYou are too far from the bed."); 82 | disconnect(); 83 | return; 84 | } 85 | String myName = player.getNetworkPlayer() != null ? player.getNetworkPlayer().getDisplayName() : player.getDisplayName(); 86 | if (!player.isInvisible() && myName.contains(" ")) myTeamColor = myName.substring(0, 2); 87 | 88 | for (Entity p : world.getPlayerEntities()) { 89 | String uuid = p.getUUID(); 90 | if (p == player || p.getNetworkPlayer() == null || (uuid.charAt(14) != '4' && uuid.charAt(14) != '1') || p.getDisplayName().startsWith(myTeamColor) || p.getDisplayName().startsWith(defaultColor)) continue; 91 | 92 | String itemName = p.getHeldItem() != null ? p.getHeldItem().name : ""; 93 | boolean badItem = blacklistedItems.contains(itemName); 94 | if (badItem) { 95 | client.print(prefix + p.getDisplayName() + " &r&7is holding a blacklisted item: &d" + itemName + "&7."); 96 | disconnect(); 97 | return; 98 | } 99 | 100 | Vec3 ePos = p.getPosition(); 101 | double dX = ePos.x - bedPosition.x; 102 | double dZ = ePos.z - bedPosition.z; 103 | boolean within = areWithinBoundingBox(bedPosition, ePos, range) && Math.abs(Math.sqrt(dX * dX + dZ * dZ)) < range; 104 | if (within) { 105 | client.print(prefix + p.getDisplayName() + " &r&7is near bed: &d" + util.round(Math.abs(Math.sqrt(dX * dX + dZ * dZ)), 1) + "&7."); 106 | disconnect(); 107 | break; 108 | } 109 | } 110 | 111 | if (player.getTicksExisted() % 5 == 0) { 112 | for (Entity en : world.getEntities()) { 113 | if (!blacklistedEntities.contains(en.type)) continue; 114 | 115 | double closest = Double.MAX_VALUE; 116 | Entity closestPlayer = null; 117 | for (Entity p : world.getPlayerEntities()) { 118 | String uuid = p.getUUID(); 119 | if (p == player || p.getNetworkPlayer() == null || (uuid.charAt(14) != '4' && uuid.charAt(14) != '1') || p.getDisplayName().startsWith(myTeamColor) || p.getDisplayName().startsWith(defaultColor)) continue; 120 | double dist = p.getPosition().distanceToSq(en.getPosition()); 121 | if (dist < closest) { 122 | closest = dist; 123 | closestPlayer = p; 124 | } 125 | } 126 | 127 | String closestName = closestPlayer != null ? closestPlayer.getDisplayName() : "&dUnknown"; 128 | client.print(prefix + "&7Blacklisted entity detected: &d" + en.type + "&7."); 129 | client.print(prefix + "&7Closest player: " + closestName + "&r&7."); 130 | disconnect(); 131 | } 132 | } 133 | } 134 | 135 | void onRenderTick(float partialTicks) { 136 | if (!client.getScreen().isEmpty() || bedDistance < tooFarRange * tooFarRange) return; 137 | int[] displaySize = client.getDisplaySize(); 138 | render.text2d(farmsg, (displaySize[0] / 2) - (farwidth / 2), displaySize[1] - offset, 1, 0, true); 139 | } 140 | 141 | void onWorldJoin(Entity en) { 142 | Entity player = client.getPlayer(); 143 | if (en == player && getBedwarsStatus() != 2) { 144 | if (bedPosition != null) client.print(prefix + "&7Reset bed position."); 145 | bedPosition = null; 146 | bedDistance = 0; 147 | disconnecting = false; 148 | return; 149 | } 150 | 151 | if (blacklistedEntities.contains(en.type)) { 152 | double closest = Double.MAX_VALUE; 153 | Entity closestPlayer = null; 154 | for (Entity p : world.getPlayerEntities()) { 155 | String uuid = p.getUUID(); 156 | if (p == player || p.getNetworkPlayer() == null || (uuid.charAt(14) != '4' && uuid.charAt(14) != '1') || p.getDisplayName().startsWith(myTeamColor) || p.getDisplayName().startsWith(defaultColor)) continue; 157 | double dist = p.getPosition().distanceToSq(en.getPosition()); 158 | if (dist < closest) { 159 | closest = dist; 160 | closestPlayer = p; 161 | } 162 | } 163 | 164 | String closestName = closestPlayer != null ? closestPlayer.getDisplayName() : "&dUnknown"; 165 | client.print(prefix + "&7Blacklisted entity detected: &d" + en.type + "&7."); 166 | client.print(prefix + "&7Closest player: " + closestName + "&r&7."); 167 | disconnect(); 168 | return; 169 | } 170 | } 171 | 172 | void disconnect() { 173 | //client.sendPacketNoEvent(new C07(null, "", "UP")); 174 | client.chat("/bedwars"); 175 | 176 | for (int i = 0; i < 100; i++) { 177 | client.chat("/"); 178 | } 179 | 180 | client.chat("/bedwars"); 181 | disconnecting = true; 182 | bedPosition = null; 183 | bedDistance = 0; 184 | client.print(prefix + "&7Disconnected."); 185 | 186 | client.async(() -> { 187 | client.sleep(3000); 188 | disconnecting = false; 189 | }); 190 | } 191 | 192 | boolean areWithinBoundingBox(Vec3 vec1, Vec3 vec2, double x) { 193 | return Math.abs(vec1.x - vec2.x) <= x && Math.abs(vec1.z - vec2.z) <= x; 194 | } 195 | 196 | Vec3 findBed(int range) { 197 | Vec3 playerPos = client.getPlayer().getBlockPosition(); 198 | int startX = (int)playerPos.x - range; 199 | int startY = (int)playerPos.y - range; 200 | int startZ = (int)playerPos.z - range; 201 | 202 | for (int x = startX; x <= playerPos.x + range; x++) { for (int y = startY; y <= playerPos.y + range; y++) { for (int z = startZ; z <= playerPos.z + range; z++) { 203 | Block block = world.getBlockAt(new Vec3(x, y, z)); 204 | if (!block.name.equalsIgnoreCase("bed")) continue; 205 | return new Vec3(x, y, z); 206 | }}} 207 | 208 | return null; 209 | } 210 | 211 | int getBedwarsStatus() { 212 | List sidebar = world.getScoreboard(); 213 | if (sidebar == null) { 214 | if (world.getDimension().equals("The End")) { 215 | return 0; 216 | } 217 | return -1; 218 | } 219 | 220 | int size = sidebar.size(); 221 | if (size < 7) return -1; 222 | 223 | if (!util.strip(sidebar.get(0)).startsWith("BED WARS")) { 224 | return -1; 225 | } 226 | 227 | String lobbyId = util.strip(sidebar.get(1)).split(" ")[1]; 228 | if (lobbyId.charAt(lobbyId.length() - 1) == ']') { 229 | lobbyId = lobbyId.split(" ")[0]; 230 | } 231 | 232 | if (lobbyId.charAt(0) == 'L') { 233 | return 1; 234 | } 235 | 236 | if (util.strip(sidebar.get(5)).startsWith("R Red:") && util.strip(sidebar.get(6)).startsWith("B Blue:")) { 237 | return 3; 238 | } 239 | 240 | String six = util.strip(sidebar.get(6)); 241 | if (six.equals("Waiting...") || six.startsWith("Starting in")) { 242 | return 2; 243 | } 244 | 245 | return -1; 246 | } -------------------------------------------------------------------------------- /hotkeys.java: -------------------------------------------------------------------------------- 1 | /* 2 | simple chat hotkeys 3 | loadstring: load - "https://raw.githubusercontent.com/PugrillaDev/Raven-Scripts/refs/heads/main/hotkeys.java" 4 | */ 5 | 6 | Map hotkeys = new HashMap<>(); 7 | Map lastPressed = new HashMap<>(); 8 | 9 | void onLoad() { 10 | modules.registerButton("Show Alerts", true); 11 | registerHotkey("Bedwars Lobby", "/bedwars"); 12 | registerHotkey("Lobby", "/l"); 13 | registerHotkey("Warp", "/p warp"); 14 | registerHotkey("Fours", "/play bedwars_four_four"); 15 | } 16 | 17 | void onEnable() { 18 | for (String key : hotkeys.keySet()) { 19 | lastPressed.put(key, false); 20 | } 21 | } 22 | 23 | void onPreUpdate() { 24 | for (String name : hotkeys.keySet()) { 25 | boolean pressed = modules.getKeyPressed(scriptName, name); 26 | boolean wasPressed = lastPressed.getOrDefault(name, false); 27 | if (client.getScreen().isEmpty() && !wasPressed && pressed) { 28 | activate(name); 29 | } 30 | lastPressed.put(name, pressed); 31 | } 32 | } 33 | 34 | void activate(String name) { 35 | if (modules.getButton(scriptName, "Show Alerts")) { 36 | client.print("&7[&dR&7] &7Activated keybind &d" + name + "&7."); 37 | } 38 | client.chat(hotkeys.get(name)); 39 | } 40 | 41 | void registerHotkey(String name, String text) { 42 | hotkeys.put(name, text); 43 | modules.registerKey(name, 0); 44 | lastPressed.put(name, false); 45 | } -------------------------------------------------------------------------------- /itemAlerts.java: -------------------------------------------------------------------------------- 1 | /* 2 | Made by pug 3 | 4 | Steps to add a new item: 5 | 1. Add a display tag using the addDisplayColor method with the item name/displayName in the onLoad event. 6 | 2. Register a button for the item using the registerButton method in the onLoad event. 7 | 3. Add the item as a name/displayName/armorPiece using the addName/addDisplayName/addArmorPiece methods in the setupItems method. 8 | 9 | Tips: 10 | All variables are updated every 5 seconds because raven FPS is dogshit. Refer to this line: if (playerEntity.getTicksExisted() % 100 == 0). 11 | Use the debug option to print the name/displayName of a player's held item in the chat when attacking them. 12 | Check your latest.log file for specific color codes in the displayName. 13 | Display names are the names display for the item, names are the raw minecraft names; they are different. 14 | Items in your inventory may have different displayName values than other players. (ex: Dream Defenders vs Machine Gun Bow) 15 | Don't be stupid, look at the code as a reference to add items. 16 | 17 | loadstring: load - "https://raw.githubusercontent.com/PugrillaDev/Raven-Scripts/refs/heads/main/itemAlerts.java" 18 | */ 19 | 20 | Map> playerItems = new HashMap<>(); 21 | HashSet teamUpgrades = new HashSet<>(); 22 | Map itemDisplayColors = new HashMap<>(); 23 | HashSet armorPieceNames = new HashSet<>(); 24 | HashSet heldItemNames = new HashSet<>(); 25 | HashSet heldItemDisplayNames = new HashSet<>(); 26 | HashSet checkedPlayers = new HashSet<>(); 27 | List> alerts = new ArrayList<>(); 28 | 29 | boolean showDistance = true, showTeammates = false, debug = false, showSharpness = false, showProtection = false; 30 | String myName, myTeam = "", chatPrefix = "&7[&dR&7]&d&r "; 31 | String[] colorKeysArray = {"c", "9", "a", "e", "b", "f", "d", "8"}; 32 | int status = -1, DELAY_INTERVAL = 15000; 33 | 34 | void onLoad() { 35 | addDisplayColor("chainmail_leggings", "&fChainmail Armor"); 36 | addDisplayColor("iron_leggings", "&fIron Armor"); 37 | addDisplayColor("diamond_leggings", "&bDiamond Armor"); 38 | addDisplayColor("iron_sword", "&fIron Sword"); 39 | addDisplayColor("diamond_sword", "&bDiamond Sword"); 40 | addDisplayColor("diamond_pickaxe", "&bDiamond Pickaxe"); 41 | addDisplayColor("ender_pearl", "&3Ender Pearl"); 42 | addDisplayColor("egg", "&eBridge Egg"); 43 | addDisplayColor("fire_charge", "&6Fireball"); 44 | addDisplayColor("Bow", "&2Bow"); 45 | addDisplayColor("obsidian", "&5Obsidian"); 46 | addDisplayColor("tnt", "&cT&fN&cT"); 47 | addDisplayColor("prismarine_shard", "&3Block Zapper"); 48 | addDisplayColor("Speed II Potion (45 seconds)", "&bSpeed Potion"); 49 | addDisplayColor("Jump V Potion (45 seconds)", "&aJump Boost Potion"); 50 | addDisplayColor("Invisibility Potion (30 seconds)", "&fInvisibility Potion"); 51 | addDisplayColor("&cDream Defender", "&fIron Golem"); 52 | addDisplayColor("Machine Gun Bow", "&4Machine Gun Bow"); 53 | addDisplayColor("Charlie the Unicorn", "&dCharlie the Unicorn"); 54 | addDisplayColor("Ice Bridge", "&bIce Bridge"); 55 | addDisplayColor("Sleeping Dust", "&cSleeping Dust"); 56 | addDisplayColor("Unstable Teleportation Device", "&eUnstable Teleportation Device"); 57 | addDisplayColor("Devastator Bow", "&2Devastator Bow"); 58 | addDisplayColor("Miracle of the Stars", "&eMiracle of the Stars"); 59 | addDisplayColor("Mystic Mirror", "&dMystic Mirror"); 60 | 61 | modules.registerButton("Chat Alerts", true); 62 | modules.registerButton("HUD Alerts", true); 63 | modules.registerSlider("Hud Alerts Duration", "", 5, 0, 10, 0.1); 64 | 65 | modules.registerButton(util.color("&bSharpness"), true); 66 | modules.registerButton(util.color("&bProtection"), true); 67 | 68 | registerButton("chainmail_leggings"); 69 | registerButton("iron_leggings"); 70 | registerButton("diamond_leggings"); 71 | registerButton("iron_sword"); 72 | registerButton("diamond_sword"); 73 | registerButton("diamond_pickaxe"); 74 | registerButton("ender_pearl"); 75 | registerButton("obsidian"); 76 | registerButton("egg"); 77 | registerButton("fire_charge"); 78 | registerButton("tnt"); 79 | registerButton("Bow"); 80 | registerButton("prismarine_shard"); 81 | registerButton("Ice Bridge"); 82 | registerButton("Sleeping Dust"); 83 | registerButton("Machine Gun Bow"); 84 | registerButton("Charlie the Unicorn"); 85 | registerButton("Unstable Teleportation Device"); 86 | registerButton("Miracle of the Stars"); 87 | registerButton("Mystic Mirror"); 88 | registerButton("Devastator Bow"); 89 | registerButton("Speed II Potion (45 seconds)"); 90 | registerButton("Jump V Potion (45 seconds)"); 91 | registerButton("Invisibility Potion (30 seconds)"); 92 | registerButton("&cDream Defender"); 93 | 94 | modules.registerButton("Show Teammates", false); 95 | modules.registerButton("Show Distance", true); 96 | modules.registerSlider("Delay (s)", "", 15, 0, 60, 1); 97 | modules.registerButton("Debug", false); 98 | 99 | setupItems(); 100 | } 101 | 102 | void setupItems() { 103 | heldItemNames.clear(); 104 | heldItemDisplayNames.clear(); 105 | armorPieceNames.clear(); 106 | 107 | addName("iron_sword"); 108 | addName("diamond_sword"); 109 | addName("diamond_pickaxe"); 110 | addName("ender_pearl"); 111 | addName("egg"); 112 | addName("fire_charge"); 113 | addName("tnt"); 114 | addName("prismarine_shard"); 115 | addName("obsidian"); 116 | 117 | addDisplayName("Bow"); 118 | addDisplayName("Speed II Potion (45 seconds)"); 119 | addDisplayName("Jump V Potion (45 seconds)"); 120 | addDisplayName("Invisibility Potion (30 seconds)"); 121 | addDisplayName("&cDream Defender"); 122 | addDisplayName("Machine Gun Bow"); 123 | addDisplayName("Charlie the Unicorn"); 124 | addDisplayName("Ice Bridge"); 125 | addDisplayName("Sleeping Dust"); 126 | addDisplayName("Unstable Teleportation Device"); 127 | addDisplayName("Devastator Bow"); 128 | addDisplayName("Miracle of the Stars"); 129 | addDisplayName("Mystic Mirror"); 130 | 131 | addArmorPiece("chainmail_leggings"); 132 | addArmorPiece("iron_leggings"); 133 | addArmorPiece("diamond_leggings"); 134 | 135 | showDistance = modules.getButton(scriptName, "Show Distance"); 136 | showTeammates = modules.getButton(scriptName, "Show Teammates"); 137 | DELAY_INTERVAL = (int) modules.getSlider(scriptName, "Delay (s)") * 1000; 138 | debug = modules.getButton(scriptName, "Debug"); 139 | showSharpness = modules.getButton(scriptName, util.color("&bSharpness")); 140 | showProtection = modules.getButton(scriptName, util.color("&bProtection")); 141 | } 142 | 143 | void onPreUpdate() { 144 | Entity playerEntity = client.getPlayer(); 145 | if (playerEntity.getTicksExisted() % 100 == 0) { 146 | status = getBedwarsStatus(); 147 | myName = playerEntity.getNetworkPlayer() == null ? playerEntity.getName() : playerEntity.getNetworkPlayer().getName(); 148 | refreshTeams(); 149 | setupItems(); 150 | } 151 | 152 | if (!alerts.isEmpty() && !bridge.has("pugalert")) { 153 | bridge.add("pugalert", alerts.remove(0)); 154 | } 155 | } 156 | 157 | void onWorldJoin(Entity en) { 158 | if (en == client.getPlayer()) { 159 | playerItems.clear(); 160 | teamUpgrades.clear(); 161 | status = getBedwarsStatus(); 162 | } 163 | } 164 | 165 | boolean onPacketReceived(SPacket packet) { 166 | if (packet instanceof S04) { 167 | S04 s04 = (S04) packet; 168 | ItemStack item = s04.item; 169 | int entityId = s04.entityId; 170 | int slot = s04.slot; 171 | Entity entity = world.getEntityById(entityId); 172 | doAlerts(entity, item, slot); 173 | } 174 | return true; 175 | } 176 | 177 | void doAlerts(Entity player, ItemStack item, int slot) { 178 | if (player == null || !player.type.contains("EntityOtherPlayerMP") || status != 3) return; 179 | Entity playerEntity = client.getPlayer(); 180 | long now = client.time(); 181 | if (player == playerEntity || player.isDead()) return; 182 | NetworkPlayer nwp = player.getNetworkPlayer(); 183 | String playerDisplay = player.getDisplayName(); 184 | if (nwp == null || (!showTeammates && playerDisplay.startsWith(util.colorSymbol + myTeam)) || playerDisplay.startsWith(util.colorSymbol + "7")) return; 185 | 186 | String uuid = nwp.getUUID(); 187 | String teamColor = playerDisplay.substring(1, 2); 188 | String team = getColoredTeam(teamColor); 189 | if (team == null) return; 190 | String itemName = item == null ? "" : item.name; 191 | String itemDisplayName = item != null ? item.displayName : ""; 192 | Map existingData = playerItems.getOrDefault(uuid, new HashMap<>()); 193 | 194 | if (item != null) { 195 | boolean heldRaw = heldItemNames.contains(itemName); 196 | boolean heldDisplay = heldItemDisplayNames.contains(itemDisplayName); 197 | boolean isWeapon = itemName.endsWith("sword"); 198 | boolean hasEnchantments = item.getEnchantments() != null; 199 | 200 | if (slot == 0 && (heldRaw || heldDisplay)) { 201 | String lastItem = existingData.getOrDefault("lastitem", "").toString(); 202 | String trackedItemName = heldRaw ? itemName : itemDisplayName; 203 | long lastTime = Long.parseLong(existingData.getOrDefault(trackedItemName, "0").toString()); 204 | 205 | if (now > lastTime && !lastItem.equals(itemName)) { 206 | String coloredName = util.colorSymbol + teamColor + player.getName(); 207 | String displayColor = itemDisplayColors.get(trackedItemName); 208 | String msg = chatPrefix + "&eAlert: " + coloredName + " &7is holding&r " + displayColor + "&r&7"; 209 | 210 | if (showDistance) msg += " &7(&d" + (int) playerEntity.getPosition().distanceTo(player.getPosition()) + "m&7)"; 211 | String alertmsg = util.color(coloredName + " &7has " + displayColor + "&7."); 212 | 213 | if (modules.getButton(scriptName, "HUD Alerts")) { 214 | addAlert(util.color("&lItem Alerts"), alertmsg, (int) (modules.getSlider(scriptName, "Hud Alerts Duration") * 1000), ""); 215 | } 216 | if (modules.getButton(scriptName, "Chat Alerts")) client.print(msg); 217 | 218 | existingData.put(trackedItemName, now + DELAY_INTERVAL); 219 | } 220 | } 221 | 222 | if (hasEnchantments && (slot == 2 || (slot == 0 && isWeapon))) { 223 | String upgradeKey = slot == 2 ? "protection" + teamColor : "sharpness" + teamColor; 224 | String upgradeName = slot == 2 ? "Reinforced Armor" : "Sharpened Swords"; 225 | String upgradeAlert = "&b" + upgradeName; 226 | 227 | if (!teamUpgrades.contains(upgradeKey)) { 228 | teamUpgrades.add(upgradeKey); 229 | String msg = chatPrefix + "&eAlert: " + team + " &7purchased " + upgradeAlert; 230 | String alertmsg = util.color(team + " &7has " + upgradeAlert + "&7."); 231 | 232 | if (modules.getButton(scriptName, "HUD Alerts")) { 233 | addAlert(util.color("&lItem Alerts"), alertmsg, (int) (modules.getSlider(scriptName, "Hud Alerts Duration") * 1000), ""); 234 | } 235 | if (modules.getButton(scriptName, "Chat Alerts")) client.print(msg); 236 | } 237 | } 238 | 239 | if (slot == 2 && armorPieceNames.contains(itemName)) { 240 | String existingArmor = existingData.getOrDefault("armorpiece", "").toString(); 241 | if (!existingArmor.equals(itemName)) { 242 | String coloredName = util.colorSymbol + teamColor + player.getName(); 243 | String armorDisplayColor = itemDisplayColors.get(itemName); 244 | String msg = chatPrefix + "&eAlert: " + coloredName + " &7purchased&r " + armorDisplayColor + "&r&7"; 245 | 246 | if (showDistance) msg += " &7(&d" + (int) playerEntity.getPosition().distanceTo(player.getPosition()) + "m&7)"; 247 | String alertmsg = util.color(coloredName + " &7has " + armorDisplayColor + "&7."); 248 | 249 | if (modules.getButton(scriptName, "HUD Alerts")) { 250 | addAlert(util.color("&lItem Alerts"), alertmsg, (int) (modules.getSlider(scriptName, "Hud Alerts Duration") * 1000), ""); 251 | } 252 | if (modules.getButton(scriptName, "Chat Alerts")) client.print(msg); 253 | } 254 | existingData.put("armorpiece", itemName); 255 | } 256 | } 257 | 258 | if (slot == 0) existingData.put("lastitem", itemName); 259 | playerItems.put(uuid, existingData); 260 | } 261 | 262 | boolean onPacketSent(CPacket packet) { 263 | if (!debug) return true; 264 | if (packet instanceof C02) { 265 | C02 c02 = (C02) packet; 266 | Entity en = (Entity)c02.entity; 267 | client.print(en.getName() + " " + en.getDisplayName() + " " + en.type + " " + en.getHeight()); 268 | if (!c02.action.equals("ATTACK") || !en.type.equals("EntityOtherPlayerMP")) return true; 269 | String msg = chatPrefix + en.getDisplayName().substring(0, 2) + en.getName() + "&7: "; 270 | ItemStack item = en.getHeldItem(); 271 | if (item == null) { 272 | msg += "&r'null' / 'null'"; 273 | } else { 274 | msg += "&r'" + item.name + "&r' &7/ &r'" + item.displayName + "&r' " + item.stackSize; 275 | } 276 | client.print(msg); 277 | } 278 | return true; 279 | } 280 | 281 | void addAlert(String title, String message, int duration, String command) { 282 | Map alert = new HashMap<>(4); 283 | alert.put("title", title); 284 | alert.put("message", message); 285 | alert.put("duration", duration); 286 | alert.put("command", command); 287 | alerts.add(alert); 288 | } 289 | 290 | void addDisplayColor(String key, String value) { 291 | itemDisplayColors.put(util.color(key), util.color(value)); 292 | } 293 | 294 | void registerButton(String key) { 295 | modules.registerButton(itemDisplayColors.get(util.color(key)), true); 296 | } 297 | 298 | void addName(String key) { 299 | if (modules.getButton(scriptName, itemDisplayColors.get(key))) { 300 | heldItemNames.add(key); 301 | } 302 | } 303 | 304 | void addArmorPiece(String key) { 305 | if (modules.getButton(scriptName, itemDisplayColors.get(key))) { 306 | armorPieceNames.add(key); 307 | } 308 | } 309 | 310 | void addDisplayName(String key) { 311 | key = util.color(key); 312 | if (modules.getButton(scriptName, itemDisplayColors.get(key))) { 313 | heldItemDisplayNames.add(key); 314 | } 315 | } 316 | 317 | String getColoredTeam(String colorCode) { 318 | switch (colorCode) { 319 | case "c": 320 | return util.color("&cRed Team&r"); 321 | case "9": 322 | return util.color("&9Blue Team&r"); 323 | case "a": 324 | return util.color("&aGreen Team&r"); 325 | case "e": 326 | return util.color("&eYellow Team&r"); 327 | case "b": 328 | return util.color("&bAqua Team&r"); 329 | case "f": 330 | return util.color("&fWhite Team&r"); 331 | case "d": 332 | return util.color("&dPink Team&r"); 333 | case "8": 334 | return util.color("&8Gray Team&r"); 335 | default: 336 | return null; 337 | } 338 | } 339 | 340 | int getBedwarsStatus() { 341 | List sidebar = world.getScoreboard(); 342 | if (sidebar == null) { 343 | if (world.getDimension().equals("The End")) { 344 | return 0; 345 | } 346 | return -1; 347 | } 348 | int size = sidebar.size(); 349 | if (size < 7) return -1; 350 | if (!util.strip(sidebar.get(0)).startsWith("BED WARS")) { 351 | return -1; 352 | } 353 | if (util.strip(sidebar.get(5)).startsWith("R Red:") && util.strip(sidebar.get(6)).startsWith("B Blue:")) { 354 | return 3; 355 | } 356 | String six = util.strip(sidebar.get(6)); 357 | if (six.equals("Waiting...") || six.startsWith("Starting in")) { 358 | return 2; 359 | } 360 | return -1; 361 | } 362 | 363 | void refreshTeams() { 364 | if (status != 3 || client.allowFlying()) return; 365 | for (NetworkPlayer pla : world.getNetworkPlayers()) { for (int i = 0; i < colorKeysArray.length; i++) { 366 | if (!pla.getName().equals(myName) || !pla.getDisplayName().startsWith(util.colorSymbol + colorKeysArray[i])) continue; 367 | myTeam = colorKeysArray[i]; 368 | }} 369 | } -------------------------------------------------------------------------------- /nickbot.java: -------------------------------------------------------------------------------- 1 | /* 2 | bot that auto claims nicks based on specified parameters 3 | loadstring: load - "https://raw.githubusercontent.com/PugrillaDev/Raven-Scripts/refs/heads/main/nickbot.java" 4 | */ 5 | 6 | static final String NICK_CLAIM_COMMAND = "/nick actuallyset "; 7 | final String chatPrefix = "&7[&dN&7]&r "; 8 | long lastSentLimbo = client.time(); 9 | int lastSentNick; 10 | long lastLobbySelect = client.time(); 11 | boolean enabled; 12 | boolean startup; 13 | boolean wait; 14 | int INTERVAL = 20; 15 | int counter = 0; 16 | int resetCount; 17 | int existed; 18 | boolean waitForLobbySelector; 19 | String currentNick = ""; 20 | List containsList = new ArrayList<>(); 21 | List startsWithList = new ArrayList<>(); 22 | List endsWithList = new ArrayList<>(); 23 | String currentLobby = ""; 24 | String[] lobbies = { "mw", "blitz", "sw", "bw", "mm", "bb", "duels", "s", "classic", "arcade", "uhc", "tnt", "ww", "prototype" }; 25 | HashSet allowedRepeating = new HashSet<>(Arrays.asList( 26 | 'a', 27 | 'e', 28 | 'i', 29 | 'o', 30 | 'u', 31 | 'y', 32 | 'A', 33 | 'E', 34 | 'I', 35 | 'O', 36 | 'U', 37 | 'Y' 38 | )); 39 | 40 | void onLoad() { 41 | modules.registerSlider("Nick Interval", "", 15, 1, 50, 1); 42 | modules.registerSlider("Reset Interval", "", 0, 0, 50, 1); 43 | modules.registerButton("Vowel Repeaters", true); 44 | modules.registerButton("4 Letters", true); 45 | modules.registerButton("N Word", true); 46 | } 47 | 48 | void onEnable() { 49 | enabled = false; 50 | if (!startup) { 51 | client.print(chatPrefix + "&eRun &3/nb &efor custom nickbot commands."); 52 | startup = true; 53 | } 54 | } 55 | 56 | void onPreUpdate() { 57 | if (!enabled) return; 58 | existed++; 59 | 60 | if (client.getScreen().equals("GuiScreenBook")) { 61 | List pages = inventory.getBookContents(); 62 | if (pages != null) { 63 | String nick = ""; 64 | 65 | for (int i = 0; i < pages.size(); i++) { 66 | String page = pages.get(i); 67 | if (!page.equals("you:")) continue; 68 | nick = util.strip(pages.get(i + 1)); 69 | break; 70 | } 71 | 72 | if (!nick.isEmpty()) { 73 | boolean isGood = isGood(nick); 74 | 75 | if (isGood) { 76 | client.chat(NICK_CLAIM_COMMAND + nick); 77 | client.print(chatPrefix + "&eClaimed nick &3" + nick + "&e!"); 78 | enabled = false; 79 | } else { 80 | client.print(chatPrefix + "&eNew nick #" + (++counter) + ": &3" + nick + "&e."); 81 | client.closeScreen(); 82 | } 83 | } 84 | } 85 | } 86 | 87 | int status = getLobbyStatus(); 88 | if (status != 1) { 89 | if (status == 0 && client.time() - lastSentLimbo > 5000) { 90 | client.chat("/l " + lobbies[util.randomInt(0, lobbies.length - 1)]); 91 | lastSentLimbo = client.time(); 92 | } 93 | return; 94 | } 95 | 96 | if (waitForLobbySelector) { 97 | if (client.time() - lastLobbySelect > 5000) { 98 | waitForLobbySelector = false; 99 | } else { 100 | if (client.getScreen().equals("GuiChest") && inventory.getChest().endsWith("Lobby Selector")) { 101 | Map inv = createCustomInventory(); 102 | for (int i = inv.size() - 1; i >= 0; i--) { 103 | ItemStack stack = inv.get(i); 104 | if (stack != null) { 105 | String name = stack.displayName; 106 | if (name.startsWith(util.colorSymbol + "a") && util.strip(name).contains("Lobby #")) { 107 | inventory.click(i, 0, 0); 108 | waitForLobbySelector = false; 109 | break; 110 | } 111 | } 112 | } 113 | } 114 | return; 115 | } 116 | } 117 | 118 | if (existed - lastSentNick > INTERVAL) { 119 | INTERVAL = (int) modules.getSlider(scriptName, "Nick Interval"); 120 | lastSentNick = existed; 121 | 122 | int resetInterval = (int)modules.getSlider(scriptName, "Reset Interval"); 123 | if (resetInterval > 0 && ++resetCount > resetInterval) { 124 | if (inventory.getSlot() != 8) inventory.setSlot(8); 125 | keybinds.rightClick(); 126 | lastLobbySelect = client.time(); 127 | waitForLobbySelector = true; 128 | resetCount = 0; 129 | return; 130 | } 131 | 132 | client.chat("/nick help setrandom"); 133 | } 134 | } 135 | 136 | boolean onChat(String message) { 137 | String msg = util.strip(message); 138 | if (wait && msg.startsWith("You are now nicked as ")) { 139 | currentNick = msg.substring(22, msg.length() - 1); 140 | wait = false; 141 | enabled = true; 142 | client.print(chatPrefix + "&eCurrent nick set to &3" + currentNick + "&e."); 143 | client.print(chatPrefix + "&eNickbot has been " + (enabled ? "&aenabled" : "&cdisabled") + "&e."); 144 | return false; 145 | } else if (wait && msg.equals("Processing request. Please wait...")) { 146 | return false; 147 | } else if (msg.equals("Generating a unique random name. Please wait...")) { 148 | return false; 149 | } 150 | return true; 151 | } 152 | 153 | boolean isGood(String nick) { 154 | String lower = nick.toLowerCase(); 155 | 156 | if (currentNick.toLowerCase().equals(lower)) return false; 157 | if (modules.getButton(scriptName, "4 Letters") && nick.length() == 4) return true; 158 | if (modules.getButton(scriptName, "N Word") && lower.contains("nickherr")) return true; 159 | 160 | if (modules.getButton(scriptName, "Vowel Repeaters") && Character.isUpperCase(nick.charAt(0))) { 161 | for (int j = 1; j < nick.length(); j++) if (Character.isUpperCase(nick.charAt(j))) return false; 162 | 163 | char last = 0; 164 | int count = 1; 165 | for (int i = 0; i < nick.length(); i++) { 166 | char c = nick.charAt(i); 167 | if ("aeiouyAEIOUY".indexOf(c) >= 0 && c == last) { 168 | if (++count >= 3) { 169 | return true; 170 | } 171 | } else { 172 | last = c; 173 | count = 1; 174 | } 175 | } 176 | } 177 | 178 | for (String pattern : startsWithList) 179 | if (lower.startsWith(pattern)) return true; 180 | 181 | for (String pattern : endsWithList) 182 | if (lower.endsWith(pattern)) return true; 183 | 184 | for (String pattern : containsList) 185 | if (lower.contains(pattern)) return true; 186 | 187 | return false; 188 | } 189 | 190 | int getLobbyStatus() { 191 | List sidebar = world.getScoreboard(); 192 | if (sidebar == null) { 193 | if (world.getDimension().equals("The End")) { 194 | return 0; 195 | } 196 | return -1; 197 | } 198 | 199 | ItemStack item = inventory.getStackInSlot(4); 200 | 201 | if (item == null || !item.name.equals("trapped_chest")) return -1; 202 | else return 1; 203 | } 204 | 205 | boolean onPacketSent(CPacket packet) { 206 | if (packet instanceof C01) { 207 | C01 c01 = (C01) packet; 208 | if (!c01.message.startsWith("/nb")) return true; 209 | String[] parts = c01.message.split(" "); 210 | if (parts.length <= 1) { 211 | String title = " &eNick Bot &7"; 212 | String footerText = " &eMade by Pug &7"; 213 | String[] messages = { 214 | "&3/nb toggle&e: Toggles the nickbot &aon&e/&coff&e.", 215 | "&3/nb test [nick]&e: Checks if a nick would be claimed or not.", 216 | "", 217 | "&eTypes of checks: &3startsWith, endsWith, contains&e.", 218 | "&3/nb [pattern]&e: Checks if the nick matches a pattern.", 219 | "&3/nb &e: Shows the contents of a check.", 220 | "&3/nb clear&e: Clears contents of specified check.", 221 | "", 222 | "&eCheck the module settings as well!" 223 | }; 224 | 225 | int maxPixelWidth = 0; 226 | for (String message : messages) { 227 | int messageWidth = render.getFontWidth(message); 228 | if (messageWidth > maxPixelWidth) { 229 | maxPixelWidth = messageWidth; 230 | } 231 | } 232 | int titleWidth = render.getFontWidth(title); 233 | int footerTextWidth = render.getFontWidth(footerText); 234 | if (titleWidth > maxPixelWidth) maxPixelWidth = titleWidth; 235 | if (footerTextWidth > maxPixelWidth) maxPixelWidth = footerTextWidth; 236 | 237 | int headerFooterWidth = maxPixelWidth + render.getFontWidth(" "); 238 | int titlePaddingTotal = headerFooterWidth - titleWidth; 239 | int titlePaddingSides = titlePaddingTotal / 2; 240 | 241 | String header = "&7" + generatePadding('-', titlePaddingSides) + title + generatePadding('-', titlePaddingSides); 242 | if (titlePaddingTotal % 2 != 0) header += "-"; 243 | client.print(chatPrefix + header); 244 | 245 | for (String message : messages) { 246 | int messagePixelWidth = render.getFontWidth(message); 247 | int totalPaddingWidth = maxPixelWidth - messagePixelWidth; 248 | int paddingLeftWidth = totalPaddingWidth / 2; 249 | String paddedMessage = generatePadding(' ', paddingLeftWidth) + message; 250 | client.print(chatPrefix + paddedMessage); 251 | } 252 | 253 | int footerPaddingTotal = headerFooterWidth - footerTextWidth; 254 | int footerPaddingSides = footerPaddingTotal / 2; 255 | String footer = "&7" + generatePadding('-', footerPaddingSides) + footerText + generatePadding('-', footerPaddingSides); 256 | if (footerPaddingTotal % 2 != 0) footer += "-"; 257 | client.print(chatPrefix + footer); 258 | 259 | return false; 260 | } 261 | 262 | String command = parts[1]; 263 | 264 | if (command.equalsIgnoreCase("toggle")) { 265 | if (enabled) { 266 | enabled = false; 267 | client.print(chatPrefix + "&eNickbot has been " + (enabled ? "&aenabled" : "&cdisabled") + "&e."); 268 | } else { 269 | wait = true; 270 | counter = resetCount = lastSentNick = 0; 271 | waitForLobbySelector = false; 272 | client.chat("/nick reuse"); 273 | client.print(chatPrefix + "&eFetching current nick..."); 274 | } 275 | return false; 276 | } else if (command.equalsIgnoreCase("test")) { 277 | if (parts.length < 3) { 278 | client.print(chatPrefix + "&eInvalid syntax. Use &3/nb test [nick]&e."); 279 | return false; 280 | } 281 | 282 | String nick = parts[2]; 283 | 284 | boolean isGood = isGood(nick); 285 | 286 | client.print(chatPrefix + "&eThe nick &3" + nick + " &eis " + (isGood ? "&agood" : "&cbad") + "&e."); 287 | 288 | return false; 289 | } else if (command.equalsIgnoreCase("contains")) { 290 | if (parts.length < 3) { 291 | if (containsList.size() > 0) { 292 | String msg = chatPrefix + "&eList of &3" + containsList.size() + " &econtains pattern"; 293 | if (containsList.size() != 1) msg += "s"; 294 | msg += ":"; 295 | client.print(msg); 296 | for (String pattern : containsList) { 297 | client.print(chatPrefix + "&e\"&3" + pattern + "&e\""); 298 | } 299 | } else { 300 | client.print(chatPrefix + "&eYou aren't using any contains patterns!"); 301 | } 302 | return false; 303 | } 304 | 305 | String pattern = parts[2]; 306 | 307 | if (pattern.equalsIgnoreCase("clear")) { 308 | String msg = chatPrefix + "&eCleared &3" + containsList.size() + " &econtains pattern"; 309 | if (containsList.size() != 1) msg += "s"; 310 | msg += "."; 311 | containsList.clear(); 312 | client.print(msg); 313 | return false; 314 | } 315 | 316 | containsList.add(pattern); 317 | client.print(chatPrefix + "&eAdded &3" + pattern + " &eto the contains list!"); 318 | 319 | return false; 320 | } else if (command.equalsIgnoreCase("startswith")) { 321 | if (parts.length < 3) { 322 | if (startsWithList.size() > 0) { 323 | String msg = chatPrefix + "&eList of &3" + startsWithList.size() + " &estartsWith pattern"; 324 | if (startsWithList.size() != 1) msg += "s"; 325 | msg += ":"; 326 | client.print(msg); 327 | for (String pattern : startsWithList) { 328 | client.print(chatPrefix + "&e\"&3" + pattern + "&e\""); 329 | } 330 | } else { 331 | client.print(chatPrefix + "&eYou aren't using any startsWith patterns!"); 332 | } 333 | return false; 334 | } 335 | 336 | String pattern = parts[2]; 337 | 338 | if (pattern.equalsIgnoreCase("clear")) { 339 | String msg = chatPrefix + "&eCleared &3" + startsWithList.size() + " &estartsWith pattern"; 340 | if (startsWithList.size() != 1) msg += "s"; 341 | msg += "."; 342 | startsWithList.clear(); 343 | client.print(msg); 344 | return false; 345 | } 346 | 347 | startsWithList.add(pattern); 348 | client.print(chatPrefix + "&eAdded &3" + pattern + " &eto the startsWith list!"); 349 | 350 | return false; 351 | } else if (command.equalsIgnoreCase("endswith")) { 352 | if (parts.length < 3) { 353 | if (endsWithList.size() > 0) { 354 | String msg = chatPrefix + "&eList of &3" + endsWithList.size() + " &eendsWith pattern"; 355 | if (endsWithList.size() != 1) msg += "s"; 356 | msg += ":"; 357 | client.print(msg); 358 | for (String pattern : endsWithList) { 359 | client.print(chatPrefix + "&e\"&3" + pattern + "&e\""); 360 | } 361 | } else { 362 | client.print(chatPrefix + "&eYou aren't using any endsWith patterns!"); 363 | } 364 | return false; 365 | } 366 | 367 | String pattern = parts[2]; 368 | 369 | if (pattern.equalsIgnoreCase("clear")) { 370 | String msg = chatPrefix + "&eCleared &3" + endsWithList.size() + " &eendsWith pattern"; 371 | if (endsWithList.size() != 1) msg += "s"; 372 | msg += "."; 373 | endsWithList.clear(); 374 | client.print(msg); 375 | return false; 376 | } 377 | 378 | endsWithList.add(pattern); 379 | client.print(chatPrefix + "&eAdded &3" + pattern + " &eto the endsWith list!"); 380 | 381 | return false; 382 | } 383 | } 384 | return true; 385 | } 386 | 387 | String generatePadding(char character, int pixelWidth) { 388 | StringBuilder builder = new StringBuilder(); 389 | int charWidth = render.getFontWidth(String.valueOf(character)); 390 | int numChars = pixelWidth / charWidth; 391 | for (int i = 0; i < numChars; i++) { 392 | builder.append(character); 393 | } 394 | return builder.toString(); 395 | } 396 | 397 | Map createCustomInventory() { 398 | Map inv = new HashMap<>(); 399 | String screen = client.getScreen(); 400 | int inventorySize = inventory.getSize() - 4, slot = 0; 401 | 402 | if (screen.equals("GuiInventory")) { 403 | for (int i = 0; i < 5; i++) inv.put(slot++, null); 404 | Entity player = client.getPlayer(); 405 | for (int i = 3; i >= 0; i--) inv.put(slot++, player.getArmorInSlot(i)); 406 | } else if (screen.equals("GuiChest") && !inventory.getChest().isEmpty()) { 407 | int chestSize = inventory.getChestSize(); 408 | for (int i = 0; i < chestSize; i++) { 409 | inv.put(slot++, inventory.getStackInChestSlot(i)); 410 | } 411 | } 412 | 413 | for (int i = 9; i < inventorySize + 9; i++) { 414 | inv.put(slot++, inventory.getStackInSlot(i % inventorySize)); 415 | } 416 | 417 | return inv; 418 | } -------------------------------------------------------------------------------- /zombies.java: -------------------------------------------------------------------------------- 1 | /* Auto weapon swap macro for hypixel zombies */ 2 | 3 | Map> weapons = new HashMap<>(); 4 | boolean reviving = false; 5 | 6 | void onLoad() { 7 | modules.registerButton("Use Slot 1", true); 8 | modules.registerButton("Use Slot 2", true); 9 | modules.registerButton("Use Slot 3", true); 10 | } 11 | 12 | void onEnable() { 13 | client.print("&7[&dZ&7] &eZombies Helper: &aEnabled&e."); 14 | } 15 | 16 | void onDisable() { 17 | client.print("&7[&dZ&7] &eZombies Helper: &cDisabled&e."); 18 | } 19 | 20 | void onPreUpdate() { 21 | long now = client.time(); 22 | refreshWeapons(); 23 | 24 | if (!client.getScreen().isEmpty() || !keybinds.isMouseDown(1) || (inventory.getSlot() < 1 || inventory.getSlot() > 3)) return; 25 | 26 | Map bestWeaponStats = null; 27 | Map lowestFireRateWeaponStats = null; 28 | double highestDamage = 0.0; 29 | long lowestFireRateTime = Long.MAX_VALUE; 30 | int bestSlot = 1; 31 | int lowestFireRateSlot = 1; 32 | 33 | for (int slot = 1; slot <= 3; slot++) { 34 | if (!modules.getButton(scriptName, "Use Slot " + slot)) continue; 35 | ItemStack itemStack = inventory.getStackInSlot(slot); 36 | if (itemStack == null || itemStack.name.equals("dye")) continue; 37 | 38 | String itemName = util.strip(itemStack.displayName); 39 | if (!weapons.containsKey(itemName)) continue; 40 | 41 | Map weaponStats = weapons.get(itemName); 42 | double damage = (double) weaponStats.get("Damage"); 43 | long fireRateDelay = Long.parseLong(weaponStats.getOrDefault("FireRateDelay", "0").toString()); 44 | long reloadDelay = Long.parseLong(weaponStats.getOrDefault("ReloadDelay", "0").toString()); 45 | int reloadTicks = Integer.parseInt(weaponStats.getOrDefault("ReloadTicks", "0").toString()); 46 | int durability = itemStack.durability; 47 | int maxDurability = itemStack.maxDurability; 48 | int stackSize = itemStack.stackSize; 49 | 50 | if (durability <= 1 && durability != maxDurability && stackSize < 2 && (now > reloadDelay || reloadTicks == 1)) { 51 | if (inventory.getSlot() != slot) inventory.setSlot(slot); 52 | client.swing(); 53 | double reloadTime = (double) weaponStats.get("Reload"); 54 | weaponStats.put("ReloadDelay", now + (long) ((reloadTime * 1000) / 2)); 55 | weaponStats.put("ReloadTicks", reloadTicks == 1 ? 0 : 1); 56 | return; 57 | } 58 | 59 | if (damage > highestDamage && now >= fireRateDelay && (durability == maxDurability || stackSize > 1)) { 60 | highestDamage = damage; 61 | bestWeaponStats = weaponStats; 62 | bestSlot = slot; 63 | } 64 | 65 | if (fireRateDelay < lowestFireRateTime && (durability == maxDurability || stackSize > 1)) { 66 | lowestFireRateTime = fireRateDelay; 67 | lowestFireRateWeaponStats = weaponStats; 68 | lowestFireRateSlot = slot; 69 | } 70 | } 71 | 72 | if (bestWeaponStats != null) { 73 | if (inventory.getSlot() != bestSlot) inventory.setSlot(bestSlot); 74 | client.sendPacketNoEvent(new C08(client.getPlayer().getHeldItem(), new Vec3(-1, -1, -1), 255, new Vec3(0.0, 0.0, 0.0))); 75 | 76 | double fireRate = (double) bestWeaponStats.get("Fire Rate"); 77 | bestWeaponStats.put("FireRateDelay", now + (long) (fireRate * 1000)); 78 | } else if (lowestFireRateWeaponStats != null) { 79 | if (inventory.getSlot() != lowestFireRateSlot) inventory.setSlot(lowestFireRateSlot); 80 | client.sendPacketNoEvent(new C08(client.getPlayer().getHeldItem(), new Vec3(-1, -1, -1), 255, new Vec3(0.0, 0.0, 0.0))); 81 | } 82 | } 83 | 84 | void onPostPlayerInput() { 85 | Entity player = client.getPlayer(); 86 | Vec3 m = player.getPosition(); 87 | double closest = Double.MAX_VALUE; 88 | Entity knockedPlayer = null; 89 | for (Entity e : world.getEntities()) { 90 | String name = util.strip(e.getDisplayName()); 91 | if (!name.contains("HOLD SNEAK TO REVIVE!") && !name.contains("REVIVING...")) continue; 92 | double dist = e.getPosition().distanceToSq(m); 93 | if (dist < closest) { 94 | closest = dist; 95 | knockedPlayer = e; 96 | } 97 | } 98 | 99 | double sqrtDist = Math.sqrt(closest); 100 | if (knockedPlayer == null || sqrtDist > 3.5) { 101 | if (reviving && player.isSneaking()) { 102 | keybinds.setPressed("sneak", false); 103 | reviving = false; 104 | } 105 | return; 106 | } 107 | 108 | if (sqrtDist < 3.5) { 109 | keybinds.setPressed("sneak", true); 110 | reviving = true; 111 | } 112 | } 113 | 114 | void refreshWeapons() { 115 | for (int slot = 1; slot <= 3; slot++) { 116 | ItemStack itemStack = inventory.getStackInSlot(slot); 117 | if (itemStack == null || itemStack.name.equals("dye")) continue; 118 | 119 | String itemName = util.strip(itemStack.displayName); 120 | if (weapons.containsKey(itemName)) continue; 121 | HashMap weaponStats = getWeaponStats(itemStack); 122 | if (weaponStats.size() == 0) continue; 123 | 124 | weapons.put(itemName, weaponStats); 125 | } 126 | } 127 | 128 | HashMap getWeaponStats(ItemStack itemStack) { 129 | List tooltips = itemStack.getTooltip(); 130 | HashMap weaponStats = new HashMap<>(); 131 | 132 | for (String tip : tooltips) { 133 | String strippedTip = util.strip(tip); 134 | String[] parts = strippedTip.split(" "); 135 | if (strippedTip.contains("Damage:") && !strippedTip.contains("Bonus Damage")) { 136 | weaponStats.put("Damage", Double.parseDouble(parts[parts.length - 2])); 137 | } else if (strippedTip.contains("Clip Ammo:")) { 138 | weaponStats.put("Clip Ammo", Double.parseDouble(parts[parts.length - 1])); 139 | } else if (strippedTip.contains("Ammo:")) { 140 | weaponStats.put("Ammo", Double.parseDouble(parts[parts.length - 1])); 141 | } else if (strippedTip.contains("Fire Rate:")) { 142 | weaponStats.put("Fire Rate", Double.parseDouble(parts[parts.length - 1].replace("s", ""))); 143 | } else if (strippedTip.contains("Reload:")) { 144 | weaponStats.put("Reload", Double.parseDouble(parts[parts.length - 1].replace("s", ""))); 145 | } 146 | } 147 | 148 | return weaponStats; 149 | } --------------------------------------------------------------------------------