DuraBlock - 自定义方块耐久度插件
DuraBlock 是一款 Minecraft 插件,灵感来源于《Metin2》中的石头系统,允许服务器管理员创建具有可配置耐久度的自定义方块。玩家可以竞速打破这些方块并获取奖励!
? 功能特性
- 带耐久度的自定义方块: 设置方块在被破坏前需要被击打的次数。
- 全息图: 在方块上方显示自定义全息图,无论方块处于激活还是非激活状态。
- 权限支持: 指定打破每个方块所需的权限。
- 声音与广播事件: 当方块被破坏时播放声音并向全服广播消息。
- 奖励系统: 当方块被破坏时,根据可配置的几率给予奖励。
- 自动方块恢复: 方块会在设定的时间间隔后自动重新出现。
- 自定义纹理支持: 你可以添加来自 ItemsAdder、Nexo 和 Oraxen 等插件的自定义方块。
- MiniMessage 支持: DuraBlock 支持 MiniMessage,用于在配置文件和语言文件中实现丰富的文本格式。
? 依赖要求
?️ 安装方法
- 下载 DuraBlock 的最新发布版本。
- 将
.jar 文件放入服务器的 plugins 文件夹中。
- 重启服务器以生成默认配置文件。
- 编辑
config.yml 以自定义你的方块。
- 运行
/durablock reload 重载插件以应用更改。
? 语言支持
? 默认配置
点击查看 config.yml
language: en_us
prefix: "<#874CCC><bold>DuraBlock</bold> <gray>» "
blocks:
test-block:
durability: 20
# 方块被破坏后恢复的时间间隔(秒)
restore-interval: 30
# 方块上方全息图的垂直偏移量(以方块为单位)
y-level: 2
# 打破此方块所需的权限
permission: durablock.break.test-block
# 方块处于激活/启用状态时在全息图中显示的文本行
# 有关格式和颜色选项,请参阅 DecentHolograms wiki:
# https://wiki.decentholograms.eu/general/format-and-colors/
enabled-hologram-lines:
- "<#6DE1D2>Test Block"
- "<#FF0000>Durability: {durability}</#00FF00>"
# 方块处于禁用状态时在全息图中显示的文本行
disabled-hologram-lines:
- "Disabled for now."
- "Will be activated in: <#FFA725>{restore}"
- "Broken by: <#FFA725>{last_player}"
# 当方块耐久度大于 0 时,以一定概率执行的命令列表
rewards:
- command: "give {player} diamond 1"
chance: 0.1 # 10% 几率
- command: "give {player} emerald 2"
chance: 0.3 # 30% 几率
# 当方块被破坏时执行的操作
on-break:
sound:
enabled: true
# https://minecraft.wiki/w/Sounds.json/Java_Edition_values 查看声音列表
sound-type: "minecraft:entity.player.levelup"
# 声音是否对所有人播放,还是仅对打破方块的玩家播放
play-to-everyone: true
broadcast:
enabled: true
# 方块被破坏时向所有玩家广播的消息
message: "<red>{player} broke the test-block"
# 方块被破坏时执行的命令
commands:
- "give {player} diamond 16"
# 警告:调整这些值可能会影响服务器性能或导致意外行为。
# 只有在了解潜在后果的情况下才进行修改。
# 更新全息图的时间间隔(秒)
hologram-update-interval: 1
# 检查方块是否需要启用(恢复)的时间间隔(秒)
block-restore-interval: 1
? 使用方法
- 通过在
config.yml 文件中添加方块来创建自定义方块。
- 自定义方块耐久度、全息图、声音和奖励。
- 使用权限控制谁可以打破特定的方块。
? 命令与权限
| 命令 |
描述 |
/durablock reload |
重载配置文件 |
/durablock add <block-type> |
添加指定类型的新自定义方块 |
/durablock list |
列出所有已配置的自定义方块 |
/durablock remove <block-id> |
通过 ID 移除特定的自定义方块 |
/durablock restore <block-id> |
通过 ID 手动恢复方块 |
/durablock info |
显示插件相关信息 |
| 权限 |
描述 |
durablock.commands.main |
允许使用 /durablock 命令 |
durablock.notify.update |
允许接收更新通知 |
? 占位符
全息图占位符
{last_player} - 显示最后破坏该方块的玩家名称。
{restore} - 显示方块恢复前剩余的秒数。
{durability} - 显示方块当前的耐久度。
命令占位符
? 示例
要创建一个名为 "diamond-block"、耐久度为 50、恢复时间为 20 秒的新方块,请将以下内容添加到您的 config.yml 中:
blocks:
diamond-block:
durability: 50
restore-interval: 20
permission: durablock.break.diamond-block
enabled-hologram-lines:
- "Diamond Block - {durability} hits left"
disabled-hologram-lines:
- "Regenerating in: {restore} seconds"
rewards:
- command: "give {player} diamond 1"
chance: 0.1 # %10 chance
on-break:
sound:
enabled: true
sound-type: "minecraft:entity.player.levelup"
play-to-everyone: true
broadcast:
enabled: true
message: "<red>{player} broke the diamond block and earned 16 diamonds!"
commands:
- "give {player} diamond 16"
? 支持
如果您遇到任何问题或有功能建议,欢迎在 GitHub 上提交 Issue,或加入我的 Discord Server。
? 许可证
本项目采用 MIT 许可证授权 - 详情请参阅 LICENSE.md 文件。
祝您使用 DuraBlock 使服务器更加动态!
DuraBlock - Custom Block Durability Plugin
DuraBlock is a Minecraft plugin, inspired by the Metin Stones from Metin2, that allows server owners to create custom blocks with configurable durabilities. Players can race to break these blocks and earn rewards!
? Features
- Custom Blocks with Durability: Set how many times a block needs to be hit before breaking.
- Holograms: Display custom holograms above blocks, both when active and inactive.
- Permission Support: Specify permissions required to break each block.
- Sound and Broadcast Events: Play a sound and broadcast a message when a block is broken.
- Reward System: Give rewards with customizable chances when a block is broken.
- Automatic Block Restoration: Blocks automatically reappear after a configurable interval.
- Custom Textures Support: You can add custom blocks from plugins like ItemsAdder, Nexo and Oraxen.
- MiniMessage Support: DuraBlock supports MiniMessage for rich text formatting in config and language files.
? Requirements
?️ Installation
- Download the latest release of DuraBlock.
- Place the
.jar file in your server's plugins folder.
- Restart the server to generate the default configuration.
- Edit the
config.yml to customize your blocks.
- Reload the plugin
/durablock reload to apply changes.
? Language Support
? Default Configuration
Click to view config.yml
language: en_us
prefix: "<#874CCC><bold>DuraBlock</bold> <gray>» "
blocks:
test-block:
durability: 20
# Time in seconds before the block gets restored after being broken
restore-interval: 30
# Vertical offset for the hologram above the block (in blocks)#
y-level: 2
# Permission required to break this block
permission: durablock.break.test-block
# Text lines displayed in the hologram when the block is active/enabled
# Refer to the DecentHolograms wiki for formatting and color options:
# https://wiki.decentholograms.eu/general/format-and-colors/
enabled-hologram-lines:
- "<#6DE1D2>Test Block"
- "<#FF0000>Durability: {durability}</#00FF00>"
# Text lines displayed in the hologram when the block is disabled
disabled-hologram-lines:
- "Disabled for now."
- "Will be activated in: <#FFA725>{restore}"
- "Broken by: <#FFA725>{last_player}"
# List of commands executed with a certain probability when the block's durability is above 0
rewards:
- command: "give {player} diamond 1"
chance: 0.1 # %10 chance
- command: "give {player} emerald 2"
chance: 0.3 # %30 chance
# Actions to perform when the block is broken
on-break:
sound:
enabled: true
# https://minecraft.wiki/w/Sounds.json/Java_Edition_values for sound list
sound-type: "minecraft:entity.player.levelup"
# Whether the sound should play for everyone or only the player who broke it
play-to-everyone: true
broadcast:
enabled: true
# Message broadcast to all players when the block is broken
message: "<red>{player} broke the test-block"
# Commands executed when the block is broken
commands:
- "give {player} diamond 16"
# Warning: Adjusting these values may impact server performance or cause unexpected behavior.
# Only change them if you understand the potential consequences.
# Interval for updating hologram (in seconds)
hologram-update-interval: 1
# Interval for checking if blocks needs to be enabled (in seconds)
block-restore-interval: 1
? Usage
- Create custom blocks by adding them to the
config.yml file.
- Customize block durability, holograms, sounds, and rewards.
- Use permissions to control who can break specific blocks.
? Commands and Permissions
| Command |
Description |
/durablock reload |
Reloads the configuration |
/durablock add <block-type> |
Adds a new custom block of the specified type |
/durablock list |
Lists all configured custom blocks |
/durablock remove <block-id> |
Removes a specific custom block by ID |
/durablock restore <block-id> |
Manually restores a block by ID |
/durablock info |
Displays information about the plugin |
| Permission |
Description |
durablock.commands.main |
Allows using /durablock command |
durablock.notify.update |
Allows receiving update notifications |
? Placeholders
Hologram Placeholders
{last_player} - Displays the name of the player who last broke the block.
{restore} - Displays the remaining time (in seconds) until the block is restored.
{durability} - Shows the current durability of the block.
Command Placeholders
{player} - Represents the name of the player who broke the block.
? Examples
To create a new block named "diamond-block" with 50 durability and a 20-second restore time, add this to your config.yml:
blocks:
diamond-block:
durability: 50
restore-interval: 20
permission: durablock.break.diamond-block
enabled-hologram-lines:
- "Diamond Block - {durability} hits left"
disabled-hologram-lines:
- "Regenerating in: {restore} seconds"
rewards:
- command: "give {player} diamond 1"
chance: 0.1 # %10 chance
on-break:
sound:
enabled: true
sound-type: "minecraft:entity.player.levelup"
play-to-everyone: true
broadcast:
enabled: true
message: "<red>{player} broke the diamond block and earned 16 diamonds!"
commands:
- "give {player} diamond 16"
? Support
If you encounter any issues or have feature suggestions, feel free to open an issue on GitHub or join my Discord Server.
? License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Enjoy making your server more dynamic with DuraBlock!
评论 0
登录后参与评分
还没有评论,来抢沙发吧