Execute fill command relative to player

Execute fill command relative to player - Crop anonymous female filling questionnaire when applying for job sitting in employer office

How can I execute the fill command relative to the player? If you are wondering why I am asking this, and for more information, reference my earlier question here: How to make a block disappear after a certain period of time Look to the bottom section for the info you want. Also, I don't want it to just fill the selected areas, I just want to replace wool with air.



Best Answer

To fill an area relative to the player, put the following code into a command block or your chat: /execute @<p,a,r,e> <x> <y> <z> /fill <x1> <y1> <z1> <x2> <y2> <z2> <block> 0 replace <blocktoreplace>. The p, a, r, and e are the selectors.

  • @p is as if you had typed the nearest players name in
  • @a is as if you had put everyone's name tag in
  • @r is as if you had put a random player's name in, and
  • @e is as if you had put every entity's ID in.

The first x, y, and z are the relative coordinates, meaning that they must have the symbol ~ before them, and are relative to the player. The next two sets of x y and z should also be relative otherwise there wouldn't be any use of using execute. The block is now used by it's name with minecraft: before it or what ever mod it comes from with a colon after meaning that items that have the same name won't override each other. The block to replace is just that, the block to replace.




Pictures about "Execute fill command relative to player"

Execute fill command relative to player - Crop relatives filling dim sum in kitchen
Execute fill command relative to player - Side view of crop anonymous female relatives cooking dumplings with minced meat filling at kitchen table
Execute fill command relative to player - Crop woman with relative filling dim sum in kitchen



How do you run a fill command in Minecraft?

Type the command in the chat window and press the Enter key to run the command. This /fill command would replace all blocks in the fill region, including air. The replaced blocks will be dropped and can then be collected as if they were mined with a pickaxe or shovel.



Minecraft Execute Command [1.19] Tutorial




More answers regarding execute fill command relative to player

Answer 2

/execute at @p positioned ~ ~ ~ run fill ~-5 ~-2 ~-5 ~5 ~2 ~5 minecraft:air replace minecraft:wool

Here's the new command for Java, everyone!

Answer 3

For everyone reading this in the future like i was, /execute [selector] doesn't work anymore. If you want to execute at someone's location, use /execute AT [selector] and then the relative ~ ~ ~ or modified relative ~ ~-5 ~ and the like coords.

Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Sora Shimazaki, Angela Roma, Angela Roma, Angela Roma