Skip to content

Commit 4a21683

Browse files
committed
AutoDisconnect y level option
1 parent b07055d commit 4a21683

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/main/kotlin/com/lambda/module/modules/combat/AutoDisconnect.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ object AutoDisconnect : Module(
5757
) {
5858
private val health by setting("Health", true, "Disconnect from the server when health is below the set limit.")
5959
private val minimumHealth by setting("Min Health", 10, 1..36, 1, "Set the minimum health threshold for disconnection.", unit = " half-hearts") { health }
60+
private val yLevel by setting("Y Level", false, "Disconnect from the server when the player is below a certain y level")
61+
private val minimumYLevel by setting("Minimum Y Level", 50, 0..319, 1, "The minimum y level the player can be at before disconnecting") { yLevel }
6062
private val falls by setting("Falls", false, "Disconnect if the player will die of fall damage")
6163
private val fallDistance by setting("Falls Time", 10, 0..30, 1, "Number of blocks fallen before disconnecting for fall damage.", unit = " blocks") { falls }
6264
private val crystals by setting("Crystals", false, "Disconnect if an End Crystal explosion would be lethal.")
@@ -205,6 +207,15 @@ object AutoDisconnect : Module(
205207
}
206208
} else null
207209
}),
210+
YLevel({ yLevel }, {
211+
if (player.pos.y < minimumYLevel) {
212+
buildText {
213+
literal("Player went below y level ")
214+
highlighted("$minimumYLevel")
215+
literal("!")
216+
}
217+
} else null
218+
}),
208219
Totem({ totem }, {
209220
val totemCount = player.allStacks.count { it.item == Items.TOTEM_OF_UNDYING }
210221
if (totemCount < minTotems) {

0 commit comments

Comments
 (0)