Skip to content

Conversation

@KMatias123
Copy link

I don't like it when the aura hits the pink zombies and they get angry and I die because of it. Very stupid. Endermen also.

Anyways now the targeting has settings to not target Angerable entities.

Comment on lines +70 to +80
private fun findClosestEntity(packet: PlaySoundS2CPacket): UUID? {
val vec3 = Vec3d(packet.x, packet.y, packet.z)
val soundId = packet.sound.value().id.path
return when {
soundId.contains(".growl") || // (wolf) randomly while angry
soundId.contains(".stare") || // when it mad when u look at it
soundId.contains(".scream") || // randomly when hostile
soundId.contains(".angry") // (zombie pigmen) randomly when angry and when getting angry
-> matchLocations(vec3)
else -> null
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its not the best way to know is the entity is angry tbh. for piglins you can check their activity (like PiglinActivity.ATTACKING_WITH_MELEE_WEAPON) and for wolf check the texture id wolf.getTextureId()

}

companion object {
const val ANGER_DURATION_MS = 60000L
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zombified piglins are not gonna stop attacking you after 60 seconds (same with wolfs)

Comment on lines +62 to +67
fun Entity.distanceSqTo(vec3d: Vec3d): Double {
val dx = this.x - vec3d.x
val dy = this.y - vec3d.y
val dz = this.z - vec3d.z
return dx * dx + dy * dy + dz * dz
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just do Vec3d.squaredDistanceTo instead of making a util for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants