Перейти к содержимому
Mineforgian

C4 Pro

A refined mod porting CS2’s C4 system to Minecraft.

Загрузки
13K
Подписчики
7
Обновлён
25 июля 2026 г.
Лицензия
MIT

Опубликован 29 марта 2026 г.

📦 Mod Introduction

1. 🎯 Positioning

This mod is a fork, enhancement, and optimization of the original C4 mod created by qisumei. While retaining the core mechanics, it addresses many limitations of the original version through extensive refactoring and improvements, aiming to deliver a more stable, flexible, and multiplayer-friendly C4 experience.


2. 💣 Gameplay

  • Planting C4: Hold the C4 in hand, standing on the permitted blocks, and hold the right button for 4 seconds to plant it.
  • Defusing C4: Use shears on a planted C4 and hold the right button for 4 seconds to defuse it.
  • Detonation Timer: The C4 will explode 40 seconds after being planted, with in-game alerts throughout the countdown.

3. ⚙️ Key Changes

  • Entity-Based Design: The C4 is now an entity instead of a block, ensuring proper planting and defusing mechanics regardless of game mode, and allowing easier server-side cleanup( /c4clear ).
  • Configurable Valid Blocks: Only blocks specified in the configuration can have C4 planted on them, offering better control over gameplay scenarios.
  • Scoreboard Integration: The status of C4 is synchronized to the scoreboard, enabling seamless integration with maps or server logic (see “Scoreboard Integration” for details).

4. 📊 Scoreboard Integration

C4 status is stored in the player’s #C4 scoreboard under the objective c4_condition. The possible values are:

Value Status
1 C4 Planted
2 C4 Exploded
3 C4 Defused

📌 Note: At the start of each round, this value should be manually reset to 0 to ensure accurate state tracking.


📦 模组介绍

1. 🎯 模组定位

本模组由 qisumei 的 C4 模组移植、改造并深度优化而来。在保留原版玩法精髓的基础上,针对其机制与体验上的不足进行了大量重构与增强,旨在提供更稳定、更灵活、更适合多人游戏环境的 C4 机制。


2. 💣 玩法说明

  • 安装 C4:手持 C4,站在允许放置的方块上,持续按住右键 4 秒即可完成安装。
  • 拆除 C4:使用 剪刀 对准已安装的 C4,持续按住右键 4 秒即可拆除。
  • 爆炸倒计时:C4 安装后 40 秒 自动爆炸,期间会通过游戏内提示进行预警。

3. ⚙️ 核心改动

  • 实体化重构:将 C4 从方块改为实体,解决了原版中因游戏模式限制导致的拆装问题,同时便于服务器进行实体清理(/c4clear)与管理。
  • 合法方块配置:支持自定义可安装 C4 的方块类型,只有在配置名单内的方块上才允许安装,提升玩法可控性。
  • 记分板状态反馈:C4 的安装、爆炸、拆除状态会实时同步至记分板,便于地图或服务器进行逻辑联动(详见“记分板联动”部分)。

4. 📊 记分板联动

C4 的状态将记录在玩家 #C4 的记分板项 c4_condition 中,状态值含义如下:

状态值 含义
1 已安装 C4
2 C4 已爆炸
3 C4 已拆除

📌 注意:每局游戏开始时,需手动将该值重置为 0,以确保状态判断准确。


Ченджлог

1.6.0Релиз1.20.1 · 25 июля 2026 г.

Allowing for manual bomb disposal
The main functions have all been fully completed.

If you want the items dropped by C4 to glow, please load the datapack "c4 glowing" in the attached files, and then enter "/function glowing:glowing_loop" in the chat box to start.

1.5.0Релиз1.20.1 · 12 июля 2026 г.

C4 Pro v1.5.0


🚀 新增功能

1. 拆除队伍白名单

  • 新增 allowed_defuse_teams 配置项,只有指定队伍的玩家可以拆除C4
  • 空列表表示任何队伍都可以拆除
  • 配置示例:allowed_defuse_teams = ["red", "blue"]

2. 空手拆除C4(待实现)

  • 允许玩家空手拆除C4,方法与剪刀拆除相同,但需要10秒
  • 拆除过程中切换物品或移动会中断拆除
  • 状态:计划中,将在后续版本实现

3. C4掉落系统

  • 当玩家在 保留物品栏 游戏规则开启时被击杀,身上的C4会在死亡位置掉落
  • 掉落时在聊天栏广播C4掉落位置坐标
  • 只有安装队伍(allowed_install_teams)的玩家可以拾取C4
  • 不允许拾取的队伍捡起C4时会立即被清除并在脚底掉落

4. C4全局清除指令

  • 新增 /c4clear 指令(需要OP权限)
  • 可清除整个存档所有已加载的C4实体
  • 执行后显示清除的C4数量

🔧 功能优化

1. 拆除逻辑重构

  • 拆除改为基于时间戳计时,不再受服务器TPS影响
  • 先拆除的玩家优先,后续玩家尝试拆除会被阻止并提示
  • 拆除过程中移动或切换物品会自动中断
  • 支持视角射线检测,需要玩家看着C4才能拆除

2. UI系统优化

  • 新增独立UI显示系统,位于Action Bar上方
  • 安装/拆除倒计时精确到0.1秒
  • UI提示仅在安装/拆除时显示,其他时间自动隐藏
  • 提示信息不再占用Action Bar,避免与其他模组冲突

3. 队伍检测优化

  • 使用原版队伍API检测玩家队伍
  • 添加0.5秒缓存,减少性能开销
  • 移除所有调试日志输出

4. 计分板系统扩展

  • 新增 p1scorep2scorep3score 计分板
  • 在虚拟玩家 #C4 中存储C4的XYZ坐标(整数)
  • C4状态计分板 c4_condition 功能保留

5. C4实体优化

  • C4安装后强制加载所在区块,保证倒计时正常进行
  • C4被拆除或爆炸后自动卸载区块
  • 只有剪刀可以拆除C4(拆除时间5秒)

🐛 Bug修复

  • 修复局域网客端无法看到UI提示的问题
  • 修复拆除时倒计时UI与整数UI冲突
  • 修复C4队伍检测不生效的问题
  • 修复C4掉落物粒子无法清除的问题

📊 配置文件更新

c4-common.toml 新增配置项:

# 允许安装C4的队伍名称列表(空列表表示任何队伍都可以)
allowed_install_teams = []

# 允许拆除C4的队伍名称列表(空列表表示任何队伍都可以)
allowed_defuse_teams = []

# 是否启用C4掉落功能(需要保留物品栏游戏规则开启)
enable_c4_drop = true

⚠️ 已知问题

  • C4掉落物标记(火圈粒子)可能不稳定,建议搭配客户端高亮模组使用

📋 待办事项 (TODO)

  • 空手拆除C4:允许玩家空手拆除C4,耗时10秒,与剪刀拆除逻辑一致
1.2.0Релиз1.20.1 · 24 апреля 2026 г.

C4-Pro v1.2 更新日志 / Changelog


🛡️ 队伍权限系统 / Team-Based Planting Permission

  • 新增基于队伍的安装许可功能
    Added team-based planting permission

  • 可通过配置文件设置白名单队伍,仅允许指定队伍中的玩家安装 C4
    Whitelisted teams can be configured – only players in allowed teams can plant C4

  • 非白名单队伍成员尝试安装时会收到提示
    Players not in whitelisted teams will receive a warning when attempting to plant


🔧 拆除机制修复 / Defuse Fixes

  • 修复拆除 C4 时的交互问题
    Fixed interaction issues when defusing C4

  • 补全拆除过程中的操作 UI 提示,提升用户体验
    Completed UI prompts during defuse process for better user experience


🌐 网络与性能优化 / Network & Performance Optimization

  • 更多逻辑移至客户端自动处理,显著减少带宽占用
    More logic moved to client-side auto-handling, significantly reducing bandwidth usage

  • 降低网络请求频率,减少操作延迟
    Reduced network request frequency and operation latency

  • 优化多人游戏环境下的同步效率
    Improved synchronization efficiency in multiplayer environments


📝 日志精简 / Log Reduction

  • 大幅减少不必要的控制台日志输出
    Drastically reduced unnecessary console log output

  • 降低 I/O 开销,进一步提升整体性能
    Reduced I/O overhead for better overall performance


📌 升级提醒 / Upgrade Notice
新增队伍权限配置项,如需要使用该功能,请参考配置文件中的说明进行设置。
A new team permission option has been added. To use this feature, please refer to the configuration file for setup instructions.

1.1.0Релиз1.20.1 · 6 апреля 2026 г.

Sound effect completion; Several issues of the client have been fixed. Improve stability;

1.0.0Релиз1.20.1 · 29 марта 2026 г.

The first version.

Комментарии

Загружаем…