Updated:
1. Feather jump (Java 1.20.5+)
Put this in a repeating, always active command block:
/execute as @a if items entity @s weapon.mainhand minecraft:feather run effect give @s minecraft:jump_boost 1 2 true
The one-second duration means the effect ends as soon as the feather is put away.
2. Other slots
| Slot | Syntax |
|---|---|
| Main hand | weapon.mainhand |
| Offhand | weapon.offhand |
| Armor | armor.head, armor.chest, armor.legs, armor.feet |
| Anywhere in inventory | container.* |
/execute as @a if items entity @s armor.feet minecraft:golden_boots run effect give @s minecraft:speed 1 1 true
3. Only a special item
/give @s minecraft:blaze_rod[custom_name="Fire Wand",custom_data={fire_wand:1b}]
/execute as @a if items entity @s weapon.mainhand minecraft:blaze_rod[custom_data~{fire_wand:1b}] at @s run particle minecraft:flame ~ ~1 ~ 0.3 0.5 0.3 0 5
The ~ in custom_data~{...} means a partial match: the item only needs to contain fire_wand:1b, so a renamed or enchanted wand still works. A plain blaze rod without the tag is ignored. See custom items and the particle command.
4. Bedrock
/effect @a[hasitem={item=feather,location=slot.weapon.mainhand}] jump_boost 1 2 true
Leave out location to match the item anywhere in the inventory.
Troubleshooting
- if items error: needs Java 1.20.5 or later.
- Effect lingers: keep the duration at one or two seconds.
- Special item ignored: the custom_data in /give and the check must match.
Check your command
The Command Error Doctor checks common syntax mistakes in your browser.