Possible to enable flight

CanaryMod related discussions

Possible to enable flight

Postby dropbear42 » Thu Oct 20, 2016 2:14 am

Hi there,

This may be a very newby question, but is there any API to enable player flight? We're using ScriptCraft with CanaryMod and it doesn't appear to be possible. There are clear APIs in Bukkit.

Maybe I'm having a "man look"?

Cheers
Stephen
dropbear42
 
Posts: 4
Joined: Fri Sep 16, 2016 12:49 am

Re: Possible to enable flight

Postby WWOL » Sat Oct 22, 2016 8:24 am

I think it was (where player is a Player variable)
player.getCapabilities().setMayFly(true);

And to update the client of this info (may be needed)

player.updateCapabilities();

I'm unsure of how scriptcraft works but these are the Java APIs if scriptcraft can access them.
User avatar
WWOL
 
Posts: 12
Joined: Wed Sep 02, 2015 2:12 am

Re: Possible to enable flight

Postby dropbear42 » Sun Oct 23, 2016 12:29 am

Thanks.

I'd tried step 1. I'll add the updateCapabilities set to see if that is the problem.

Appreciate the help

Cheers
Stephen
dropbear42
 
Posts: 4
Joined: Fri Sep 16, 2016 12:49 am


Return to Discussions

Who is online

Users browsing this forum: No registered users and 10 guests