-
Notifications
You must be signed in to change notification settings - Fork 2
Zone special client
XiaoColorful edited this page Nov 12, 2025
·
3 revisions
该特殊功能仅为发送SpecialZoneRenderEvent,供其他模组开发者监听事件
- zoneSpecialType:"render"
- protocol:自定义协议名称,建议优先通过该字符串筛选要处理的事件
- jsonTag:自定义数据
"zoneSpecial": {
"zoneSpecialType": "render",
"protocol": "cbr:0.4.6",
"jsonTag": {
}
}本模组内置的区域特殊词条扩展,从玩家位置指向区域中心渲染一个长方体
- hideInSpectate:是否在旁观模式下隐藏
- heightOffset:竖直方向偏移距离
- side:长方体的宽/高
长方体中心与玩家脚底在同一平面,heightOffset 为 side / 2 时长方体底面与玩家脚底共面
- 3dDistance:是否计算玩家位置到区域中心的三维距离,若为false则取在XZ平面上的投影
- distDim:取区域维度的x/y/z分量为基础距离,若不为"x"、"y"、"z"则为0
- distMul:基础距离缩放比例
- distAdd:使固定加上固定距离
若 距离 ≤ distDim * distMul + distAdd,则在范围内
- innerColor:在范围内时的颜色,留空则取区域颜色,格式 #RRGGBBAA
- outsideColor:在范围外时的颜色,留空则取区域颜色,格式为 #RRGGBBAA
"zoneSpecial": {
"zoneSpecialType": "render",
"protocol": "cbr:direct",
"jsonTag": {
"hideInSpectate": true,
"heightOffset": 0.25,
"side": 0.5,
"3dDistance": false,
"distDim": "x",
"distMul": 1.0,
"distAdd": 0.0,
"innerColor": "#00FF0011"
// outsideColor留空,自动取区域颜色及其透明度
}
}This special function is only for sending SpecialZoneRenderEvent, allowing other mod developers to listen for them.
- zoneSpecialType: "render"
- protocol: A custom protocol name. It's recommended to use this string to filter events to be processed.
- jsonTag: Custom data
"zoneSpecial": {
"zoneSpecialType": "render",
"protocol": "cbr:0.4.6",
"jsonTag": {
}
}This is an extension to the zone special entry built into this mod, which renders a cuboid from the player's position pointing towards the center of the zone.
- hideInSpectate: Whether to hide in spectator mode
- heightOffset: Vertical offset distance
- side: The width/height of the cuboid
The center of the cuboid is on the same plane as the player's foot position. When heightOffset is side / 2, the bottom surface of the cuboid is coplanar with the player's foot position.
- 3dDistance: Whether to calculate the three-dimensional distance from the player's position to the center of the zone. If false, the projection on the XZ plane is used.
- distDim: Takes the x/y/z component of the zone dimension as the base distance. If it is not "x", "y", or "z", it is 0.
- distMul: Scaling ratio for the base distance
- distAdd: Adds a fixed distance
If distance ≤ distDim * distMul + distAdd, then it is within the range.
- innerColor: Color when within the range. If left blank, the zone color will be used. Format: #RRGGBBAA
- outsideColor: Color when outside the range. If left blank, the zone color will be used. Format: #RRGGBBAA
"zoneSpecial": {
"zoneSpecialType": "render",
"protocol": "cbr:direct",
"jsonTag": {
"hideInSpectate": true,
"heightOffset": 0.25,
"side": 0.5,
"3dDistance": false,
"distDim": "x",
"distMul": 1.0,
"distAdd": 0.0,
"innerColor": "#00FF0011"
// outsideColor left blank, automatically takes the zone color and its transparency
}
}🌐 Language / 语言
-
- Configuration Introduction
- Command Introcuction
- Game type introduction
- About
- Mod development tutorial