Minecraft Java Edition Commands – How to Target All Mobs Except Player in 5 Block Radius

minecraft-commandsminecraft-java-edition

I tried using this command to give every entity in a 5 block radius

[/effect @e[r=5, type=!player] minecraft:levitation 10 1 true]. 

I expect player levitation, but it doesn't work.

Best Answer

You had a space in there that you shouldn't have here is the fixed command

/effect @e[r=5,type=!player] minecraft:levitation 10 1 true