Area Protection v1.0.0 - 初始版本发布
概述
适用于 Minecraft 1.21.11 的全面服务器端区域保护与警报系统,支持 LuckPerms 集成。创建受保护的区域、管理权限、接收实时警报,并控制谁能访问你的区域。
核心功能
区域管理
- 创建受保护区域:使用
/area pos1、/area pos2 和 /area create <name> 定义矩形区域
- 删除区域:使用
/area delete <name> 移除区域
- 查看区域信息:使用
/area info <name> 或 /area list 显示区域详情、保护状态和列表
- 区域扩展:使用
/area expand <region> <direction> <amount> 向任何方向(上、下、北、南、东、西)扩展现有区域
- 优先级系统:为区域分配优先级级别以处理重叠情况
- 体积限制:可配置每个玩家的最大区域体积(默认:1,000,000 个方块)
- 按玩家限制:限制每个玩家可以创建的区域数量(默认:每个玩家 10 个区域)
- 防止重叠:阻止创建与现有区域重叠的新区域
保护标志
使用 /area protection <region> <type> <true/false> 针对每个区域切换保护开关:
| 保护类型 |
描述 |
block_break |
防止未经授权的方块破坏 |
block_place |
防止未经授权的方块放置 |
block_interact |
防止与方块交互(按钮、拉杆等) |
container_open |
防止访问容器(箱子、 barrels、漏斗等) |
entity_damage |
防止对非玩家实体造成伤害(动物、宠物等) |
pvp |
防止玩家之间的战斗 |
新区域默认启用所有保护标志。
访问控制
白名单系统
- 添加玩家到白名单:
/area whitelist add <region> <player>
- 从白名单移除:
/area whitelist remove <region> <player>
- 被列入白名单的玩家可执行受保护的操作
黑名单系统
- 添加玩家到黑名单:
/area blacklist add <region> <player>
- 从黑名单移除:
/area blacklist remove <region> <player>
- 被列入黑名单的玩家无法访问受保护的操作
- 将黑名单中的玩家加入白名单(反之亦然)会将其从另一个列表中移除
所有者控制
- 只有区域所有者或管理员可以修改区域设置
- 区域所有者是创建该区域的玩家
- 管理员权限:
areaprotection.admin
警报系统
实时警报
- 当有人违反保护规则时立即收到警报
- 如果区域所有者在线,警报将发送给区域所有者
- 使用
/alert inbox [page] 查看待处理的警报
- 使用
/alert clear 清除警报
- 使用
/alert history <region> [page] 查看警报历史记录
警报类型
使用 /alert settings <region> <type> 切换特定的警报类型:
| 警报类型 |
触发条件 |
enter |
任何玩家进入区域 |
leave |
任何玩家离开区域 |
block_break |
有人尝试破坏受保护的方块 |
block_place |
有人尝试放置受保护的方块 |
block_interact |
有人尝试与方块交互 |
container_open |
有人尝试打开容器 |
entity_damage |
有人尝试伤害实体 |
pvp |
有人尝试进行玩家间战斗 |
离线警报存储
- 当区域所有者离线时,警报会被存储
- 玩家上线时自动发送
- 在聊天中显示前 5 条警报,可使用
/alert inbox 查看所有
警报冷却时间
- 每种警报类型可单独配置冷却时间以防止刷屏(默认:30-60 秒)
- 防止短时间内对同一操作重复发送警报
切换警报
- 禁用某个区域的所有警报:
/alert toggle <region>
- 使用相同命令重新启用
自定义消息
- 设置进入消息:
/area message <region> enter <message>
- 设置离开消息:
/area message <region> leave <message>
- 消息将以彩色形式显示给所有进入/离开该区域的玩家
权限集成
LuckPerms 支持
- 自动检测并与 LuckPerms 集成
- 通过 LuckPerms Web 编辑器或在游戏内分配权限
- 服务器启动时权限会自动注册到 LuckPerms
权限节点
| 权限 |
用途 |
areaprotection.pos |
使用 /area pos1 和 /area pos2 命令 |
areaprotection.create |
使用 /area create 创建新区域 |
areaprotection.delete |
使用 /area delete 删除区域 |
areaprotection.whitelist |
管理白名单 |
areaprotection.blacklist |
管理黑名单 |
areaprotection.protection |
修改保护设置 |
areaprotection.alerts.receive |
接收警报通知 |
areaprotection.bypass |
绕过所有保护(仅限管理员) |
areaprotection.admin |
对所有区域的完全管理员访问权限 |
areaprotection.reload |
重载配置 |
备用权限
- 如果未安装 LuckPerms,默认授予所有玩家基本权限
- 管理员权限需要服务器 OP 状态(等级 4)或 LuckPerms 权限
配置
config/areaprotection.json - 可自定义设置:
limits.maxRegionVolume - 每个区域的最大方块数(默认:1,000,000)
limits.maxRegionsPerPlayer - 每个玩家的最大区域数(默认:10)
alertCooldowns - 警报冷却时间(秒)
defaultProtectionFlags - 新区域的默认保护设置
blacklistHardBlock - 是否防止在区域内破坏某些方块
数据存储
- 自动将区域和警报数据持久化保存到
config/areaprotection/
- 基于 JSON 的存储,便于备份和编辑
- 离线警报在服务器重启后保留
事件处理
- 方块破坏:监控并防止未经授权的方块破坏
- 方块交互:阻止按钮、拉杆及其他方块的交互
- 实体伤害:防止对动物和实体的伤害
- 玩家移动:追踪区域进入/离开,显示消息,触发警报
- 容器访问:防止未经授权打开容器
- 玩家连接:在登录时发送离线警报
技术细节
要求
- Minecraft 版本:1.21.11
- Fabric 加载器:0.17.3+
- Fabric API:0.141.1+1.21.11
- Java:21+
可选依赖项
映射
- 使用 Mojang 官方映射,实现 100% 兼容性
命令参考
/area pos1 - 在当前坐标设置位置 1
/area pos2 - 在当前坐标设置位置 2
/area create <name> [priority] - 从选区创建区域
/area delete <name> - 删除一个区域
/area info <name> - 显示区域详情
/area list - 列出所有区域
/area protection <region> <type> <true/false> - 切换保护状态
/area whitelist add <region> <player> - 添加至白名单
/area whitelist remove <region> <player> - 从白名单移除
/area blacklist add <region> <player> - 添加至黑名单
/area blacklist remove <region> <player> - 从黑名单移除
/area message <region> enter <message> - 设置进入消息
/area message <region> leave <message> - 设置离开消息
/area expand <region> <direction> <amount> - 扩展区域
/alert toggle <region> - 开启或关闭所有警报
/alert inbox [page] - 查看离线警报
/alert clear - 清除所有离线警报
/alert history <region> [page] - 查看区域警报历史
/alert settings <region> <type> - 切换特定警报类型
文件结构
config/
├── areaprotection.json - 主配置文件
└── areaprotection/
├── regions.json - 已保存的区域
└── offline_alerts.json - 存储的离线警报
备注
- 区域保护仅在服务端生效(适用于原版和模组客户端)
- 所有时间戳均以 UTC 格式存储,并根据玩家时区进行格式化
- 警报冷却机制可防止刷屏,但无法阻止违规行为
- 若同一玩家同时存在于黑名单和白名单中:该玩家将被移至相反列表(并从原列表中移除)
版本信息
- 版本:1.0.0
- 发布日期:2026 年 1 月
- 状态:初始发布
Area Protection v1.0.0 - Initial Release
Overview
A comprehensive server-side region protection and alert system for Minecraft 1.21.11 with LuckPerms integration. Create protected regions, manage permissions, receive real-time alerts, and control who can access your areas.
Core Features
Region Management
- Create Protected Regions: Define rectangular areas with
/area pos1, /area pos2, and /area create <name>
- Delete Regions: Remove regions with
/area delete <name>
- View Region Info: Display region details, protection status, and lists with
/area info <name> or /area list
- Region Expansion: Expand existing regions in any direction (up, down, north, south, east, west) with
/area expand <region> <direction> <amount>
- Priority System: Assign priority levels to regions for overlap handling
- Volume Limits: Configurable maximum region volume per player (default: 1,000,000 blocks)
- Per-Player Limits: Limit how many regions a player can create (default: 10 regions per player)
- Overlap Prevention: Prevents creation of regions that overlap with existing regions
Protection Flags
Toggle protection on/off per region with /area protection <region> <type> <true/false>:
| Protection Type |
Description |
block_break |
Prevent unauthorized block breaking |
block_place |
Prevent unauthorized block placement |
block_interact |
Prevent interaction with blocks (buttons, levers, etc.) |
container_open |
Prevent access to containers (chests, barrels, hoppers, etc.) |
entity_damage |
Prevent damage to non-player entities (animals, pets, etc.) |
pvp |
Prevent player-versus-player combat |
All protection flags enabled by default on new regions.
Access Control
Whitelist System
- Add players to whitelist:
/area whitelist add <region> <player>
- Remove from whitelist:
/area whitelist remove <region> <player>
- Whitelisted players can perform protected actions
Blacklist System
- Add players to blacklist:
/area blacklist add <region> <player>
- Remove from blacklist:
/area blacklist remove <region> <player>
- Blacklisted players have no access to protected actions
- Whitelisting a blacklisted player (or vice versa) removes them from the opposite list
Owner Control
- Only region owner or admins can modify region settings
- Region owner is the player who created the region
- Admin permission:
areaprotection.admin
Alert System
Real-Time Alerts
- Receive alerts instantly when someone violates protection rules
- Alerts sent to region owner if online
- View pending alerts with
/alert inbox [page]
- Clear alerts with
/alert clear
- View alert history with
/alert history <region> [page]
Alert Types
Toggle specific alert types with /alert settings <region> <type>:
| Alert Type |
Triggered When |
enter |
Any player enters the region |
leave |
Any player exits the region |
block_break |
Someone attempts to break a protected block |
block_place |
Someone attempts to place a protected block |
block_interact |
Someone attempts to interact with a block |
container_open |
Someone attempts to open a container |
entity_damage |
Someone attempts to damage an entity |
pvp |
Someone attempts player combat |
Offline Alert Storage
- Alerts are stored when region owner is offline
- Automatically delivered when player logs in
- Shows first 5 alerts in chat, can view all with
/alert inbox
Alert Cooldowns
- Configurable per alert type to prevent spam (default: 30-60 seconds)
- Prevents duplicate alerts for the same action in quick succession
Toggle Alerts
- Disable all alerts for a region:
/alert toggle <region>
- Re-enable with the same command
Custom Messages
- Set enter message:
/area message <region> enter <message>
- Set leave message:
/area message <region> leave <message>
- Messages displayed in color to all players entering/leaving the region
Permission Integration
LuckPerms Support
- Automatic LuckPerms detection and integration
- Assign permissions via LuckPerms web editor or in-game
- Permissions automatically registered with LuckPerms on server start
Permission Nodes
| Permission |
Use |
areaprotection.pos |
Use /area pos1 and /area pos2 commands |
areaprotection.create |
Create new regions with /area create |
areaprotection.delete |
Delete regions with /area delete |
areaprotection.whitelist |
Manage whitelists |
areaprotection.blacklist |
Manage blacklists |
areaprotection.protection |
Modify protection settings |
areaprotection.alerts.receive |
Receive alert notifications |
areaprotection.bypass |
Bypass all protections (admin only) |
areaprotection.admin |
Full admin access to all regions |
areaprotection.reload |
Reload configuration |
Fallback Permissions
- If LuckPerms not installed, basic permissions granted to all players by default
- Admin permissions require server op status (level 4) or LuckPerms permission
Configuration
config/areaprotection.json - Customizable settings:
limits.maxRegionVolume - Maximum blocks per region (default: 1,000,000)
limits.maxRegionsPerPlayer - Maximum regions per player (default: 10)
alertCooldowns - Alert cooldown times in seconds
defaultProtectionFlags - Default protection settings for new regions
blacklistHardBlock - Whether to prevent breaking certain blocks in regions
Data Storage
- Automatic region and alert data persistence to
config/areaprotection/
- JSON-based storage for easy backup and editing
- Offline alerts retained across server restarts
Event Handling
- Block Breaking: Monitor and prevent unauthorized block destruction
- Block Interaction: Prevent button, lever, and other block interactions
- Entity Damage: Prevent harm to animals and entities
- Player Movement: Track region entry/exit, display messages, trigger alerts
- Container Access: Prevent unauthorized container opening
- Player Connection: Deliver offline alerts on login
Technical Details
Requirements
- Minecraft Version: 1.21.11
- Fabric Loader: 0.17.3+
- Fabric API: 0.141.1+1.21.11
- Java: 21+
Optional Dependencies
- LuckPerms: For advanced permission management (automatic detection)
Mappings
- Uses Mojang official mappings for 100% compatibility
Command Reference
/area pos1 - Set position 1 at current location
/area pos2 - Set position 2 at current location
/area create <name> [priority] - Create region from selection
/area delete <name> - Delete a region
/area info <name> - Show region details
/area list - List all regions
/area protection <region> <type> <true/false> - Toggle protection
/area whitelist add <region> <player> - Add to whitelist
/area whitelist remove <region> <player> - Remove from whitelist
/area blacklist add <region> <player> - Add to blacklist
/area blacklist remove <region> <player> - Remove from blacklist
/area message <region> enter <message> - Set enter message
/area message <region> leave <message> - Set leave message
/area expand <region> <direction> <amount> - Expand region
/alert toggle <region> - Toggle all alerts on/off
/alert inbox [page] - View offline alerts
/alert clear - Clear all offline alerts
/alert history <region> [page] - View region alert history
/alert settings <region> <type> - Toggle specific alert type
File Structure
config/
├── areaprotection.json - Main configuration
└── areaprotection/
├── regions.json - Saved regions
└── offline_alerts.json - Stored offline alerts
Notes
- Region protection is server-side only (works on both vanilla and modded clients)
- All timestamps stored in UTC and formatted for player's timezone
- Alert cooldowns prevent spam but don't prevent violations
- Blacklist + whitelist on same player: player goes to opposite list (removes from previous)
Version Info
- Version: 1.0.0
- Release Date: January 2026
- Status: Initial Release
评论 0
登录后参与评分
还没有评论,来抢沙发吧