HomeJavaDatapacksReplaceBlock
ReplaceBlock
DatapacksJava

ReplaceBlock

by white_elephant · on Modrinth

This datapack provides a powerful API that can replace blocks in the world with high performance in a completely vanilla way after world generation.

Which build do you need?

This mod ships a separate file for every mod loader and every version of the game. Pick both, then download — the wrong build installs fine and then does nothing in the game.

Mod loader

Minecraft version

⬇ Download for 1.21.3–1.21.10 · Data pack⬇ Download for 1.21.3–1.21.10 · Fabric⬇ Download for 1.21.3–1.21.10 · Forge⬇ Download for 1.21.3–1.21.10 · NeoForge⬇ Download for 1.21.3–1.21.10 · Quilt
I don't know my version or loader
Open the Minecraft launcher and look at the profile you play on — it names both, like fabric-loader-1.21.4. The version also shows in the bottom-right corner of the game's main menu.
No loader in the profile name? Then it's plain Minecraft, and these mods won't run — you need Fabric or NeoForge installed first.

[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 中的示例。


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.

Quick facts

Install steps are the general flow for this file type — see the MC Java Mods guides for the full walkthrough.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more