Started by
txrxn
on
Topic category: Help with Minecraft modding (Java Edition)
I have been trying to make a jetpack item that allows you to fly while midair. That works, however i also want the player to move faster while using it. Is there anyway to make the player move faster?
there is a block in entity procedures that allows you to add a potion effect to an entity, you can make it something like: on worn tick add potion haste level 2 for 10 ticks to event/target entity
Does haste increase flight speed?
If not then you could override entity velocity by [get entity velocity] * 1.5 (or any number above 1 to increase the speed) for each x y z or not y depending on what you want and how the jetpack is supposed to work. You could also check for entity velocity so when it reaches max you change the override to setting to the number equal to max velocity otherwise the jetpack will accelerate indefinitely. But for that you would also need to check for when the player stops pressing a movement key in order to slow them down and stop.
To make it a lot easier you could assign a keybind which provides a boost when wearing the jetpack and checking whether that key is pressed determines if the player's velocity is increased.