Execute command doesn't work - Minecraft 1.16.3

422 Views Asked by At

I'm making a map and I want every time a player walks on top of an orange terracotta block, the player receives levitation for 1 second. The problem is when I run the command, the game just does nothing, there is no output even with /gamerule commandBlockOutput true.

execute as @a at @s if block ~ ~ ~ minecraft:orange_terracotta run effect give @s minecraft:levitation 1 40 true

This is the command I am using; I've put it in a command block with repeat mode, unconditional and needs redstone.

1

There are 1 best solutions below

1
greenCode_TM On

Try to do ~ ~-1 ~ or something like that. You are saying at the specific block that the player is at. If you do execute as @a at @s if block ~ ~-1 ~ minecraft:orange_terracotta run effect give @s minecraft:levitation 1 40 true it will do the block under the player.