1
I need help with command
Hey there Minecrafters!
I just wanted to ask one question.
I´m making a Super Mario Bros. map and I´ve got a problem.
I want to make it so if you punch your head against a brick block, the bricks would dissapear above players head, and question block would turn into block that does nothing, like in original (Of course you would say me /execute), But that is not working. It just breaks blocks just up the command block, that is running command /setblock ~ ~1 ~ air destroy and then bye-bye. If anyone knows how to do this, I will put this person in credits when the map will be finished.
Thank you to anyone!
I just wanted to ask one question.
I´m making a Super Mario Bros. map and I´ve got a problem.
I want to make it so if you punch your head against a brick block, the bricks would dissapear above players head, and question block would turn into block that does nothing, like in original (Of course you would say me /execute), But that is not working. It just breaks blocks just up the command block, that is running command /setblock ~ ~1 ~ air destroy and then bye-bye. If anyone knows how to do this, I will put this person in credits when the map will be finished.
Thank you to anyone!
Create an account or sign in to comment.
3
1
Its best to summon a floating armor stand in the same position as the block
As a test:
On top of brick block: /summon armor_stand ~ ~-1 ~ {NoGravity:1b}
In your command block (repeating, active): /execute as @a at @s if block ~ ~1 ~ minecraft:bricks run setblock ~ ~1 ~ air destroy
Chain command block or another repeating command block (active): /execute if block (actual cords) minecraft:air run as @e[type=armorstand,x=(x_cord),y=(y_cord),z(z_cord),distance=..2] run setblock ~ ~ ~ (desired non-functioning block)
The armor stand is useful if you want to summon coins/mushrooms as well.
Since you've already figured this out, just keep this in mind for future use
As a test:
On top of brick block: /summon armor_stand ~ ~-1 ~ {NoGravity:1b}
In your command block (repeating, active): /execute as @a at @s if block ~ ~1 ~ minecraft:bricks run setblock ~ ~1 ~ air destroy
Chain command block or another repeating command block (active): /execute if block (actual cords) minecraft:air run as @e[type=armorstand,x=(x_cord),y=(y_cord),z(z_cord),distance=..2] run setblock ~ ~ ~ (desired non-functioning block)
The armor stand is useful if you want to summon coins/mushrooms as well.
Since you've already figured this out, just keep this in mind for future use
1
I found an easier way. You will see once Mario map is released.
1
This thread is NOT functioning from now on, because I figured it out by accident.