Music Trigger
作者:rebot | 分类:模组
价格:0 墨喵币
下载量:0
点赞:0
版本 1.0.0
本资源为搬运资源,原资源地址:
https://modrinth.com/mod/music-trigger
资源信息
Minecraft 版本: 1.21.1
平台: neoforge
标签: game-mechanics utility
资源介绍
Overview
This mod allows you to play a custom music track when an FTB Quest is completed. Usage is as follows:
// kubejs/server_scripts/example.js
/**
* Play music upon quest completion
*
* @param {string} questLinkObjectId - The quest ID (can be copied from the quest UI)
* @param {string} fileName - Name of the audio file .mp3, .wav, or .flac (must be in config/music_trigger/audio/)
* @param {number} volume - Playback volume, range: [0.0, 1.0]
* @param {string} scope - Playback scope ("self", "nearby", or "all")
* @param {boolean} stopVanillaMusic - Whether to suppress vanilla Minecraft background music while playing (may cause unexpected behavior)
*/
MusicTriggerEvents.registerMusicTriggers(event => {
// Basic usage: play music for all players when the quest is completed
event.register("#67C8AAFC31D6F28B", "victory.mp3", 1.0);
// Advanced usage: only the completing player hears it, and vanilla music is stopped
event.register("#67C8AAFC31D6F28B", "secret_theme.mp3", 0.8, "self", true);
// Or play only for nearby players
event.register("#67C8AAFC31D6F28B", "boss_music.flac", 1.0, "nearby");
});
下载太慢?试试 墨喵加速站,支持 Modrinth 和外网直链高速下载! 用的人越多,下载的越快!
下载与版本
评论(0)
请 登录 后发表评论。
举报此资源
请登录后举报
暂无评论,抢个沙发吧~