How to repeatedly spawn blocks behind each players?

How to repeatedly spawn blocks behind each players? - A Woman Behind a Wall

What me and my friends want to do is make a slight copy of tron but niether of us know how to spawn blocks about a block away for each player. How do we do this and what kind of command block do we need? Thanks



Best Answer

You can use the relative coordinates and detect orientation selectors for that.

First we need to work with the relative coordinates combined with execute command, so we can detect for orientation of the player later:

North:

/execute @a[rym=135,ry=-135] ~ ~ ~ setblock ~ ~ ~1 stained_glass 11

South:

/execute @a[ry=22,rym=-22] ~ ~ ~ setblock ~ ~ ~-1 stained_glass 11

East

/execute @a[rym=-135,ry=-45] ~ ~ ~ setblock ~-1 ~ ~ stained_glass 11

West

/execute @a[rym=-135,ry=-45] ~ ~ ~ setblock ~1 ~ ~ stained_glass 11

This commands sets a block of stained glass behind the player for each direction.

You have to run all these commands on a clock to set permanently blocks behind the player, depending of his orientation.




Pictures about "How to repeatedly spawn blocks behind each players?"

How to repeatedly spawn blocks behind each players? - Wooden Blocks with Numbers and Letters
How to repeatedly spawn blocks behind each players? - Gray Concrete Blocks
How to repeatedly spawn blocks behind each players? - Red and White Letter Blocks



How do you spawn multiple blocks at once?

To fill multiple blocks there are a few choices. First if you have a rectangular shaped area, use the fill command: /fill <x1> <y1> <z1> <x2> <y2> <z2> block . Second choice is to use command block mine carts stacked in a single block space each with an individual /setblock command in it.

How do you make a block repeat in Minecraft?

To get a repeating command block, players must use the /give command like so: /give @p minecraft:repeating_command_block <amount> . Players can also change a normal command block into a repeating command block by selecting the option in the command block GUI.

How do Repeating command blocks work?

A repeat command block executes its command once every one game tick (or more\u200c [BEonly]) until no longer activated.

How do you fill blocks around a player?

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.



Using Commands in Minecraft: How to Use /setblock \u0026 /fill to Alter Terrain! | 1.11.2




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

Images: Andrey Che, Hanna Auramenka, Smadar Bergman, Michelle Leman