Skip to content

Commit

Permalink
added toggle sneak feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyzev committed Jun 14, 2024
1 parent 8dd700f commit dd09edd
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright (c) 2024. Schizoid
* All rights reserved.
*/

package dev.lyzev.schizoid.feature.features.module.modules.movement

import dev.lyzev.api.events.EventClientPlayerEntityTick
import dev.lyzev.api.events.EventListener
import dev.lyzev.api.events.on
import dev.lyzev.api.setting.settings.switch
import dev.lyzev.schizoid.feature.IFeature
import dev.lyzev.schizoid.feature.features.module.ModuleToggleable

object ModuleToggleableToggleSneak :
ModuleToggleable("Toggle Sneak", "Automatically toggles sneak when riding a boat.", category = IFeature.Category.MOVEMENT), EventListener {

val screen by switch("Screen", "Whether to sneak in screen.", true)

init {
on<EventClientPlayerEntityTick> {
if (mc.currentScreen == null || screen)
mc.options.sneakKey.isPressed = true
}
}

override val shouldHandleEvents: Boolean
get() = isEnabled
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ object ModuleToggleableFastPlace :

val delay by slider("Delay", "The delay between block placements.", 0, 0, 4, "ticks", true)

override val shouldHandleEvents: Boolean
get() = isEnabled
override val shouldHandleEvents by ::isEnabled

init {
on<EventItemUse> { it.itemUseCooldown = delay }
Expand Down

0 comments on commit dd09edd

Please sign in to comment.