Minecraft:Commands/effect: Difference between revisions
From SAS Gaming Wiki
More actions
imported>MinecraftBedrockPlayer7 mNo edit summary |
Remove broken links to missing pages |
||
| Line 4: | Line 4: | ||
* 2 {{only|java|short=1}} | * 2 {{only|java|short=1}} | ||
* 1 {{only|bedrock|short=1}} | * 1 {{only|bedrock|short=1}} | ||
|others= | |others=Cheat only{{only|bedrock|short=1}} | ||
}} | }} | ||
Adds or removes the | Adds or removes the status effects of players and other entities. | ||
== Usage == | == Usage == | ||
| Line 44: | Line 44: | ||
{{argument|effect|resource|effect: Effect|enum}} | {{argument|effect|resource|effect: Effect|enum}} | ||
: Specifies the | : Specifies the effect to be added or removed. | ||
: {{arg desc|je=resource|registry=minecraft:mob_effect|be=enum}} | : {{arg desc|je=resource|registry=minecraft:mob_effect|be=enum}} | ||
| Line 56: | Line 56: | ||
{{argument|hideParticles|bool|hideParticles: Boolean|enum}} | {{argument|hideParticles|bool|hideParticles: Boolean|enum}} | ||
: Specifies whether the | : Specifies whether the particles and the HUD indicator{{only|java}} of the status effect should be hidden. If not specified, defaults to <code>false</code>. | ||
: {{arg desc|je=bool|be=bool}} | : {{arg desc|je=bool|be=bool}} | ||
| Line 87: | Line 87: | ||
![[Minecraft:Bedrock Edition]] | ![[Minecraft:Bedrock Edition]] | ||
|- | |- | ||
|To grant a | |To grant a Resistance V effect to the current entity for 1 million seconds, hiding particles: | ||
|<code>effect give @s minecraft:resistance 1000000 4 true</code> | |<code>effect give @s minecraft:resistance 1000000 4 true</code> | ||
|<code>effect @s resistance 1000000 4 true</code> | |<code>effect @s resistance 1000000 4 true</code> | ||
|- | |- | ||
|To grant a | |To grant a Speed II effect to the nearest player for 60 seconds: | ||
|<code>effect give @p minecraft:speed 60 1</code> | |<code>effect give @p minecraft:speed 60 1</code> | ||
|<code>effect @p speed 60 1</code> | |<code>effect @p speed 60 1</code> | ||
| Line 99: | Line 99: | ||
|<code>effect @p speed 60 2</code> | |<code>effect @p speed 60 2</code> | ||
|- | |- | ||
|To clear any | |To clear any Haste effects from all players: | ||
|<code>effect clear @a minecraft:haste</code> | |<code>effect clear @a minecraft:haste</code> | ||
|<code>effect @a haste 0</code> | |<code>effect @a haste 0</code> | ||
| Line 144: | Line 144: | ||
{{Navbox commands}} | {{Navbox commands}} | ||
de:Befehl/effect | |||
es:Comandos/effect | |||
ja:コマンド/effect | |||
ko:명령어/effect | |||
pt:Comandos/effect | |||
ru:Команды консоли/effect | |||
uk:Команди консолі/effect | |||
zh:命令/effect | |||
Latest revision as of 15:43, 9 April 2026
Adds or removes the status effects of players and other entities.
Usage
- Template:IN, 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 is hidden.
- If the new effect has a lower amplifier and a longer duration, the new effect is hidden.
- If their "hideParticles" values are different, the active effect's value is set to the specified value.
- Otherwise, the original active effect is 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.
- Template:IN, 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.
- Template:IN, no matter whether the new effect can override the original effect, "hideParticles" value is always applied.
- Template:IN, if the player uses an NBT editor to get negative levels of effects, the level of the effect jumps to 255 instead.
Syntax
- Java Edition
effect clear [<targets>] [<effect>]- Removes all effects or an effect.
effect give <targets> <effect> [<seconds>] [<amplifier>] [<hideParticles>]- Gives an effect.
effect give <targets> <effect> infinite [<amplifier>] [<hideParticles>]- Gives an effect with infinite duration, which displays as
∞in the GUI.
- Gives an effect with infinite duration, which displays as
- Bedrock Edition
effect <player: target> <effect: Effect> [seconds: int] [amplifier: int] [hideParticles: Boolean]- Gives or removes an effect.
effect <player: target> <effect: Effect> infinite [amplifier: int] [hideParticles: Boolean]- Gives an effect with infinite duration, which displays as
∞in the GUI.
- Gives an effect with infinite duration, which displays as
effect <player: target> clear [effect: Effect]- Removes all effects or an effect.
Arguments
- Specifies the target(s). Template:IN, if not specified, defaults to the player who executes the command.
- Template:Arg desc
- Specifies the effect to be added or removed.
- Template:Arg desc
- Specifies the effect's duration in seconds (or in gameticks for
instant_damage,instant_health, andsaturation). If not specified, defaults to 30 seconds (or 1 gameticks forinstant_damage,instant_health, andsaturation). - Template:Arg desc Template:IN, it must be between 0 and 2147483647 (inclusive), and values higher than 1000000 are treated as 1000000.
- 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.
- Template:Arg desc And it must be between 0 and 255 (inclusive).
- Specifies whether the particles and the HUD indicatorTemplate:Only of the status effect should be hidden. If not specified, defaults to
false. - Template:Arg desc
Result
Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table
Output
Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table
Examples
| Minecraft:Java Edition | Minecraft:Bedrock Edition | |
|---|---|---|
| To grant a Resistance V effect to the current entity for 1 million seconds, hiding particles: | effect give @s minecraft:resistance 1000000 4 true
|
effect @s resistance 1000000 4 true
|
| To grant a Speed II effect to the nearest player for 60 seconds: | effect give @p minecraft:speed 60 1
|
effect @p speed 60 1
|
| To grant a Speed III effect to the nearest player for 60 seconds: | effect give @p minecraft:speed 60 2
|
effect @p speed 60 2
|
| To clear any Haste effects from all players: | effect clear @a minecraft:haste
|
effect @a haste 0
|
| To clear all effects from all Minecraft:zombies: | effect clear @e[type=zombie]
|
effect @e[type=zombie] clear
|
History
Java Edition
Bedrock Edition
References
External links
de:Befehl/effect es:Comandos/effect ja:コマンド/effect ko:명령어/effect pt:Comandos/effect ru:Команды консоли/effect uk:Команди консолі/effect zh:命令/effect