Automated Sand Sifter

Build an automated sand sifter in Minecraft Java Edition using display entities and command blocks to shake blocks of sand into sparkling treasure items.

Java EditionMini-games & UtilitiesMedium26 commandsTested on a real 26.2 & 26.3 server
A sand sifter machine with a copper grate sifting sand into glowing gemstones and gold ingots. Download the GIF Video & GIF © www.9minecraft.net

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.

1. Setup - type these once 10 commands

  1. /scoreboard objectives add c9_tick dummy
  2. /scoreboard objectives add c9_age dummy
  3. /fill ~-2 ~ ~-2 ~2 ~ ~2 polished_deepslate
  4. /fill ~-1 ~ ~-1 ~1 ~ ~1 black_concrete
  5. /setblock ~-1 ~1 ~-1 lightning_rod
  6. /setblock ~1 ~1 ~-1 lightning_rod
  7. /setblock ~-1 ~1 ~1 lightning_rod
  8. /setblock ~1 ~1 ~1 lightning_rod
  9. /summon marker ~ ~ ~ {Tags:["c9_sifter","c9_root"]}
  10. /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}

2. Loop - one repeating command block each (Always Active) 16 commands

  1. /scoreboard players add @e[tag=c9_root] c9_tick 1
  2. /execute if score @e[tag=c9_root,limit=1] c9_tick matches 41.. run scoreboard players set @e[tag=c9_root] c9_tick 1
  3. /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}
  4. /scoreboard players add @e[tag=c9_sand] c9_age 1
  5. /execute as @e[tag=c9_sand,scores={c9_age=1..12}] at @s run tp @s ~ ~-0.2 ~
  6. /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
  7. /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]}}
  8. /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]}}
  9. /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]}}
  10. /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]}}
  11. /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]}}
  12. /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]}}
  13. /scoreboard players add @e[tag=c9_gem] c9_age 1
  14. /execute as @e[tag=c9_gem,scores={c9_age=1..14}] at @s run tp @s ~ ~-0.08 ~ ~12 ~
  15. /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
  16. /kill @e[tag=c9_sifter,scores={c9_age=36..}]

How it works

Frames from the test run

Automated Sand Sifter - frame 1Automated Sand Sifter - frame 2Automated Sand Sifter - frame 3

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.

Build it in your world

  1. Stand at the spot where you want the sifter basin and run each command from the Setup list in chat.
  2. Place a chain of 16 command blocks nearby: the first one Repeating and Always Active, feeding into 15 Chain Always Active command blocks.
  3. Paste the 16 Loop commands in order into the command block chain.
  4. Watch sand blocks drop onto the vibrating copper grate every two seconds and filter into glowing gems below.
  5. When you want to remove the machine, turn off the repeating command block and run the Remove commands.

Use it with real players

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.

Remove it again 4 commands

  1. /kill @e[tag=c9_sifter]
  2. /fill ~-2 ~ ~-2 ~2 ~2 ~2 air
  3. /scoreboard objectives remove c9_tick
  4. /scoreboard objectives remove c9_age

FAQ

Why does the sand block shrink smoothly instead of disappearing all at once?

The 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.

Will the sifter cause lag if left running?

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.

Commands used

/data/execute/fill/kill/particle/scoreboard/setblock/summon/tp

Similar creations

Join 9Minecraft News & Guides