Fly For Food
Fly for Food
I wanted a realistic flying plugin. Most plugins I found had to be activated with a command and when activated players where invincible. Fly for Food enables players on a server to fly per right mouse click when they have a feather in their hand.
While it is not possible with the bukkit API (at least for me) to make a player vincible while flying, the flight mode will be automatically disabled when he lands. Further while flying the players food level decreases for the distance and time he flys. If the food level reaches 0, the flight mode will be deactivated.
My main purpose was to make a flight plugin that is as realistic as possible, please feel free to give constructive critique. If you have a good idea how to improve the pluging I will consider to implement it.
Features
- Activates flying with right click when a player has a feather in his hand.
- Flying costs food, it is calculated from time and distance.
Permissions
permission | description | default |
---|---|---|
flyforfood.fly | Allows a player to use a feather to fly (by default flying is allowed) | true |
flyforfood.freeflight | If set, flying will not cause hunger (by default flying causes hunger) | false |
config.yml
With the two parameters cost_distance and cost_time in config.yml you can control how much flying costs. The values are in percent to the default setting.
The default config.yml will be created at you-plugin-folder/Fly for Food/config.yml and looks like that:
cost_distance: 100 cost_time: 100 console_output: false player_messages: true player_message_start: You spread your wings, have fun and don't forget to eat! player_message_landed: You landed. player_message_no_food: You are too hungry to fly! player_message_no_food_while_flying: You are too hungry to fly, you had to fold your wings.
Commands
If you are searching for a plugin where you can toggle flight mode with a command, you should take a look at http://dev.bukkit.org/server-mods/dyrofly/
@Nickbbeezy Hm, I can disable fly mode if a player drops the feather. But require it to be in hand? What if a player accidentally touches the scrool wheel?
What I dislike most is that while flying, a player is invincible ... But it seems there is no way around this yet.
Can you add an option to require the feather to be in their hand in order for them to fly as well? Players can just get rid of the feather after toggling their flight.
@receter
Thanks :D It's perfect now
@lipe124
I will upload an update today, it may take some time to get approved.
2:04:56 AM CONSOLE: [INFO] foodLevelDifference 7 Food. 12:04:56 AM CONSOLE: [INFO] event.getFoodLevel() 14 Food. 12:04:56 AM CONSOLE: [INFO] player.getFoodLevel() 7 Food. 12:04:56 AM CONSOLE: [INFO] fp.fineFoodLevel 7.579095265517577 Food. 12:04:58 AM CONSOLE: [INFO] foodLevelDifference 6 Food. 12:04:58 AM CONSOLE: [INFO] event.getFoodLevel() 20 Food. 12:04:58 AM CONSOLE: [INFO] player.getFoodLevel() 14 Food. 12:04:58 AM CONSOLE: [INFO] fp.fineFoodLevel 14.414567379101488 Food. 12:05:40 AM CONSOLE: [INFO] foodLevelDifference 6 Food. 12:05:40 AM CONSOLE: [INFO] event.getFoodLevel() 20 Food. 12:05:40 AM CONSOLE: [INFO] player.getFoodLevel() 14 Food. 12:05:40 AM CONSOLE: [INFO] fp.fineFoodLevel 14.711993237299135 Food.
PLEASE!!! Can you take this out already.
@fakmin
I'm blind I'm sorry: D
hi how is it possible that players fly even when do not have permission
Suggestion : permissions for diffrent level of food cost , so that diffrent players can have different cost.
Hello, Found a conflict between the mod and the creative gamemode. As an admin that spend a lot of his free time to go around flying to help players, it's pretty annoying.
Also since you can't eat in creative mode it is really a pain in the....
@diannetea
Will fix this as soon as I have some time.
I was just going to post the same thing Mercury92 did. Please fix this
This is what I have been looking for! Thank you so very much. Keep up the good work!
I love this plugin already! Imma use it for a skylands world so players can get around (: But the only thing I can think of to add is an option to not let players eat while they are flying.
Getting debug code in console with console_output: false
occurs on eat
http://pastie.org/7898658
It would be cool to be able to define multiple items that could be used, each with their on attributes. Here are some possibilities:
- cost_distance - cost_time - if you have to keep holding the item - if the item must remain in inventory - if item is consumed on use - if the item must periodically consume another item to keep flying - custom messages - how fast you can fly - how high you can fly - whether you take damage if you fall.
If you've ever used IBICF, it would be awesome if a "shift to fly super fast" option was available as well.
I know some of these suggestions are sort of getting away from "fly for food" so they may not be appropriate, but I wanted to share just in case.
Anyway, great plugin. Thanks for making it!
It will be great if you can allow us to set the minimum hunger needed to fly.
@Maxiride
I agree. A custom item would be awesome.
Thanks for the great plugin!
What about making flying possibile with a custom item? So for instance at a shop players are able to buy a unique item non craftable and non findable in game which is needed to fly. So flying will be allowed only to player with some rights.
Is this possbile?
I just uploaded a new version, it will be online as soon as it gets approved.
@receter
sweet, cant wait