📄
pasted-code-1787231133928.txt
txt
941 lines
▶
# SCRIPTED SMP — COMPLETE CUSTOM ABILITY PLUGIN
Build a complete **Minecraft Java Paper 1.21.11 plugin** for my scripted SMP.
The plugin's main purpose is to give every player unique supernatural abilities through a cinematic `/event` awakening system.
This is a **player ability system**, NOT a weapon system. Abilities belong directly to players and are activated with commands.
The plugin must be designed so I can easily add more abilities later.
---
# 1. PLATFORM
* Minecraft Java Edition
* Paper 1.21.11
* Java
* Server-side plugin
* No client-side mod required
* Must work on normal Minecraft clients
* Use current Paper 1.21.11 APIs
* Do not use outdated Minecraft APIs
* Make sure the project actually compiles
---
# 2. MAIN SYSTEM
Every player can receive:
* Ability 1
* Ability 2
Players activate them with:
`/ability`
and:
`/ability2`
Abilities belong permanently to the player.
Store ability assignments using the player's UUID.
If a player leaves and rejoins, they keep their abilities.
Abilities are NOT attached to items.
---
# 3. `/event` AWAKENING SYSTEM
Create a cinematic server-wide event.
Only players with:
`scriptedsmp.admin`
can use:
`/event`
The event should feel like a major scripted SMP story moment.
It should NOT simply give abilities instantly.
The entire event should take approximately **30–60 seconds**.
---
## PHASE 1 — THE WARNING
When `/event` begins:
Announce:
`Something is coming...`
Then:
* Play mysterious sounds.
* Create dark/purple particles.
* Create supernatural effects around the online players.
* Add a short delay.
Next announce:
`The world has chosen...`
Then wait again.
---
# PHASE 2 — THE AWAKENING
Every online player is affected.
Slowly raise every player approximately **10 blocks into the air**.
IMPORTANT:
* Do not launch them so high that they take damage.
* Prevent fall damage from the event.
* Temporarily prevent normal movement if necessary.
* Do not teleport them into blocks.
* Do not destroy terrain.
While players are floating:
* Create particles underneath them.
* Create a particle beam/pillar around each player.
* Play magical sounds.
* Create a large supernatural particle formation in the sky.
The event should visually look like every player is being selected by some unknown force.
---
# PHASE 3 — THE WORLD REACTS
While everyone is floating, gradually increase the intensity.
Display messages such as:
`The awakened are among you.`
`Your power is being decided.`
`You cannot choose what you become.`
Do NOT reveal abilities yet.
Add:
* Increasing particle effects
* Increasing sound intensity
* Large circular/rune-like particles in the sky
* Lightning-like visual effects without destroying terrain
* A dramatic final sound before the ability selection
---
# PHASE 4 — ABILITY ASSIGNMENT
Now assign abilities.
Every player gets:
**Ability 1**
and
**Ability 2**
Normal players receive random combinations from the normal ability pool.
The abilities should be permanently saved.
Do not overwrite existing abilities unless `/event reset` is used.
---
# 5. SPECIAL PLAYERS
These players must receive special, stronger abilities:
## Chxso_
Chxso_ gets the **strongest and rarest ability combination**.
His abilities should feel like a main-character/story character power.
They should be noticeably more powerful and unique than normal abilities.
## SYRESYT
Give SYRESYT a powerful unique ability combination.
## El1te_K
Give El1te_K a powerful unique ability combination.
## MoonsV1
Give MoonsV1 a powerful unique ability combination.
## BlockishZulu737
Give BlockishZulu737 a powerful unique ability combination.
Do NOT randomly give these special abilities to other players.
Everyone else gets normal abilities.
---
# 6. NORMAL ABILITY POOL
Create simple but creative abilities.
Do NOT make abilities generic Minecraft powers such as:
* Fireball
* Basic lightning strike
* Strength boost
* Basic speed boost
* Generic explosion
* Generic teleport
Abilities should be easy to understand but feel original.
Use these abilities as the initial pool:
---
## SWAP
Activation:
`/ability`
Target a nearby player.
Swap the positions of the user and target.
Requirements:
* Must have a valid target.
* Cannot swap through unsafe locations.
* Add particles and sound.
* Add a cooldown.
---
## AFTERIMAGE
Activation:
`/ability`
Create a visual fake copy/afterimage of the player.
The player moves away while the afterimage remains for approximately 2 seconds.
The afterimage disappears afterward.
Use particles to make it look supernatural.
---
## REWIND
Activation:
`/ability`
Record the player's previous position.
When activated, return the player to their previous safe position from several seconds earlier.
Do not teleport them into blocks or dangerous locations.
---
## ECHO
Activation:
`/ability`
Show particles representing where nearby players were several seconds earlier.
This should allow the player to track movement without directly revealing exact current locations.
---
## PHASE
Activation:
`/ability`
For approximately 3 seconds:
* Allow the player to move through other players.
* Do not allow them to phase through solid terrain.
* Add ghost-like particles.
---
## REPEL
Activation:
`/ability`
Push nearby players away from the user.
No major damage.
Focus on knockback and visual impact.
---
## MARK
Activation:
`/ability`
Target a player.
Mark them for several seconds.
The user can see the marked player's location through particles/glowing effects.
---
## MIRROR
Activation:
`/ability`
For a short duration, the next negative effect applied to the player is reflected back toward the attacker/source where possible.
Make sure this does not create infinite reflection loops.
---
## TETHER
Activation:
`/ability`
Connect the user and target with an invisible supernatural tether.
If the target moves farther than approximately 10 blocks away:
* Pull them back toward the user.
Display a particle connection between them.
---
## DISORIENT
Activation:
`/ability`
Target a nearby player.
Temporarily disorient their movement for approximately 2 seconds.
Do not make the effect permanently affect their controls.
---
## DECOY
Activation:
`/ability`
Create a fake visual copy of the player.
The decoy moves in the direction the player chooses.
It disappears after several seconds.
---
## SACRIFICE
Activation:
`/ability`
The user sacrifices a small amount of health.
In exchange:
* Remove negative potion effects.
* Create a dramatic particle effect.
Do not allow the ability to kill the player.
---
## MOMENTUM
Passive/activation-based ability.
The longer the player continuously runs:
* Their movement gradually becomes faster.
Set a reasonable maximum.
Stopping resets the momentum.
Add particles at high momentum.
---
## GHOST
Activation:
`/ability`
Make the player invisible for approximately 3 seconds.
Attacking ends the invisibility.
Add subtle particles so the ability is still visually understandable.
---
## RANDOMIZE
Activation:
`/ability`
Target a nearby player.
Safely teleport them a short random distance.
Do not teleport them into:
* Lava
* Void
* Solid blocks
* Dangerous locations
---
## DELAYED DAMAGE
Activation:
`/ability`
For a short duration:
* Damage taken is stored.
* The stored damage is applied several seconds later.
The player should still feel the damage visually but the health reduction is delayed.
Do not allow the stored damage to kill the player unexpectedly.
---
## STEAL
Activation:
`/ability`
Target a player.
Temporarily copy one beneficial potion effect from the target to the user.
Remove/cancel the copied effect from the target only if configured to do so.
---
## FLOAT
Activation:
`/ability`
Target a player.
Slowly raise them a few blocks into the air.
Do not cause fall damage.
---
## FREEZE
Activation:
`/ability`
Temporarily restrict the target's movement for approximately 2 seconds.
Use ice/frost particles.
---
# 7. SPECIAL ABILITIES
Create stronger abilities specifically for the five special players.
---
# CHXSO_ — FRACTURE
## Ability 1 — FRACTURE
When activated:
* Record Chxso_'s position and health.
* For approximately 8 seconds, track his movement.
* He can fight normally.
* When the ability is activated again, return him to the recorded position.
* Restore his health to the recorded amount.
* Make sure the destination is safe.
Add a major purple/dimensional visual effect.
This should feel like Chxso_ is breaking reality.
## Ability 2 — REALITY BREAK
When activated:
* Affect players within approximately 10 blocks.
* Heavily slow them for approximately 3 seconds.
* Chxso_ remains mostly unaffected.
* After the duration, release a knockback burst.
* Create a large dimensional particle effect.
This is supposed to be one of the strongest abilities in the plugin.
---
# SYRESYT
## Ability 1 — SWAP
Allow SYRESYT to instantly swap positions with a targeted player.
Add a unique visual effect.
## Ability 2 — REWIND
Allow SYRESYT to return to a safe position from approximately 5 seconds earlier.
Make these abilities stronger/faster than the normal versions.
---
# EL1TE_K
## Ability 1 — ECHO
Reveal recent movement trails of nearby players.
## Ability 2 — HUNT
Target one player.
For approximately 10 seconds:
* Show their direction.
* Show particles indicating their trail.
* Allow tracking through walls.
---
# MOONSV1
## Ability 1 — PHASE
Temporarily allow movement through players.
## Ability 2 — AFTERIMAGE
Create a powerful decoy/afterimage effect.
Make the decoy visually convincing but do not create an actual second player entity.
---
# BLOCKISHZULU737
## Ability 1 — TETHER
Create a strong tether between BlockishZulu737 and a target.
If the target moves too far away, pull them back.
## Ability 2 — MIRROR
Reflect the next applicable negative effect back at the source.
Prevent reflection loops.
---
# 8. ABILITY COOLDOWNS
Every ability must have its own cooldown.
Example cooldowns:
* Normal abilities: approximately 10–30 seconds.
* Strong abilities: approximately 20–60 seconds.
* Chxso_'s strongest ability can have a longer cooldown.
When a player tries to use an ability during cooldown, display:
`Ability on cooldown: 12.4s`
Do not allow ability spam.
Make all cooldowns configurable in `config.yml`.
---
# 9. COMMANDS
Create:
`/event`
Starts the awakening event.
`/event stop`
Stops the current event safely.
`/event reset`
Resets ability assignments.
`/ability`
Activates the player's first ability.
`/ability2`
Activates the player's second ability.
`/smpability`
Shows the player's current abilities.
`/smpability `
Shows another player's abilities if the user has permission.
`/smpability set `
Allows admins to manually assign abilities.
`/smpability clear `
Removes a player's abilities.
`/smpability list`
Lists every available ability.
---
# 10. PERMISSIONS
Admin commands require:
`scriptedsmp.admin`
Normal players should only need permission to use:
`/ability`
and:
`/ability2`
---
# 11. ABILITY INVENTORY GUI / INFORMATION
When a player runs:
`/smpability`
Show:
Player:
`Chxso_`
Ability 1:
`FRACTURE`
Ability 2:
`REALITY BREAK`
Also show cooldown information if applicable.
---
# 12. DATA STORAGE
Save all player ability assignments using UUIDs.
Save:
* Ability 1
* Ability 2
* Special status
* Cooldowns where appropriate
Data must survive:
* Server restarts
* Player disconnects
* Player reconnects
Use a simple reliable storage method such as YAML or JSON.
---
# 13. RESOURCE PACK
Create a custom resource pack for the plugin.
IMPORTANT:
The abilities themselves do NOT require weapons.
The resource pack is for the plugin's visual identity and future custom items/artifacts.
Create a professional dark-fantasy/supernatural Minecraft resource pack.
Include:
* `pack.mcmeta`
* Textures
* Models
* Required item mappings
* Any custom UI textures needed
* Ability icons where practical
* Event visuals where possible
Use Minecraft-style pixel art.
The resource pack should match the scripted SMP's supernatural theme.
---
# 14. RESOURCE PACK UI / ABILITY ICONS
Create unique visual icons for the abilities:
* Swap
* Afterimage
* Rewind
* Echo
* Phase
* Repel
* Mark
* Mirror
* Tether
* Disorient
* Decoy
* Sacrifice
* Momentum
* Ghost
* Randomize
* Delayed Damage
* Steal
* Float
* Freeze
* Fracture
* Reality Break
* Hunt
Use distinct symbols and colors for each ability.
Example:
Fracture → purple cracked reality symbol
Reality Break → purple dimensional eye/rift
Blood-related abilities → dark red
Tracking abilities → glowing eye
Time abilities → clock/hourglass
Movement abilities → wind/rift symbols
---
# 15. PARTICLES AND SOUNDS
Every ability needs its own visual identity.
Use:
* Minecraft particles
* Sounds
* Particle trails
* Rings
* Shockwaves
* Runes
* Beams
* Small bursts
Do not rely on resource-pack-only effects for core functionality.
Everything important must work server-side.
---
# 16. SAFETY
The plugin must prevent abilities from:
* Killing players accidentally when not intended.
* Teleporting players into blocks.
* Teleporting players into lava.
* Teleporting players into the void.
* Causing accidental fall damage.
* Permanently breaking terrain.
* Crashing the server.
* Creating unlimited entities.
* Creating infinite particles.
Clean up temporary effects/entities after abilities finish.
---
# 17. EVENT SAFETY
During `/event`:
* Protect players from fall damage.
* Do not kill players.
* Do not destroy terrain.
* Do not permanently modify the world.
* Do not trap players permanently.
* Safely handle players who disconnect during the event.
* If `/event stop` is used, return everyone to normal immediately.
---
# 18. CONFIG.YML
Make these configurable:
* Ability cooldowns
* Ability durations
* Ability ranges
* Target ranges
* Particle types
* Sound effects
* Event messages
* Event timings
* Float height
* Float duration
* Reveal duration
* Special-player abilities
* Whether abilities are publicly revealed
* Whether players are frozen during the event
---
# 19. PROJECT STRUCTURE
Organize the project cleanly.
Example:
```text
ScriptedSMP/
├── pom.xml
├── src/
│ └── main/
│ ├── java/
│ │ └── com/scriptedsmp/
│ │ ├── ScriptedSMP.java
│ │ ├── commands/
│ │ ├── abilities/
│ │ ├── event/
│ │ ├── players/
│ │ ├── cooldowns/
│ │ ├── storage/
│ │ └── listeners/
│ │
│ └── resources/
│ ├── plugin.yml
│ └── config.yml
│
└── resourcepack/
├── pack.mcmeta
└── assets/
```
Do not put everything into one Java class.
Make it easy to add new abilities later.
---
# 20. FINAL REQUIREMENTS
Give me:
1. Complete source code.
2. Every Java class.
3. `plugin.yml`.
4. `config.yml`.
5. `pom.xml` or Gradle build files.
6. Resource-pack structure.
7. All required model/texture files or exact specifications for generating them.
8. Build instructions.
9. Installation instructions.
10. All commands.
11. All permissions.
12. Explanation of how to add future abilities.
Most importantly:
**Make sure the plugin compiles and works on Paper 1.21.11.**
Do not give me pseudocode.
Do not leave important systems as placeholders.
Do not say "implement this later."
Actually implement the `/event`, ability assignment, `/ability`, `/ability2`, cooldowns, permanent player data, special player abilities, normal ability pool, particles, sounds, and safety systems.
The final result should feel like a **real scripted SMP awakening system**, where `/event` is a memorable cinematic moment and every player walks away with a unique supernatural power.
Create the Gradle/Paper project, plugin metadata, configuration, and resource-pack scaffold.
Add persistent UUID-based ability data, cooldown handling, extensible ability definitions, and safe visual utilities.
Implement normal and special abilities plus the cinematic awakening scheduler.
Add commands, GUI/listeners, registration, and installation/extension documentation.
The initial files are in place; I’m correcting the cross-file wiring and dependency declarations before finishing the remaining registration details.
Core wiring is now consistent. I’m applying the final safety corrections: event damage protection, non-blocking aerial positioning, attack-cancelling ghost state, and loop-safe mirror reflection.Implemented the ScriptedSMP supernatural ability plugin from scratch.
Project setup
Gradle Java 21 project targeting Paper 1.21.11.
plugin.yml,config.yml,manifest.kod.Configurable cooldowns, durations, ranges, event messages, and special-player assignments.
Persistent player data
UUID-based YAML storage in
plugins/ScriptedSMP/data.yml.Permanent Ability 1 and Ability 2 assignments.
Special-player handling for:
Chxso_
SYRESYT
El1te_K
MoonsV1
BlockishZulu737
Implemented abilities
Swap
Afterimage
Rewind
Echo
Phase
Repel
Mark
Mirror
Tether
Disorient
Decoy
Sacrifice
Momentum
Ghost
Randomize
Delayed Damage
Steal
Float
Freeze
Fracture
Reality Break
Hunt
Awakening event
/event/event stop/event resetMulti-phase cinematic sequence with:
Server-wide announcements
Player elevation
Particle pillars and rings
Magical sounds
Fall and movement protection
Delayed ability assignment
Special-player ability assignment
Commands
/ability/ability2/smpability/smpability <player>/smpability set <player> <ability1> <ability2>/smpability clear <player>/smpability list
GUI
Added reusable inventory GUI framework.
/smpabilityopens an ability information menu for players.
Safety systems
Safe teleport checks.
Fall-damage prevention.
No terrain destruction.
No spawned entities.
Bounded temporary tasks.
Delayed-damage protection.
Ghost attack cancellation.
Reflection loop prevention.
Resource-pack scaffold
Added
resourcepack/pack.mcmeta.Added icon specifications and future model-mapping guidance in
resourcepack/README.md.
Documentation
Added root
README.mdwith build, installation, command, permission, and future-ability instructions.
Build with:
gradle build
The resulting plugin jar will be located in:
build/libs/
IMPORTANT FIXES
1. /event MUST END
The /event command is currently getting stuck and continuing forever.
Fix the event system so it has a strict finite sequence and always reaches an EVENT_COMPLETE state.
The event must:
- Start.
- Run Phase 1.
- Run Phase 2.
- Run Phase 3.
- Assign abilities.
- Run the ability reveal.
- Return all players safely to normal.
- Clean up ALL temporary effects, particles, tasks, entities, and event data.
- Display:
THE AWAKENING IS COMPLETE.
- Set the event state to inactive.
After this happens:
* eventRunning = false * No event tasks should continue running. * No repeating scheduler should remain active. * Players must stop floating. * Players must regain normal movement. * Event particles must stop. * Temporary potion effects from the event must be removed. * Temporary entities must be removed. * No event loop should continue. * /event should be usable again later if configured.
Use a clear event state such as:
IDLE
PHASE_1
PHASE_2
PHASE_3
ABILITY_ASSIGNMENT
REVEAL
FINISHING
COMPLETE
Make sure every possible path eventually calls the cleanup/finalization method.
If a player disconnects during the event, the event must still continue and eventually finish.
If /event stop is used, immediately perform the same cleanup and return to IDLE.
There must NEVER be an infinite repeating task for the event.
---
2. COOLDOWN DISPLAY ABOVE THE HOTBAR
Add a cooldown display in the action bar, directly above the player's hotbar.
When the player uses an ability, show:
⚡ ABILITY: 12.4s
or:
⚡ ABILITY 2: 8.2s
The timer should update smoothly as the cooldown decreases.
Example:
⚡ ABILITY: 10s
⚡ ABILITY: 9s
⚡ ABILITY: 8s
etc.
When the cooldown reaches zero:
⚡ ABILITY READY
For players who have both abilities on cooldown, show both if possible:
⚡ A1: 8s | A2: 14s
If only one ability is on cooldown:
⚡ A1: 8s
If neither is on cooldown:
⚡ A1 READY | A2 READY
The action-bar display must NOT permanently spam chat.
Use the action bar rather than normal chat.
---
3. COOLDOWN DISPLAY BEHAVIOR
The cooldown UI should:
* Update automatically. * Only show cooldowns relevant to the player. * Work after server restarts. * Disappear/reset correctly when cooldowns finish. * Never create an infinite repeating task. * Use one efficient scheduled task per player or one centralized cooldown-display task. * Automatically stop updating when the player disconnects.
When the player uses /ability, immediately show the cooldown.
When the player uses /ability2, immediately show the second cooldown.
When the cooldown reaches zero, display:
⚡ READY
for a short period, then return to the normal status display.
Make the cooldown display configurable in config.yml.
Trace and repair the event lifecycle so every start, stop, disconnect, and failure path finalizes cleanly.
Add action-bar cooldown tracking for both abilities with restart-safe persistence and disconnect cleanup.
Add configurable cooldown-display settings and wire the display into the existing commands/configuration.
I found the event’s scheduler is bounded under defaults, but its lifecycle is not explicit and cleanup only iterates online players. I’m replacing that with a state-driven finite run, idempotent finalization, and quit/join restoration for affected players.
The cooldown renderer is now wired to activation, joins, persisted epoch timestamps, and per-player task cleanup. I’m tightening its scheduler so it runs only during active cooldown/brief READY feedback, and fixing quit cleanup so no display task survives disconnect.One behavior mismatch remained: with one cooldown active, the renderer was also showing the other slot as READY. I’m narrowing the action bar to active cooldowns (plus a brief just-finished READY notice), while retaining the two-slot READY status when neither ability is cooling down.
Finite
/eventlifecycle: Added explicit event states fromIDLEthroughCOMPLETE, bounded phase progression, guarded failure handling, and idempotent cleanup. Completion now displaysTHE AWAKENING IS COMPLETE.and stops all event scheduling.Event cleanup: Restores gravity, velocity, fall distance, and original locations; handles disconnects, reconnects, kicks, event stops, and plugin shutdown safely.
Cooldown action bar: Added configurable per-player action-bar updates for ability slots, including cooldown seconds, READY notifications, dual cooldown display, and relevant-slot filtering.
Persistence and task control: Existing persisted cooldown timestamps continue working after restarts. Display tasks stop on disconnect, cooldown completion, plugin shutdown, and disabled configuration.
Configuration: Added
cooldown-displaysettings for enablement, update frequency, READY duration, prefix, separator, slot labels, cooldown format, and READY text.
change the event so it floats the player up 10 blocks then scrolls through all the abilities and tells the player what they got then drop them and they have awakend
Update the awakening sequence to lift players 10 blocks, reveal every ability, then release them.
Preserve the finite state machine and ensure completion always runs full cleanup.
Keep disconnect and
/event stoppaths safe while using the new reveal flow.
Updated the awakening event:
Players now float upward to 10 blocks during the event.
The event cycles through every registered ability.
Players see the current ability in the action bar.
Their two assigned abilities are then revealed in chat.
Players regain gravity and drop safely.
After the drop, all players are restored and the event completes.
The event ends with:
THE AWAKENING IS COMPLETE.
The finite event scheduler is cancelled during completion or
/event stop.Added configuration options:
event:
ability-scroll-ticks: 6
drop-ticks: 40
The event can be started again after it reaches COMPLETE.
📄
pasted-code-1787232958550.txt
txt
319 lines
▶
# CRITICAL — COMPLETELY REBUILD `/event`
The current `/event` system is broken.
**DO NOT try to patch, modify, or reuse the existing event code.**
Delete the current `/event` implementation entirely, including:
* Old event manager
* Old event scheduler/tasks
* Old event phases
* Old floating system
* Old event state system
* Old particle loops
* Old event timers
* Old event cleanup code
* Any repeating tasks created specifically for the old event
Then build `/event` again from scratch.
The new event must be **simple, finite, reliable, and guaranteed to end**.
---
# NEW `/event` DESIGN
When an admin runs:
`/event`
the plugin performs one cinematic sequence.
There must be **NO infinite loops**.
There must be **NO permanent repeating event task**.
Use a single controlled sequence of scheduled tasks with known delays.
---
## STEP 1 — START
Immediately:
* Check whether an event is already running.
* If one is running, tell the admin:
`An event is already running.`
* If not running, set:
`eventRunning = true`
* Save the list of currently online players.
Announce:
`§5Something is coming...`
Play a mysterious sound.
Wait approximately **3 seconds**.
---
# STEP 2 — THE AWAKENING
Announce:
`§5The world has chosen...`
Then:
* Temporarily make every online player float upward.
* Raise them exactly **10 blocks**.
* Do NOT continuously teleport them upward.
* Do NOT use an infinite repeating task.
* Move them upward once or use a short, finite animation.
* Prevent fall damage from this event.
* Give them a temporary floating/levitation effect if necessary.
Create particles around the players.
Play a powerful sound.
Wait approximately **5 seconds**.
---
# STEP 3 — POWER SELECTION
Announce:
`§dYour power is being decided...`
Wait approximately **3 seconds**.
Now assign every player:
* Ability 1
* Ability 2
Use the existing ability assignment system.
Special players MUST receive their predefined abilities:
### Chxso_
* FRACTURE
* REALITY BREAK
### SYRESYT
* SWAP
* REWIND
### El1te_K
* ECHO
* HUNT
### MoonsV1
* PHASE
* AFTERIMAGE
### BlockishZulu737
* TETHER
* MIRROR
Everyone else gets two random normal abilities.
Save all assignments permanently using UUIDs.
---
# STEP 4 — ABILITY REVEAL
After assigning abilities:
Announce:
`§dTHE AWAKENING IS COMPLETE.`
Then reveal each player's abilities.
For each player:
`§5 has awakened.`
Then:
`§dAbility I: `
`§dAbility II: `
Wait approximately **1 second** between players.
Do NOT create a repeating loop.
Use a finite list and advance through it.
---
# STEP 5 — RETURN PLAYERS TO NORMAL
After the final player has been revealed:
* Remove temporary levitation.
* Restore normal movement.
* Restore normal gravity.
* Make sure everyone is safely placed on the ground.
* Prevent fall damage caused by the event.
* Remove temporary event particles/effects.
* Remove any temporary event entities.
* Stop all event sounds/effects.
Then display:
`§5THE AWAKENING IS COMPLETE.`
Wait 2 seconds.
---
# STEP 6 — END THE EVENT
Finally:
```java
eventRunning = false;
```
The event is now completely finished.
There must be **NO scheduler still running**.
There must be **NO event task still alive**.
There must be **NO event loop**.
There must be **NO repeating timer**.
There must be **NO code that automatically starts another event**.
The only way to start another event is for an admin to manually run:
`/event`
again.
---
# `/event stop`
Keep:
`/event stop`
If an admin uses it:
1. Immediately stop the current event sequence.
2. Cancel the active scheduled task.
3. Remove temporary effects.
4. Stop particles.
5. Restore players.
6. Prevent fall damage.
7. Set:
`eventRunning = false`
8. Tell the admin:
`§cEvent stopped.`
The event must then be completely inactive.
---
# IMPORTANT SCHEDULER RULE
Do NOT use something like:
```java
runTaskTimer(...)
```
for the entire event.
Instead use a **finite chain of delayed tasks**, such as:
```java
runTaskLater(...)
```
Each phase should schedule the next phase exactly once.
Example:
```text
/event
↓
START
↓ 3 sec
AWAKENING
↓ 5 sec
ABILITY ASSIGNMENT
↓ 3 sec
REVEAL
↓
FINISH
↓
eventRunning = false
```
The final step MUST cancel/clear anything associated with the event.
---
# CRASH/DISCONNECT SAFETY
If a player leaves during `/event`:
* Do not crash.
* Do not stop the event.
* Remove that player from the active event player list.
* Continue the event for everyone else.
If everyone leaves:
* Safely terminate the event.
* Set `eventRunning = false`.
If the server shuts down:
* Do not save an event as permanently running.
---
# TESTING REQUIREMENT
Before giving me the final code, verify logically that:
1. `/event` starts once.
2. It progresses through every phase.
3. It assigns abilities.
4. It reveals abilities.
5. It returns players to normal.
6. It reaches the final cleanup.
7. `eventRunning` becomes false.
8. No scheduler remains active.
9. `/event` can be run again afterward.
10. `/event stop` works at any point.
Do not leave the old event code in the project.
**The old event system must be completely removed and replaced with this new implementation.**
Replace
AwakeningEventwith a finite delayed-task chain: lift once by 10 blocks, scroll through every ability, reveal assignments one player at a time, drop, and finalize.Remove reconnect/pending-event behavior; disconnects now remove only that participant and the sequence continues or terminates if nobody remains.
Keep event safety only for active participants and fall damage, then update event timing/messages to match the new sequence.
The replacement is in place as a single delayed-task chain. I’m correcting the final landing so completion always returns online participants to their saved safe ground position, and ensuring configured event messages render their color codes instead of exposing & literals.Rebuilt /event as a finite delayed-task sequence:
Captures online players and waits 3 seconds.
Teleports participants exactly 10 blocks upward once.
Holds them there for 5 seconds with gravity disabled.
Assigns abilities using the existing special-player and random assignment system.
Scrolls through every ability with action-bar updates.
Reveals each participant’s two abilities one second apart.
Releases players and safely restores them to their original ground position.
Cleans up tasks, effects, particles, entities, participant data, and event state.
Displays
§dTHE AWAKENING IS COMPLETE.after final cleanup./event stopimmediately cancels the active delayed task and restores everyone.Disconnecting players are removed from the sequence without stopping it.
If everyone disconnects, the event terminates safely.
Fall protection now only cancels event-related fall damage.
Updated event timing configuration in
config.yml.
The ability Fracture is supposed to teleport me back to where i activated the ability after 10 seconds
Replace Fracture’s second-activation toggle with one delayed return task.
Set the Fracture return delay to 10 seconds while preserving safe teleport and cleanup.
Fracture now:
Saves your activation location.
Automatically teleports you back there after exactly 10 seconds.
Restores your saved health.
Plays the return effect.
No longer requires a second activation to teleport back.
Updated:
AbilityService.javaconfig.yml(durations.fracture: 10)
Make a command where admins can set abilities
Add an admin-only command for assigning one or two abilities to a target player.
Register tab completion/validation and persist the assignment through the existing ability data system.
The admin command already exists:
/smpability set <player> <ability1> <ability2>
Examples:
/smpability set Chxso_ FRACTURE REALITY_BREAK
/smpability set Steve SWAP REWIND
It:
Requires
scriptedsmp.adminSupports online and previously saved offline players
Accepts names like
REALITY_BREAK,reality-break, orReality BreakSaves both abilities permanently to
data.yml
Other admin commands:
/smpability list
/smpability clear <player>
Fix the Decoy ability put a fake player ith the users name and skin and armor and last held item
Make
DECOYuse a dedicated player-like decoy setup instead of the generic afterimage path.Show the activating player’s exact name and preserve their profile skin, armor, and main-hand item on the decoy.
Keep the existing finite lifetime and cleanup behavior.
Updated DECOY in AbilityService to create a named player-looking decoy with:
The activating player’s name
Their skin profile on the head
Cloned armor
Their last held main-hand item
Existing invisibility, particles, sound, duration, and cleanup
A true fake Player entity cannot be spawned through the Bukkit/Paper API alone; this implementation uses the existing ArmorStand-based player model. A fully authentic player body would require an NPC or packet library such as Citizens or ProtocolLib.
package com.scriptedsmp;
import com.scriptedsmp.abilities.AbilityService;
import com.scriptedsmp.commands.AbilityCommand;
import com.scriptedsmp.commands.EventCommand;
import com.scriptedsmp.commands.SmpAbilityCommand;
import com.scriptedsmp.commands.TrustCommand;
import com.scriptedsmp.cooldowns.CooldownManager;
import com.scriptedsmp.cooldowns.CooldownDisplayManager;
import com.scriptedsmp.event.AwakeningEvent;
import com.scriptedsmp.inventory.AbilityGUI;
import com.scriptedsmp.inventory.GUIListener;
import com.scriptedsmp.inventory.GUIManager;
import com.scriptedsmp.listeners.AbilityListener;
import com.scriptedsmp.listeners.EventSafetyListener;
import com.scriptedsmp.model.PlayerData;
import com.scriptedsmp.players.AssignmentService;
import com.scriptedsmp.storage.PlayerDataStore;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerKickEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
public class ScriptedSMP extends JavaPlugin implements Listener {
private PlayerDataStore dataStore;
private CooldownManager cooldowns;
private CooldownDisplayManager cooldownDisplay;
private AssignmentService assignments;
private AbilityService abilities;
private AwakeningEvent awakening;
private GUIManager guiManager;
@Override public void onEnable() {
saveDefaultConfig();
dataStore = new PlayerDataStore(this);
dataStore.load();
cooldowns = new CooldownManager(this, dataStore);
cooldownDisplay = new CooldownDisplayManager(this, cooldowns, dataStore);
assignments = new AssignmentService(this);
abilities = new AbilityService(this, cooldowns, cooldownDisplay);
awakening = new AwakeningEvent(this, assignments);
guiManager = new GUIManager();
getCommand("event").setExecutor(new EventCommand(this));
getCommand("ability").setExecutor(new AbilityCommand(this, 1));
getCommand("ability2").setExecutor(new AbilityCommand(this, 2));
getCommand("smpability").setExecutor(new SmpAbilityCommand(this));
getCommand("trust").setExecutor(new TrustCommand(this));
getServer().getPluginManager().registerEvents(this, this);
getServer().getPluginManager().registerEvents(new AbilityListener(this, abilities), this);
getServer().getPluginManager().registerEvents(new EventSafetyListener(awakening), this);
getServer().getPluginManager().registerEvents(new GUIListener(guiManager), this);
getServer().getScheduler().runTaskTimer(this, abilities::recordRewindPositions, 0, 100);
for (Player player : getServer().getOnlinePlayers()) cooldownDisplay.refresh(player);
}
@Override public void onDisable() {
if (awakening != null) awakening.stop();
if (abilities != null) abilities.stopAll();
if (cooldownDisplay != null) cooldownDisplay.stopAll();
if (dataStore != null) dataStore.save();
}
@EventHandler public void onJoin(PlayerJoinEvent event) {
awakening.onJoin(event.getPlayer());
dataStore.getOrCreate(event.getPlayer());
cooldownDisplay.refresh(event.getPlayer());
dataStore.save();
}
@EventHandler public void onQuit(PlayerQuitEvent event) {
awakening.onQuit(event.getPlayer().getUniqueId());
abilities.onQuit(event.getPlayer());
cooldownDisplay.onQuit(event.getPlayer());
}
@EventHandler public void onKick(PlayerKickEvent event) {
awakening.onQuit(event.getPlayer().getUniqueId());
abilities.onQuit(event.getPlayer());
cooldownDisplay.onQuit(event.getPlayer());
}
public String message(String key) { return ChatColor.translateAlternateColorCodes('&', getConfig().getString("messages." + key, "&cMissing message: " + key)); }
public void broadcast(String message) { for (CommandSender sender : getServer().getOnlinePlayers()) sender.sendMessage(message); getServer().getConsoleSender().sendMessage(message); }
public void openAbilityGui(Player viewer, Player target) { guiManager.openGUI(createAbilityGui(dataStore.getOrCreate(target)), viewer); }
public AbilityGUI createAbilityGui(PlayerData data) { return new AbilityGUI(this, data); }
public PlayerDataStore getDataStore() { return dataStore; }
public CooldownManager getCooldowns() { return cooldowns; }
public AssignmentService getAssignments() { return assignments; }
public AbilityService getAbilities() { return abilities; }
public AwakeningEvent getAwakening() { return awakening; }
public GUIManager getGuiManager() { return guiManager; }
}