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_range3{}.replace_block.success_threshold50{}.replace_block.replace_pairs[].target_block"stone"{}.replace_block.replace_pairs[].replace_with"air"{}.replace_block.dimensions[].dimension"minecraft:overworld"{}.replace_block.dimensions[].min_y-64{}.replace_block.dimensions[].max_y319This datapack provides a powerful API that can replace blocks in the world with high performance in a completely vanilla way after world generation.
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.
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.
Below is the complete configuration list. You can also view the example in reset_settings.mcfunction.
{}.replace_block.selector"@e[type=player]"{}.replace_block.search_range3{}.replace_block.success_threshold50{}.replace_block.replace_pairs[].target_block"stone"{}.replace_block.replace_pairs[].replace_with"air"{}.replace_block.dimensions[].dimension"minecraft:overworld"{}.replace_block.dimensions[].min_y-64{}.replace_block.dimensions[].max_y319
This datapack provides a powerful API that can replace blocks in the world with high performance in a completely vanilla way after world generation.