Minecraft /execute Command
다른 엔티티, 위치, 차원 또는 조건을 일치시켜 관점에서 명령어를 실행합니다.
버전 호환성
명령어 문법
/execute <subcommands...> run <command>/execute <subcommands...> run <command>인수 설명
as <entity>SubcommandChanges who the executor (@s) is, without moving where the command runs.
at <entity>SubcommandChanges execution position (~ ~ ~), rotation, and dimension to match the entity.
positioned <pos>SubcommandExplicitly moves the execution location to coordinates (absolute or relative).
in <dimension>SubcommandExecutes within minecraft:overworld, the_nether, or the_end.
if / unless <condition>SubcommandEvaluates block matches, entity counts, score comparisons, or predicates before running.
store (result|success)SubcommandStores the numeric result or success count of the command into a scoreboard or NBT path.
run <command>Terminator필수The terminating command executed if all modifiers and condition checks succeed.
실용적인 예시
/execute as @a at @s if block ~ ~-1 ~ minecraft:water run effect give @s speed 5 1 trueGives speed boost to players who are currently standing on top of water.
Detecting ground blocks beneath players.
/execute as @e[type=cow] at @s run summon lightning_boltStrikes a lightning bolt at every cow in loaded chunks.
Changing both identity and position context.
/execute in minecraft:the_nether run tp @s 0 64 0Teleports the player to coordinates 0, 64, 0 in the Nether dimension.
Cross-dimensional teleportation.
/execute store result score @p CoinCount run clear @p gold_nugget 0Counts how many gold nuggets a player holds and stores the number in their CoinCount scoreboard.
Querying inventory amounts into variables without removing items.
/execute at @e[type=arrow] if block ~ ~-0.5 ~ minecraft:sand run setblock ~ ~-0.5 ~ minecraft:glassTurns sand into glass wherever an arrow lands.
Dynamic projectile impact mechanics.
자주 발생하는 실수
실수:
Java에서 최종 명령어 앞에 "run"을 잊음
해결 방법:
올바른 구문: /execute as @p at @s run <command> ("run"을 잊지 마세요)
실수:
플레이어를 추적하기 위해 "at" 대신 "positioned"를 사용
해결 방법:
"at @s"는 엔티티의 위치를 추적하고 "positioned"는 고정 위치를 설정합니다.
실수:
"as"와 "at"을 혼동 - "as"는 실행자를 변경하고 "at"는 위치를 변경
해결 방법:
"as @e" = 몹이 실행, "at @e" = 몹의 위치에서 실행.
자바 vs 베드락 차이점
모든 에디션이 이제 /execute의 체인 구문을 지원합니다. Java는 `-> run`을 사용하고 Bedrock은 `run`을 직접 사용합니다. 최신 업데이트에서 기능은 본질적으로 동일합니다.
Command Block Usage & Automation
The cornerstone of command block logic. Run a Repeating Always Active command block with "/execute as @a at @s if block ~ ~-1 ~ slime_block run effect give @s jump_boost 2 3 true" to create custom trampoline jump pads, or use conditional chain blocks following execute checks to only advance storylines when a puzzle condition is met.
유용한 팁
/execute는 Minecraft에서 가장 강력한 명령어 - 조건을 결합하고 복잡한 방식으로 명령어를 실행할 수 있습니다.
"as @e"로 명령어 실행자를 변경하고 "at @s"로 실행 위치를 변경합니다.
"if block"과 "unless block"을 결합하여 블록 기반 조건 명령어를 만듭니다.
플레이어가 물 안에 있는지 확인하는 등 명령어 실행 전 조건을 확인하려면 /execute를 사용하세요.
서브 커맨드 "anchored eyes"는 발이 아닌 엔티티의 눈 위치에서 명령어를 실행합니다.
중요 참고사항
Bedrock은 이전에 더 간단한 구문을 사용했습니다. 그러나 이제 Java와 유사한 체인 구문을 네이티브로 지원하여 최신 업데이트에서 크게 통일되었습니다.
자주 묻는 질문
다른 플레이어인 것처럼 명령어를 실행할 수 있나요?
네: /execute as PlayerName at @s run <command>는 해당 플레이어의 위치에서 명령어를 실행합니다.
다른 차원에서 명령어를 실행할 수 있나요?
네: /execute in the_nether run <command>는 네더에서 명령어를 실행합니다.
조건이 충족될 때만 명령어를 실행할 수 있나요?
네: /execute if block ~ ~-1 ~ water run say 물 안에 있다!