spectate
This commit is contained in:
@@ -43,6 +43,7 @@ public class MeteorRejectsAddon extends MeteorAddon {
|
||||
commands.add(new AntiAntiXrayCommand());
|
||||
commands.add(new BookDupeCommand());
|
||||
commands.add(new GiveCommand());
|
||||
commands.add(new SpectateCommand());
|
||||
commands.add(new SaveSkinCommand());
|
||||
commands.add(new TpsCommand());
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package cloudburst.rejects.commands;
|
||||
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
|
||||
import net.minecraft.command.CommandSource;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
|
||||
import minegame159.meteorclient.systems.commands.arguments.PlayerArgumentType;
|
||||
import minegame159.meteorclient.systems.commands.Command;
|
||||
|
||||
|
||||
import static com.mojang.brigadier.Command.SINGLE_SUCCESS;
|
||||
public class SpectateCommand extends Command {
|
||||
|
||||
|
||||
public SpectateCommand() {
|
||||
super("spectate", "Allows you to spectate nearby players", "spec");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void build(LiteralArgumentBuilder<CommandSource> builder) {
|
||||
builder.executes(ctx -> {
|
||||
mc.setCameraEntity(mc.player);
|
||||
return SINGLE_SUCCESS;
|
||||
});
|
||||
|
||||
builder.then(argument("player", PlayerArgumentType.player()).executes(ctx -> {
|
||||
PlayerEntity playerEntity = ctx.getArgument("player", PlayerEntity.class);
|
||||
mc.setCameraEntity(playerEntity);
|
||||
return SINGLE_SUCCESS;
|
||||
}));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import cloudburst.rejects.modules.InteractionMenu;
|
||||
import minegame159.meteorclient.systems.commands.commands.PeekCommand;
|
||||
import minegame159.meteorclient.systems.modules.Modules;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.ChatScreen;
|
||||
import net.minecraft.client.gui.screen.ingame.InventoryScreen;
|
||||
import net.minecraft.client.options.KeyBinding;
|
||||
@@ -83,6 +84,12 @@ public class InteractionScreen extends Screen {
|
||||
client.openScreen(new PeekCommand.PeekShulkerBoxScreen(new ShulkerBoxScreenHandler(0, client.player.inventory, getSimpleInventory(e)), client.player.inventory, entity.getName()));
|
||||
});
|
||||
}
|
||||
|
||||
functions.put("Spectate", (Entity e) -> {
|
||||
MinecraftClient.getInstance().setCameraEntity(e);
|
||||
closeScreen();
|
||||
});
|
||||
|
||||
if (entity.isGlowing()) {
|
||||
functions.put("Remove highlight", (Entity e) -> {
|
||||
entity.setGlowing(false);
|
||||
|
||||
Reference in New Issue
Block a user