Services

Services

envelope:misc/services
Source modEnvelope
IDenvelope:services
TypOther

Services are virtual recipients that can receive and handle mail.

List of services

Envelope currently has 3 services:

Mail Service

envelope:gui/address_mail_service Mail Service is a special address that is used for mail infrastructure related correspondence.

It has several mailing recipes:

Mail Service also sends a Courier Death Notice to the sender's mailbox, when a courier dies while delivering.

envelope:service/courier_death_notice
Courier Death Notice

Automated Supply Service

envelope:gui/address_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

envelope:gui/address_service 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.

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:

envelope:mailing/mail_service/payback_tag.json
{
"type": "envelope:mail_crafting",
"address": "envelope:mail_service",
"ingredients": [
{
"item": "envelope:address_tag"
},
{
"tag": "c:dyes/red"
}
],
"result": {
"count": 1,
"id": "envelope:payback_tag"
}
}
envelope:service/mailing
Mailing recipes shown in JEI

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:

data/envelope/envelope/service_address/mail_service.json
{
"name": { // translation key or literal 'text'
"translate": "address.envelope.mail_service"
},
"icon": "", // optional
"location": { // see further below
"type": "relative",
"distance": 0
}
}

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.


Envelope 
Blocks
Entities
Items
Structures