nalla_sher

Could we make builds ? Schemetic

Kodari AI
KodariJun 29 at 4:42 am 2
SchematicBuilder
A vanilla Minecraft data pack for saving and loading build schematics. Players use /trigger commands to select regions, save structures to numbered slots (0-9), and paste them with rotation support. Uses the /structure command internally with macro variable substitution for clean, reliable functionality.

Creating all 18 files for the schematic builder data pack.

I’ll create a SchematicBuilder data pack — save and load build schematics using /trigger commands, /structure command, and macro functions (1.21.4).

The data pack is ready. Here’s what it does:

SchematicBuilder — Save/load build schematics entirely in vanilla 1.21.4.

Usage:

  1. /trigger schem set 2 — mark your current position as corner 1

  2. Walk to the opposite corner, /trigger schem set 3 — mark corner 2

  3. /trigger schem_save set 5 — save the selected region to slot 5

  4. Walk where you want to paste, /trigger schem_rot set 1 (optional rotation)

  5. /trigger schem_load set 5 — paste the schematic from slot 5

How it works:

  • Uses /trigger scoreboard objectives (no operator needed for players)

  • A tick function detects trigger usage and routes to the correct handler

  • Corner positions stored in /data storage

  • $macro functions substitute coordinates into /structure save and /structure load commands

  • Rotation mapped: 0=none, 1=clockwise_90, 2=180, 3=counterclockwise_90

Files (10 total):

  • pack.mcmeta — format 48 for 1.21.4

  • data/minecraft/tag/function/load.json + tick.json — register lifecycle hooks

  • data/schematic/function/load.mcfunction — sets up scoreboards on reload

  • data/schematic/function/tick.mcfunction — processes trigger commands every tick

  • help.mcfunction, pos1.mcfunction, pos2.mcfunction, set_rotation.mcfunction — utility functions

  • save_schem.mcfunction + save_macro.mcfunction — structures the save via macro

  • load_schem.mcfunction + load_macro.mcfunction — structures the load with rotation

Extract to world/datapacks/schematic_builder/, run /reload, then any player can use the triggers.

Kodari can make mistakes. Review important code before using.
Files
schematic_builder
Code
13 95
schematic_builder/data/schematic/function/load_schem.mcfunction
# Store slot number
execute store result storage schematic:load slot int 1 run scoreboard players get @s schem_load

# Store player's feet position as load origin
execute store result storage schematic:load x int 1.0 run data get entity @s Pos[0] 1.0
execute store result storage schematic:load y int 1.0 run data get entity @s Pos[1] 1.0
execute store result storage schematic:load z int 1.0 run data get entity @s Pos[2] 1.0

# Get rotation value (defaults to 0=none)
execute store result storage schematic:load rot int 1 run data get storage schematic:rotation value

# Map rotation number to string for /structure load
data modify storage schematic:load rot_string set value "none"
execute if data storage schematic:load{rot:1} run data modify storage schematic:load rot_string set value "clockwise_90"
execute if data storage schematic:load{rot:2} run data modify storage schematic:load rot_string set value "180"
execute if data storage schematic:load{rot:3} run data modify storage schematic:load rot_string set value "counterclockwise_90"

# Validate slot has been saved before
execute if data storage schematic:load{slot:0} unless entity @e[type=minecraft:area_effect_cloud,tag=scheme_0] run tellraw @s ["",{"text":"⚠ Slot 0 is empty! Save something first.","color":"red"}]

# Load structure
function schematic:load_macro with storage schematic:load