Tutorial:
Template
U can use skills
Code (Text):
prueba:
Type: ZOMBIE
Display: '&6Steve the Guide &2[Lv. 2]'
Options:
AlwaysShowName: true
PreventSunburn: true
Silent: true
Collidable: false
Despawn: true
PlaceholderAPI
%santumspawn_mythicmobnear_<radio>%
true or false if exist MythicMob in radius
✨ Features
- Persistent Targeting: Mobs attack only the specified player
- ️Exclusive Visibility: Only the target player can see the spawned mobs
- Continuous Enforcement: The system verifies and forces targeting every tick (20 times/second)
- ️Aggro Protection: Other players cannot "steal" the mob's aggro or attention
- Persistence: The system remains active even if the player leaves and rejoins the server
- Multi-Mob Support: Capability to spawn and manage multiple mobs simultaneously
Requirements
- Minecraft: 1.21.4+
- Java: 21
- Server: Paper
- Plugins: MythicMobs, ProtocolLib, MMOCore and MythicLibs for Party System
Installation
- Download the SantumSpawn-1.0-SNAPSHOT.jar file
- Place the file into your server's plugins folder
- Restart the server
- Done!
Use
Code (Text):
/santumspawn <mythicmobname> X Y Z <playername> [size]
Parameters
- <mythicmobname>: Name of the MythicMob to be spawned
- 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) Number of mobs to spawn (Default: 1)
Behavior
Exclusive Targeting
The mob
only attacks the player specified in the command. Other players
cannot be attacked by the mob, even if:
- They are closer to the mob than the target
- They attack the mob
- The target player is far away
Visibility
- Only the specified player can see the mob
- Other players cannot see the entity at all
- Visibility is maintained even if the player reconnects
Enforcement System
The plugin utilizes a continuous enforcement system that:
- Runs every tick (20 times per second)
- Verifies that the mob has the correct target
- Forces targeting if it has changed
- Automatically cleans up dead or invalid mobs
Technical Details
- VisibilityManager: Manages mob visibility every tick
- TargetEnforcementTask: Forces the correct targeting every tick
- SpawnCommand: Handles the command execution and mob registration
API Usage
- MythicMobs API: Used for spawning and mob control
- ProtocolLib: Used for visibility management (packet interception)
- Bukkit Scheduler: Used for handling asynchronous tasks
Party System (MMOCore)
The plugin integrates automatically with the MMOCore party system:
- Automatic Detection: The plugin detects if the target player is currently in a party
- Shared Visibility: All party members are able to see the mob
- Shared Targeting: The mob will attack the target player or any nearby member of their party
- Dynamic Updates:
- If someone joins the party They see the mob and can be attacked
- If someone leaves the party They lose visibility and the mob stops attacking them
- If someone reconnects Their status is correctly restored based on their party membership
Exclusive Targeting (Party)
The mob attacks
only the specified player and their party members. Players outside the party
cannot be attacked, even if:
- They are closer to the mob
- They attack the mob
- The target player is far away
️ Visibility
- Shared Access: Only the specified player and their party members can see the mob
- Complete Stealth: Other external players cannot see the entity at all; it is completely invisible and non-existent to them