0

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?

1
  • 2
    Why is it executing @p but affecting @a ?
    – Reflexive
    Commented Feb 25, 2017 at 12:04

1 Answer 1

1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .