Skip to content

Commit 44a9814

Browse files
Disable Enderman Teleportation
#350 Original credit: Co-authored-by: biscuut <[email protected]>
1 parent 6c822d6 commit 44a9814

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/main/kotlin/gg/skytils/skytilsmod/core/Config.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,6 +1780,13 @@ object Config : Vigilant(
17801780
)
17811781
var customDamageSplash = 0
17821782

1783+
@Property(
1784+
type = PropertyType.SWITCH, name = "Disable Enderman Teleportation",
1785+
description = "Removes the enderman teleport effect.",
1786+
category = "Miscellaneous", subcategory = "Quality of Life"
1787+
)
1788+
var disableEndermanTeleport = false
1789+
17831790
@Property(
17841791
type = PropertyType.SWITCH, name = "Disable Night Vision",
17851792
description = "Removes the vanilla effects of Night Vision.",

src/main/kotlin/gg/skytils/skytilsmod/features/impl/misc/MiscFeatures.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ import net.minecraftforge.client.event.ClientChatReceivedEvent
7272
import net.minecraftforge.client.event.RenderBlockOverlayEvent
7373
import net.minecraftforge.client.event.RenderGameOverlayEvent
7474
import net.minecraftforge.event.entity.EntityJoinWorldEvent
75+
import net.minecraftforge.event.entity.living.EnderTeleportEvent
7576
import net.minecraftforge.event.entity.player.ItemTooltipEvent
7677
import net.minecraftforge.fml.common.Loader
7778
import net.minecraftforge.fml.common.eventhandler.EventPriority
@@ -491,6 +492,13 @@ object MiscFeatures {
491492
}
492493
}
493494

495+
@SubscribeEvent(priority = EventPriority.LOW)
496+
fun onEnderTeleport(event: EnderTeleportEvent) {
497+
if (Utils.inSkyblock && Skytils.config.disableEndermanTeleport) {
498+
event.isCanceled = true
499+
}
500+
}
501+
494502
class GolemSpawnTimerElement : GuiElement("Endstone Protector Spawn Timer", FloatPair(150, 20)) {
495503
override fun render() {
496504
val player = mc.thePlayer

0 commit comments

Comments
 (0)