Minecraft Wiki
Advertisement
Minecraft Wiki
effect
Permission level
required

2‌[JE only]
1‌[BE only]

Restrictions

Cheat only‌[BE only]

Add or remove status effects on players and other entities.

Syntax[]

  • Java Edition
effect clear [<targets>] [<effect>]
Removes an effect.
effect give <targets> <effect> [<seconds>] [<amplifier>] [<hideParticles>]
Gives an effect.
  • Bedrock Edition
effect <player: target> clear
Removes all effects.
effect <player: target> <effect: Effect> [seconds: int] [amplifier: int] [hideParticles: Boolean]
Gives or removes an effect.

Arguments[]

JE<targets>: entity
BE: player: target: CommandSelector<Actor>

Specifies the target(s). In Bedrock Edition, if not specified, defaults to the player who executes the command.
Must be a player name, a target selector or a UUID[Java Edition only].

JE<effect>: mob_effect
BE: effect: Effect

Specifies the effect to be added or removed.

JE<seconds>: integer
BE: seconds: int: int

Specifies the effect's duration in seconds (or in gameticks for instant_damage, instant_health, and saturation). If not specified, defaults to 30 seconds (or 1 gameticks for instant_damage, instant_health, and saturation). In Java Edition, any duration greater than or equal to 1639 will display as '**:**' in the player's inventory (while still counting down).
Must be a 32-bit integer number. In Java Edition, it must be between 0 and 1000000 (inclusive). In Bedrock Edition, it must be between 0 and 2147483647 (inclusive), and values higher than 1000000 are treated as 1000000.

JE<amplifier>: integer
BE: amplifier: int: int

Specifies the number of additional levels to add to the effect. If not specified, defaults to 0. Note that the first tier of a status effect (e.g. Regeneration I) is 0, so the second tier, for example Regeneration II, would be specified by an amplifier level of 1.
Must be a 32-bit integer number. And it must be between 0 and 255 (inclusive).

JE<hideParticles>: bool
BE: hideParticles: Boolean: bool

Specifies whether the particles and the HUD indicator‌[Java Edition only] of the status effect should be hidden. If not specified, defaults to false.

Result[]

CommandTriggerJava EditionBedrock Edition
anythe arguments are not specified correctly Unparseable Failed
<targets> or player: target fails to resolve to one or more entities (named player must be online) Failed
/effect give ...All the selected entities meets one or more of the following conditions:
  • the entity is immune to the specified effect.
  • the entity already has a status effect with the same id and the same "hideParticles" value, but the new effect doesn't has a higher amplifier or a shorter duration than it.
  • the entity already has a status effect with the same id and the same "hideParticles" value, and the new effect has a lower amplifier and a longer duration than it.
Successful
/effect clear<targets> is not specified when the command's executor is not a player N/A
/effect clear ...there's no effect removed from any entity
/effect ... clearthere's no effect removed from any entity N/A Failed
anyOn successRemoves or gives the specified effect(s).

Output[]

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn fail000
On success11the number of entities that are given or revoked effect(s).
Bedrock EditionOn fail0N/AN/A
On successthe number of entities that are given or revoked effect(s).N/AN/A

Note[]

In Java Edition, if a target already has a status effect with the same id, a new effect only with a longer duration or a higher amplifier can be added.
  • If the new effect has a higher amplifier and a shorter duration, the original effect will be hidden.
  • If the new effect has a lower amplifier and a longer duration, the new effect will be hidden.
    • If their "hideParticles" values are different, the active effect's value will be set to the specified value.
  • Otherwise, the original active effect will be replaced by the new effect, without changing hidden effects.
Only if the active effect is changed does the command succeed, no matter whether the hidden effects are changed or not.
In Bedrock Edition, if a target already has the status effect, a new status effect with the same amplifier overrides the old duration if it is longer, but a new status effect with a higher amplifier overrides any previous effect.

Examples[]

  • To grant a Resistance V effect to the current entity for 1 million seconds, hiding particles: effect give @s minecraft:resistance 1000000 4 true[Java Edition only] or effect @s resistance 1000000 4 true[Bedrock Edition only]
  • To grant a Speed II effect to the nearest player for 60 seconds: effect give @p minecraft:speed 60 1[Java Edition only] or effect @p speed 60 1[Bedrock Edition only]
  • To grant a Speed III effect to the nearest player for 60 seconds: effect give @p minecraft:speed 60 2[Java Edition only] or effect @p speed 60 2[Bedrock Edition only]
  • To clear any Haste effects from all players: effect clear @a minecraft:haste[Java Edition only] or effect @a haste 0[Bedrock Edition only]
  • To clear all effects from all zombies: effect clear @e[type=zombie][Java Edition only] or effect @e[type=zombie] clear[Bedrock Edition only]

History[]

Java Edition
1.513w09bAdded /effect.
1.6.1preAdded clear argument to /effect.
1.814w06aAdded hideParticles argument to /effect
1.15.2Pre-Release 1When a stronger effect overwrites a weaker effect, the weaker effect now are hidden.[1]
Pocket Edition
1.0.5alpha 1.0.5.0Added /effect.
alpha 1.0.5.3The amplifier on /effect can no longer have negative values.
Bedrock Edition
?Max value for <seconds> argument was changed to 32 bit integer limit, although gives effect only at 2040109465 or below.
1.16.200beta 1.16.200.52Duration is now capped at 1,000,000 seconds .
Advertisement