流体炮弹扩展

流体炮弹扩展

已为流体弹射物实现灵活的自定义效果系统。通过简单的JSON配置文件,用户无需编写任何代码即可为任意流体添加丰富的爆炸效果。无论是放置流体、生成物品、施加药水

游戏机制

流体炮弹扩展

流体炮弹扩展 是 [Create Big Cannons] 的附属模组,通过灵活的自定义效果框架扩展了流体炮弹系统。借助简单的 JSON 配置文件,你无需编写任何代码,即可为任意流体添加丰富的爆炸效果。无论是放置流体源、生成物品、施加药水效果、制造爆炸,还是产生粒子——一切尽在掌控。


特性

  • 完全数据驱动 – 所有效果均通过 JSON 文件配置,无需修改模组代码。
  • 多阶段效果 – 根据炮弹内流体数量触发不同效果。
  • 多种效果类型 – 放置流体源方块、生成物品实体、施加药水效果、制造爆炸、发射粒子。
  • 软依赖支持 – 可根据特定模组是否加载来设置条件,实现跨模组集成。
  • 详细日志 – 便于调试和效果追踪。

需求

  • Minecraft 1.20.1
  • Forge 47.0.0 或更高版本
  • 必需模组:
    • [Create] 6.0.0+
    • [Create Big Cannons] 5.10.2+

配置

配置文件位于 config/fluid_shell_extensions/effects/:

  • 单人游戏:.minecraft/config/fluid_shell_extensions/effects/
  • 服务器:server-root/config/fluid_shell_extensions/effects/

每种流体都需要单独的 JSON 文件。建议以流体的注册名命名(例如 create_chocolate.json)。


配置文件结构

{
  "fluid": "modid:fluid_name",
  "condition": {
    "mod": "required_mod_id"
  },
  "effects": [
    {
      "type": "effect_type",
      "properties": {
        // 效果专属属性
      }
    }
  ]
}

字段说明

字段 说明
fluid 流体注册名(modid:fluid_name)
condition(可选) 效果加载的条件
condition.mod 必需模组 ID – 仅当此模组存在时效果才会加载
effects 要触发的效果数组

效果类型

放置流体

{
  "type": "place_fluid",
  "properties": {
    "fluid": "modid:fluid_name",
    "radius": 3,
    "density": 0.5
  }
}

生成物品

{
  "type": "spawn_items",
  "properties": {
    "items": [
      {
        "item": "modid:item_name",
        "count": 1,
        "chance": 0.5
      }
    ],
    "velocity": 2.0
  }
}

施加药水效果

{
  "type": "potion_effect",
  "properties": {
    "effects": [
      {
        "effect": "minecraft:effect_name",
        "amplifier": 1,
        "duration": 200
      }
    ],
    "radius": 5
  }
}

爆炸

{
  "type": "explosion",
  "properties": {
    "power": 3.0,
    "fire": false,
    "break_blocks": true
  }
}

粒子效果

{
  "type": "particles",
  "properties": {
    "particle": "minecraft:particle_name",
    "count": 100,
    "speed": 0.5
  }
}

示例

水

{
  "fluid": "minecraft:water",
  "effects": [
    {
      "type": "place_fluid",
      "properties": {
        "fluid": "minecraft:water",
        "radius": 2,
        "density": 0.8
      }
    },
    {
      "type": "particles",
      "properties": {
        "particle": "minecraft:splash",
        "count": 50,
        "speed": 0.3
      }
    }
  ]
}

岩浆

{
  "fluid": "minecraft:lava",
  "effects": [
    {
      "type": "place_fluid",
      "properties": {
        "fluid": "minecraft:lava",
        "radius": 2,
        "density": 0.6
      }
    },
    {
      "type": "explosion",
      "properties": {
        "power": 2.0,
        "fire": true,
        "break_blocks": false
      }
    },
    {
      "type": "particles",
      "properties": {
        "particle": "minecraft:flame",
        "count": 80,
        "speed": 0.4
      }
    }
  ]
}

常见问题

问:如何安装扩展?
答:安装模组,运行一次游戏,将你的 JSON 文件放入 config/fluid_shell_extensions/effects/,然后重启游戏或服务器。

问:如何创建自定义扩展?
答:请遵循上方的编写指南。

问:如何在多人服务器上设置?
答:服务器和客户端需要相同的配置。将文件放入服务器的 serverconfig/fluid_shell_extensions/effects/ 目录(服务器端配置优先)。

问:如何报告 bug 或建议功能?
答:请在模组的讨论页面留言。附上完整日志和复现步骤会很有帮助。


总结

流体炮弹扩展将流体炮弹从单纯的弹药转变为高度可定制的投射物,为你的游戏增添更多乐趣与策略。