[::] Place blocks with dispensers

๐ŸŽ™๏ธ tryashtar ยท 67 points ยท Posted at 20:55:25 on June 29, 2015 ยท (Permalink)


FeminineLeafyCreature

๐ŸŽ™๏ธ tryashtar ยท 6 points ยท Posted at 21:02:38 on June 29, 2015 ยท (Permalink)*

Dispensers are cool and all, but they leave a lot to be desired. If dispensers could automatically dispense blocks when powered, it would add a whole new level to redstone.

So I made it with command blocks. It's fairly simple and mainly follows the same concept as my crop-planting dispensers here, but allows for more powerful redstone creations.

It does not work with every block, but I chose as many blocks as possible which have a special function when placed in the world, as well as some common building blocks.

Examples are rails, redstone blocks, stained clay, nether quartz ore, sponges, ladders, redstone torches, saplings, wood, gravel, and more. All data values of the dispensable blocks function as expected.

As always, the compressed command necessary to accomplish this will be linked right here in case you want to try it out for yourself.
.
This time, however, there are two separate commands. The first one allows all supported blocks with damage value 0 to be placed. The second one, when added to the first, allows all supported blocks to be placed regardless of damage value. Here they are:

Part 1: above-ground, bedrock

Part 2: above-ground, bedrock

Up next is block breakers with command blocks, so expect that.

Evtema3 ยท 2 points ยท Posted at 22:10:53 on June 29, 2015 ยท (Permalink)

Cool! It's a shame that all blocks aren't place-able using this because of how many blocks there are and how there would need to be big sections of command blocks for each one - 6 different orientations to place each block, scoreboard objectives/values for each item, and execute commands setting the blocks the items inhabit to be their respective block. Still nice that you used as many as possible of the blocks that have special functions when placed in the world. Looking forward to the block breakers!

๐ŸŽ™๏ธ tryashtar ยท 1 points ยท Posted at 22:21:44 on June 29, 2015 ยท (Permalink)

Because of how I've set up the commands, it only requires one command to allow a new placeable block, and then one more for each damage value.

By the way, here's a link to the full list of dispensable blocks in case anyone wants to check it out. Note that all damage values can also be placed. Did I forget an important block? Let me know.

Evtema3 ยท 2 points ยท Posted at 22:49:18 on June 29, 2015 ยท (Permalink)

Oh, that's interesting.

Thanks! Quite a lot of blocks there.

MasInYoFace ยท 2 points ยท Posted at 22:47:16 on June 29, 2015 ยท (Permalink)

Nice idea, I'd love to see this added to the game. Dispensing the gravity-affected blocks would be fun to work with. I haven't looked at the commands yet, but is 'detect' being used to test if the dropped item came from the dispenser? Or would either a dropper or player dropping a compatible item set this off?

๐ŸŽ™๏ธ tryashtar ยท 1 points ยท Posted at 23:09:55 on June 29, 2015 ยท (Permalink)

Just like the crop-dispensing system, a block can only be placed under the following conditions:

1) when an item first enters into the world, it needs to detect the dispensing side of a dispenser 0.3 blocks in any direction. As an example, if it detects a north-facing dispenser 0.3 blocks to its south upon creation, it assumes it has been shot from that dispenser.

2) The item can only place blocks for one second after it enters the world.

With those conditions, items falling past dispensers or being dropped by players will not place blocks.

MasInYoFace ยท 2 points ยท Posted at 23:13:26 on June 29, 2015 ยท (Permalink)

I see, thanks for the reply!

Slaker_Kanston ยท 2 points ยท Posted at 04:52:57 on June 30, 2015 ยท (Permalink)

A very good work ! :3

HiDefSheep ยท 2 points ยท Posted at 05:31:29 on June 30, 2015 ยท (Permalink)

Does this work with droppers because i think they should still drop the item instead of placing it

And if you drop an item on the ground wouldn't that also turn into a solid block? Or is there a mechanic to stop that?

๐ŸŽ™๏ธ tryashtar ยท 1 points ยท Posted at 06:11:51 on June 30, 2015 ยท (Permalink)

Droppers still function as intended. Dropping items still works as intended. The commands are made so that everything else in the game works normally, while still adding this cool feature!

HiDefSheep ยท 1 points ยท Posted at 06:12:46 on June 30, 2015 ยท (Permalink)

Nice, great job man! :)