Services are virtual recipients that can receive and handle mail.
List of services
Envelope currently has 3 services:
Mail Service
Mail Service is a special address that is used for mail infrastructure related correspondence.
It has several mailing recipes:
- Letter broadcasting
- Seal stamps with unique dies
- Lost mail
- Payback tag
- Payback request cancelling
Mail Service also sends a Courier Death Notice to the sender's mailbox, when a courier dies while delivering.
Automated Supply Service
Automated Supply Service is a purely crafting oriented address.
It has various recipes like rotten flesh to leather, saddle,
name tag, alternative book and quill and letter and quill, etc.
Equine Assurance Bureau
Equine Assurance Bureau sends spam letters asking players for a block of gold.
Spam letter has a chance of being sent when player tames an animal.
Horse-like mobs have a 100% chance to trigger it, other animals only 20%.
Each letter sent or block of gold received also lowers the chance of the next one.
Sending the gold (mild spoiler)
Sending a block of gold to Equine Assurance Bureau will result in golden horse armor being sent back.
Info
Equine Assurance Bureau is hidden from address suggestions. Players need to manually type it's name into an address tag.
When typed correctly, address icon in the tag interface will change to the 'service':
Mailing
All service addresses support mail crafting recipes by default.
Sending a package with items to an address will produce a result if matching recipe is found.
Multiple crafting operations can be done with a single package.
If some if the items were unprocessed, they will be returned using the sender's courier and crafting results will arrive with a service courier.
Recipe Definition
Mailing recipes are defined similarly to the vanilla shapeless recipes:
{"type": "envelope:mail_crafting","address": "envelope:mail_service","ingredients": [{"item": "envelope:address_tag"},{"tag": "c:dyes/red"}],"result": {"count": 1,"id": "envelope:payback_tag"}}
Definition
For the game to know about a service, it's definition must be registered.
To register a definition, json file needs to be created in the data/<namespace>/envelope/service_address/ folder.
For example:
{"name": { // translation key or literal 'text'"translate": "address.envelope.mail_service"},"icon": "", // optional"location": { // see further below"type": "relative","distance": 0}}
Info
Mail service uses "
\uEE05" in combination with custom font to display a unique icon.location controls delivery duration and is calculated relative to the mail hub.
Possible definitions:
"location": {"type": "relative","distance": 500}
Note that service address by itself doesn't do anything, it's meant to be used in combination with mailing recipes or custom mail handlers to be useful.
Custom Handlers
Custom mail drop off handlers can be registered in code (from another java mod, that depends on Envelope) or using a KubeJS.