Yeh, i only need that, i tried using the CaeF_Pausefix.js but it didn't work 😛 i need to stop the SE from sounding when i unfocus but i can't im going crazy
MZ Pause music in MZ when not in focus???
Javascript/Plugin SupportHave you tried using conditional branches?
Conditional branches in what? This is modifying something in MZ's engine.
Please clarify "didn't work." If you press F8 and look in the Console tab, do you see any errors?
Are you using any other plugins? Per the section guidelines for Plugin Support, please provide links to plugins you're asking for help with.
I put the plugin into a new test project of MZ and it works perfectly.
To set a script, for example:
JavaScript:
document.addEventListener("visibilitychange", function() {
if (document.hidden) {
AudioManager.stopAll();
} else {
$gameSystem.onAfterLoad(); // Resume BGM/BGS
}
});
The code listens for changes in visibility (when the game loses or regains focus).
When the game window becomes hidden (document.hidden), it stops all audio using AudioManager.stopAll().
When the game window becomes visible again, it calls $gameSystem.onAfterLoad() to resume the background music and sound.
Would this not work?
Okay! Your first post was confusing because the OP is clearly not a coder. So just asking if they "tried conditional branches" wouldn't mean anything to them (and that's the terminology used for event commands in the engine).
It doesn't work for me - it crashes when the window comes back into focus.
caethyril's plugin does work for me, which is why I was asking the OP to troubleshoot as much as they could.
Im only seeing this but i think its from other script
I tried using BGM, BGS, etc but when im out of focus i can still hear the sounds and the game pauses so some things im doing get out of sync
And if you turn off all the other plugins, save your project, start a game, does it work correctly? It's very hard to say "this plugin doesn't work" when you have other plugins active.
If yes, does it do any better if you drag caethyril's plugin to the bottom of your list?
If yes, does it do any better if you drag caethyril's plugin to the bottom of your list?
Try Turan's suggestions first, but I implemented a similar fix in Cae_Tweaks (feature Q06), in case you want to try that:
forums.rpgmakerweb.com
(I don't recall why I didn't just use my existing fix.)
MZ - Cae_Tweaks - lots of little features
Cae_Tweaks v19 updated 2026-06-16 (UTC+0) Terms of Use MIT License: https://opensource.org/licenses/mit-license.html Description The plugin file must be named Cae_Tweaks.js. This plugin contains a bunch of different things. It's mostly just me slowly making a game and coding some more stuff...
forums.rpgmakerweb.com
Yeh, u right, its bcs other scritp, i just don't know wich one 😛
Edit: i think is the EliMZ zoom, thats sad, i use a lot that zoom script :/
Thx, but the script also dont work with elimz zoom, i might just search another zoom script compatible 😛
I ask the same question I had from your first post - why not ask the author? @Eliaquim is very active on the forum, he might well be willing to look at his plugin (not script) if you've proven that it's conflicting with caethyril's plugin.
I didn't know that, im not very active here really, i work in my game 2 or 3 times in a month 😛 srry
You're right, it does crash when the window comes back into focus, I'll rearrange it.
I'm glad you found a better way to it!
Well, I would need to know exactly what happens for it to not work. If enabled only my plugins and caethyril's ones, then:
- What is happening? There is an error on the console?
- The zoom plugin commands does not work?
- Changing Caethyril plugin position fix the issue?
There is no error in the console
The zoom plugin works perfect
i tried change positions but it dont work at all
i tried just loading the 3 plugins in another project but i got nothing, same problem
Edit: when i activate the zoom plugin the window of the game moves to the left corner of the screen automatically idk if that is on purpose or not
Got it: Plugin Manager -> EliMZ_Book -> Playtest settings -> Dev Tools Focus:
Save your project to apply Plugin Manager changes, then test.
When enabled, this parameter causes the game to be always active while in playtest mode. In that case, my plugin will never see a reason to pause the audio.
false. 😮💨Save your project to apply Plugin Manager changes, then test.
When enabled, this parameter causes the game to be always active while in playtest mode. In that case, my plugin will never see a reason to pause the audio.
I've moved this thread to Plugin Support (from MZ Support). Thank you.
Original thread: https://forums.rpgmakerweb.com/threads/pause-music-in-mz-when-not-in-focus.168445/