Zrobię Ci tylko na diamenty, a resztę chyba sam zrobisz, co nie?
command /bloki [<text>]:
trigger:
close player's inventory
open chest with 1 row named "&6&lBLOKI" to player
wait 3 tick
set player's current inventory's slot 4 to 57 named "&b&lDIAMENTY"
on inventory click:
if inventory name of current inventory of player is "&6&lBLOKI":
cancel event
if clicked slot is 4:
set {_x} to "%number of diamond in player's inventory%"
set {_s} to {_x}/9
give {_s} 57 to player
remove {_x} diamond from player's inventory
send "&8&l[&6&lBLOKI&8&l] &aOtrzymujesz &2%{_s}% &ablokow &b&lDIAMENTOW" to the player
stop