I'm making a map. And I want to give the player levitation when standing on bedrock.

I tried this command:

execute @p ~ ~ ~ detect ~ ~-1 ~ minecraft:bedrock effect @a minecraf:levitation 30

But I constantly get this error:

[13:02:26] Failed to execute 'detect' as F1NN3RT

What am I doing wrong?

  • 2
    Why is it executing @p but affecting @a ? – Reflexive Feb 25 '17 at 12:04

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


execute @a ~ ~ ~ detect ~ ~-1 ~ minecraft:bedrock 0 effect @a[c=1] minecraft:levitation 30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.