Minecraft – Activate piston on command

minecraft-bedrock-editionminecraft-commands

I'm trying to create an elevator where you can't see any of the redstone or pistons while in or outside of it since I want to make an actually nice-looking one for a hotel or something.
Anyways, this is my setup for one which may be impossible unless I can either use a command to move blocks (and the player) up, or activate the pistons without having to summon a redstone block:

P=Sticky Piston

D=Dirt or solid block

1=Redstone torch

(I have it set up already so the lever can switch the torches on/off and activate the outer ones, but I'm having trouble with trying to get an elevator that's larger than 4×4 blocks to raise two blocks up or higher without a ridiculously complex or confusing system.

Side view:

DDDD

PPPP

PPPP

1111

DDDD

1111

Top view (in layers)

DDDD

DDDD

DDDD

DDDD


PPPP

PPPP

PPPP

PPPP


PPPP

PPPP

PPPP

PPPP

etc. I'll be very greatful if I can get some help with this!

Best Answer

/setblock ~ ~-2 ~ redstone_block

Activate it and 2 blocks under the command block will be a redstone block above the redstone block place another command block above the redstone block saying:

/setblock ~ ~-1 ~ air

From the redstone block put redstone to the pistons or better yet

/setblock (x y z of one block under piston) redstone_block