Create a fully working Minecraft Paper 1.21.11 plugin called "Hunter" using Java 21.
Hunter is a custom one-use Crossbow homing missile weapon.
COMMAND:
- /hunter gives the Hunter Crossbow.
- Permission: hunter.admin
- Default permission: OP.
HUNTER ITEM:
- Base item: Crossbow
- Name: ⚡ HUNTER | READY ⚡
- Identify the Hunter using PersistentDataContainer.
Lore:
Projectile: [Arrow] ━━━━━━━━━━━━━━━━━━━━ ▌ Advanced Homing Missile System ▌ High-Speed Predictive Tracking Built for Elytra Interception ▌ Target Range: 50 Blocks Players & Entities ▌ Direct Line-of-Sight Required No Lock Through Blocks ▌ Left-Click to Lock Target Right-Click to Fire ▌ Load With Any Compatible Arrow ▌ One Hunter • One Missile
TARGET LOCK:
The Hunter can lock Players and LivingEntities up to 50 blocks away.
The player must directly aim at the target and LEFT-CLICK to lock it.
The target must have direct line-of-sight. Hunter must NEVER lock entities through walls or solid blocks.
When a target is successfully locked:
- Make the target glow.
- Spawn a Sonic Boom visual.
- Play a fast "tun-tun-tun" note/pling sound.
- Show a BossBar at the top ONLY to the shooter.
BossBar:
HUNTER | READY TO FIRE! | TARGET: <target name>
The BossBar must appear only after a successful lock, not simply by holding Hunter.
Left-click again should unlock the current target, remove the Hunter glow/BossBar and allow another target to be selected.
ARROW LOADING:
Hunter must work as a Crossbow for loading ammunition.
The player must load compatible Minecraft arrow ammunition before firing.
Support compatible normal, spectral and tipped arrows where supported by Paper.
The Hunter cannot launch its missile without ammunition.
FIRING:
After loading Hunter and locking a target, RIGHT-CLICK fires the missile.
IMPORTANT:
Use the actual Crossbow projectile firing event.
The projectile that Minecraft actually fires must become the Hunter missile.
Do not create a separate normal arrow plus a missile.
There must be only ONE projectile.
When the missile successfully launches:
- Play fast "tun-tun-tun" launch feedback.
- Start homing immediately.
- The Hunter Crossbow is permanently used.
- Remove the Hunter.
- Replace it with the Hunter Cell.
Hunter is ONE USE only.
HOMING MISSILE:
The missile must be visible and physically fly through the world.
It must NOT teleport.
The missile should be very fast and continuously chase ONLY the original locked target.
Use predictive homing designed for Elytra interception.
The guidance system should use:
- Target position
- Target velocity
- Missile position
- Missile velocity
- Distance to target
Predict where the moving target will be and steer toward that future interception point.
The missile should lead fast Elytra players instead of simply following their current position.
Update the missile guidance frequently/every tick while keeping movement smooth and fast.
Add a visible missile trail.
Maximum flight time should be approximately 15 seconds (300 ticks).
BLOCK COLLISION:
The missile must NEVER fly through solid blocks.
Because the missile is high-speed, use reliable collision detection so it cannot tunnel through walls between ticks.
If the missile hits a wall, floor, ceiling or another solid block:
- Immediately remove the missile.
- Do NOT destroy blocks.
- Do NOT trigger the successful 5-block impact radius.
Result:
STATUS: NOT IMPACTED UNSUCCESSFULLY REASON: COLLIDED WITH BLOCK
OTHER FAILURE CONDITIONS:
If the missile hits another entity before the original locked target:
STATUS: NOT IMPACTED UNSUCCESSFULLY REASON: WRONG ENTITY HIT
If the target becomes unavailable:
STATUS: NOT IMPACTED UNSUCCESSFULLY REASON: TARGET LOST
If the missile exceeds its flight timeout:
STATUS: NOT IMPACTED UNSUCCESSFULLY REASON: MISSILE TIMEOUT
SUCCESSFUL IMPACT:
A Hunter shot is considered successful ONLY when the missile hits/reaches the ORIGINAL locked target.
On successful impact:
- Spawn Sonic Boom visual effects.
- Spawn explosion-style visual effects.
- Do NOT destroy terrain.
- Play an End Portal activation/spawn-style sound to EVERY online player on the server.
5-BLOCK IMPACT RADIUS:
After a successful original-target impact, create a spherical 5-block impact radius.
All applicable LivingEntities inside the radius receive:
- Levitation for 5 seconds
- Slow Falling for 5 seconds
- Instant Damage II
- Slowness for 5 seconds
- Poison for 10 seconds
The radius activates ONLY after the original locked target is successfully hit.
A failed missile must never activate this radius.
TOTEM SYSTEM:
Hunter impact is lethal unless the affected entity has a valid Totem of Undying.
If an affected player/entity has a valid Totem of Undying in an appropriate hand:
- Consume exactly ONE Totem.
- Trigger the proper Totem activation/pop behavior using supported Paper API.
- The entity survives.
If there is no valid Totem:
- Kill the affected entity.
Do not use nonexistent Bukkit/Paper constants such as:
Effect.TOTEM_USED Effect.TOTEM_RESURRECT
Use only API methods/constants that actually exist in the targeted Paper version.
HUNTER CELL:
When Hunter successfully launches its missile, replace the used Hunter Crossbow with a Hunter Cell.
Hunter Cell base item:
PRISMARINE_CRYSTALS
It must specifically be Prismarine Crystals, NOT Prismarine Shard.
Use the normal vanilla Prismarine Crystals texture.
Give it a colorful custom name:
🌈 HUNTER CELL 🌈
The Hunter Cell is only a missile mission/status record.
It cannot fire another missile.
Associate the Cell with its individual shot using PersistentDataContainer.
CELL AFTER LAUNCH:
🚀 MISSILE: FIRED 🎯 TARGET: <target name> 👤 FIRED BY: <shooter name>
STATUS: IN FLIGHT
HUNTER USED!!
Make "HUNTER USED!!" bold dark red.
Do not display coordinates.
SUCCESS CELL:
When the ORIGINAL locked target is successfully hit, update the same Hunter Cell to:
🚀 MISSILE: FIRED 🎯 TARGET: <target name> 👤 FIRED BY: <shooter name>
STATUS: IMPACTED SUCCESSFULLY
HUNTER USED!!
FAILED CELL:
If the missile fails, update the same Cell to:
🚀 MISSILE: FIRED 🎯 TARGET: <target name> 👤 FIRED BY: <shooter name>
STATUS: NOT IMPACTED UNSUCCESSFULLY REASON: <failure reason>
HUNTER USED!!
Possible reasons:
- COLLIDED WITH BLOCK
- WRONG ENTITY HIT
- TARGET LOST
- MISSILE TIMEOUT
MULTIPLAYER:
Multiple players must be able to use Hunter at the same time.
Use UUID-based shot/target tracking.
Each shooter must have their own:
- Target lock
- BossBar
- Missile
- Shot UUID
- Hunter Cell
- Shot result
One Hunter must never interfere with another player's Hunter.
Clean up completed missile tasks and stored data correctly.
IMPORTANT BUG PREVENTION:
Do not repeat these previous bugs:
- Normal arrow fires straight instead of becoming a homing missile.
- Arrow fires but homing tracking never starts.
- Hunter remains in the player's inventory after firing.
- Hunter Cell does not appear after firing.
- A normal arrow and separate missile both spawn.
- Missile passes through walls.
- Missile only follows the target's current location and cannot intercept Elytra players.
The actual projectile fired by the Hunter Crossbow must be connected to the Hunter shot and homing system.
After a confirmed missile launch, the Hunter must reliably disappear and the PRISMARINE_CRYSTALS Hunter Cell must appear.
Make the complete Hunter system reliable and compatible with Paper 1.21.11 and Java 21.