{"id":21491,"date":"2024-06-29T10:04:11","date_gmt":"2024-06-29T08:04:11","guid":{"rendered":"https:\/\/minecraft-tutos.com\/?p=21491"},"modified":"2024-06-29T10:04:14","modified_gmt":"2024-06-29T08:04:14","slug":"how-do-i-use-the-execute-command-in-minecraft","status":"publish","type":"post","link":"https:\/\/minecraft-tutos.com\/en\/how-do-i-use-the-execute-command-in-minecraft\/","title":{"rendered":"How do I use the \/execute command in Minecraft ?"},"content":{"rendered":"\n<p>The <strong>\/execute command<\/strong> is one of Minecraft&#8217;s most powerful and versatile commands. It allows you to execute other commands based on specific conditions, modifications and more. This <a href=\"https:\/\/minecraft-tutos.com\/en\/minecraft-commands-complete-list-of-the-most-useful-ones\/\">Minecraft command<\/a> is available in different versions of Minecraft.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_80 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69d9c89061f7a\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69d9c89061f7a\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/minecraft-tutos.com\/en\/how-do-i-use-the-execute-command-in-minecraft\/#execute-command-syntax\" >\/execute command syntax<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/minecraft-tutos.com\/en\/how-do-i-use-the-execute-command-in-minecraft\/#How-to-enter-the-execute-command\" >How to enter the \/execute command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/minecraft-tutos.com\/en\/how-do-i-use-the-execute-command-in-minecraft\/#Examples-of-use\" >Examples of use<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/minecraft-tutos.com\/en\/how-do-i-use-the-execute-command-in-minecraft\/#Explanations-on-arguments\" >Explanations on arguments<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/minecraft-tutos.com\/en\/how-do-i-use-the-execute-command-in-minecraft\/#Using-the-execute-command\" >Using the \/execute command<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/minecraft-tutos.com\/en\/how-do-i-use-the-execute-command-in-minecraft\/#Modify-subcommands\" >Modify subcommands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/minecraft-tutos.com\/en\/how-do-i-use-the-execute-command-in-minecraft\/#Condition-subcommands\" >Condition subcommands<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/minecraft-tutos.com\/en\/how-do-i-use-the-execute-command-in-minecraft\/#Store-subcommand\" >Store subcommand<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/minecraft-tutos.com\/en\/how-do-i-use-the-execute-command-in-minecraft\/#Run-subcommand\" >Run subcommand<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/minecraft-tutos.com\/en\/how-do-i-use-the-execute-command-in-minecraft\/#Additional-information\" >Additional information<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"execute-command-syntax\"><\/span>\/execute command syntax<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The syntax of the <code>\/execute<\/code> command varies according to the sub-commands used. Here are some basic examples :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>\/execute as &lt;targets&gt; &lt;secondExecuteCommand&gt;<\/code><\/li>\n\n\n\n<li><code>\/execute at &lt;targets&gt; &lt;secondExecuteCommand&gt;<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How-to-enter-the-execute-command\"><\/span>How to enter the \/execute command<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Open the chat window :<\/strong> Use the appropriate key for your version of Minecraft.<\/li>\n\n\n\n<li><strong>Type the command :<\/strong> Enter the command in the chat window.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Examples-of-use\"><\/span>Examples of use<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>To give you 8 golden apples : <code>\/execute as @a run give @p golden_apple 8<\/code><\/li>\n\n\n\n<li>To summon lightning on all creepers : <code>\/execute at @e[type=creeper] run summon lightning_bolt<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Explanations-on-arguments\"><\/span>Explanations on arguments<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Arguments vary according to the sub-commands used. Here are a few examples :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>secondExecuteCommand<\/code> : A chained <code>\/execute<\/code> command.<\/li>\n\n\n\n<li><code>axes<\/code> : The axes to be aligned, such as x, y, z, xz, xy, yz, xyz.<\/li>\n\n\n\n<li><code>target<\/code> or <code>targets<\/code> : The player&#8217;s name or a target selector.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Using-the-execute-command\"><\/span>Using the \/execute command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The <code>\/execute<\/code> command is used to execute other commands according to various conditions and modifications. It can be used to create complex, customized in-game effects.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Modify-subcommands\"><\/span>Modify subcommands<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Modify subcommands allow you to change the way the command is executed. For example :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>\/execute align &lt;axes&gt;<\/code> aligns the current position in the block grid.<\/li>\n\n\n\n<li><code>\/execute anchored &lt;eyes\u00a6feet&gt;<\/code> anchors the origin of local coordinates to the entity&#8217;s eyes or feet.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Condition-subcommands\"><\/span>Condition subcommands<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>Condition subcommands allow the command to be executed based on certain conditions. For example :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>\/execute if entity @s[x=229,y=70,z=92,distance=..5]<\/code> executes the command if the entity is within 5 blocks of the specified coordinate.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Store-subcommand\"><\/span>Store subcommand<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The <code>store<\/code> subcommand is used to store the result of a command in a data block, entity or score. For example :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>\/execute store result score @s test run say Hello<\/code> stores the result of the <code>say<\/code> command in the player&#8217;s <code>test<\/code> score.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Run-subcommand\"><\/span>Run subcommand<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p>The <code>run<\/code> subcommand is used to execute the specified command. It is often the last part of the <code>\/execute<\/code> command. For example :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>\/execute as @a run tp @p 8 64 22<\/code> teleports all players to the specified coordinates.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Additional-information\"><\/span>Additional information<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Supported versions :<\/strong> The <code>\/execute<\/code> command is available in various versions of Minecraft.<\/li>\n\n\n\n<li><strong>Coordinates and block detection :<\/strong> The command allows you to execute actions based on the detection of specific blocks or the relative position of the entity.<\/li>\n<\/ul>\n\n\n\n<p>The <code>\/execute<\/code> command offers incredible flexibility in the creation of complex commands in Minecraft. With a clear understanding of its sub-commands and how it works, you can create amazing effects and enhance your gameplay experience.<\/p>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-center kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;center&quot;,&quot;id&quot;:&quot;21491&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;1&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;5&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;4&quot;,&quot;greet&quot;:&quot;Rate this post&quot;,&quot;legend&quot;:&quot;5 \\\/ 5 - (1 vote)&quot;,&quot;size&quot;:&quot;20&quot;,&quot;title&quot;:&quot;How do I use the \\\/execute command in Minecraft ?&quot;,&quot;width&quot;:&quot;118&quot;,&quot;_legend&quot;:&quot;{score} \\\/ {best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 20px; height: 20px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 20px; height: 20px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 20px; height: 20px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 20px; height: 20px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 20px; height: 20px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 118px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 20px; height: 20px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 20px; height: 20px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 20px; height: 20px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 20px; height: 20px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 20px; height: 20px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 16px;\">\n            5 \/ 5 - (1 vote)    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>The \/execute command is one of Minecraft&#8217;s most powerful and versatile commands. It allows you to execute other commands based<\/p>\n","protected":false},"author":2,"featured_media":21492,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"pgc_sgb_lightbox_settings":"","footnotes":""},"categories":[30],"tags":[],"class_list":["post-21491","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"_links":{"self":[{"href":"https:\/\/minecraft-tutos.com\/en\/wp-json\/wp\/v2\/posts\/21491","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/minecraft-tutos.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/minecraft-tutos.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/minecraft-tutos.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/minecraft-tutos.com\/en\/wp-json\/wp\/v2\/comments?post=21491"}],"version-history":[{"count":2,"href":"https:\/\/minecraft-tutos.com\/en\/wp-json\/wp\/v2\/posts\/21491\/revisions"}],"predecessor-version":[{"id":21499,"href":"https:\/\/minecraft-tutos.com\/en\/wp-json\/wp\/v2\/posts\/21491\/revisions\/21499"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/minecraft-tutos.com\/en\/wp-json\/wp\/v2\/media\/21492"}],"wp:attachment":[{"href":"https:\/\/minecraft-tutos.com\/en\/wp-json\/wp\/v2\/media?parent=21491"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/minecraft-tutos.com\/en\/wp-json\/wp\/v2\/categories?post=21491"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/minecraft-tutos.com\/en\/wp-json\/wp\/v2\/tags?post=21491"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}