How to disable sprint?

Started by BlackAndWhite on

Topic category: Help with Minecraft modding (Java Edition)

Active 1 year ago
Joined Jul 2022
Points:
306

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1
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?

Active 2 years ago
Joined Jul 2022
Points:
328

User statistics:

  • Modifications: 0
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1
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.

Active 3 months ago
Joined Dec 2023
Points:
100

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 16
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.