본문으로 건너뛰기
Day 1 · MakeCode

건축 마법사

블록 하나로 금 블록 소환!

학습 목표

  • 블록 에디터에서 드래그 & 드롭으로 코드 만들기
  • 좌표(X, Y, Z)의 의미 이해하기
  • place 블록으로 원하는 위치에 블록 놓기
  • 에이전트(로봇)를 불러서 건축 시키기

핵심 개념

마인크래프트 좌표계

X좌/우Y위/아래Z앞/뒤~3 ~0 ~0~0 ~2 ~0
X = 좌우Y = 위아래Z = 앞뒤

~0 ~0 ~0 = 내 위치 기준 바로 여기!

에이전트 = 건축 로봇

에이전트는 나를 따라다니는 로봇 친구! 블록을 줘서 → 앞에 놓고 → 이동... 을 반복하면 건축!

데모 코드

데모

내 발밑에 금 블록!

on chat command "금" {
    place [GOLD BLOCK] at pos (~0 ~0 ~0)
}
JavaScript 참고 (🌳)
player.onChat("금", function () {
    blocks.place(GOLD_BLOCK, pos(0, 0, 0));
});

블록 에디터: [블록] → place [블록] at [위치]

데모

위로 3칸 탑!

on chat command "탑" {
    place [STONE] at pos (~0 ~0 ~0)
    place [STONE] at pos (~0 ~1 ~0)
    place [STONE] at pos (~0 ~2 ~0)
}
JavaScript 참고 (🌳)
player.onChat("탑", function () {
    blocks.place(STONE, pos(0, 0, 0));
    blocks.place(STONE, pos(0, 1, 0));
    blocks.place(STONE, pos(0, 2, 0));
});

💡 Y가 1씩 올라가면 위로 쌓여요!

데모

가로등 (기둥 + 빛!)

on chat command "가로등" {
    place [OAK FENCE] at pos (~0 ~0 ~0)
    place [OAK FENCE] at pos (~0 ~1 ~0)
    place [OAK FENCE] at pos (~0 ~2 ~0)
    place [GLOWSTONE] at pos (~0 ~3 ~0)
}
JavaScript 참고 (🌳)
player.onChat("가로등", function () {
    blocks.place(OAK_FENCE, pos(0, 0, 0));
    blocks.place(OAK_FENCE, pos(0, 1, 0));
    blocks.place(OAK_FENCE, pos(0, 2, 0));
    blocks.place(GLOWSTONE, pos(0, 3, 0));
});
데모

에이전트 불러오기!

on chat command "로봇" {
    agent teleport to player
}
JavaScript 참고 (🌳)
player.onChat("로봇", function () {
    agent.teleportToPlayer();
});

💡 실행하면 내 옆에 로봇이 나타남!

데모

에이전트한테 블록 주고 놓기!

on chat command "놓기" {
    agent teleport to player
    agent set item [STONE] count (64) in slot (1)
    agent set active slot (1)
    agent place [forward]
}
JavaScript 참고 (🌳)
player.onChat("놓기", function () {
    agent.teleportToPlayer();
    agent.setItem(STONE, 64, 1);
    agent.setSlot(1);
    agent.place(FORWARD);
});
데모

에이전트로 벽 쌓기

on chat command "벽" {
    agent teleport to player
    agent set item [STONE BRICKS] count (64) in slot (1)
    agent set active slot (1)
    agent place [forward]
    agent move [right] by (1)
    agent place [forward]
    agent move [right] by (1)
    agent place [forward]
    agent move [right] by (1)
    agent place [forward]
}
JavaScript 참고 (🌳)
player.onChat("벽", function () {
    agent.teleportToPlayer();
    agent.setItem(STONE_BRICKS, 64, 1);
    agent.setSlot(1);
    agent.place(FORWARD);
    agent.move(RIGHT, 1);
    agent.place(FORWARD);
    agent.move(RIGHT, 1);
    agent.place(FORWARD);
    agent.move(RIGHT, 1);
    agent.place(FORWARD);
});

💡 place + move 반복! 결과: 돌벽돌 4개가 옆으로!

실습

빈칸을 채우고 정답을 확인해보세요!

다이아 블록 놓기

🌱 seedling
on chat command "다이아" {
    place [] at pos (~0 ~0 ~0)
}

