Is there a way to make a block placeable on any block in adventure mode?

Solution 1:

This is ablout what you said, this does it, works on erything maybe excluding stairs. Try it yourself:

 give @p cake 1 0 {CanPlaceOn:["minecraft:grass","minecraft:dirt","minecraft:stone","minecraft:cobblestone","minecraft:planks","minecraft:log","minecraft:cobblestone_wall","minecraft:bedrock","minecraft:redstone_block","minecraft:quartz_ore","minecraft:quartz","minecraft:cake","minecraft:sand","minecraft:gravel","minecraft:iron_ore","minecraft:coal_ore","minecraft:stained_hardened_clay","minecraft:leaves","minecraft:sponge","minecraft:glass","minecraft:lapis_ore","minecraft:dispenser","minecraft:sandstone","minecraft:stained_glass_pane","minecraft:stained_glass","minecraft:glass_pane","minecraft:lapis_block","minecraft:noteblock","minecraft:bed","minecraft:golden_rail","minecraft:detector_rail","minecraft:rail","minecraft:sticky_piston","minecraft:web","minecraft:piston","minecraft:wool","minecraft:wooden_stairs","minecraft:barrier","minecraft:slime","minecraft:iron_trapdoor","minecraft:prismarine","minecraft:sea_lantern","minecraft:hay_block","minecraft:carpet","minecraft:gold_block","minecraft:iron_block","minecraft:coal_block","minecraft:hardened_clay","minecraft:packed_ice","minecraft:ice","minecraft:double_stone_slab","minecraft:stone_slab","minecraft:red_sandstone","minecraft:obsidian","minecraft:mossy_cobblestone","minecraft:bookshelf","minecraft:tnt","minecraft:brick_block","minecraft:diamond_ore","minecraft:diamond_block","minecraft:farmland","minecraft:furnace","minecraft:crafting_table","minecraft:ladder","minecraft:redstone_ore","minecraft:redstone_wire","minecraft:snow","minecraft:netherrack","minecraft:glowstone","minecraft:soul_sand","minecraft:pumpkin","minecraft:mycelium","minecraft:end_stone","minecraft:emerald_ore","minecraft:emerald_block","minecraft:cocoa"]}

Expanded:

give @p cake 1 0 {CanPlaceOn:[ "minecraft:grass", "minecraft:dirt ", "minecraft:stone ", "minecraft:cobblestone ", "minecraft:planks ", "minecraft:log ", "minecraft:cobblestone_wall ", "minecraft:bedrock ", "minecraft:redstone_block ", "minecraft:quartz_ore ", "minecraft:quartz ", "minecraft:cake ", "minecraft:sand ", "minecraft:gravel ", "minecraft:iron_ore ", "minecraft:coal_ore ", "minecraft:stained_hardened_clay ", "minecraft:leaves ", "minecraft:sponge ", "minecraft:glass ", "minecraft:lapis_ore ", "minecraft:dispenser ", "minecraft:sandstone ", "minecraft:stained_glass_pane ", "minecraft:stained_glass ", "minecraft:glass_pane ", "minecraft:lapis_block ", "minecraft:noteblock ", "minecraft:bed ", "minecraft:golden_rail ", "minecraft:detector_rail ", "minecraft:rail ", "minecraft:sticky_piston ", "minecraft:web ", "minecraft:piston ", "minecraft:wool ", "minecraft:wooden_stairs ", "minecraft:barrier ", "minecraft:slime ", "minecraft:iron_trapdoor ", "minecraft:prismarine ", "minecraft:sea_lantern ", "minecraft:hay_block ", "minecraft:carpet ", "minecraft:gold_block ", "minecraft:iron_block ", "minecraft:coal_block ", "minecraft:hardened_clay ", "minecraft:packed_ice ", "minecraft:ice ", "minecraft:double_stone_slab ", "minecraft:stone_slab ", "minecraft:red_sandstone ", "minecraft:obsidian ", "minecraft:mossy_cobblestone ", "minecraft:bookshelf ", "minecraft:tnt ", "minecraft:brick_block ", "minecraft:diamond_ore ", "minecraft:diamond_block ", "minecraft:farmland ", "minecraft:furnace ", "minecraft:crafting_table ", "minecraft:ladder ", "minecraft:redstone_ore ", "minecraft:redstone_wire ", "minecraft:snow ", "minecraft:netherrack ", "minecraft:glowstone ", "minecraft:soul_sand ", "minecraft:pumpkin ", "minecraft:mycelium ", "minecraft:end_stone ", "minecraft:emerald_ore ", "minecraft:emerald_block ", "minecraft:cocoa " ]}

Solution 2:

This command should work:

/give @p minecraft:cake 1 0 {CanPlaceOn:["minecraft:stone","minecraft:dirt","minecraft:grass",...,"minecraft:structure_block"]}

Fill in the ellipsis with whatever blocks are in your world, or at least the ones that you would be able to place it on.