From e316874da50cadfdb60db630b5d905e531aea6cc Mon Sep 17 00:00:00 2001
From: leonetics <244417669+leonetics@users.noreply.github.com>
Date: Tue, 14 Jul 2026 20:14:45 -0400
Subject: [PATCH 1/2] port EndermanLook from homovore using Lambda's rotation
system
Stares down endermen or keeps you from staring at them, depending on
the mode. Rotation lifecycle is handled by RotationManager, so requests
decay on their own instead of being cancelled by hand.
Looking away submits a pitch-only request, since the original's yaw
argument was the player's current yaw and would fight the mouse in Sync
mode. isPlayerStaring is package private, so the staring cone check is
reimplemented.
---
.../module/modules/player/EndermanLook.kt | 100 ++++++++++++++++++
1 file changed, 100 insertions(+)
create mode 100644 src/main/kotlin/com/lambda/module/modules/player/EndermanLook.kt
diff --git a/src/main/kotlin/com/lambda/module/modules/player/EndermanLook.kt b/src/main/kotlin/com/lambda/module/modules/player/EndermanLook.kt
new file mode 100644
index 000000000..4cab8ec48
--- /dev/null
+++ b/src/main/kotlin/com/lambda/module/modules/player/EndermanLook.kt
@@ -0,0 +1,100 @@
+/*
+ * Copyright 2026 Lambda
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.lambda.module.modules.player
+
+import com.lambda.config.ConfigEditor.hideAllExcept
+import com.lambda.config.automation.AutomationConfig.Companion.setDefaultAutomationConfig
+import com.lambda.config.withEdits
+import com.lambda.context.SafeContext
+import com.lambda.event.events.TickEvent
+import com.lambda.event.listener.SafeListener.Companion.listen
+import com.lambda.interaction.managers.rotating.IRotationRequest.Companion.rotationRequest
+import com.lambda.interaction.managers.rotating.Rotation.Companion.rotationTo
+import com.lambda.module.Module
+import com.lambda.module.tag.ModuleTag
+import com.lambda.util.math.distSq
+import net.minecraft.entity.EquipmentSlot
+import net.minecraft.entity.mob.EndermanEntity
+import net.minecraft.item.Items
+import net.minecraft.util.math.Vec3d
+
+@Suppress("unused")
+object EndermanLook : Module(
+ name = "EndermanLook",
+ description = "Either stares at every enderman or stops you from staring at them",
+ tag = ModuleTag.PLAYER,
+) {
+ private val mode by setting("Mode", Mode.Away, "Whether to stare down endermen or avoid their gaze")
+ private val stunHostiles by setting("Stun Hostiles", true, "Stare back at already provoked endermen to freeze them") { mode == Mode.Away }
+
+ private const val STARE_CONE = 0.025 // vanilla to aggro endermen
+
+ init {
+ setDefaultAutomationConfig()
+ .withEdits {
+ hideAllExcept(::rotationConfig)
+ }
+
+ listen {
+ if (player.getEquippedStack(EquipmentSlot.HEAD).isOf(Items.CARVED_PUMPKIN)
+ || player.abilities.creativeMode
+ ) return@listen
+
+ val endermen = world.entities
+ .filterIsInstance()
+ .filter { it.isAlive && player.canSee(it) }
+
+ when (mode) {
+ Mode.At -> closest(endermen.filter { !it.isAngry })
+ ?.let { stareAt(it) }
+
+ Mode.Away -> {
+ val (stunnable, rest) = endermen.partition { it.isAngry && stunHostiles }
+
+ closest(stunnable)?.let { stareAt(it) }
+ ?: closest(rest.filter { isStaringAt(it) })?.let { lookAway() }
+ }
+ }
+ }
+ }
+
+ private fun SafeContext.stareAt(enderman: EndermanEntity) =
+ rotationRequest { rotation(player.eyePos.rotationTo(enderman.eyePos)) }.submit()
+
+ private fun SafeContext.lookAway() =
+ rotationRequest { pitch(90f) }.submit()
+
+ private fun SafeContext.closest(endermen: List) =
+ endermen.minByOrNull { it.eyePos distSq player.eyePos }
+
+ private fun SafeContext.isStaringAt(enderman: EndermanEntity): Boolean {
+ val diff = Vec3d(
+ enderman.x - player.x,
+ enderman.eyeY - player.eyeY,
+ enderman.z - player.z
+ )
+
+ return player.getRotationVec(1f).normalize()
+ .dotProduct(diff.normalize()) > 1.0 - STARE_CONE / diff.length()
+ }
+
+ enum class Mode {
+ At,
+ Away
+ }
+}
From 7fef643e2a2fd4577c44760c61f9dc255ac56db3 Mon Sep 17 00:00:00 2001
From: leonetics <244417669+leonetics@users.noreply.github.com>
Date: Wed, 15 Jul 2026 17:25:36 -0400
Subject: [PATCH 2/2] the greatest mind of our generation
---
.../kotlin/com/lambda/module/modules/player/EndermanLook.kt | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/main/kotlin/com/lambda/module/modules/player/EndermanLook.kt b/src/main/kotlin/com/lambda/module/modules/player/EndermanLook.kt
index 4cab8ec48..4909d8f78 100644
--- a/src/main/kotlin/com/lambda/module/modules/player/EndermanLook.kt
+++ b/src/main/kotlin/com/lambda/module/modules/player/EndermanLook.kt
@@ -41,6 +41,7 @@ object EndermanLook : Module(
) {
private val mode by setting("Mode", Mode.Away, "Whether to stare down endermen or avoid their gaze")
private val stunHostiles by setting("Stun Hostiles", true, "Stare back at already provoked endermen to freeze them") { mode == Mode.Away }
+ private val disableWhileGliding by setting("Disable While Gliding", true, "Disables when gliding with an elytra")
private const val STARE_CONE = 0.025 // vanilla to aggro endermen
@@ -53,6 +54,7 @@ object EndermanLook : Module(
listen {
if (player.getEquippedStack(EquipmentSlot.HEAD).isOf(Items.CARVED_PUMPKIN)
|| player.abilities.creativeMode
+ || (disableWhileGliding && player.isGliding)
) return@listen
val endermen = world.entities
@@ -76,7 +78,7 @@ object EndermanLook : Module(
private fun SafeContext.stareAt(enderman: EndermanEntity) =
rotationRequest { rotation(player.eyePos.rotationTo(enderman.eyePos)) }.submit()
- private fun SafeContext.lookAway() =
+ private fun lookAway() =
rotationRequest { pitch(90f) }.submit()
private fun SafeContext.closest(endermen: List) =