Give yourself a temporary boost with attribute modifiers
Setting a base value overwrites the starting number. A modifier is added on top of it and can be removed cleanly, which makes modifiers better for buffs such as faster swimming or higher jumps.
Add a modifier
1. Type /attribute @s and Tab-complete to one of the added attributes, such as the jump height or water speed one.
2. Add modifier add.
3. Give the modifier a unique ID of your own choosing. This is how you find it again later.
4. Enter the amount.
5. Choose the operation from the Tab list. Your game offers an additive option and one or two multiplier options. The additive one adds a flat amount. The multiplier ones scale the value by a fraction.
Then run /attribute @s <attribute> get to confirm the total changed.
Remove it
Use /attribute @s <attribute> modifier remove <your ID>. The value returns to what it was before.
Good combinations to try
- Water speed plus lung capacity for a diving setup.
- Lava speed with fire resistance for exploring the Nether.
- Jump height to clear taller blocks. Watch your fall damage when you jump from higher up.
- Dropped experience to see how much more XP blocks and mobs give.
If the command says the ID is already in use, pick a different one or remove the old modifier first. Modifier syntax is the same as for vanilla attributes, so datapacks and other mods that apply modifiers to gear can use these attributes too.