I can't target all mobs expect player in a 5 block radius

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.


Solution 1:

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