높이 5 탑

🌱 seedling🌿 herb
on chat command "높이" {
    place [STONE] at pos (~0 ~0 ~0)
    place [STONE] at pos (~0 ~1 ~0)
    place [STONE] at pos (~0 ~ ~0)
    place [STONE] at pos (~0 ~ ~0)
    place [STONE] at pos (~0 ~ ~0)
}

무지개 탑 (4색)

🌱 seedling🌿 herb
on chat command "무지개" {
    place [RED WOOL] at pos (~0 ~0 ~0)
    place [] at pos (~0 ~1 ~0)
    place [] at pos (~0 ~2 ~0)
    place [] at pos (~0 ~3 ~0)
}

에이전트 돌담

🌿 herb🌳 tree
on chat command "돌담" {
    agent teleport to player
    agent set item [COBBLESTONE] count (64) in slot (1)
    agent set active slot (1)
    agent place [forward]
    agent move [] by (1)
    agent place [forward]
    agent move [] by (1)
    agent place [forward]
}

L자 모양

🌿 herb🌳 tree
on chat command "엘" {
    place [IRON BLOCK] at pos (~0 ~0 ~0)
    place [IRON BLOCK] at pos (~1 ~0 ~0)
    place [IRON BLOCK] at pos (~ ~0 ~0)
    place [IRON BLOCK] at pos (~0 ~ ~0)
    place [IRON BLOCK] at pos (~0 ~ ~0)
}

블록 이름 검색

명령어에 쓸 블록 이름을 검색하세요 (영어 또는 한국어)

돌/벽돌나무광물색상유리특수유틸
stone돌/벽돌
cobblestone조약돌돌/벽돌
stone_bricks돌벽돌돌/벽돌
brick_block벽돌돌/벽돌
sandstone사암돌/벽돌
obsidian흑요석돌/벽돌
bedrock기반암돌/벽돌
oak_planks참나무 판자나무
spruce_planks가문비나무 판자나무
birch_planks자작나무 판자나무
dark_oak_planks짙은 참나무 판자나무
oak_log참나무 통나무나무
oak_fence참나무 울타리나무
oak_stairs참나무 계단나무
gold_block금 블록광물
diamond_block다이아몬드 블록광물
iron_block철 블록광물
emerald_block에메랄드 블록광물
white_wool하얀 양털색상
red_wool빨간 양털색상
orange_wool주황 양털색상
yellow_wool노란 양털색상
green_wool초록 양털색상
blue_wool파란 양털색상
purple_wool보라 양털색상
black_wool검정 양털색상
brown_wool갈색 양털색상
gray_wool회색 양털색상
white_concrete하얀 콘크리트색상
red_concrete빨간 콘크리트색상
blue_concrete파란 콘크리트색상
green_concrete초록 콘크리트색상
black_concrete검정 콘크리트색상
glass유리유리
stained_glass색유리유리
glowstone발광석특수
torch횃불특수
lantern랜턴특수
sea_lantern바다 랜턴특수
water특수
lava용암특수
grass잔디 블록특수
sand모래특수
dirt특수
air공기특수
tntTNT특수
chest상자유틸
crafting_table제작대유틸
furnace화로유틸
bed침대유틸
rail레일유틸
golden_rail파워 레일유틸
command_block커맨드 블록유틸
chain_command_block체인 커맨드 블록유틸
repeating_command_block반복 커맨드 블록유틸

자유 도전

실습이 끝났으면 티어에 맞는 도전을 골라보세요!

A🌱

무지개 탑 (6색)

실습 3의 확장! 6가지 색 wool로 높은 탑 만들기

B🌿

공원

잔디 바닥 + 가로등(OAK_FENCE 3칸 + GLOWSTONE)

C🌿

수영장

돌 테두리 + 안쪽 물(WATER)

D🌳

에이전트 자유 건축!

에이전트로 성, 탑, 울타리... 뭐든! agent turn + move + place 조합

Day 1 핵심 정리

  • 🎯place [블록] at pos (~x ~y ~z) → 좌표에 블록 놓기
  • 🎯좌표: X(좌우), Y(위아래), Z(앞뒤)
  • 🎯에이전트 = 건축 로봇! teleport → set item → place → move
  • 🎯블록 에디터에서 드래그 & 드롭!