How to disable sprint?

Started by BlackAndWhite on Mon, 07/18/2022 - 16:22

Topic category: Help with modding (Java Edition)

Last seen on 18:01, 2. Oct 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How to disable sprint?
Mon, 07/18/2022 - 16:22

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 22:19, 23. Jul 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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.