Basic syntax
/effect give <targets> <effect> [<seconds>|infinite] [<amplifier>] [<hideParticles>]
/effect clear [<targets> [<effect>]]
Arguments in <…> are required, and arguments in […] are optional. Omit the effect to clear all effects. In Java 1.15 and later, omitting the target also defaults to the executor.
| Argument | Meaning |
|---|---|
targets | A player name or a selector such as @s, @a, or @e[type=minecraft:zombie]. |
effect | The status effect ID. For example, minecraft:speed is Speed. |
seconds | The duration, from 1 to 1,000,000. Normal effects use seconds and instant effects use ticks. The defaults are 30 seconds or one tick, respectively. |
amplifier | The strength is 0–255. 0 is level I, and 1 is level II. |
hideParticles | Set to true to hide particles. The default is false. |
Examples
Give yourself Speed II for 60 seconds
/effect give @s minecraft:speed 60 1
Open these settings in the generator →
Give yourself permanent Night Vision (Java 1.19.4+)
/effect give @s minecraft:night_vision infinite
Open these settings in the generator →
Clear Poison from all players
/effect clear @a minecraft:poison
Open these settings in the generator →
Versions and targets
infinite requires Java 1.19.4 or later, and @n, which selects the nearest entity, requires Java 1.21 or later.
In chat, @s is yourself. In a command block, target a player with @p or a player name.