Minecraft Effect Command Generator

Two things trip people up with /effect: the amplifier is one lower than the level shown in game, and the duration is in seconds, not ticks, which is the opposite of potion item data. Set both visually here, use the infinite keyword where the version supports it, and hide the particles when the effect is a game mechanic rather than a visual.

Read the matching guide

Java 26.2

Effects

Speed

Apply to @p

/effect give @p minecraft:speed 30 0 false