Expire
A lightweight mod for usage on servers that want items to expire without the drawbacks of a classic mod that ticks every second on every item
How does it work?
at every server startup, the mod will save the current time and will use that as the "reference time" from which every item will start expiring.
reference time = the world time at server startup
current time = the time the mod actually uses to do all of its checks
expiration date = the time at which the item will expire
Usage
everything is explained in the config file, but if you want to use it via code, look at ExpireTime and ItemExpire classes
Advantages
- Cheks based on interactions with world or inventories rather than on tick
- All stacks that share the same expiration date and same reference time are stackable
- The current time update frequency can be changed via the config to give more margin before the item actually expires
- All the APIs will use IRL measures, so one day is 24 real hours
Drawbacks
- While it shines on items that expire after several days, if the server starts at the 00:00, then an item that expired after 5 minutes created at the 00:05 will expire instantly, as 00:00 is the "reference time"
Features
- Configs with live reload and with settings for everything, from custom expiration to auto-set the expiration on certain items
- A command for debugging via
/expire
- The option to choose between the classic "Expired Dust" or the more mysterious "Echo of the crystal"
Licence
zlib license