How to disable sprint?

Started by BlackAndWhite on

Topic category: Help with modding (Java Edition)

Last seen on 20:28, 3. Jan 2024
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to disable sprint?

Can please someone help me with making procedure that will disable sprint for player when he wears an armor? Is it possible?

Last seen on 21:46, 29. Dec 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can do something like: …
Sat, 07/23/2022 - 01:34

You can do something like:

Event Trigger - (on player update tick)

while

Get Item from Armor Slot 0 of Event/Target Entity = (custom armor boots)
and
Get Item from Armor Slot 1 of Event/Target Entity = (custom armor leggings)
and
Get Item from Armor Slot 2 of Event/Target Entity = (custom armor chestplate)
and
Get Item from Armor Slot 3 of Event/Target Entity = (custom armor helmet)

do

Set sprinting of Event/Target Entity to false

For every tick the player is wearing a full set of your custom armor, the script will set the sprint state to false. IF the player tries to sprint, it will immediately set the sprint state to false. I have not tested the script, so I do not know of any errors currently.

Last seen on 22:48, 24. Apr 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You could give them slowness…
Sat, 02/10/2024 - 18:58

You could give them slowness I. This actually won't slow the player's walking speed down, but it will stop them from sprinting.