• Hey! Register here to create your account, engage with the community, and talk about what is new!

Player event for landing after flying with elytra

ibiteni

New member
Joined
May 16, 2022
Messages
8
Reaction score
0
i've been coding smth with Stop Flight player event for a few hours only to realise it tests for creative flight not elytra flight (the icon confused me) and now i'm sad lol. maybe there's a way to do that and i just don't know about it?
 

Electric

Support staff
Support
Joined
Dec 6, 2020
Messages
2
Reaction score
2
There is a pretty simple way of doing this, although not a player event. If you constantly check the If Player: Is Gliding, and check when it is no longer true, you can detect when they land.
 

ibiteni

New member
Joined
May 16, 2022
Messages
8
Reaction score
0
There is a pretty simple way of doing this, although not a player event. If you constantly check the If Player: Is Gliding, and check when it is no longer true, you can detect when they land.
I’ve found this solution since i opened the thread, but i didn’t implement it bc last time i tried to make an infinite loop it threw an error. Is that actually how it’s done?
 

Speeder323

Senior Moderator
Senior Moderator
Joined
Sep 17, 2020
Messages
176
Reaction score
33
I’ve found this solution since i opened the thread, but i didn’t implement it bc last time i tried to make an infinite loop it threw an error. Is that actually how it’s done?
I believe you can simply have code on Player Event StopFly, since it's not related to creative mode flying but elytra flying.
But you can do StartFly,
then have a Repeat While (IfPlayer IsGliding) {
Control: Wait (1t)
}

...code here you want to run.
 
Last edited:

ibiteni

New member
Joined
May 16, 2022
Messages
8
Reaction score
0
I believe you can simply have code on Player Event StopFly, since it's not related to creative mode flying but elytra flying.
excuse me, did you read my first post? StopFly is about creative flight, i’ve tested it
 

Speeder323

Senior Moderator
Senior Moderator
Joined
Sep 17, 2020
Messages
176
Reaction score
33
Whoops. That's what I get for quickreading in school.
Player Event Join → Start Process elytracheck

PROCESS elytracheck
Repeat forever {
Control Wait (1t) /Prevent getting stopped by lagslayer while waiting for the player to glide
If Player (Is Gliding) { /Check if the player is gliding
Repeat While (If Player (Is Gliding)){
Control Wait 1t /Wait for the player to stop gliding
}
<Insert code here that you want to run upon the player stopping flight>
}
}
 

ibiteni

New member
Joined
May 16, 2022
Messages
8
Reaction score
0
Whoops. That's what I get for quickreading in school.
Player Event Join → Start Process elytracheck

PROCESS elytracheck
Repeat forever {
Control Wait (1t) /Prevent getting stopped by lagslayer while waiting for the player to glide
If Player (Is Gliding) { /Check if the player is gliding
Repeat While (If Player (Is Gliding)){
Control Wait 1t /Wait for the player to stop gliding
}
<Insert code here that you want to run upon the player stopping flight>
}
}
oh thank you!
 
Top Bottom