ReplaceBlock
No reviews yet
This datapack provides a powerful API that can replace blocks in the world with high performance in a completely vanilla way after world generation.
Provides a framework or library for other mods to use.
Data Packs were introduced to vanilla Minecraft in version 1.13 and allow the server to modify data about the game, or run commands. Data Packs are compatible with all mod loaders.
Forge is a popular mod loader for versions 1.1+ of Minecraft.
Neoforge is a fork of the Minecraft Forge available for versions 1.20.1+ of Minecraft. Many Forge mods are compatible with Neoforge and vice versa.
Fabric is a mod loader for versions 1.14+ of Minecraft, particularly popular for client side and optimization mods.
Quilt is a fork of the Fabric mod loader. Many Fabric mods are compatible with Quilt and vice versa.
Community voices
Reviews
Click once to include, again to exclude, again to clear
No reviews yet. Be the first to review this project!
Get it on
Available Platforms
Compatibility
Supported Environments
About
Project Details
For authors
Embed Badge
If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.
Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.
Identifiers
Platform IDs
About
Description
[RB]方块替换 (ReplaceBlock)
The English description is below.
简介
此数据包提供了一个强大的 API,可以以完全原版的方式在世界生成后高性能地替换世界中的方块。
功能
此数据包以区块为单位遍历并替换方块,每次调用会从目标实体所在区块向远处遍历,直到成功清除一个区块,或者遍历完加载范围内所有区块。遍历范围可以进行配置,见下文。
调用
要调用 API,请先在您命令存储的 {}.replace_block 中存储 API 配置,可调用 replace_block:api/reset_settings 函数并传入 {storage:"您命令存储的命名空间 ID"} 生成示例配置,然后调用 replace_block:api/execute 函数并传入 {storage:"您命令存储的命名空间 ID"}。方块替换将立即开始,并在同一 tick 内结束。请务必确认您的配置包含所有要求的数据,ReplaceBlock 会验证您的配置参数,若缺失参数会导致 API 调用失败。
配置
以下为完整的配置列表,另可查看 reset_settings.mcfunction 中的示例。
- 目标选择器:
- 路径:
{}.replace_block.selector - 内容:一个目标选择器,可包含参数。
- 示例:
"@e[type=player]"
- 替换范围:
- 路径:
{}.replace_block.search_range - 内容:遍历距离,为 1 即以玩家为中心的 9 个区块。
- 示例:
3
- 路径:
- 成功数量:
- 路径:
{}.replace_block.success_threshold - 内容:一次区块替换视为成功所需的方块替换数量,如果某区块所有方块对成功替换的方块数量总和未达到此数值,则继续遍历下一区块。
- 示例:
50
- 路径:
- 要替换的方块对列表:
- target_block
- 路径:
{}.replace_block.replace_pairs[].target_block - 内容:将被替换方块的命名空间 ID
- 示例:
"stone"
- 路径:
- replace_with
- 路径:
{}.replace_block.replace_pairs[].replace_with - 内容:新方块的命名空间 ID
- 示例:
"air"
- 路径:
- target_block
- 替换生效维度列表:
- dimension
- 路径:
{}.replace_block.dimensions[].dimension - 内容:替换生效维度的命名空间 ID
- 示例:
"minecraft:overworld"
- 路径:
- min_y
- 路径:
{}.replace_block.dimensions[].min_y - 内容:替换生效的最小高度
- 示例:
-64
- 路径:
- max_y
- 路径:
{}.replace_block.dimensions[].max_y - 内容:替换生效的最大高度
- 示例:
319
- 路径:
- dimension
- 路径:
Introduction
This datapack provides a powerful API that can replace blocks in the world with high performance in a completely vanilla way after world generation.
Features
This datapack traverses and replaces blocks chunk by chunk. Each call will traverse from the target entity's current chunk outward until successfully clearing one chunk or traversing all chunks within the loaded range. The traversal range can be configured as described below.
Usage
To use the API, first store the API configuration in your command storage at {}.replace_block. You can call the replace_block:api/reset_settings function with {storage:"your command storage namespace ID"} to generate example configuration, then call the replace_block:api/execute function with {storage:"your command storage namespace ID"}. Block replacement will start immediately and end within the same tick. Please ensure your configuration contains all required data. ReplaceBlock will validate your configuration parameters, and missing parameters will cause API calls to fail.
Configuration
Below is the complete configuration list. You can also view the example in reset_settings.mcfunction.
- Target Selector:
- Path:
{}.replace_block.selector - Content: A target selector that can include parameters.
- Example:
"@e[type=player]"
- Search Range:
- Path:
{}.replace_block.search_range - Content: Traversal distance, where 1 means 9 chunks centered on the player.
- Example:
3
- Path:
- Success Threshold:
- Path:
{}.replace_block.success_threshold - Content: Number of block replacements required for a chunk replacement to be considered successful. If the total number of successfully replaced blocks in a chunk does not reach this value, traversal continues to the next chunk.
- Example:
50
- Path:
- Replacement Block Pairs List:
- target_block
- Path:
{}.replace_block.replace_pairs[].target_block - Content: Namespace ID of the block to be replaced
- Example:
"stone"
- Path:
- replace_with
- Path:
{}.replace_block.replace_pairs[].replace_with - Content: Namespace ID of the new block
- Example:
"air"
- Path:
- target_block
- Effective Dimensions List:
- dimension
- Path:
{}.replace_block.dimensions[].dimension - Content: Namespace ID of the dimension where replacement takes effect
- Example:
"minecraft:overworld"
- Path:
- min_y
- Path:
{}.replace_block.dimensions[].min_y - Content: Minimum height where replacement takes effect
- Example:
-64
- Path:
- max_y
- Path:
{}.replace_block.dimensions[].max_y - Content: Maximum height where replacement takes effect
- Example:
319
- Path:
- dimension
- Path:
Screenshots
Gallery
Versions
Files
Relations
Project Relations
More like this
Similar Mods
Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.
On ModDex
Community snapshot
By the numbers
Statistics
Want to reach Minecraft players?
We're looking for a server hosting partner to feature here and other parts of the site. Interested? Send us a message!
Get in touchGet it on
Available Platforms
On ModDex
Community snapshot
By the numbers