---
# System prepended metadata

title: Repurposed Allays

---

![Allay Map](https://i.imgur.com/tg3QH0u.png)

# Repurposed Allays

###### Garden of Fancy confidential (or is it?)
~~I would say yes~~

## About

Allows players to ||~~enslave~~|| "repurpose" entities to transfer items, specifically Allays, and maybe Foxes too?

## Lore

*just wrote this in one go, still very much subject to change*

Have you ever wondered if all those creatures you met every day while traveling through the world could do.. more? Well, it turns out you were not the only one asking that question. And so it is of no surprise that sooner or later someone would have an answer. After days and nights of hard work Doctor **TBD** finally finished his work. The work on a device. A device that will change how we precieve creatures forever. The **TBD**: a revolutionary brain stimulating chip, once implanted enabling possibilities no one could have ever dreamed of. 

### TODO
- Figure out name

## How it works

The **MindJack300-DG9BWA-10OH** is used to hijack entities' brains and give them a better purpose - hard work, mostly.

After installing the device on the entity's head, we replace it with our own, better version (with the device equipped). This transition should be seamless.

Hijacked entities can also no longer move on their free will - they are fully under your control.

Upon detach, the entity is replaced with its default version.


### Upgrades

With a custom entity, we should be able to easily add new render layers on top of the existing allay model, as well as ai logic.

- [ ] Additional storage: More inventory slots to store items
- [ ] Additional speed: Currently, the speed multipler is `1.75`, same as when picking up an item. Maybe we could have a jetpack or metal wings? I mean, just imagine a fox with a jetpack
<img src="https://i.imgur.com/0eS6eLk.jpg" width="250px">

### TODO

- Mind Control Device name
- Spawn particles when attached
- When is the right moment to attach the device?
  1. Anytime, the device is strong enough to hijack any entity's mind
  2. Entity must trust the player \[tamed/fed (fox), dancing (allay)]

### Bugfixes

- [ ] Replacing entities will snap them to their exact BlockPos without the decimal offset

## Mob Purposes

Each mob can do different things upon being "enabled".

- Allay: tranfer item from one chest to another (see [The Allay Map](#The-Allay-Map))
- Fox: harvest plants **TBD**
- Bee: flower farming **TBD**
- Dolphin: always swims between fixed places to give the player boost **TBD**

Note: for the mod jam we should concentrate on the Allay. But while at it, we can try to make our system extensible to allow for more additions later on.

## The Allay Map

The **Allay Map** is an item used to guide allays to item pickup/delivery points.
It has a menu, inside which you can configure the input/output sides of targets, for example.

To obtain one, first select the source target by shift-clicking on a valid container block with an empty map. Then, repeat this process with the draft map to turn it into a complete Allay Map.

### TODO

- [X] Are Allay Map locations immutable?
  - Yes they are
- [ ] Should Allay Maps render like normal maps? We can show the chest locations and maybe also the path the Allay will take to get there
- [ ] Should Allays consume the map, kinda like they need it to find their way? In this case we need to be able to reproduce the map, like normal vanilla maps.

## Monitoring

Idea:  
A monitoring device you can use to track the location and status of your allays. Maybe even remotely disable them?

## Chunkloading

Will hijacked entities trigger chunk loading? If not, will they just stop when they move into unloaded zones, or will we  somehow simulate their movement?

# Technical Design

- Replace Mod or just extend it with our own capabilities?
    - Second option feels cleaner but maybe it does not matter in the end?
- Custom registry to store different repurposed mobs? RegistryEntry could be an interface which defines methods to return the information we need.
    - Event handling could then be generic and just try to find the RegistryEntry for the given mob
    - Probably first implement it directly so we know what capabilities the interface even needs to define
