2

I'm trying to make a vanilla KitPvP server, and I want to make a kit that gives you normal walking speed, but when you are sprinting, you have a speed boost. Is that possible? If so, then how?

1 Answer 1

5

First, add an objective to keep track of whether players are sprinting:

/scoreboard objectives add IsSprinting stat.sprintOneCm

On a clock, give all players with a score in that objective of at least 1 the speed effect:

/effect @a[score_IsSprinting_min=1] speed 1 2

Then, also on the same clock, set the score to 0 for everyone so that the speed boost stops being applied when a player stops sprinting:

/scoreboard players set @a IsSprinting 0
2
  • Awww, Colorfusion, you steal all the positions for my answers :D
    – user143228
    Commented Jun 14, 2016 at 17:11
  • 1.13 syntax: minecraft.custom:minecraft.sprint_one_cm instead of stat.sprint_one_cm and the middle command becomes /effect give @a[scores={isSprinting=1..}] speed 1 2
    – pppery
    Commented Aug 20, 2018 at 22:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.