Files
spigot-tyrant/design/user-stories/us-007-capture-and-place-mobs.md
T
dmg 80810b3ba1
Release / release (push) Successful in 2m42s
CI / build (push) Successful in 1m11s
feat(tamer): limit custody to one mob
2026-08-21 21:47:42 -04:00

46 lines
3.3 KiB
Markdown

---
type: User Story
title: "US-007: Capture and place mobs as a Tamer"
description: Let the Tamer move supported mobs without losing or duplicating them.
status: done
---
# US-007: Capture and place mobs as a Tamer
As the **Tamer**, I want to capture a mob and release it elsewhere so that I can relocate creatures safely.
## Acceptance criteria
- [x] The Tamer can use a named fishing rod on a supported targeted mob to capture it with no cooldown.
- [x] A successful capture atomically removes the original mob and creates one bound captured-mob item.
- [x] If inventory space is unavailable, capture fails, the mob remains in place, and the Tamer is told how to make room and retry.
- [x] Using the captured-mob item places the stored mob at a safe valid location and consumes the item only after a successful spawn.
- [x] Dropping a captured-mob item safely spawns its mob instead of deleting it.
- [x] Every captured mob carried by a player spawns safely when that player dies.
- [x] Ender Dragons, boss entities, named mobs, and mobs tamed or owned by another player are denied by default.
- [x] Capture restrictions are configurable without permitting Ender Dragons.
- [x] Invalid placement, full inventory, death, logout, restart, plugin disable, containers, and concurrent interaction cannot lose or duplicate a mob.
- [x] Stored mob data is validated defensively before spawning and cannot execute untrusted serialized behavior.
- [x] When a player loses the Tamer class, every captured mob in their custody is automatically released at the former Tamer's location.
- [x] Ordinary inventory items are not dropped or changed during automatic release.
- [x] Each captured-mob item and custody record is removed only after its mob spawns successfully.
- [x] Multiple captured mobs are released without duplicating entities or custody records.
- [x] If the former Tamer is offline or no safe release location is available, release is deferred without losing the captured mob.
- [x] A deferred release is retried when the former Tamer next logs in or reaches a safe location.
- [x] Tyrant death, class reassignment, opt-out, administration, and other Tamer-removal paths use the same release behavior.
- [x] A Tamer can hold custody of at most one captured mob at a time.
- [x] Attempting to capture another mob while one is held is rejected before changing either mob.
- [x] The Tamer is told to release the currently captured mob before capturing another.
- [x] Releasing or dropping the held mob immediately allows another capture.
- [x] The one-mob limit survives logout, restart, item recovery, and repeated or concurrent interaction.
- [x] If legacy state contains multiple captured mobs, extras are safely released when possible; custody is retained until release succeeds so no mob is lost.
## Validation
Automated tests verify that only former Tamers are processed, offline custody remains deferred, successful releases remove only their corresponding custody records, and failed releases remain available for retry. Additional tests verify pre-mutation rejection of a second capture, clear player guidance, and safe reduction of legacy excess custody. The complete `./gradlew clean check jar` lifecycle passes.
## Related
- [Use class ability items](us-014-use-class-ability-items.md)
- [Persistence model](../concepts/persistence-model.md)