This is a discussion topic for the Ore project, RottenFood. View the full project on Ore for downloads and more information.
RottenFood
Gives items the abillity to age. You can configurate any item to change as time goes on.
Download
The download here is for SpongeAPI-6.0.0! If you want a version for SpongeAPI-5.1.0 there are more releases on GitHub
Examples
(Those are things you can do, using the plugins config)
steaks that you store in a chest can become rotten_flesh after a week if you don’t eat them
all potatoes could suddenly be poisonous if you logged-off for a month
flowers that you just put in some chest instead of planting them can dry out (become dead bushes) after 3 days without water and sunlight
This Steak just got cooked and taken out of a furnace:
And this one is 4,5 hours old:
And if you’d wait even longer the stack would change to rotten flesh!
Also, it’s possible to change the aging speed of an item by putting it together with other items in a chest. With that you can e.g. “cool” your steaks with ice so they last 10 times longer…
Amazing idea! I am having an error when starting my server and the plugin isn’t loading. I submitted an issue ticket on github for ya to look at with pastebins of the error.
I still have some questions. For example, if I give my food to others, will this food still rot according to the previous recording? And, if I set ice will “rot”, will the action, that a player places the ice block on the ground, reset the recording of rotting?
[17:55:55 WARN] [Sponge]: rottenfood: It is no longer required to include the plugin id when specifying a Key id through Key.Builder#id. This is deprecated and may be removed later. The plugin id will be retrieved from the current PluginContainer in the cause stack. Key: SpongeKey{name=RottenFood Update Time, id=rottenfood:update_time, valueToken=org.spongepowered.api.data.value.mutable.Value<java.lang.Long>, elementToken=java.lang.Long, query=rotten.updateTime}
You look to be still coming on the forum, I hope you will see this message
Made a quick fix and released it here: Releases · TBlueF/RottenFood · GitHub
Didn’t had the time to test it much though, make a backup and tell me if you get any issues
Do you plan to move config file to a dedicated folder ?
Also, you advice to use /sponge reload plugins but it’s not really convenient because it reload all plugins. As you already have the reload mechanism, maybe you could add a /rottenfood reload command ?
Anyway, I will share my config file when it’s done
The problem with this is that currently RottenFood only supports ItemTypes and not ItemStates … that means that it is only possible to use e.g. “minecraft:dye” (any color) but not a specific color like white (bone-meal) in your case.
There is a branch in git where i tried to implement the support of ItemStates, but I ran into some issues with comparing items and than didn’t find the time or motivation to continue…
So until my time/motivation comes back, or someone else implements this, using items with data sadly isn’t possible.