ONEBLOCK BY BAKU — 10 PHASES
Created by Baku. All addon credits and rights to original addon content: Baku.

INSTALL AND START
1. Open OneBlock_By_Baku.mcaddon with Minecraft Bedrock / MCPE.
2. In your world's Behavior Packs, activate "OneBlock by Baku".
3. Enter the world. Setup and the first arrival start automatically.
   No start command, Beta APIs experiment or resource pack is required.
4. The requested layer is cleared once; the OneBlock appears at 0,105,0.
   Each new player is placed on it at the displayed coordinates 0,106,0.
   Allow a few seconds for the initial chunk loading and setup.
5. Mine the same central block. Open loot chests before breaking them.
   Each chest counts as one of the phase's blocks when you break it.
6. Mined drops go directly into the mining player's inventory.

WORLD SETUP
The exact requested clearing is:
  from -16,-64,-16 through 16,-64,16, inclusive -> AIR
Both supplied corners have Y=-64, so this is one 33 x 33 layer:
1,089 blocks total. Blocks at Y=-63 and higher are not cleared by this
operation. It does not make the entire world or the whole vertical
33 x 33 column empty. For a sky challenge, use an empty world.
The OneBlock generator is placed at y=105, above normal ground in most worlds.

Layer clearing is done only once and is saved per world. Rejoining
does not delete blocks again. The previous phase and counter are kept
when this update is applied to a world using the earlier pack.

The addon owns 0,105,0 and places one invisible support at 0,104,0 so that
sand/gravel cannot fall away. Automatic arrival also clears the three
headroom blocks at 0,106,0 through 0,108,0 for a safe spawn.
The brief mining guard raises players back onto the generator if a
replacement makes them sink into it. Normal jumping and walking away
are allowed. It does not provide flight or rescue every fall off an island.

New players arrive automatically and receive an origin respawn point.
Rejoining players keep their saved position and progression. Death with
the origin spawn returns them safely to the OneBlock; beds elsewhere
are respected.

Keep x=5..11, z=-3..3, y=104..108 clear for the future End portal.
That reserved area becomes a portal platform during the End phase.
A narrow bridge connects the platform to the generator.

PHASES
No.  Phase         Blocks     Total at completion
 1   Beginning         30          30
 2   Plains           500         530
 3   Underground    1,000       1,530
 4   Snowy          1,000       2,530
 5   Desert         1,000       3,530
 6   Jungle         1,000       4,530
 7   Ocean          1,000       5,530
 8   Nether         1,000       6,530
 9   Deep Dark      1,000       7,530
10   End            1,000       8,530

At each of the nine phase changes, the core becomes bedrock and a
10-second countdown appears. Timers use 200 game ticks. They pause
when the world/area is not ticking or no players are online; lag can
make those ticks take longer than ten real-world seconds.

BEGINNING
The first four blocks are grass, oak log, dirt, and oak log.
Block #5 is a guaranteed starter chest containing:
  1 water bucket, 16 oak planks, 8 grass blocks, 16 dirt,
  8 oak logs, 2 oak saplings, 6 apples, and 4 wheat seeds.
Block #15 supplies basic tools, food, torches and wool.
Block #30 supplies a lava bucket, stone pickaxe and cobblestone.

BIOME SUPPLIES
Plains: oak/birch logs and leaves, grass, dirt, gravel, clay, crops;
chests have saplings, seeds, flowers, food and animal spawn eggs.
Underground: stone families, deepslate, amethyst, dripstone, all eight
Overworld ores and all eight deepslate ore variants.
Snowy: spruce, podzol, snow and ice; cold-biome supplies and animals.
Desert: sand, sandstone and terracotta; cactus and desert supplies.
Jungle: jungle wood, bamboo, moss, melons and mud; cocoa and animals.
Ocean: prismarine, gravel, clay, sponge and dead coral; living coral,
kelp, aquatic supplies and conduit ingredients in chests.
Nether: netherrack, stems, soul blocks, quartz/gold ores, ancient debris;
chests include fungi, nether wart, blaze rods and upgrade ingredients.
Deep Dark: sculk and deepslate building blocks; echo shards and treasure.
End: end stone, end bricks, purpur and obsidian; chorus and shulker loot.

