---
id: envelope:address
icon: envelope:misc/address
title: Address
type: other
related_items: ["envelope:address_tag", "envelope:mailbox"]
infobox:
    inventory: []
---

**Address** is a crucial part of a delivery system, allowing correct routing of mail.

## Usage

### Mailbox
Each [mailbox](@envelope:mailbox) must have an address to be able to send and receive mail.

### Mail
Address is selected and applied to a mailable item using an [address tag](@envelope:address_tag).\
It's also used in a "sender" field and delivery log.

## Types

There are 5 types of addresses:
- <Asset location="envelope:misc/address_block" width={36} /> - **Block**: *mailbox*
- <Asset location="envelope:misc/address_player" width={36} /> - **Player**: *player name; resolves to player's default mailbox*
- <Asset location="envelope:misc/address_service" width={36} /> - **Service**: *NPCs*
- <Asset location="envelope:misc/address_custom" width={36} /> - **Custom**: *for use in commands; cannot receive mail*
- <Asset location="envelope:misc/address_unknown" width={36} /> - **Unknown**: *for cases where address could not be determined or does not exist*

Players would mostly be dealing with **Block**, **Player** and **Service** types in-game.

<Callout variant="info">Service addresses use translations for their names,
and they will work and resolve correctly regardless of the selected language.</Callout>

## Data

### Definition
Addresses can be defined in commands or json like this:

```json json
{ "type":"block", "id":"Mortuus Base" }
{ "type":"player", "name":"mortuusars" }
{ "type":"service", "definition":"envelope:automated_supply_service" }
{ "type":"custom", "name":{ "translate": "entity.minecraft.villager" } }
{ "type":"unknown" }
```

<Callout>
As opposed to the rest of the types which can be defined freely, **service address** needs to be [registered](services#definition) first.
</Callout>

