
/execute
รันคำสั่งอื่นในฐานะเอนทิตีอื่น ที่ตำแหน่งอื่น หรือเฉพาะเมื่อเงื่อนไขเป็นจริง รูปแบบพื้นฐานคือ /execute if biome <pos> <biome> มีรูปแบบคำสั่ง 17 แบบและอาร์กิวเมนต์ 27 ตัว สิทธิ์: สูตรโกง / op 2
รูปแบบคำสั่ง /execute
ข้อมูลเกมทุกรูปแบบที่เกมยอมรับ คำใน <วงเล็บมุม> คืออาร์กิวเมนต์ที่คุณต้องกรอก ส่วนที่เหลือพิมพ์ตามที่เห็น
/execute if biome <pos> <biome>/execute if block <pos> <block>/execute if blocks <start> <end> <destination> all/execute if blocks <start> <end> <destination> masked/execute if data block <source> <path>/execute if data entity <source> <path>/execute if data storage <source> <path>/execute if dimension <dimension>/execute if entity <entities>/execute if items block <source> <slots> <item_predicate>/execute if items entity <source> <slots> <item_predicate>/execute if loaded <pos>/execute if predicate <predicate>/execute if score <target> <targetObjective> < <source> <sourceObjective>/execute if score <target> <targetObjective> <= <source> <sourceObjective>/execute if score <target> <targetObjective> = <source> <sourceObjective>/execute if score <target> <targetObjective> > <source> <sourceObjective>บางสาขาต่อเข้าไปในรูปแบบของอีกคำสั่งหนึ่ง (แสดงด้วย …) เช่น run ของ /execute
ตัวอย่างคำสั่ง /execute
ตัวอย่างพร้อมวาง (เปิดสูตรโกง) @s คือตัวคุณ @p คือผู้เล่นที่ใกล้ที่สุด @a คือทุกคน @e คือทุกเอนทิตี
/execute as @a at @s run summon minecraft:firework_rocket ~ ~1 ~- ยิงจรวดพลุเหนือผู้เล่นทุกคน
/execute if block ~ ~-1 ~ minecraft:gold_block run say Gold!- พูดว่า "Gold!" ถ้าคุณยืนบนบล็อกทอง
อาร์กิวเมนต์ของ /execute
อาร์กิวเมนต์แต่ละตัวรับค่าอะไร พร้อมข้อจำกัดที่เกมบังคับใช้
| อาร์กิวเมนต์ | รับค่า | ข้อจำกัด |
|---|---|---|
<axes> | แกน (x, y, z ใดก็ได้) | — |
<anchor> | eyes หรือ feet | — |
<targets> | ตัวเลือกเป้าหมายหรือชื่อผู้เล่น (@s, @p, @a, @e, @r) | หนึ่งเป้าหมายขึ้นไป |
<pos> | ตำแหน่ง (x y z, ใช้ทศนิยมได้) | — |
<biome> | ID ของเกมหรือ #แท็ก | worldgen/biome |
<block> | ID บล็อกหรือ #แท็ก พร้อม [สถานะ] (ไม่บังคับ) | — |
<start> | พิกัดบล็อก (x y z, ~ สัมพัทธ์, ^ เฉพาะที่) | — |
<end> | พิกัดบล็อก (x y z, ~ สัมพัทธ์, ^ เฉพาะที่) | — |
<destination> | พิกัดบล็อก (x y z, ~ สัมพัทธ์, ^ เฉพาะที่) | — |
<source> | พิกัดบล็อก (x y z, ~ สัมพัทธ์, ^ เฉพาะที่) | — |
<path> | เส้นทาง NBT | — |
<dimension> | มิติ (minecraft:overworld, the_nether, the_end) | — |
<entities> | ตัวเลือกเป้าหมายหรือชื่อผู้เล่น (@s, @p, @a, @e, @r) | หนึ่งเป้าหมายขึ้นไป |
<name> | ID ฟังก์ชันหรือ #แท็ก | — |
<slots> | แหล่งช่อง | — |
<item_predicate> | ID ไอเทมหรือ #แท็ก พร้อมคอมโพเนนต์ (ไม่บังคับ) | — |
<predicate> | ID เพรดิเคต | — |
<target> | ผู้ถือคะแนน (ตัวเลือกเป้าหมาย ชื่อ หรือ *) | เป้าหมายเดียว |
<targetObjective> | ชื่อเป้าหมายสกอร์บอร์ด | — |
<sourceObjective> | ชื่อเป้าหมายสกอร์บอร์ด | — |
<range> | ช่วงตัวเลข (เช่น 1..5) | — |
<id> | ID พร้อมเนมสเปซ (minecraft:…) | — |
<heightmap> | ประเภทแผนที่ความสูง | — |
<rot> | การหมุน (yaw pitch) | — |
<scale> | ตัวเลข | — |
<objective> | ชื่อเป้าหมายสกอร์บอร์ด | — |
<entity> | ID ของเกมจากรีจิสทรี | entity_type |
คำสั่งที่เกี่ยวข้อง
ข้อมูล: ไฟล์เกม Minecraft Java Edition 26.3 ที่มาของข้อมูล
รันคำสั่งอื่นในฐานะเอนทิตีอื่น ที่ตำแหน่งอื่น หรือเฉพาะเมื่อเงื่อนไขเป็นจริง มีรูปแบบคำสั่ง 17 แบบ และผู้ที่ใช้ได้คือ: สูตรโกง / op 2
ดูเพิ่มเติม
ช่วยเรารักษาความถูกต้อง! หากพบสถิติที่ไม่ถูกต้อง ข้อมูลที่หายไป หรือปัญหาอื่นๆ ความเห็นของคุณช่วยยกระดับคุณภาพข้อมูลของเราให้ทั้งชุมชน
คำถามที่พบบ่อยเกี่ยวกับ /execute (Java 26.3)
/execute ในมายคราฟทำอะไร?
รันคำสั่งอื่นในฐานะเอนทิตีอื่น ที่ตำแหน่งอื่น หรือเฉพาะเมื่อเงื่อนไขเป็นจริง
รูปแบบของ /execute คืออะไร?
รูปแบบพื้นฐานคือ /execute if biome <pos> <biome> รูปแบบทั้งหมดอยู่ด้านบน
ตัวอย่างการใช้ /execute มีอะไรบ้าง?
/execute as @a at @s run summon minecraft:firework_rocket ~ ~1 ~ — ยิงจรวดพลุเหนือผู้เล่นทุกคน
ต้องเปิดสูตรโกงเพื่อใช้ /execute ไหม?
ต้อง: สูตรโกง / op 2 ในโหมดผู้เล่นคนเดียวให้เปิด อนุญาตสูตรโกง (หรือเปิดให้ LAN พร้อมสูตรโกง)