The generated blocks do not change the actual biome or dimension.
Animals are supplied as spawn eggs; hostile mobs are not force-spawned.
Blocks retain vanilla mining rules: use the appropriate tools for drops.
Use Survival mode to test mining drops; Creative follows the game's
normal Creative drop rules.

CHESTS AND PROGRESS
Beginning has 3 fixed chests, Plains has 20, and every later phase has
20. Total: 183 loot chests, included in the 8,530-block count.
Chest rewards rotate through guaranteed supply sets. Every material in
a phase's configured block pool is guaranteed at least once.

Progress is shared across multiplayer and saved per world. Only player
mining at the Overworld origin advances it. Mining elsewhere, explosions,
or automatic restoration do not advance the count.
Rejoining and repairing do not refill a chest you already looted.

DIRECT INVENTORY COLLECTION
The addon collects newly spawned item drops associated with mining the
central OneBlock. It uses the game's actual drops, so native tool rules,
Fortune/Silk Touch results and custom item data are retained.
Drops are transferred on the next script tick. Breaking a loot chest
also collects its dropped contents.
When inventory space is limited, only the amount that fits is inserted.
The remainder stays above the OneBlock, with a full-inventory message.
Make space promptly; normal world item despawning rules still apply.
Old ground items and blocks mined elsewhere are not part of auto-loot.

END PORTAL
The locked 12-frame portal structure appears around 8,105,0 at the start
of the End phase. After you mine all 1,000 End blocks, nine real End
portal blocks activate inside the frame. Manual eye insertion into the
reserved frame is blocked while the phase is unfinished.
The final chest includes an elytra, rockets and extra combat supplies.
After completion, the generator remains bedrock; there is no 11th phase.

OPTIONAL RECOVERY COMMANDS (CHEATS / OPERATOR ACCESS REQUIRED)
The game starts automatically without any of these commands.
/function oneblock/start   Travel to the block and set your personal spawn.
/function oneblock/status  Show the current phase and total progress.
/function oneblock/repair  Restore the core without resetting progression.
                          During End, also rebuild the reserved portal area.
World owners can send all players to the block with:
/execute as @a run function oneblock/start

If ticking-area preload is unavailable, automatic setup moves the new
player near the origin to load it and finishes their safe arrival there.
Keep the same pack header UUID when updating, so the world's saved
dynamic properties remain associated with this pack.

COMPATIBILITY AND VERIFICATION
Uses the stable @minecraft/server 2.0.0 API with vanilla content.
Designed for current Bedrock/MCPE. Does not require Beta APIs.
Java Edition is not supported.
Do not stack another addon that replaces or manages the same origin block.

The actual JavaScript was checked against Microsoft's API declarations.
Automated simulations covered all 8,530 blocks, phase boundaries, chest
loot persistence, reloads, multiplayer duplicate events, unloaded chunks,
and the 12-frame / 9-block portal structure. Additional checks covered
the exact clearing bounds, automatic arrival, fall protection, inventory
capacity, item metadata and rollback without duplicated drops. All
configured IDs were checked against Mojang's vanilla data.
These checks are not a Minecraft client/server playtest. Import behavior,
mobile visuals and actual portal travel still need an in-game test.

TECHNICAL REFERENCES
https://learn.microsoft.com/minecraft/creator/scriptapi/minecraft/server/minecraft-server
https://learn.microsoft.com/minecraft/creator/scriptapi/minecraft/server/world
https://learn.microsoft.com/minecraft/creator/scriptapi/minecraft/server/playerbreakblockafterevent
https://github.com/Mojang/bedrock-samples/tree/main/metadata/vanilladata_modules
