Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.text.Text;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.chunk.Chunk;
Expand Down Expand Up @@ -238,6 +240,29 @@ private void onTick(TickEvent.Post event) {
return;
}

// Elytra check
if (ElytraController.isActive() && mc.player.getEquippedStack(EquipmentSlot.CHEST).isEmpty()) {
// Send Discord notification
DiscordEmbed embed = new DiscordEmbed(
"Out of Elytras!",
"The bot has run out of elytras and will now disconnect.",
0xFF0000
);
DiscordWebhook.sendMessage("@everyone", embed);

// Disconnect from server
if (mc.getNetworkHandler() != null) {
mc.getNetworkHandler().getConnection().disconnect(Text.of("Ran out of elytras."));
}

// Stop elytra controller
ElytraController.stop();

// Deactivate the module
toggle();
return; // Stop further processing in onTick
}

// Death detection - check if player health dropped to 0 or respawned
if (notifyOnDeath.get()) {
float currentHealth = mc.player.getHealth();
Expand Down
Loading