Bobochop Unbound-1.6.5.zip
What's new
================================================================================
CHANGELOG: bobochop_dynamic_music.js (ClientLevel GameTime Fix)
================================================================================
Date: 2026-11-25
File: kubejs/client_scripts/bobochop_dynamic_music.js
Type: Bugfix (Client-Tick / Rhino 1.20.1 API Compatibility)
--------------------------------------------------------------------------------
ISSUE:
- In the `ClientEvents.tick` handler (around line 215, `runMusicControl`),
calling `level.getGameTime()` threw an error on every single game tick,
flooding the client log:
`TypeError: Cannot find function getGameTime in object ClientLevel`
- Cause: In Minecraft 1.20.1 (Mojang mappings / Rhino), `ClientLevel` does not
expose `getGameTime()`; it uses `level.time` or `level.getTime()` instead.
CHANGES:
+ [Added, ~lines 55-79] Helper function `gameTimeOf(level)` right after
`dayTimeOf`:
1. Attempts `Number(level.time)` inside a `try/catch` block.
2. Falls back to `Number(level.getTime())` if step 1 returns `NaN`.
3. Falls back to `Number(level.getGameTime())` inside a `try/catch` block if
step 2 also returns `NaN`.
4. Returns `0` if all lookups yield `NaN`, preventing `NaN` from breaking
cooldown/timing calculations (`lastPlayed`).
* [Changed, ~line 215] Inside `runMusicControl`:
- Old: `var now = Number(level.getGameTime());`
- New: `var now = gameTimeOf(level);`
================================================================================
This mod has no additional files