0

I'm trying to learn how to spawn in multiple command blocks with lines in them using a single command block. Apparently it can be achieved via falling block entities and I have been successful in summoning a single command block as a falling block type, however I am unable to find out at the moment how to summon just one with commands inside.

I've tried looking around for documentation on this stuff but I didn't find much help and the majority of stuff that could've is probably too complicated/unnecessary for what I'm trying to achieve right now, so any help from anyone would be appreciated.

Here is the command I currently have working so far without the command line inside the target entity/command block:

summon minecraft:falling_block ~ ~3 ~2 {BlockState:{Name:command_block},Time:1}
1

You do not have to do any of the work yourself. Just go to a command generator site such as this one by Tschallacka (archive) and enter the commands, one-per-line. It will spit back a command that summons a command block tower and removes itself when completed.

Credit to Fabian Röling for his answer!!


Technical Explanation

Very brief, refer to Fabian's answer for more details and give the guy an upvote for his troubles :)

Any entity can have a Passenger NBT tag. This is an entity that is 'riding' the parent entity. The passenger can be another falling block. However, due to a bug, the passengers of a falling block land inside the block they fall on. This can be worked around by placing an armor stand in between each command block, which will immediately die and separate the next block from the previous.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.