revert(easter-egg): single-block eggs — 2-block block-state syntax broke placement
All checks were successful
Deploy Addons / deploy (push) Successful in 14s

Block state syntax ["facing_direction":N] in setblock silently failed, so no
egg blocks were placed and nothing could be collected. Revert to plain single
block setblock with no states.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-05 03:02:13 +01:00
parent 5befc216d3
commit 616395de88

View File

@@ -222,9 +222,7 @@ function buildScene(dim, sceneIndex, x, surfY, z) {
break;
}
// 2-block tall egg: opposing facing directions create an oval silhouette
cmds.push(`setblock ${x} ${eggY} ${z} ${EGG_BLOCK} ["facing_direction":2]`);
cmds.push(`setblock ${x} ${eggY + 1} ${z} ${EGG_BLOCK} ["facing_direction":3]`);
cmds.push(`setblock ${x} ${eggY} ${z} ${EGG_BLOCK}`);
for (const cmd of cmds) {
try { dim.runCommand(cmd); } catch (e) {}
@@ -313,9 +311,7 @@ function collectEgg(player, egg, tagId) {
else if (PREFIX === "l") updateBasket(player, counts.j, count, counts.m);
else if (PREFIX === "m") updateBasket(player, counts.j, counts.l, count);
// Remove both blocks of the 2-block tall egg
player.dimension.runCommand(`setblock ${egg.x} ${egg.y} ${egg.z} air`);
player.dimension.runCommand(`setblock ${egg.x} ${egg.y + 1} ${egg.z} air`);
player.dimension.runCommand(`particle minecraft:egg_destroy_emitter ${egg.x} ${egg.y} ${egg.z}`);
player.runCommand(`playsound random.orb @s`);
player.runCommand(`playsound random.levelup @s`);
@@ -334,7 +330,6 @@ function collectEgg(player, egg, tagId) {
}
// ─── Detection Loop ──────────────────────────────────────────────
// dy <= 3.0 covers both blocks of a 2-block tall egg (bottom at eggY, top at eggY+1).
system.runInterval(() => {
const positions = getEggPositions();
@@ -352,7 +347,7 @@ system.runInterval(() => {
const dy = Math.abs(pos.y - egg.y);
const dz = Math.abs(pos.z - egg.z);
if (dx <= 2.5 && dy <= 3.0 && dz <= 2.5) {
if (dx <= 2.5 && dy <= 2.0 && dz <= 2.5) {
collectEgg(player, egg, tagId);
}
}