1

Is it possible to detect block updates with command blocks?

E3R0 10/22/20 9:14 am
769
10/23/2020 11:35 am
So basically I want to do what observers do but with command blocks and from anywhere in the world.
Posted by
E3R0
Level 36 : Artisan Procrastinator
6

  Have something to say?

JoinSign in

4

garlicbreathinator
10/22/2020 2:47 pm
Level 33 : Artisan Loremaster owo
history
To test if a specific block has changed, you could clone the block and surrounding area to a fixed location, then use "/execute if blocks" the next tick to compare the saved version to the location's current state. (You put the test BEFORE the clone in the chain). The reason why you clone all the blocks around it (3x3 cube) is so any connections like fences it has will stay the same.



For this to work, the block being tested and the command block both need to be loaded. You might need to force-load one or the other.
2
E3R0
10/23/2020 11:12 am
Level 36 : Artisan Procrastinator
I simply want to check if a bell is rung, is it possible to do this?
1
Command Witchery
10/23/2020 11:35 am
Level 64 : High Grandmaster Robot
Do you want to check weither any bell is rung, or a specific bell? If it is any bell, a simple scoreboard should work (minecraft.custom:minecraft.bell_ring). If it is a specific bell then you would probably need to do raycasting to check the direction that the player is looking, which could miss etc, and I would personally not advice.
1
EnderDragon__
10/22/2020 1:35 pm
He/Him • Level 14 : Journeyman Dragonborn Mountaineer
I'm pretty sure it is possible, I've seen it before on bedrock, but I don't know how to do it.
1

Welcome