Make falling sand disappear when it lands

Solution 1:

If you place a torch beneath the falling sand, the sand block will "break" and become a sand block item that can be picked up or ignored until it despawns.

Solution 2:

Create a scoreboard objective named onGround

/scoreboard objectives add onGround dummy

Set all entity's onGround scores whose OnGround tag equals 1 to 1; kill all FallingSand entity's with onGround score of 1

/scoreboard players set @e onGround 1 {OnGround:1b}
/kill @e[type=FallingSand,score_onGround_min=1]

Put the last two commands on a 20Hz clock


If the ground is only made op of a certain material, for example, stone

You can use an execute with detect and test for the block below the FallingSand

/execute @e[type=FallingSand] ~ ~ ~ detect ~ ~-1 ~ stone 0 kill @e[type=FallingStand,r=0]

the r=0 at the end is to make sure that the fallingsand only targets itself.

Solution 3:

I already have a slime riding my block, but if you just have a block, you can make an invisible mob ride it and this will still work.

NOTE: All commands here, unless specified, should be run on a 20hz clock.

The solution I found was to let the falling sand become a block, then use the slime to destroy the block. First you need to detect slimes that have only just touched the ground, so they don't destroy other blocks. A scoreboard can be used to track this. First, create the scoreboard objective manually:

/scoreboard objectives add onGroundTicks dummy

Then add to the score for slimes on the ground:

/scoreboard players add @e[type=Slime] onGroundTicks 1 {OnGround:1b}

Any slime that has only just touched the ground for the first time will have a score of 1. Slimes that have never touched the ground have a score of 0. Slimes that have touched the ground before have a score that is greater than 1.

Next, you need to remove the extra blocks around the slimes with a score of 1. I am using barriers, but whatever block you are using, you must replace minecraft:barrier with that block. Only the barrier blocks in this example are destroyed.

/execute @e[type=Slime,score_onGroundTicks=1] ~ ~ ~ /fill ~1 ~ ~1 ~-1 ~ ~-1 minecraft:air 0 replace minecraft:barrier 0

You may or may not want to kill the slimes after that:

/kill @e[type=Slime,score_onGroundTicks_min=2]