> For the complete documentation index, see [llms.txt](https://donkolia.gitbook.io/minesantum/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://donkolia.gitbook.io/minesantum/santumspawn.md).

# SantumSpawn

{% embed url="<https://www.youtube.com/watch?v=qv2c26dF7eQ>" %}

A Minecraft plugin to spawn MythicMobs creatures with exclusive visibility and targeting for a specific player or their MMOCore party.

## ✨ Features

* 🎯 **Persistent Targeting**: The mobs attack **only** the specified player
* 👁️ **Exclusive Visibility**: Only the target player can see the spawned mobs
* 🔒 **Continuous Enforcement**: The system checks and forces the targeting every tick (20 times/second)
* 🛡️ **Change Resistant**: Other players cannot "steal" the mob's aggro
* 🔄 **Persistence**: It works even if the player leaves and rejoins the server
* 📊 **Multiple Mobs**: Support for spawning several mobs at once

## 📦 Requirements

* **Minecraft**: 1.21.4
* **Java**: 21
* **Server**: Paper, Spigot or derivatives
* **Plugins**: MythicMobs, ProtocolLib, MMOCore (Optional, for party support)

## 🔧 Installation

1. Download the file `SantumSpawn-1.0-SNAPSHOT.jar`
2. Place the file in your server's `plugins` folder
3. Restart the server
4. Done!

## 📖 Usage

### Command

```
/santumspawn <mythicmobname> X Y Z <playername> [size]
```

### Parameters

* `<mythicmobname>`: Name of the MythicMob to spawn
* `X Y Z`: Coordinates where the mob will spawn
* `<playername>`: Name of the player who will see and be attacked by the mob
* `[size]`: (Optional) Amount of mobs to spawn (default: 1)

### Examples

```bash
# Spawn a single mob
/santumspawn prueba 124 85 802 DonKolia

# Spawn 5 mobs of the same type
/santumspawn prueba 124 85 802 DonKolia 5
```

## 🎮 Behavior

### Party System (MMOCore) 🆕

The plugin automatically integrates with the MMOCore party system:

* **Automatic Detection**: The plugin detects if the target player is in a party
* **Shared Visibility**: All party members can see the mob
* **Shared Targeting**: The mob will attack the target player or any member of their party who is nearby
* **Dynamic**:
  * If someone **joins** the party -> They see the mob and can be attacked
  * If someone **leaves** the party -> They stop seeing the mob and the mob stops attacking them
  * If someone **reconnects** -> They maintain the correct state depending on whether they are still in the party

### Exclusive Targeting

* The mob only attacks the specified player **and their party**
* Other players outside the party **cannot** be attacked by the mob, even if:
  * They are closer to the mob
  * They attack the mob
  * The target player is far away

### Visibility

* Only the specified player **and their party** can **see** the mob
* Other external players do not see the entity at all

### Enforcement System

The plugin uses a continuous enforcement system that:

* Runs every tick (20 times per second)
* Checks that the mob has the correct target
* Forces the targeting if it has changed
* Automatically cleans up dead or invalid mobs

## 🔧 Technical Details

### Architecture

* **VisibilityManager**: Manages the visibility of the mobs every tick
* **TargetEnforcementTask**: Forces the correct targeting every tick
* **SpawnCommand**: Handles the command and registers the mobs

### API Used

* MythicMobs API for spawning and mob control
* ProtocolLib for visibility management
* Bukkit Scheduler for asynchronous tasks

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://donkolia.gitbook.io/minesantum/santumspawn.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
