Skip to content

Fixed Crash when using Custom Break Sound#1

Open
Reyxs712 wants to merge 1 commit intoRevvilon:1.21.11from
Reyxs712:1.21.11
Open

Fixed Crash when using Custom Break Sound#1
Reyxs712 wants to merge 1 commit intoRevvilon:1.21.11from
Reyxs712:1.21.11

Conversation

@Reyxs712
Copy link
Copy Markdown

@Reyxs712 Reyxs712 commented Mar 22, 2026

This PR fixes a client-side crash triggered when the Custom Break Sound feature attempts to parse a sound identifier.

The Problem

The crash was caused by using String.valueOf(SoundEvents.ALLAY_AMBIENT_WITH_ITEM) (or similar toString() calls) inside Identifier.parse().

In many Minecraft versions/mappings, calling .toString() on a SoundEvent object returns a formatted object string rather than the raw namespace ID (e.g., minecraft:entity.allay.ambient_with_item). This causes the Identifier class to throw an exception because the input contains invalid characters or an incorrect format.

The Solution

I have updated the logic in PingOffsetMinerClient.java to ensure the parser always receives a clean, valid string:

  1. Config First: The system now checks if Config.soundpath is valid and uses it.
  2. Safe Fallback: If the config is missing or invalid, it falls back to a hardcoded string literal: "minecraft:entity.allay.ambient_with_item".

Testing Status

I have verified that the game no longer crashes when using the following sound paths in the configuration:

  • block.note_block.bit
  • block.anvil.fall
  • block.basalt.break
  • Probably every Sound

Changes

  • File: src/client/java/pom/v1/PingOffsetMinerClient.java
  • Action: Replaced problematic Identifier.parse logic with a safety check and string-based fallback.

Log

https://mclo.gs/SesV25s

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.

1 participant