Explosion Condition
基本信息
| 属性 | 值 |
|---|---|
| handler ID | explosion |
| 事件订阅 | Forge MinecraftForge.EVENT_BUS(net.minecraftforge.event.world.ExplosionEvent$Detonate) |
| 优先级 | 默认(无显式标注) |
| 触发对象 | EntityPlayer(玩家作为爆炸者) |
配置字段
| 字段 | 类型 | 默认 | 含义 |
|---|---|---|---|
size |
浮点 | 0.0 |
爆炸威力阈值(event.explosion.explosionSize >= size) |
触发流程
- 玩家触发的爆炸命中
ExplosionEvent.Detonate。 - 取
event.explosion.explosionSize。 - 顺序遍历所有配置项,命中阈值则调用 listener。
JSON 示例
TNT ≥ 5 威力爆炸:
{
"id": "kaboom",
"x": 0, "y": 4,
"icon": { "registryName": "minecraft:tnt" },
"condition": {
"type": "explosion",
"size": 5.0
}
}
相关条目
源码
src/main/java/glowredman/amazingtrophies/condition/ExplosionConditionHandler.java