The syntax of execute detect
is:
/execute <entity> <x> <y> <z> detect <x> <y> <z> <block> <dataValue|blockState> <command>
You need a data value or block state (e.g: 0
or default
) after minecraft:bedrock
.
You've missed the t
in minecraf:levitation
.
You're also executing from @p
but affecting @a
. This would mean that if the closest player to the command block stands on bedrock, everyone will get levitation. Instead, you should make everyone (/execute @a
) give themselves levitation (/effect @a[c=1]
, to select theirself even if they're dead).
Try:
execute @a ~ ~ ~ detect ~ ~-1 ~ minecraft:bedrock 0 effect @a[c=1] minecraft:levitation 30