-
Notifications
You must be signed in to change notification settings - Fork 19
Feat: Anger Management #212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 1.21.11
Are you sure you want to change the base?
Feat: Anger Management #212
Conversation
…d portals and enderchests have custom colors cuz they were all gray :(.
| 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 | ||
| } |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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)
| 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 | ||
| } |
There was a problem hiding this comment.
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
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.