Filled Food Expiration

Discussion in 'Plugin Requests' started by Attune, Jul 12, 2017.

Thread Status:
Not open for further replies.
  1. Offline

    Attune

    Plugin category: Roleplaying / Economy

    Minecraft version: 1.11.2 +

    Suggested name: Food Expiration

    What I want: I'd like to see a plugin created where food has a set amount of time before it expires, which in turn causes harm to any players who eat any food past it's prime. Preventing players from stockpiling thousands of pork chops in a chest for all of the eternity, creating a necessity to farm. I've seen one or two similar plugins, but they are not quite what I'm looking for or seemingly abandoned.

    Mechanics:

    As soon as a food item is created/spawned a count-down starts on the item and a timer can be seen while hovering over the food item. (set in hours and minutes)

    The timer counts down until the food is prepared (cooked, crafted, etc)

    Configerable expiration times for every food item/ingredient used in food crafting

    Allow for the creation of "barrels" to extend food life for a configurable amount of time, when removed it resumes to it's natural expiration time (chest surrounded in wooden planks for a recipe?)

    Eating expired foods cause an array of configurable ailments with configurable times including; hunger, blindness, nausea, poison, or wither effects, weakness, mining fatigue, or slowness.

    Permissions to cook/prepare food


    Ideas for commands: (Can't think of any necessary commands)

    Ideas for permissions:

    - food.expiration.craft (allows for work bench food)
    - food.expiration.cook (allows for furance cooking)
    - food.expiration.barrel (allows for barrel creation)

    All i can think of right now

    When I'd like it by: Before August would be great, but however long it takes to create the optimal version is fine with me :)

    Thank for taking your time to read this, I think it would be a great addition to roleplay servers of all kinds!
     
  2. Offline

    htmlman1

    [​IMG]
     
    Matroxko and C.L. like this.
  3. Offline

    Attune

    Awesome to hear!
     
  4. Offline

    Attune

    Any progress? (Assuming that gif meant you had an interest in making it)




    If not anyone else interested in making the plugin?
     
  5. Offline

    htmlman1

    Okay - finished the first build of the plugin:

    The plugin will generate a config file with complete instructions for configuration, but feel free to ask if I wasn't clear enough. I've only added one command - /expiration - which serves to load any changes to said config.
     
  6. Offline

    Attune

    Awesome!

    Going to test it out now thanks! :)

    Everything is working very well so far, just minor things I noticed:

    1. Cake, Hayblocks and Melon Blocks, Sugarcane do not expire.

    - Since they are blocks I'm not sure if you can do it the same way as everything else. If not, maybe make it so you can't turn expired hayblocks into wheat, but could still use them as a building block. For cake and melons, maybe just restrict placement for expired and melon blocks? For Sugarcane restrict placement and crafting of sugar?

    2. Permissions restrictions

    - Sorry, this one is my bad for not specifying it before, but instead of restricting the use of workbench and furnace interaction, I was hoping to only restrict the recipes to craft food items and the ability to place cookable foods in furnaces.

    3. Timer

    - Add the words "Expires in..." above the timer so players know what the countdown on their food is for.

    That's it, everything else seemed to be working great!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 26, 2017
  7. Offline

    htmlman1

    Got it - I'll fix those issues ASAP.
     
  8. Offline

    Attune

    Thanks!
     
  9. Offline

    Attune

    Sorry one last thing I noticed.

    Would it be possible to make food stacks with different expiration times and the stack takes the item with the lowest timer?

    For instance:

    10 wheat = 10 mins
    +
    8 wheat = 9 mins

    = 18 wheat with 9 mins


    As it is currently, when a player is farming, it creates various stacks of items when a player is farming with multiple stacks of wheat with only 3-4 in each stack.
     
  10. Offline

    htmlman1

    Sure, though that feature's a bit more complicated. Just wanted to let you know because it'll bump up production time. Shouldn't be slower by much, though.

    As for hay blocks, etc., I've made it so that players can place blocks, and the items that are there when dropped will still display an expiration time - meaning that once placed, a hay block could still be picked up as [EXPIRED] after its time is up. That way, players still can't bypass the timers.

    Just working on some permissions stuff now - but I'll add your stack request in as well!
     
  11. Offline

    Attune

    Thanks man, this plugin is great ^-^
     
  12. Offline

    htmlman1

    Alright, I've finished all the item-related features you asked for! Blocks now expire like items would, after placement, and picking up one perishable item will stack it on top of any others of its kind already present in the player's inventory.

    I've also taken a look at permissions, though they worked fine before on my test server and I couldn't really see any changes to make. Could I ask what permissions plugin you're using?

    In the meantime, here's a fresh download link:

     
  13. Offline

    Attune

    Sure thing, I'm using permissionsex. Trying out the plugin now.

    Everything seems great!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 26, 2017
  14. Offline

    htmlman1

    Awesome - let me know if perms are working too!
     
  15. Offline

    Attune

    Sorry for the late response, my internet was down for about a week :/

    Anyways, the perms still restrict furnace interaction as opposed to certain objects.

    It's alright though I have no problems leaving the plugin as just simply the expiration and barrels without the other perms. Though there is one tweak I'd like to add to the barrels if possible! Instead of having them as craftable items, could you make it so they are purchasable for a configurable amount instead?

    /expiration buy barrel (amount) or something along those lines

    also if possible forbid players in creative from doing the command.


    Other than that, the plugin is working as intended, and the food expiration and barrels work perfectly!


    EDIT: Cooking expired raw meeat resets the timer
     
    Last edited: Aug 3, 2017
  16. Offline

    htmlman1

    Sorry - my turn to lose Internet access for a while; I was out of the country for the past two weeks.

    I'll look at the permissions, though to be very frank I'm pretty jetlagged at the moment. I'll get back to you soon (preferably after a very long nap), just wanted to let you know I'd seen this.
     
Thread Status:
Not open for further replies.

Share This Page