What I'm trying to accomplish is the creation of a smooth, realistic elevator using command blocks. There has been many videos before 1.14 about smooth elevators by using armor stands and entities that you can stand on, for ex., shulkers. I want to recreate it on 1.14 and can someone help me find a tutorial to do this or can anyone help me with some commands to make this possible?
What I'm trying to accomplish is the creation of a smooth, realistic elevator using command blocks. There has been many videos before 1.14 about smooth elevators by using armor stands and entities that you can stand on, for ex., shulkers. I want to recreate it on 1.14 and can someone help me find a tutorial to do this or can anyone help me with some commands to make this possible?
obviously you could make this incredibly complex by adding call buttons so you can call the elevator from any floor and thing things like that but I will not g over that in this example.
First, you need to create your floor by summoning armor stands with shulkers as passengers:
then you need to tag a specific shulker to act as a detector for when the elevator reaches the next floor. If you're using a 3x3 grid, tag the middle outer shulker by looking at it and running this:
/tag <press_tab_and_select_long_id> add detector
now you need to set up elevator detectors on every floor. There are many fancy ways to do this but I will show you the most basic one.
Place a diamond block in the wall at the level you want your elevator to stop (on the side your detector shulker is) and do that for every floor.
the idea is to use a detection command on the shulker you have tagged and stop the elevator when the command detects a diamond block.
Let's get some buttons working, place one button on your bottom floor for going up and attach a command block to it. Paste this in:
/tag @e[tag=detector,limit=1,sort=nearest,distance=..10] add up
(make sure it is within range)
you should also have these two commands always running in the background:
/execute as @e[tag=detector,tag=up] at @s run execute as @e[tag=floor,distance=..5] at @s run tp @s ~ ~0.05 ~
/execute as @e[tag=detector,tag=down] at @s run execute as @e[tag=floor,distance=..5] at @s run tp @s ~ ~-0.05 ~
if you accidentally activated the elevator, do:
/tag @e remove up
or (depending on where it is going)
/tag @e remove down
also have these running in the background in a command block chain (it is very important that they run in order):
/execute as @e[tag=detector,tag=!block] at @s if block ~1 ~ ~ diamond_block run tag @s remove up
/execute as @e[tag=detector,tag=!block] at @s if block ~1 ~ ~ diamond_block run tag @s remove down
/execute as @e[tag=detector,tag=!block] at @s if block ~1 ~ ~ diamond_block run tag @s add block
/execute as @e[tag=detector,tag=block] at @s unless block ~1 ~ ~ diamond_block run tag @s remove block
(make sure you adjust the ~ ~ ~ to point to your diamond block)
^ this is the core of the entire system. I call this a "virtual flip-flop" because it does just that.
At this point, you should have a working up/down system if you did everything correctly. You can apply an offset with "positioned" to make any adjustments to the detection command.
Love that system and works like a charm, for EXCEPT one thing.
when it detects the diamond block, it won't "stop" at the diamond_block, but CLOSE to it.
So the elevator sometimes is under the block(halfway)
or over the block(halfway as well)
Edit: Nvm, got it working and improved for multiple floors when calling it from any floor.
Edit:
I used a Gold Block(for going down) & Diamond Block(for going up).
From whatever floor i'm calling it to, It will change the diamond into ore block (if shulker is located under)
or from up, will change gold block into nether brick.
Then going lower or higher is 1 by 1 floor. I don't have a floor selector yet.
What I'm trying to accomplish is the creation of a smooth, realistic elevator using command blocks. There has been many videos before 1.14 about smooth elevators by using armor stands and entities that you can stand on, for ex., shulkers. I want to recreate it on 1.14 and can someone help me find a tutorial to do this or can anyone help me with some commands to make this possible?
obviously you could make this incredibly complex by adding call buttons so you can call the elevator from any floor and thing things like that but I will not g over that in this example.
First, you need to create your floor by summoning armor stands with shulkers as passengers:
then you need to tag a specific shulker to act as a detector for when the elevator reaches the next floor. If you're using a 3x3 grid, tag the middle outer shulker by looking at it and running this:
now you need to set up elevator detectors on every floor. There are many fancy ways to do this but I will show you the most basic one.
Place a diamond block in the wall at the level you want your elevator to stop (on the side your detector shulker is) and do that for every floor.
the idea is to use a detection command on the shulker you have tagged and stop the elevator when the command detects a diamond block.
Let's get some buttons working, place one button on your bottom floor for going up and attach a command block to it. Paste this in:
(make sure it is within range)
you should also have these two commands always running in the background:
if you accidentally activated the elevator, do:
also have these running in the background in a command block chain (it is very important that they run in order):
^ this is the core of the entire system. I call this a "virtual flip-flop" because it does just that.
At this point, you should have a working up/down system if you did everything correctly. You can apply an offset with "positioned" to make any adjustments to the detection command.
Command block engineer // Developer // #TeamTrees
Love that system and works like a charm, for EXCEPT one thing.
when it detects the diamond block, it won't "stop" at the diamond_block, but CLOSE to it.
So the elevator sometimes is under the block(halfway)
or over the block(halfway as well)
Edit: Nvm, got it working and improved for multiple floors when calling it from any floor.
Edit:
I used a Gold Block(for going down) & Diamond Block(for going up).
From whatever floor i'm calling it to, It will change the diamond into ore block (if shulker is located under)
or from up, will change gold block into nether brick.
Then going lower or higher is 1 by 1 floor. I don't have a floor selector yet.