How to set a block to a different block then restore the previous one?

Started by RoboMan on

Topic category: Help with modding (Java Edition)

Last seen on 06:49, 13. Oct 2022
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to set a block to a different block then restore the previous one?

I am making a procedure so when a specific type of block is right clicked, a block spawns two blocks under it, then after 20 ticks it gets restored to its original block. I am having difficulties with the last part, though, as I do not know what type of block was originally there.

Last seen on 04:28, 26. Jan 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
you could try by Getting the…
Sun, 10/10/2021 - 00:00

you could try by Getting the block Below it, making a Blockstate Local Variable, and setting Local:VARIABLE = block at X Y - 1 Z

then after 40 ticks, replace block at X Y - 1 Z with Local:VARIABLE 

for this to work, you HAVE to make the Variable a Blockstate

Last seen on 06:49, 13. Oct 2022
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
That worked, but now I'm…
Sun, 10/10/2021 - 02:37

That worked, but now I'm running into a different issue. The block I am having it affect is an iron door, and the being set two blocks underneath it is a redstone torch. However, the door does not open.

Last seen on 04:28, 26. Jan 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
?
Sun, 10/10/2021 - 02:43

?

Last seen on 06:49, 13. Oct 2022
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The strange part is, it…
Sun, 10/10/2021 - 02:52

The strange part is, it plays the door opening and closing sounds, but the door itself doesn't do anything

Last seen on 06:49, 13. Oct 2022
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I just tried it again, and…
Sun, 10/10/2021 - 02:55

I just tried it again, and the good news is it doesn't play the sound anymore. Bad news is it still doesn't open.

Last seen on 04:28, 26. Jan 2024
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yeah sorry this is how far…
Sun, 10/10/2021 - 03:43

yeah sorry this is how far my knowledge goes

Last seen on 06:49, 13. Oct 2022
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks for trying to help…
Sun, 10/10/2021 - 06:20

Thanks for trying to help anyway!