[PR #7834] A creaking and a giant hurt with the monster sounds #7850

Open
opened 2026-11-03 07:25:24 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7834
Author: @MSedgeMC
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix/creaking-hurt-sound


📝 Commits (3)

  • 3dc2eba fix: a creaking and a giant hurt with the monster sounds
  • 9e91a6c test: a blow on a creaking names the sway or the hostile hurt
  • efcc2c4 port_map: Creaking.getHurtSound names the sway and the hostile hurt

📊 Changes

3 files changed (+100 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/mobs/ai.rs (+17 -0)
📝 crates/horizon-client/src/mobs/creaking.rs (+82 -0)
📝 tools/port_map/game2-003.tsv (+1 -0)

📄 Description

Vanilla

Monster names the hostile pair for every monster that has no voice of its own (javap -p -c -constants -cp /tmp/cj net.minecraft.world.entity.monster.Monster):

protected SoundEvent getHurtSound(DamageSource);
 0: getstatic #45  // Field net/minecraft/sounds/SoundEvents.HOSTILE_HURT
 3: areturn
protected SoundEvent getDeathSound();
 0: getstatic #48  // Field net/minecraft/sounds/SoundEvents.HOSTILE_DEATH
 3: areturn

SoundEvents.HOSTILE_HURT is register("entity.hostile.hurt") and HOSTILE_DEATH register("entity.hostile.death").

Creaking.getHurtSound (net.minecraft.world.entity.monster.creaking.Creaking) only replaces the hurt half, and only for a creaking that has a heart:

 0: aload_0
 1: invokevirtual #368  // Method isHeartBound:()Z
 4: ifeq          13
 7: getstatic     #660  // Field net/minecraft/sounds/SoundEvents.CREAKING_SWAY
10: goto          18
13: aload_0
14: aload_1
15: invokespecial #663  // Method net/minecraft/world/entity/monster/Monster.getHurtSound
18: areturn

so an unbound creaking is hurt with entity.hostile.hurt. Creaking.hurtServer is what decides which of the two a blow meets: it hands the damage to super.hurtServer when getHomePos() is null or the source is(#bypasses_invulnerability), and otherwise only animates the shell. Creaking.getDeathSound is entity.creaking.death either way.

Giant extends Monster and overrides none of the three, so its hurt and death are the hostile pair too.

Horizon

ai::voice_sounds names the state-dependent hurt, death and ambient sounds of the species that pick their own — drowned and guardians by land, small cubes, a closed shulker, a baby turtle, a skeleton horse in water — and had no arm for the creaking or the giant, so both read their row of the species table: entity.generic.hurt for the creaking, entity.generic.hurt and entity.generic.death for the giant.

A creaking summoned with no heart to bind to, or a bound one hit by something in #bypasses_invulnerability, therefore made the generic hurt sound where vanilla makes the hostile hurt or the sway. The sway of a blow the shell stops was already right: the creaking's own tick plays it for the protected case, which never reaches a hurt sound at all.

Proven:

  • cargo test -q -p horizon-client-lib --lib creaking: 4 passed; 0 failed.
  • The three new tests go through Mob::damage, the LivingEntity.hurtServer a landed blow runs, and read the sound from the mob's outbox. With the arm removed they read the values the table gives today:
    • a_creaking_with_no_heart_hurts_like_a_monster: left: ["entity.generic.hurt"] right: ["entity.hostile.hurt"].
    • a_heart_bound_creaking_sways_when_a_blow_gets_through: left: ["entity.generic.hurt"] right: ["entity.creaking.sway"].
    • a_giant_hurts_and_dies_like_a_monster: left: ["entity.generic.hurt"] right: ["entity.hostile.hurt"], then left: ["entity.generic.death"] right: ["entity.hostile.death"].
  • cargo test -q -p horizon-client-lib --lib: 1430 passed; 0 failed; 48 ignored.
  • cargo clippy -q -p horizon-client-lib --lib is silent; rustfmt --edition 2024 --check on both files is clean.

Not proven:

  • Nothing in game: the sounds are pushed as events, and no run confirms a client plays the hostile pair or the sway at the right moment.
  • The volume and pitch of both sounds are the ones Mob::damage already used (the voice pitch and sound_volume), not re-derived here; vanilla's playHurtSound does the same through makeSound.
  • The .local client data is not in this checkout, so the tests build the mob from the test kind and set the species table's own values on it; the table row the tests use is the one in mobs/species.rs.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/7834 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/creaking-hurt-sound` --- ### 📝 Commits (3) - [`3dc2eba`](https://github.com/horizon-rust/horizon/commit/3dc2eba2ad4c69bc6dc82bfe60c91aab2cd1a438) fix: a creaking and a giant hurt with the monster sounds - [`9e91a6c`](https://github.com/horizon-rust/horizon/commit/9e91a6c8c1c2915f87bc8a3ca47cac562a9656bc) test: a blow on a creaking names the sway or the hostile hurt - [`efcc2c4`](https://github.com/horizon-rust/horizon/commit/efcc2c4c980f6a9331d88151943d060543d8fd52) port_map: Creaking.getHurtSound names the sway and the hostile hurt ### 📊 Changes **3 files changed** (+100 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/ai.rs` (+17 -0) 📝 `crates/horizon-client/src/mobs/creaking.rs` (+82 -0) 📝 `tools/port_map/game2-003.tsv` (+1 -0) </details> ### 📄 Description ### Vanilla `Monster` names the hostile pair for every monster that has no voice of its own (`javap -p -c -constants -cp /tmp/cj net.minecraft.world.entity.monster.Monster`): ``` protected SoundEvent getHurtSound(DamageSource); 0: getstatic #45 // Field net/minecraft/sounds/SoundEvents.HOSTILE_HURT 3: areturn protected SoundEvent getDeathSound(); 0: getstatic #48 // Field net/minecraft/sounds/SoundEvents.HOSTILE_DEATH 3: areturn ``` `SoundEvents.HOSTILE_HURT` is `register("entity.hostile.hurt")` and `HOSTILE_DEATH` `register("entity.hostile.death")`. `Creaking.getHurtSound` (`net.minecraft.world.entity.monster.creaking.Creaking`) only replaces the hurt half, and only for a creaking that has a heart: ``` 0: aload_0 1: invokevirtual #368 // Method isHeartBound:()Z 4: ifeq 13 7: getstatic #660 // Field net/minecraft/sounds/SoundEvents.CREAKING_SWAY 10: goto 18 13: aload_0 14: aload_1 15: invokespecial #663 // Method net/minecraft/world/entity/monster/Monster.getHurtSound 18: areturn ``` so an unbound creaking is hurt with `entity.hostile.hurt`. `Creaking.hurtServer` is what decides which of the two a blow meets: it hands the damage to `super.hurtServer` when `getHomePos()` is null or the source `is(#bypasses_invulnerability)`, and otherwise only animates the shell. `Creaking.getDeathSound` is `entity.creaking.death` either way. `Giant extends Monster` and overrides none of the three, so its hurt and death are the hostile pair too. ### Horizon `ai::voice_sounds` names the state-dependent hurt, death and ambient sounds of the species that pick their own — drowned and guardians by land, small cubes, a closed shulker, a baby turtle, a skeleton horse in water — and had no arm for the creaking or the giant, so both read their row of the species table: `entity.generic.hurt` for the creaking, `entity.generic.hurt` and `entity.generic.death` for the giant. A creaking summoned with no heart to bind to, or a bound one hit by something in `#bypasses_invulnerability`, therefore made the generic hurt sound where vanilla makes the hostile hurt or the sway. The sway of a blow the shell stops was already right: the creaking's own tick plays it for the protected case, which never reaches a hurt sound at all. **Proven:** - `cargo test -q -p horizon-client-lib --lib creaking`: `4 passed; 0 failed`. - The three new tests go through `Mob::damage`, the `LivingEntity.hurtServer` a landed blow runs, and read the sound from the mob's outbox. With the arm removed they read the values the table gives today: - `a_creaking_with_no_heart_hurts_like_a_monster`: `left: ["entity.generic.hurt"] right: ["entity.hostile.hurt"]`. - `a_heart_bound_creaking_sways_when_a_blow_gets_through`: `left: ["entity.generic.hurt"] right: ["entity.creaking.sway"]`. - `a_giant_hurts_and_dies_like_a_monster`: `left: ["entity.generic.hurt"] right: ["entity.hostile.hurt"]`, then `left: ["entity.generic.death"] right: ["entity.hostile.death"]`. - `cargo test -q -p horizon-client-lib --lib`: `1430 passed; 0 failed; 48 ignored`. - `cargo clippy -q -p horizon-client-lib --lib` is silent; `rustfmt --edition 2024 --check` on both files is clean. **Not proven:** - Nothing in game: the sounds are pushed as events, and no run confirms a client plays the hostile pair or the sway at the right moment. - The volume and pitch of both sounds are the ones `Mob::damage` already used (the voice pitch and `sound_volume`), not re-derived here; vanilla's `playHurtSound` does the same through `makeSound`. - The `.local` client data is not in this checkout, so the tests build the mob from the test kind and set the species table's own values on it; the table row the tests use is the one in `mobs/species.rs`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#7850
No description provided.