Gamerule Events
作者:rebot | 分类:模组
价格:0 墨喵币
下载量:0
点赞:0
版本 1.0.0
本资源为搬运资源,原资源地址:
https://modrinth.com/mod/gamerule-events
资源信息
Minecraft 版本: 26.2
平台: neoforge
资源介绍
Gamerule Events
Gamerule Events is a Minecraft mod for NeoForge that allows you to trigger custom actions when game rules change. Actions are defined via data packs.
Features
- Trigger Actions on GameRule Change: Execute titles, subtitles, and sounds when a specific game rule is modified.
- Data Pack Driven: Define your own rules and actions in
data/<namespace>/gamerule_events/JSON files. - Multiple Actions: Supports setting title/subtitle (with fade timings) and playing sounds.
Example Configuration
Create a file at data/<namespace>/gamerule_events/<name>.json:
{
"rules": [
{
"gamerule": "minecraft:doDaylightCycle",
"when": {
"equals": "false"
},
"actions": [
{
"type": "broadcast_title",
"title": { "text": "Daylight Cycle Stopped", "color": "red" },
"subtitle": { "text": "Gamerule change detected", "color": "yellow" },
"fadeIn": 10,
"stay": 60,
"fadeOut": 10
},
{
"type": "broadcast_sound",
"sound": "minecraft:block.note_block.pling",
"volume": 1.0,
"pitch": 1.0
}
]
}
]
}
Notes:
gamerulemust match the in-game gamerule identifier (usually namespaced likeminecraft:doDaylightCycle).when.equalsis compared to the serialized new gamerule value; booleans should be"true"/"false".- After editing JSON, run
/reloadto apply changes.
Supported Actions
The datapack schema uses an actions[] array. Supported action types:
-
broadcast_titletitle(Component JSON) optionalsubtitle(Component JSON) optionalfadeIn(int, default10)stay(int, default40)fadeOut(int, default10)
-
broadcast_soundsound(string, resource location likeminecraft:block.note_block.pling)volume(float, default1.0)pitch(float, default1.0)
Installation
Gamerule Events targets NeoForge 26.1 (Minecraft 26.1) or later.
License
This project is licensed under the MIT License - see the LICENSE.txt file for details.
下载太慢?试试 墨喵加速站,支持 Modrinth 和外网直链高速下载! 用的人越多,下载的越快!
下载与版本
评论(0)
请 登录 后发表评论。
举报此资源
请登录后举报
暂无评论,抢个沙发吧~