1

As you know, you can teleport to an armor stand with /tp @s [type=armor_stand] (or something along the lines of that.)

But, I'm trying to use the armor stand location in a /fill command where I use it as the "to" section (e.g. /fill ~ ~ ~ [armor stand location here])

I'm on bedrock and I'm not sure how to use it.

1
  • 1
    The /fill command only accepts integer coordinates of the corners of the area. You can't fill 'to' an entity. There's probably a work-around that I don't dare to write, but you can't do this with just /fill.
    – AMJ
    Mar 28, 2020 at 7:12

3 Answers 3

1

There are a few ways you can do it, I'm going to try to not be confusing and I'll explain each step.

3x3x3 fill of a type of block:

/execute @e[type=armor_stand] ~ ~ ~ <gets armor stands coorinates>

/execute @e[type=armor_stand] ~ ~ ~ fill ~-1 ~ ~-1 ~1 ~3 ~1 -{block of choice}-
<fills x-1 y-0 z-1 and x+1 y+3 z+1 with block of choice>

Fill from the armor stand to a certain point:

/execute @e[type=armor_stand] ~ ~ ~ fill ~ ~ ~ -{x}- -{y}- -{z}- -{block of choice}-

If you're attempting to make a tool to fill from one stand to another that I don't think is even possible. Hope this helped ;)

1

Unless I'm missing something fundamentally different about commands in Bedrock edition, this answer for Java edition should apply here as well: Need 2 Positions to Clone With /execute

Commands are always executed at one position, so you can't use two sets of relative coordinates. The solution is to first clone one relative location to a fixed area, for example 0 0 0 (make sure that the chunks are always loaded using /tickingarea) and then cloning from that fixed area to your other relative location. Afterwards, you can delete the temporary copy at 0 0 0 again.

2
  • Before 1.19.50 the execute command on bedrock was quite different and not as useful, the top of the /execute wiki page has a link to the old one
    – Ekipsogel
    Mar 19 at 13:35
  • Since neither the question, nor my answer here or my answer of the other question mention /execute or talk about any specific syntax, that should be fine. And the other question also has the old /execute syntax. But good to know that MCBE now finally has the new one, took long enough! Mar 19 at 17:43
1

(I’m making this answer because the execute command changed in 1.19.50) The only way to do this is to change where ~ ~ ~ is, so you would have to provide the first set of coordinates. The new command is:

/execute at @e[type=armor_stand] run fill [x] [y] [z] ~ ~ ~ [block]

Make sure to replace [x] [y] [z] and [block] with your first set of coordinates and your block of choice.

Explanation: The execute command can change the way following commands are run, or only run them if a condition is met. at is a modifier that changes the position, dimension, and rotation of the following modifiers and commands, and @e[type=armor_stand] selects all entities that are armor stands, so at @e[type=armor_stand] sets the position to an armor stand. There are ways to make it only target one stand with tags, but that is more complicated, so it is recommended to remove all other armor stands, or use /tag, which is explained below. run is where you put the command you want to run, you can put multiple modifiers before run, so run tells execute where the modifiers end and the main command begins. Now when fill runs, ~ ~ ~ is the position of the armor stand.

If you want/need other armor stands, the simplest way is to use /tag. Get in the same block as the armor stand you want to tag, and run

/tag @e[type=armor_stand,r=1] add fill.

/tag adds a word (called a tag) to entities that can be looked for with @a, @p, @s, @r, and @e. r=1 (distance=..1 on Java) selects all armor stands within 1 block of the player. The command needs to be changed to:

/execute at @e[type=armor_stand,tag=fill] run fill [x] [y] [z] ~ ~ ~ [block]

Now, the @e selector is looking for entities that are armor stands and have the tag “fill” attached, instead of whatever random stand it chooses.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .