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.
Try to do
~ ~-1 ~or something like that. You are saying at the specific block that the player is at. If you doexecute as @a at @s if block ~ ~-1 ~ minecraft:orange_terracotta run effect give @s minecraft:levitation 1 40 trueit will do the block under the player.