Minecraft wiki entry for Command_blocks_and_functions, associated text: By using /give @p[level=<level>..] <item> <amount> and /experience add @p[level=<level>..] -<level> levels you can make a shop system that trades a certain amount of exp for items. For instance, if you made a command block with /give @p[level=5..] grass_block 64 and another with /experience add @p[level=5..] -5 levels connected to the same redstone current, it will take 5 levels from the player, and in return, give them 64 grass blocks.