34 lines
1.0 KiB
Kotlin
34 lines
1.0 KiB
Kotlin
package codes.som.hibiscus.features.exploits
|
|
|
|
import codes.som.hibiscus.api.feature.Feature
|
|
import codes.som.hibiscus.api.feature.FeatureCategory
|
|
import codes.som.hibiscus.events.PlayerTickEvent
|
|
import codes.som.hibiscus.mc
|
|
import codes.som.hibiscus.mixins.MixinExtEntity
|
|
import codes.som.hibiscus.util.ext.requireExtension
|
|
import codes.som.hibiscus.world
|
|
|
|
class AntiGhost : Feature("Anti Ghost", FeatureCategory.EXPLOITS) {
|
|
init {
|
|
on { _: PlayerTickEvent ->
|
|
|
|
for (player in world.players) {
|
|
if (player == mc.player)
|
|
continue
|
|
|
|
if (player.health <= 0) {
|
|
player.deathTime = -1
|
|
|
|
requireExtension<MixinExtEntity>(player)
|
|
player.setRemovalReason(null)
|
|
|
|
player.hurtTime = Int.MAX_VALUE
|
|
|
|
player.prevHeadYaw = player.prevYaw
|
|
player.headYaw = player.yaw
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|