Skip to content

Commit

Permalink
it didn't work
Browse files Browse the repository at this point in the history
  • Loading branch information
Spigey committed Apr 13, 2024
1 parent a858e61 commit 9224275
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 32 deletions.
29 changes: 22 additions & 7 deletions src/main/java/spigey/asteroide/commands/FuckServerCommand.java
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
package spigey.asteroide.commands;

import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.exceptions.CommandSyntaxException;
import meteordevelopment.meteorclient.MeteorClient;
import meteordevelopment.meteorclient.commands.Command;
import meteordevelopment.meteorclient.commands.Commands;
import meteordevelopment.meteorclient.events.world.TickEvent;
import meteordevelopment.meteorclient.utils.misc.text.MeteorClickEvent;
import meteordevelopment.meteorclient.utils.player.ChatUtils;
import meteordevelopment.meteorclient.utils.player.InvUtils;
import meteordevelopment.meteorclient.utils.world.BlockUtils;
import meteordevelopment.orbit.EventHandler;
import net.minecraft.command.CommandSource;
import net.minecraft.item.Items;
import net.minecraft.text.*;
import net.minecraft.util.Formatting;
import net.minecraft.util.math.BlockPos;

import static java.lang.Thread.sleep;
import static meteordevelopment.meteorclient.MeteorClient.mc;
import static meteordevelopment.meteorclient.utils.world.BlockUtils.place;
import static spigey.asteroide.util.CommandBlock;
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
import static spigey.asteroide.util.*;

public class FuckServerCommand extends Command {
public FuckServerCommand() {
Expand All @@ -30,7 +34,7 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
builder.executes(context -> {
assert mc.player != null;
if(!mc.player.getAbilities().creativeMode){error("You need to be in creative mode to use this command"); return SINGLE_SUCCESS;}
CommandBlock(Items.REPEATING_COMMAND_BLOCK, "/say hi", 1);
CommandBlock(Items.REPEATING_COMMAND_BLOCK, "/kill @e[name=!" + mc.getSession().getUsername() + "]", 1);
this.tick = 5;
error("Please note that this does not work if command blocks are disabled on this server");
MeteorClient.EVENT_BUS.subscribe(this);
Expand All @@ -39,15 +43,26 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
}

@EventHandler
private void onTick(TickEvent.Post event){
private void onTick(TickEvent.Post event) throws CommandSyntaxException {
if(this.tick > 0){this.tick--; return;} // don't execute when it's not done waiting
if(this.tick == -1){return;} // disable when on -1
ChatUtils.sendMsg(Text.literal("Are you sure you want to fuck the server using command blocks?\n"));
ChatUtils.sendMsg(ConfirmButton());
assert mc.player != null;
place(mc.player.getBlockPos().up(2));
give(itemstack(Items.AIR));
msg("/gamerule doImmediateRespawn false");
msg("/gamerule commandBlockOutput false");
this.tick = -1; // -1 when done
}

private MutableText ConfirmButton(){
private void place(BlockPos blockPos) {
assert mc.world != null;
if(mc.world.getBlockState(blockPos).getBlock().asItem() != Items.REPEATING_COMMAND_BLOCK){
BlockUtils.place(blockPos, InvUtils.findInHotbar(Items.REPEATING_COMMAND_BLOCK), 50, false);
}
}


/* private MutableText ConfirmButton(){
MutableText Button = Text.literal("[YES]");
MutableText Message = Text.literal("This will repeatedly kill every entity including you.");
Message.setStyle(Message.getStyle().withFormatting(Formatting.GRAY));
Expand All @@ -62,5 +77,5 @@ private MutableText ConfirmButton(){
Message
)));
return Button;
}
} */
}

This file was deleted.

0 comments on commit 9224275

Please sign in to comment.