Build an automated sand sifter in Minecraft Java Edition using display entities and command blocks to shake blocks of sand into sparkling treasure items.
Spawners & GeneratorsIndustrialTechnologyYellowOrangeCyanMap MakingDecorationBlock displaysItem displaysSmooth animation (interpolation)Block building (fill/setblock/clone)21+ commands
The Automated Sand Sifter is a compact mechanical utility powered by display entities and scoreboard timers. Blocks of sand drop from an overhead chute onto a rapidly vibrating copper grate, where they shrink away into a shower of dust while glowing diamonds, emeralds, and gold ingots drop into the collection basin below.
Using smooth transformation interpolation on block and item displays, the grate visibly rattles back and forth every few ticks while the sand blocks compress and dissolve right on camera.
/scoreboard objectives add c9_tick dummy/scoreboard objectives add c9_age dummy/fill ~-2 ~ ~-2 ~2 ~ ~2 polished_deepslate/fill ~-1 ~ ~-1 ~1 ~ ~1 black_concrete/setblock ~-1 ~1 ~-1 lightning_rod/setblock ~1 ~1 ~-1 lightning_rod/setblock ~-1 ~1 ~1 lightning_rod/setblock ~1 ~1 ~1 lightning_rod/summon marker ~ ~ ~ {Tags:["c9_sifter","c9_root"]}/summon block_display ~ ~1.8 ~ {Tags:["c9_sifter","c9_grate"],block_state:{Name:"minecraft:copper_grate"},transformation:{translation:[-0.9f,0.0f,-0.9f],scale:[1.8f,0.35f,1.8f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},interpolation_duration:2}/scoreboard players add @e[tag=c9_root] c9_tick 1/execute if score @e[tag=c9_root,limit=1] c9_tick matches 41.. run scoreboard players set @e[tag=c9_root] c9_tick 1/execute if score @e[tag=c9_root,limit=1] c9_tick matches 1 run summon block_display ~ ~4.5 ~ {Tags:["c9_sifter","c9_sand"],block_state:{Name:"minecraft:sand"},transformation:{translation:[-0.45f,0.0f,-0.45f],scale:[0.9f,0.9f,0.9f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},interpolation_duration:3}/scoreboard players add @e[tag=c9_sand] c9_age 1/execute as @e[tag=c9_sand,scores={c9_age=1..12}] at @s run tp @s ~ ~-0.2 ~/execute as @e[tag=c9_sand,scores={c9_age=13..35}] at @s run particle block{block_state:{Name:"minecraft:sand"}} ~ ~0.2 ~ 0.4 0.1 0.4 0.05 6/execute as @e[tag=c9_sand,scores={c9_age=15}] run data merge entity @s {start_interpolation:0,interpolation_duration:20,transformation:{translation:[-0.45f,0.0f,-0.45f],scale:[0.9f,0.05f,0.9f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}/execute if score @e[tag=c9_root,limit=1] c9_tick matches 1..39 as @e[tag=c9_grate] run data merge entity @s {start_interpolation:0,interpolation_duration:2,transformation:{translation:[-0.82f,0.0f,-0.9f],scale:[1.8f,0.35f,1.8f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}/execute if score @e[tag=c9_root,limit=1] c9_tick matches 20..40 as @e[tag=c9_grate] run data merge entity @s {start_interpolation:0,interpolation_duration:2,transformation:{translation:[-0.98f,0.0f,-0.9f],scale:[1.8f,0.35f,1.8f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}/execute as @e[tag=c9_sand,scores={c9_age=20}] at @s run summon item_display ~-0.35 ~-0.2 ~0.2 {Tags:["c9_sifter","c9_gem"],Glowing:1b,glow_color_override:65535,item:{id:"minecraft:diamond",count:1},transformation:{translation:[0f,0f,0f],scale:[0.65f,0.65f,0.65f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}/execute as @e[tag=c9_sand,scores={c9_age=26}] at @s run summon item_display ~0.35 ~-0.2 ~-0.25 {Tags:["c9_sifter","c9_gem"],Glowing:1b,glow_color_override:16766720,item:{id:"minecraft:gold_ingot",count:1},transformation:{translation:[0f,0f,0f],scale:[0.65f,0.65f,0.65f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}/execute as @e[tag=c9_sand,scores={c9_age=32}] at @s run summon item_display ~0.1 ~-0.2 ~0.35 {Tags:["c9_sifter","c9_gem"],Glowing:1b,glow_color_override:65280,item:{id:"minecraft:emerald",count:1},transformation:{translation:[0f,0f,0f],scale:[0.65f,0.65f,0.65f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}/scoreboard players add @e[tag=c9_gem] c9_age 1/execute as @e[tag=c9_gem,scores={c9_age=1..14}] at @s run tp @s ~ ~-0.08 ~ ~12 ~/execute at @e[tag=c9_gem,scores={c9_age=15}] run particle happy_villager ~ ~0.2 ~ 0.2 0.2 0.2 0.02 5/kill @e[tag=c9_sifter,scores={c9_age=36..}]setup #10 Summons a copper grate <code>block_display</code> stretched to 1.8 blocks wide and flattened vertically to act as the shaking sifter mesh resting above the four lightning rod supports.loop #3 Every 40 ticks (2 seconds), spawns a fresh sand <code>block_display</code> high above the centre of the grate.loop #7 When the sand hits the grate at age 15, merges a new transformation scale with a 20-tick interpolation duration so the sand block smoothly squashes flat as it is sifted.loop #10 As the sand dissolves, summons glowing treasure <code>item_display</code> entities (diamond, gold ingot, and emerald) beneath the mesh that spin and drop into the basin.loop #16 Cleans up both sifted sand displays and collected treasure displays once their <code>c9_age</code> score reaches 36 ticks, keeping entity counts low.


Recorded on our own test server: 50 frames at about 9.9 fps. Our image check saw: A sand block drops onto a raised copper grate and breaks into particles while glowing diamonds, emeralds, and gold ingots collect in a dark basin underneath.
Commands, video and screenshots: tested and recorded by www.9minecraft.net © 9Minecraft. Sharing a video or screenshot? Please credit www.9minecraft.net.
To let players feed real sand into the sifter instead of spawning demo blocks automatically, replace loop command 3 with /execute at @e[tag=c9_root] as @e[type=item,distance=..2,nbt={Item:{id:"minecraft:sand"}}] run summon block_display ~ ~1.2 ~ {Tags:["c9_sifter","c9_sand"],block_state:{Name:"minecraft:sand"}} followed by killing the dropped sand item, and replace the item_display summons in commands 10-12 with real item entities or a loot table drop.
/kill @e[tag=c9_sifter]/fill ~-2 ~ ~-2 ~2 ~2 ~2 air/scoreboard objectives remove c9_tick/scoreboard objectives remove c9_ageThe sand is a block_display entity. By setting start_interpolation to 0 and interpolation_duration to 20 while changing its vertical scale from 0.9f to 0.05f, Minecraft smoothly animates the block flattening over one second.
No. The last command in the loop deletes every sand and gem display entity as soon as it reaches 36 ticks of age, so there are never more than about a dozen entities alive at once.
/data/execute/fill/kill/particle/scoreboard/setblock/summon/tp
▶Tesla Coil Lightning Arc SpawnerSpawners & GeneratorsMedium24 cmds
▶3D Conveyor Belt LoopSpawners & GeneratorsMedium26 cmds
▶Automated Conveyor AssemblySpawners & GeneratorsEasy24 cmds
▶Automated Conveyor FactorySpawners & GeneratorsEasy24 cmds
▶Automated Crop HarvesterSpawners & GeneratorsMedium24 cmds
▶Automated Factory Assembly LineSpawners & GeneratorsMedium24 cmds