DuckyZones
在你的 Minecraft 世界中,使用强大的规则和效果创建自定义区域!
高度可配置、高效,完美适用于自定义地图、活动或游戏控制。
描述
DuckyZones 允许你在世界中定义特定的矩形区域(区域),在这些区域内应用某些规则和效果。
无论你是在建造 PvP 竞技场、冒险地图还是受控环境,此插件都能让你完全掌控玩家在这些定义区域内的行为。
功能
- 通过两个角点创建自定义区域
- 支持按区域指定世界
- 在区域内禁止特定物品或效果
- 要求进入者具备特定物品或效果
- 在区域内禁用鞘翅(自动移除玩家的鞘翅)
- 配置生命值和经验等级上限
- 在区域内自动施加药水效果
- 违规时自定义拒绝消息
- 支持无需重启服务器的重载功能
- 简洁的
config.yml 布局
- 基于 Java 21 构建,支持 Minecraft 1.21.11+
配置
config.yml
# 物品列表 (1.21.11) : https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html
# 效果列表 (1.21.11) : https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/potion/PotionEffectType.html
region-flags:
mob-entry:
knockback-strength: 0.6
knockback-y: 0.15
cooldown-ms: 250
zones:
spawn: # 区域名称
priority: 0 # 当区域重叠时,优先级高的生效
flags:
pvp: DENY
build: DENY
greeting: "&a欢迎来到 %region%!"
world: world # 区域所在的世界
corner1: world,100,64,100 # 第一个区域角点
corner2: world,110,70,110 # 第二个区域角点
elytra-disabled: false # 是否在该区域禁用鞘翅?这将移除玩家的鞘翅
elytra-disabled-message: "此区域禁用了鞘翅!"
blocked-items: # 背包中含有这些物品的玩家无法进入该区域
- TNT
- ENDER_PEARL
blocked-effects: # 含有这些效果的玩家无法进入该区域,离开后效果消失。分隔符;表示效果等级,例如 SPEED;1 = 游戏中的速度 I,如果你想屏蔽所有等级的效果,请使用 ;-1
- SPEED;-1
- INVISIBILITY;1
required-items: # 只有背包中含有这些物品的玩家才能进入该区域
- DIAMOND
- TOTEM_OF_UNDYING
required-effects: # 只有含有这些效果的玩家才能进入该区域,离开后效果消失。分隔符;表示效果等级,例如 SPEED;1 = 游戏中的速度 I,如果你想屏蔽所有等级的效果,请使用 ;-1
- NIGHT_VISION;1
zone-effects: # 进入区域后施加的效果,离开后效果消失。分隔符;表示效果等级,例如 SPEED;1 = 游戏中的速度 I
- STRENGTH;2
min-health: 5.0 # 生命值低于此数值的玩家无法进入
max-health: 20.0 # 生命值达到或高于此数值的玩家无法进入
min-level: 5 # 经验等级低于此数值的玩家无法进入
max-level: 100 # 经验等级达到或高于此数值的玩家无法进入
deny-message: "&c你无法进入该区域!" # 无法进入区域的玩家在尝试进入时会在聊天栏收到此消息
zone-teleport-back-command: "spawn %player%" # 当玩家通过传送等方式进入区域时执行的命令。要调用玩家昵称,只需输入 %player%
entry-deny-title: "&c禁止入内" # 当玩家未满足条件尝试进入区域时屏幕上显示的主标题
entry-deny-subtitle: "%reason%" # 当玩家未满足条件尝试进入区域时屏幕上显示的副标题
entry-deny-actionbar: "&e远离该区域!" # 当玩家未满足条件尝试进入区域时屏幕上显示的动作条
entry-deny-bossbar: "&4区域入口被封锁!" # 当玩家未满足条件尝试进入区域时屏幕上显示的血条
entry-deny-sound: ENTITY.VILLAGER.NO # 当玩家未满足条件尝试进入区域时播放的声音
afk-zone:
enabled: false # 这是否是一个带有奖励的挂机区域?
actionbar-format: "&e奖励:{rewards}" # 在挂机区域内动作条中显示的主格式
rewards:
reward1:
interval: 60 # 两次奖励之间的时间间隔(秒)
chance: 10.0 # 没有特定权限的玩家默认概率(0-100%)
permission-chances: # 根据玩家权限覆盖概率
"duckyzones.afk.vip": 50.0
"duckyzones.afk.premium": 75.0
bossbar-format: "&e奖励 1 将在 {time} 后发放" # 血条
commands: # 发放奖励时执行的命令
- "give %player% diamond 1"
- "tellraw %player% {\"text\":\"你因挂机获得了奖励!\",\"color\":\"green\"}"
reward2:
interval: 300 # 5分钟
chance: 50.0 # 50% 默认概率
bossbar-format: "&e奖励 2 将在 {time} 后发放" # 血条
permission-chances:
"duckyzones.afk.premium": 100.0 # 高级玩家总是获得此奖励
commands:
- "give %player% emerald 1"
命令
/duckyzones selector - 给予区域选择工具。左击一个方块以设置位置 1,右击一个方块以设置位置 2。
/duckyzones pos1 - 将位置 1 设置为当前所在方块的位置。
/duckyzones pos2 - 将位置 2 设置为当前所在方块的位置。
/duckyzones create <name> - 根据选定的位置创建一个长方体区域。
/duckyzones manage <name> - 打开单个区域的管理界面 GUI。
/duckyzones gui - 打开区域列表 GUI。
/duckyzones reload - 重新加载插件配置。
PlaceholderAPI
DuckyZones 对 PlaceholderAPI 存在软依赖。当安装并启用 PlaceholderAPI 时,DuckyZones 会注册 duckyzones 扩展,并在配置的 DuckyZones 消息中解析 PlaceholderAPI 占位符。
支持的外部占位符:
%duckyzones_region_count% - 已加载区域的总数
%duckyzones_current_region% 或 %duckyzones_primary_region% - 玩家所在位置优先级最高的区域
%duckyzones_current_regions% 或 %duckyzones_regions% - 玩家所在位置的所有区域
%duckyzones_current_region_count% - 玩家所在位置的区域数量
%duckyzones_highest_priority% 或 %duckyzones_priority% - 当前主区域的优先级
%duckyzones_world% - 玩家所在的世界
%duckyzones_flag_<flag-id>% - 玩家所在位置已解析的标志值,例如 %duckyzones_flag_build%
%duckyzones_flag_source_<flag-id>% - 已解析标志的来源区域 ID
%duckyzones_flag_priority_<flag-id>% - 用于已解析标志的优先级
任何可读取区域的占位符都可以通过在 duckyzones 标识符后添加 region_<region-id>_ 来指定某个已配置的区域。示例如下:
%duckyzones_region_spawn_id% - 区域 ID
%duckyzones_region_spawn_priority% - spawn 区域的配置优先级
%duckyzones_region_spawn_world% - 区域所在世界
%duckyzones_region_spawn_flags% 或 %duckyzones_region_spawn_flag_count% - 该区域上设置的标志数量
%duckyzones_region_spawn_volume% - 该区域的包含性方块体积
%duckyzones_region_spawn_min_block_x% 和 %duckyzones_region_spawn_max_block_x% - 区域边界
%duckyzones_region_spawn_flag_build% - 该区域上直接设置的 build 标志值
%duckyzones_region_spawn_flag_source_build% - 直接标志值的来源区域 ID
%duckyzones_region_spawn_flag_priority_build% - 直接标志值所使用的优先级
区域 ID 匹配时不区分大小写。如果区域 ID 中包含连字符,占位符中也接受使用下划线,因此 main-spawn 可以用作 main_spawn。
原生 DuckyZones 消息占位符包括 %player%、%player_uuid%、%world%、%x%、%y%、%z%、%block_x%、%block_y%、%block_z%、%region%、%regions%、%region_count% 和 %priority%。区域范围的占位符使用相同的语法,但不带 PlaceholderAPI 标识符,例如 %region_spawn_priority%、%region_spawn_flag_build% 或 %region_spawn%。
Plugin API
其他插件可以通过 Bukkit 服务或便捷提供者访问 DuckyZones:
import pl.barpad.duckyzones.api.DuckyZonesApi;
import pl.barpad.duckyzones.api.DuckyZonesProvider;
DuckyZonesApi api = DuckyZonesProvider.get();
boolean insideRegion = api.isInsideRegion(player.getLocation());
String currentRegion = api.getPrimaryRegionAt(player.getLocation())
.map(region -> region.getId())
.orElse("");
通过 Bukkit 服务也可获得相同的 API:
DuckyZonesApi api = Bukkit.getServicesManager().load(DuckyZonesApi.class);
根据你的插件是否可以在没有 DuckyZones 的情况下运行,在 plugin.yml 中使用 depend: [DuckyZones] 或 softdepend: [DuckyZones]。
DuckyZones
Create custom zones with powerful rules and effects in your Minecraft world!
Highly configurable, efficient, and perfect for custom maps, events, or gameplay control.
Description
DuckyZones allows you to define specific rectangular areas (zones) in your world where certain rules and effects apply.
Whether you're building PvP arenas, adventure maps, or controlled environments, this plugin gives you full control over player behavior inside defined areas.
Features
- Create custom zones with two corners
- Per-zone world support
- Block specific items or effects inside a zone
- Require specific items or effects to enter
- Disable Elytra inside zones (auto-removes Elytra from player)
- Configure health and XP level limits
- Apply potion effects automatically in a zone
- Custom denial messages for rule violations
- Easy reload support without restarting the server
- Simple
config.yml layout
- Built with Java 21, supports Minecraft 1.21.11+
Configuration
config.yml
# List of Items (1.21.11) : https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html
# List of Effects (1.21.11) : https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/potion/PotionEffectType.html
region-flags:
mob-entry:
knockback-strength: 0.6
knockback-y: 0.15
cooldown-ms: 250
zones:
spawn: # Zone name
priority: 0 # Higher priority wins when regions overlap
flags:
pvp: DENY
build: DENY
greeting: "&aWelcome to %region%!"
world: world # World where zone is
corner1: world,100,64,100 # First Zone Corner
corner2: world,110,70,110 # Second Zone Corner
elytra-disabled: false # Should be elytra disabled in that zone? This will remove the elytra from the player
elytra-disabled-message: "Elytra is disabled in this zone!"
blocked-items: # Player with these items in inventory cannot enter the zone
- TNT
- ENDER_PEARL
blocked-effects: # Player with these effects cannot enter the zone, after leaving it they will disappear separator; means the power of the effect, e.g. SPEED;1 = Speed 1 in the game, if you want to block all powers of effect, you must do ;-1
- SPEED;-1
- INVISIBILITY;1
required-items: # Only Player with these items in inventory can enter the zone
- DIAMOND
- TOTEM_OF_UNDYING
required-effects: # Only Players with these effects can enter the zone, after leaving it they will disappear separator; means the power of the effect, e.g. SPEED;1 = Speed 1 in the game, if you want to block all powers of effect, you must do ;-1
- NIGHT_VISION;1
zone-effects: # Effects that will be applied after entering the zone, after leaving it they will disappear separator; means the power of the effect, e.g. SPEED; 1 = Speed 1 in the game
- STRENGTH;2
min-health: 5.0 # Players who do not have this number of hearts cannot enter
max-health: 20.0 # Players who have this number of hearts or more cannot enter
min-level: 5 # Players who do not have this amount of exp level cannot enter
max-level: 100 # Players who have this amount of exp level or more cannot enter
deny-message: "&cYou can't enter this area!" # Players who are unable to enter the zone will receive this message in chat when trying to enter
zone-teleport-back-command: "spawn %player%" # The command that will be executed when the player enters the zone e.g. through teleportation, to call the player's nickname, just type %player%
entry-deny-title: "&cEntrance prohibited" # Title that will appear on the screen when a player tries to enter the zone without meeting the requirements
entry-deny-subtitle: "%reason%" # SubTitle that will appear on the screen when a player tries to enter the zone without meeting the requirements
entry-deny-actionbar: "&eGet away from the zone!" # ActionBar that will appear on the screen when a player tries to enter the zone without meeting the requirements
entry-deny-bossbar: "&4Entrance to the zone blocked!" # BossBar that will appear on the screen when a player tries to enter the zone without meeting the requirements
entry-deny-sound: ENTITY.VILLAGER.NO # Sound that will play on the screen when a player tries to enter the zone without meeting the requirements
afk-zone:
enabled: false # Is this an AFK zone with rewards?
actionbar-format: "&eRewards: {rewards}" # Main ActionBar format which will be shown in actionbar inside an AFK zone
rewards:
reward1:
interval: 60 # Time in seconds between rewards
chance: 10.0 # Default chance for players without specific permissions (0-100%)
permission-chances: # Override chance based on player permissions
"duckyzones.afk.vip": 50.0
"duckyzones.afk.premium": 75.0
bossbar-format: "&eReward 1 in {time}" # Bossbar
commands: # Commands to execute when reward is given
- "give %player% diamond 1"
- "tellraw %player% {\"text\":\"You received a reward for being AFK!\",\"color\":\"green\"}"
reward2:
interval: 300 # 5 minutes
chance: 50.0 # 50% default chance
bossbar-format: "&eReward 2 in {time}" # Bossbar
permission-chances:
"duckyzones.afk.premium": 100.0 # Premium players always get this reward
commands:
- "give %player% emerald 1"
Commands
/duckyzones selector - gives the region selector tool. Left click a block to set position 1 and right click a block to set position 2.
/duckyzones pos1 - sets position 1 to your current block location.
/duckyzones pos2 - sets position 2 to your current block location.
/duckyzones create <name> - creates a cuboid region from the selected positions.
/duckyzones manage <name> - opens the management GUI for one region.
/duckyzones gui - opens the region list GUI.
/duckyzones reload - reloads the plugin configuration.
PlaceholderAPI
DuckyZones soft-depends on PlaceholderAPI. When PlaceholderAPI is installed and enabled, DuckyZones registers the duckyzones expansion and also parses PlaceholderAPI placeholders in configured DuckyZones messages.
Supported external placeholders:
%duckyzones_region_count% - total loaded regions
%duckyzones_current_region% or %duckyzones_primary_region% - highest-priority region at the player location
%duckyzones_current_regions% or %duckyzones_regions% - all regions at the player location
%duckyzones_current_region_count% - number of regions at the player location
%duckyzones_highest_priority% or %duckyzones_priority% - priority of the current primary region
%duckyzones_world% - player world
%duckyzones_flag_<flag-id>% - resolved flag value at the player location, for example %duckyzones_flag_build%
%duckyzones_flag_source_<flag-id>% - source region ids for the resolved flag
%duckyzones_flag_priority_<flag-id>% - priority used for the resolved flag
Any region-readable placeholder can target a configured region by adding region_<region-id>_ after the duckyzones identifier. Examples:
%duckyzones_region_spawn_id% - region id
%duckyzones_region_spawn_priority% - configured priority of the spawn region
%duckyzones_region_spawn_world% - region world
%duckyzones_region_spawn_flags% or %duckyzones_region_spawn_flag_count% - number of flags set on the region
%duckyzones_region_spawn_volume% - inclusive block volume of the region
%duckyzones_region_spawn_min_block_x% and %duckyzones_region_spawn_max_block_x% - region bounds
%duckyzones_region_spawn_flag_build% - direct build flag value set on the region
%duckyzones_region_spawn_flag_source_build% - source region id for the direct flag value
%duckyzones_region_spawn_flag_priority_build% - priority used by the direct flag value
Region ids are matched case-insensitively. If a region id contains hyphens, underscores are also accepted in placeholders, so main-spawn can be used as main_spawn.
Native DuckyZones message placeholders include %player%, %player_uuid%, %world%, %x%, %y%, %z%, %block_x%, %block_y%, %block_z%, %region%, %regions%, %region_count%, and %priority%. Region-scoped placeholders use the same syntax without the PlaceholderAPI identifier, for example %region_spawn_priority%, %region_spawn_flag_build%, or %region_spawn%.
Plugin API
Other plugins can access DuckyZones through the Bukkit service or the convenience provider:
import pl.barpad.duckyzones.api.DuckyZonesApi;
import pl.barpad.duckyzones.api.DuckyZonesProvider;
DuckyZonesApi api = DuckyZonesProvider.get();
boolean insideRegion = api.isInsideRegion(player.getLocation());
String currentRegion = api.getPrimaryRegionAt(player.getLocation())
.map(region -> region.getId())
.orElse("");
The same API is also available through Bukkit services:
DuckyZonesApi api = Bukkit.getServicesManager().load(DuckyZonesApi.class);
Use depend: [DuckyZones] or softdepend: [DuckyZones] in your plugin.yml, depending on whether your plugin can run without DuckyZones.
评论 0
登录后参与评分
还没有评论,来抢沙发吧