J

and remember to make the VFX/particles as decribed

๐Ÿ“Ž 1 file 38,482 chars
๐Ÿ“„
pasted-code-1791020085371.txt
txt 2811 lines
โ–ถ
# โšก ENHANCED GLITCH SMP

## COMPLETE MASTER PLUGIN SPECIFICATION

**Plugin Name:** Enhanced Glitch SMP
**Creator:** `markyt_`
**Platform:** Minecraft Paper/Spigot
**Core Theme:** Glitch progression, hidden powers, mysterious discoveries, PvP progression, secret systems, cinematic VFX, corrupted reality, and endgame ascension.

---

# 1. ๐Ÿงฌ CORE CONCEPT

Create a highly polished Minecraft SMP plugin called:

> **Enhanced Glitch SMP**

The server contains a hidden power system known as:

> **Glitch Fragments**

Players begin as ordinary Minecraft players and gradually discover that the world contains a hidden layer of corrupted mechanics.

Players gain access to increasingly powerful:

> **Glitch Items**

Each Glitch Item has:

* A unique identity.
* A unique ability.
* A unique acquisition challenge.
* A unique cooldown.
* Unique VFX.
* Unique sounds.
* Unique lore.
* A unique PDC/NBT identifier.
* A place in the hidden Glitch database.

The plugin should feel less like a collection of custom items and more like:

> **Minecraft itself is slowly breaking.**

---

# 2. ๐Ÿ’  GLITCH FRAGMENT SYSTEM

Every player starts with:

> **3 Glitch Fragments**

Fragments represent the player's:

> **Glitch Power Level**

## Fragment Changes

### Killing a real PLAYER:

> `+1 Fragment`

### Dying:

> `-1 Fragment`

Mob kills provide:

> **0 Fragments**

Only legitimate player-versus-player kills count.

Do not award fragments for:

* Zombies
* Skeletons
* Endermen
* Withers
* Wardens
* Wither Skeletons
* Plugin entities
* NPCs
* Fake players
* Armor stands
* Summoned glitch entities
* Environmental deaths

---

# 3. ๐Ÿ“Š FRAGMENT LIMITS

Normal players:

> Minimum: `-5`
> Maximum: `10`

After Secret Gateway Ascension:

> Minimum: `-5`
> Maximum: `15`

The plugin must never allow fragments to exceed the player's current maximum.

---

# 4. ๐Ÿ”ด NEGATIVE FRAGMENT STATES

## -5 / -4

Player is:

> **GLITCH LOCKED**

They cannot:

* Craft applicable glitch items.
* Activate glitch abilities.
* Use glitch powers.

---

## -3 / -2 / -1

Player can possess/craft applicable Glitch Items but:

> **Cannot activate abilities.**

---

## 0

The player regains access to glitch abilities.

---

# 5. ๐ŸŸข POSITIVE FRAGMENT PROGRESSION

| Fragments | Effect                                   |
| --------: | ---------------------------------------- |
|         0 | Normal                                   |
|         1 | +0.1ร— damage                             |
|         2 | +0.2ร— damage                             |
|         3 | +0.3ร— damage                             |
|         4 | +0.4ร— damage                             |
|         5 | Permanent Speed II                       |
|         7 | Permanent Strength I                     |
|        10 | Strength II + Speed III + 3 extra hearts |

The damage bonuses must remain modest.

Permanent effects must safely reapply after:

* Joining
* Respawning
* World changes
* Effect clearing

Do not stack effects.

---

# 6. โค๏ธ 10-FRAGMENT MAXIMUM POWER

At:

> **10 Glitch Fragments**

the player receives:

* Permanent Strength II
* Permanent Speed III
* +3 hearts

Maximum health must be calculated safely.

Never repeatedly add health on:

* Join
* Respawn
* Reload
* World change

---

# 7. ๐Ÿฉธ PLAYER KILL SYSTEM

When a genuine player kills another genuine player:

> Killer: `+1 Fragment`

The death victim:

> `-1 Fragment`

The plugin must correctly identify the killer.

Do not allow:

* Fake-player kills
* NPC kills
* Mob kills
* Summoned entity kills
* Self-kills
* Environmental kills

to produce fragment rewards.

---

# 8. ๐ŸŽ› COMMANDS

Implement:

```text
/achievement glitch
/withdraw 
/glitch
/glitch help
/glitch info
/glitch fragments
/glitch reload
/menu
```

---

# 9. ๐Ÿ’  /WITHDRAW

Players can convert fragments into transferable Fragment Items.

Example:

Player has:

> `8 Fragments`

Runs:

```text
/withdraw 3
```

Result:

> Player has 5 fragments.

They receive:

> **3 Glitch Fragments**

Fragment Items must have a unique PDC identifier.

They cannot be counterfeited by renaming normal items.

When redeemed, respect the maximum fragment limit.

Example:

Player has:

> `9/10`

and receives:

> `3 Fragment Items`

Only one is redeemed.

The remaining two remain available.

---

# 10. ๐Ÿ–ฅ ACHIEVEMENT SYSTEM

Command:

```text
/achievement glitch
```

opens:

> **GLITCH DATABASE**

This is the main player-facing interface.

It should feel like:

> A hidden operating system inside Minecraft.

---

# 11. ๐ŸŽจ ACHIEVEMENT GUI STYLE

Do NOT make it look like a generic chest GUI.

Use:

* Dark backgrounds
* Corrupted text
* Cyan
* White
* Yellow
* Red
* Purple
* Broken symbols
* Animated lore
* Encrypted messages
* Custom model data
* Decorative panes
* Glitch particles where possible
* Sound effects
* Subtle animation

Header:

> **ENHANCED GLITCH SMP**

Footer:

> `Created by markyt_`

---

# 12. ๐Ÿ“– ACHIEVEMENT INFORMATION

Each discovered glitch should display:

* Glitch ID
* Name
* Type
* Status
* Ability
* Cooldown
* Fragment requirement
* Discovery method
* Lore
* Discovery status

Example:

```text
GLITCH-07

ERROR-202

STATUS:
DISCOVERED

TYPE:
COMBAT

POWER REQUIRED:
3+

COOLDOWN:
75s
```

---

# 13. ๐Ÿ”’ CLASSIFIED GLITCHES

The achievement database contains:

> **10 total Glitches**

Initially:

### DISCOVERABLE

1. Clock of Time
2. Reality Shard
3. Null Core
4. Redline Core
5. Desync Heart
6. Corrupted Eye
7. Error-202

### CLASSIFIED

8. `???`
9. `???`
10. `???`

Before discovery, Glitches 8โ€“10 must hide:

* Name
* Ability
* Requirements
* Cooldown
* Base Item

Display:

```text
GLITCH-08

โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ

STATUS:
CLASSIFIED

ORIGIN:
UNKNOWN

ABILITY:
[NULL]

DISCOVERY:
[CLASSIFIED]
```

Even hovering must not reveal their identity.

---

# 14. โšก GLITCH ITEM RULES

Every genuine Glitch Item must have:

* Unique PDC ID
* Unique custom name
* Custom lore
* Custom model data where possible
* Unique ability
* Unique cooldown
* Unique VFX
* Unique sounds
* Fragment requirement
* Acquisition logic

Never identify a Glitch Item only by display name.

A renamed normal Minecraft item must never activate an ability.

---

# 15. โฐ GLITCH-01 โ€” CLOCK OF TIME

**Base Item:** Clock
**Type:** Temporal
**ID:** `GLITCH-01`

## Ability: TIME CIRCLE

Activation:

> Right Click

Creates a:

> 10โ€“15 block temporal field.

Duration:

> Approximately 30 seconds of recording.

Record only explicitly supported reversible events.

Potentially reversible:

* Player health
* Player location
* Supported block changes
* Supported explosions
* Supported inventory events

Never attempt a full-world rewind.

Never allow:

* Item duplication
* Infinite restoration
* Chunk corruption
* Illegal inventory states

Second activation attempts:

> **TIME REVERSION**

---

## Acquisition

Requirements:

* Clock
* Clock in offhand
* Nighttime
* Caves & Cliffs condition

The player does **not** need to enter the Void.

Instead of dying:

> Trigger a Totem-style temporal glitch.

Award:

> **Clock of Time**

Broadcast:

```text
โš  GLITCH EVENT DETECTED

 HAS DISCOVERED
THE CLOCK OF TIME

TEMPORAL ANOMALY IDENTIFIED

BEWARE.
```

---

# 16. ๐Ÿ’Ž GLITCH-02 โ€” REALITY SHARD

**Base Item:** Nether Star
**ID:** `GLITCH-02`
**Type:** Reality

## Ability: REALITY BREAK

Radius:

> 30 blocks

Nearby enemy players receive:

* True invisibility
* Blindness
* Slowness

Duration:

> 20 seconds

Then caster enters:

> Ghost Phase

Duration:

> 10 seconds

Ghost Phase allows:

* Flying
* Limited wall movement
* Controlled invulnerability

Afterward:

> Glowing for 30 seconds.

---

## Acquisition

Player must:

> Kill 5 Withers.

Collect:

> 5 Nether Stars.

Then be killed by a:

> Wither Skeleton

while satisfying the challenge requirements.

Instead of dying:

> Trigger special survival sequence.

Award:

> Reality Shard

Broadcast:

```text
โ˜  REALITY ERROR

 HAS BROKEN REALITY

GLITCH-02 DISCOVERED

THE WORLD IS NO LONGER STABLE.
```

---

# 17. ๐Ÿ–ค GLITCH-03 โ€” NULL CORE

**Base Item:** Echo Shard
**ID:** `GLITCH-03`
**Type:** Spatial

## Ability A โ€” PLAYER SWAP

Right Click.

Find nearest valid real player within:

> 15 blocks

Swap positions.

Do not target:

* Mobs
* NPCs
* Fake players
* Armor stands
* Plugin entities

---

## Ability B โ€” SUMMONING MODE

Double Shift.

Then Right Click.

Summon:

> 3 Wither Skeleton Guardians

Duration:

> 15 seconds

### Guardian 1

Melee swordsman.

### Guardian 2

Archer using Wither Arrows.

### Guardian 3

Mage using Wither Skulls.

They cannot attack their owner.

They disappear automatically.

They must not produce exploitable valuable loot.

---

## Acquisition

Requirements:

* Echo Shard
* Wither Skeleton Skull

Player:

* Wears skull.
* Holds Echo Shard.
* Gets killed by a Warden.

Special event:

> Player survives.

> Warden disappears/dies through the challenge.

Award:

> Null Core

---

# 18. ๐Ÿ”ด GLITCH-04 โ€” REDLINE CORE

**Base Item:** Redstone Block
**ID:** `GLITCH-04`

The item cannot be placed.

## Ability: REDLINE

Duration:

> 8 seconds

Maximum multiplier:

> 2ร—

Increase:

* Movement speed
* Attack speed

VFX:

* Red lightning
* Redstone sparks
* Speed trails
* Particle rings
* Heartbeat

---

## Acquisition

Hold Redstone Block.

Get struck by:

> Lightning.

Survive.

Award:

> Redline Core

Broadcast:

```text
โšก REDLINE BREACH

 HAS SURPASSED
THE SPEED LIMIT.

GLITCH-04 DISCOVERED.
```

---

# 19. ๐Ÿ’™ GLITCH-05 โ€” DESYNC HEART

**Base Item:** Heart of the Sea
**ID:** `GLITCH-05`

## Ability: DESYNC FIELD

Radius:

> 15 blocks

Duration:

> 5 seconds

Simulate severe lag/desync using safe Minecraft effects.

Never:

* Manipulate network connections.
* Manipulate player computers.
* Force FPS changes.

Use:

* Blindness
* Slowness
* Teleport/camera effects where safe
* Particles
* Entity flickering
* Sound distortion
* Resource-pack screen effects if available

---

## Acquisition

Player:

1. Holds Heart of the Sea.
2. Throws Ender Pearl.
3. Leaves the server before it lands.

When the pearl lands:

> Persist pending event.

Trigger discovery when appropriate.

Award:

> Desync Heart

---

# 20. ๐Ÿ‘ GLITCH-06 โ€” CORRUPTED EYE

**Base Item:** Eye of Ender
**ID:** `GLITCH-06`

## Ability: CORRUPTED VISION

Radius:

> 15โ€“20 blocks

Nearby players receive:

* Weakness I
* Blindness II

Caster gains enhanced visibility through:

> Glowing/entity outlines.

VFX:

* Purple particles
* Black particles
* Eye formations
* Ender sounds
* Sculk sounds

---

## Acquisition

Player must:

* Find an Enderman.
* Hold Nether Star.
* Be during a thunderstorm.
* Kill the Enderman.

Award:

> Corrupted Eye

---

# 21. ๐Ÿช“ GLITCH-07 โ€” ERROR-202

**Base Item:** Netherite Axe
**ID:** `GLITCH-07`

## Ability: CRITICAL ERROR

Duration:

> 5 seconds

Effects:

* Critical hits where valid
* Sword-like attack speed
* Reduced attack cooldown
* Crit particles
* Crit sounds
* Netherite effects

Do not bypass every Minecraft combat rule.

---

## Acquisition

Requirements:

* Netherite Axe
* Nether Star

Hold both.

Get struck by:

> Lightning

Survive.

Award:

> Error-202

---

# 22. ๐ŸŸฃ GLITCH-08 โ€” PARADOX KEY

**Base Item:** Tripwire Hook
**ID:** `GLITCH-08`
**Type:** Causality / Spatial

## Ability: PARADOX

Right Click.

Creates:

> **Paradox Echo**

The Echo copies:

* Armor
* Held item
* Appearance
* Position
* Health percentage

Duration:

> 12 seconds

It mirrors combat actions.

The Echo cannot:

* Pick up items
* Drop items
* Open containers
* Use consumables
* Generate loot
* Generate fragments
* Trigger progression

When it expires:

> Echo collapses.

Nearby enemies receive:

> Knockback.

---

## Acquisition โ€” THE SECOND YOU

Requirements:

* Tripwire Hook
* Ender Pearl
* Full moon
* Another player observing

Player stands still:

> 60 seconds

Then performs the special Ender Pearl timing condition.

The pearl freezes.

A second version of the player appears.

Then:

> Paradox Key is awarded.

Broadcast:

```text
โš  PARADOX DETECTED



HAS CREATED THEMSELVES.

GLITCH-08 DISCOVERED
```

---

# 23. ๐Ÿ”ต GLITCH-09 โ€” VOID EYE

**Base Item:** Eye of Ender
**ID:** `GLITCH-09`
**Type:** Void / Dimensional

## Ability: VOID GATE

Radius:

> 20 blocks

Duration:

> 8 seconds

Create a black-purple rift.

Effects:

* Pull nearby enemies
* Pull nearby mobs
* Slowness
* Darkness
* Weakness

Caster is immune.

---

## VOID COLLAPSE

At the end:

* Damage
* Strong knockback
* Darkness
* Visual distortion

Never destroy players or blocks.

---

## Acquisition โ€” LOOK INTO NOTHING

Requirements:

* Eye of Ender
* Fully charged Respawn Anchor
* End Crystal

Travel to:

> The End

Throw the Eye toward the Void.

Instead of disappearing:

> The Eye freezes.

The sky glitches.

End crystals appear temporarily.

Vision distorts.

Then:

> VOID CONNECTION ESTABLISHED

The Eye returns as:

> **VOID EYE**

Broadcast:

```text
โ˜  VOID BREACH

 LOOKED
INTO NOTHING.

GLITCH-09 DISCOVERED

SOMETHING LOOKED BACK.
```

---

# 24. ๐Ÿ”ด GLITCH-10 โ€” SYSTEM ZERO

**Base Item:** Netherite Scrap
**ID:** `GLITCH-10`
**Type:** System / Reality

This is the final currently known Glitch Item.

It represents:

> **Breaking Minecraft's rules themselves.**

---

# 25. โš  SYSTEM ZERO โ€” ZERO STATE

Right Click.

Duration:

> **7 seconds**

During Zero State:

The player:

* Cannot take normal damage.
* Cannot be knocked back.
* Cannot receive potion effects.
* Is not normally targeted by hostile mobs.

Visual effects:

* Player flickering
* Black/white particles
* Distorted sounds
* Vanishing nametag
* Flickering nearby entities
* Giant `0` particle formation

The ability must not become an infinite escape mechanic.

---

# 26. โ˜  ZERO PULSE

When Zero State ends:

Radius:

> 15 blocks

Enemies receive:

* Damage
* Strong knockback
* Blindness
* Slowness
* Glowing

Then:

> All particles disappear.

Silence:

> ~0.5 seconds

Then:

> Massive glitch sound.

---

# 27. ๐Ÿ† SYSTEM ZERO โ€” EASIER ACQUISITION

The original concept should remain cinematic, but the acquisition should be achievable.

Requirements:

* `8+ Glitch Fragments`
* Netherite Scrap
* Nether Star
* Echo Shard
* Ender Pearl

Travel to:

> The End.

Stand near the Void while holding the Nether Star for:

> 30 seconds.

Then throw the Ender Pearl toward the Void.

The plugin intercepts the event before normal Void death.

System sequence:

```text
[ SYSTEM ]

Checking...

Glitch Power: VALID

Reality: UNSTABLE

Time: INVALID

Player: VALID

...

SYSTEM ACCESS GRANTED
```

Award:

> **SYSTEM ZERO**

---

# 28. โฑ DEFAULT COOLDOWNS

| Glitch        | Required Fragments | Cooldown |
| ------------- | -----------------: | -------: |
| Clock of Time |                  0 |     120s |
| Reality Shard |                  2 |     180s |
| Null Core     |                  0 |      90s |
| Redline Core  |                  1 |      60s |
| Desync Heart  |                  2 |     120s |
| Corrupted Eye |                  1 |      90s |
| Error-202     |                  3 |      75s |
| Paradox Key   |                  4 |     150s |
| Void Eye      |                  5 |     210s |
| System Zero   |                  8 |     300s |

All values must be configurable.

---

# 29. ๐Ÿšซ ABILITY ACTIVATION CHECKS

When activating any ability, check:

1. Genuine Glitch Item/Soul?
2. Player alive?
3. Player at least 0 fragments?
4. Required fragment level?
5. Cooldown ready?
6. Ability-specific requirements valid?
7. Activate.
8. Start cooldown.
9. Play VFX/SFX.
10. Persist relevant state.

If any check fails:

> No activation.

> No cooldown.

> No item consumption.

---

# 30. ๐Ÿ•ณ THE SECRET GATEWAY

The Secret Gateway is a completely hidden system.

Players are never told it exists.

No command.

No recipe.

No advancement.

No visible progress counter.

---

# 31. ๐Ÿ”ข SECRET GATEWAY DISCOVERY

Track:

> Number of genuine openings of `/achievement glitch`

Once the player has opened the main Achievement Menu:

> **46+ times**

a hidden paper can appear in the:

> **Bottom-right slot**

The counter must be invisible.

Do not display:

> `45/46`

or any progress information.

---

# 32. ๐Ÿ“œ SECRET PAPER

Bottom-right paper:

```text
???

UNKNOWN OBJECT

This item should not exist.

DATA:
[CORRUPTED]

Right Click to inspect.
```

Use:

* Unique PDC
* Custom model
* Enchanted glow
* Strange sound
* Subtle particles

Renamed normal paper must not work.

---

# 33. ๐Ÿšช ENTERING THE SECRET GATEWAY

Clicking the paper transitions into:

> **THE SECRET GATEWAY**

The transition should be cinematic.

Sequence:

1. Normal GUI freezes.
2. Sounds stop.
3. Screen becomes dark.
4. Deep sound plays.
5. Blue particle appears.
6. Blue light expands.
7. Secret GUI opens.

---

# 34. ๐Ÿœ SECRET GATEWAY UI

Style:

* Almost black
* Dark purple
* Deep blue
* Amethyst
* Minimal interface
* Strange symbols
* Empty slots
* Corrupted text

Center:

> **ONE PAPER**

Name:

> `THE GATE`

Lore:

```text
You found this.

That should not be possible.

[ INTERACT ]
```

---

# 35. ๐Ÿ”ต THE BLUE LIGHT

Clicking the center paper causes:

> The paper to disappear.

A blue light appears.

The system speaks through:

* Text
* Typing effects
* Sounds
* Particle animation

First dialogue:

```text
Hmm...

What a little creature you are.

...

Really.

An anomaly.

How did you get here?
```

---

# 36. โ“ SECRET QUESTION ONE

Question:

> **HOW DID YOU GET HERE?**

Options:

> `I DON'T KNOW`

> `BY GLITCHING`

Correct:

> **I DON'T KNOW**

---

# 37. โŒ WRONG ANSWER

If the player selects:

> BY GLITCHING

Dialogue:

```text
...

Wrong.

You do not understand.
```

Close the Gateway.

Apply:

> **30-minute Secret Gateway lockout**

The lockout must persist through:

* Relog
* Restart
* World changes
* Reload

The secret paper remains hidden during the lockout.

---

# 38. โ“ SECRET QUESTION TWO

Correct answer to Question One:

```text
...

Interesting.

What do you seek,
little one?
```

Options:

> `I SEEK POWER`

> `I SEEK NOTHING`

Correct:

> **I SEEK POWER**

Wrong:

> **I SEEK NOTHING**

causes:

```text
Then you have no reason to be here.
```

Close Gateway.

Apply:

> 30-minute lockout.

---

# 39. โ“ SECRET QUESTION THREE

Correct answer:

```text
...

I see.

You seek power.

But power always demands
something in return.
```

Question:

> **ARE YOU READY FOR PAIN AND SUFFERING?**

Options:

> `YES`

> `NO`

Correct:

> **YES**

Wrong:

> **NO**

causes:

```text
Then you are not ready.
```

Close Gateway.

Apply:

> 30-minute lockout.

---

# 40. ๐Ÿฉธ ASCENSION REQUIREMENTS

Before the final YES can succeed, the player must possess:

* **10 Glitch Fragments**
* **1 Echo Shard**
* **2 Enchanted Golden Apples**
* **1 Book and Quill**
* **Any genuine Glitch Item**

The Glitch Item can be any legitimate Glitch Item.

The plugin must verify genuine PDC identifiers.

---

# 41. โ˜ข ASCENSION VALIDATION

When YES is pressed:

```text
Fragments >= 10
Echo Shard present
Enchanted Golden Apples >= 2
Book & Quill present
Valid Glitch Item present
Ascension not already completed
```

If requirements fail:

> Do not consume anything.

Display:

```text
...

You are not ready.
```

Then close.

---

# 42. ๐ŸŒŒ ASCENSION SEQUENCE

If all requirements are valid:

> **ASCENSION BEGINS**

The player is safely frozen.

The world visually distorts.

Sound cuts out.

Blue particles appear.

Amethyst particles appear.

The Glitch Item begins corrupting.

Then:

```text
[ GLITCH SYSTEM ]

10

9

8

7

6

5

4

3

2

1

0
```

---

# 43. ๐Ÿ’€ THE SACRIFICE

After countdown:

> Set Glitch Fragments to `0`.

Remove:

> All genuine Glitch Items owned by the player.

Do not remove:

* Normal items
* Fragment items
* Cosmetic items
* Unrelated custom items

The transaction must be atomic and duplication-safe.

---

# 44. ๐Ÿ“ข ASCENSION BROADCAST

Broadcast:

```text
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”

             โš  ASCENSION โš 

          

     HAS ASCENDED BEYOND
        THE GLITCH SYSTEM.

      A DIFFERENT GLITCH
        HAS AWAKENED.

โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
```

Then:

```text
[ GLITCH SYSTEM ]

GLITCH POWER:
RESET

ASCENSION:
CONFIRMED

STATUS:
ANOMALOUS
```

---

# 45. ๐Ÿ’œ CODEX MASTERY

Give the player:

> **Amethyst Shard**

Custom name:

# `CODEX MASTERY`

Lore:

```text
CODEX MASTERY

You surrendered your glitches.

But something remained.

[ ASCENDED ]

The Codex remembers
what you have destroyed.

Abilities:
Unknown

Double Shift to inspect.

"Power does not disappear.
It changes owners."
```

Unique PDC:

```text
codex_mastery = true
```

Renaming an ordinary Amethyst Shard must not work.

---

# 46. โ“ CODEX MASTERY'S SECRET

Initially:

> Codex appears to have no ability.

Right Click can display:

```text
CODEX MASTERY

SOULS STORED: 0

ACTIVE SOUL: NONE
```

Its true ability is:

> **Glitch Soul Extraction**

---

# 47. โ˜  GLITCH SOUL EXTRACTION

If a player carrying Codex Mastery kills a genuine player who possesses a genuine physical Glitch Item:

> The Codex steals the Glitch's Soul.

The killer does NOT receive the physical item.

Instead:

> The physical Glitch Item is destroyed.

The killer receives:

> **1 Glitch Soul**

and can use that Glitch's ability through the Codex.

---

# 48. ๐Ÿงฌ GLITCH SOUL LORE

The achievement system should eventually explain:

```text
WHY CAN'T I SEE THE GLITCH?

Because you did not steal the object.

You stole what was inside it.
```

Then:

```text
GLITCH SOUL DETECTED

The physical vessel is gone.

The ability remains.
```

The lore establishes:

> Glitch Items are vessels.

> Glitch Souls are the actual power.

---

# 49. ๐Ÿ”’ GLOBAL GLITCH OWNERSHIP

Every Glitch ID can have only one active physical existence unless specifically configured otherwise.

When a Codex extracts a Soul:

> The original physical Glitch is permanently sealed.

Example:

```text
CLOCK OF TIME
STATUS: ACTIVE

REALITY SHARD
STATUS: STOLEN

NULL CORE
STATUS: ACTIVE
```

A stolen Glitch cannot simply be crafted or rediscovered.

---

# 50. ๐ŸŒ€ CODEX SOUL SWITCHING

The Codex can store multiple unique Glitch Souls.

Only:

> **ONE SOUL**

can be active at a time.

Double Shift:

> Opens Codex Selection Mode.

GUI:

```text
CODEX MASTERY

CURRENT SOUL:
CLOCK OF TIME

AVAILABLE SOULS:

โฐ Clock of Time
๐Ÿ”ด Redline Core
๐Ÿ–ค Null Core
๐Ÿช“ Error-202
```

Selecting a Soul changes:

> **Active Glitch Ability**

---

# 51. โšก SOUL VISUALS

The Codex remains an Amethyst Shard but its effects change according to the active Soul.

Examples:

### Clock Soul

Golden temporal particles.

### Redline Soul

Red lightning.

### Null Soul

Black/white spatial distortion.

### Error-202 Soul

Critical-hit and netherite particles.

The physical Codex never changes identity.

---

# 52. ๐Ÿฉธ VALID SOUL EXTRACTION TARGETS

Soul extraction only occurs from:

> Genuine player kills.

It must not activate from:

* Mob deaths
* NPCs
* Fake players
* Armor stands
* Summoned entities
* Environmental damage
* `/kill`
* Suicide
* Void deaths
* Lightning
* Plugin-created entities

---

# 53. ๐ŸŽฏ WHICH GLITCH IS STOLEN?

If the victim has multiple Glitch Items:

Priority:

> **Currently held/selected genuine Glitch Item**

If none is selected:

> Use a deterministic valid Glitch priority.

The extraction should be clearly communicated after the kill.

Example:

```text
โš  CODEX EVENT

GLITCH SOUL EXTRACTED

SOURCE:
ERROR-202

VESSEL:
DESTROYED

SOUL:
ACQUIRED
```

---

# 54. ๐Ÿง  CODEX SOUL DATA

Each Soul stores:

```text
source_glitch_id
source_glitch_name
date_acquired
original_owner_uuid
current_owner_uuid
unique_soul_id
active
```

Never rely only on display names.

---

# 55. ๐Ÿ“ˆ CODEX PROGRESSION

The Codex can collect all unique known Glitch Souls.

### 1 Soul

> `STATUS: AWAKENING`

### 3 Souls

> `STATUS: UNSTABLE`

### 5 Souls

> `STATUS: CORRUPTED`

### 7 Souls

> `STATUS: TRANSCENDENT`

### 10 Souls

```text
SOULS: 10/10

STATUS:

โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ

UNKNOWN

โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
```

Do not automatically grant additional damage merely for collecting Souls unless configurable.

---

# 56. ๐Ÿงฌ ASCENDED FRAGMENT CAP

After successful Ascension:

Normal maximum:

> `10`

becomes:

> **15**

The player can now hold:

> `0โ€“15 Glitch Fragments`

---

# 57. โค๏ธ ASCENDED HEALTH

At 10 fragments:

> Existing +3-heart bonus remains.

For every fragment above 10:

> **+0.5 heart**

Therefore:

| Fragments | Maximum Health |
| --------: | -------------: |
|        10 |          26 HP |
|        11 |          27 HP |
|        12 |          28 HP |
|        13 |          29 HP |
|        14 |          30 HP |
|        15 |          31 HP |

The player's maximum health must be calculated rather than repeatedly incremented.

---

# 58. โš  ASCENSION DOES NOT REMOVE NORMAL PROGRESSION

After Ascension:

Players can still:

* Gain fragments from PvP kills.
* Lose fragments from death.
* Use Fragment Items.
* Reach 15.

They simply have a larger maximum.

After Ascension they begin at:

> **0 fragments**

and must rebuild their power.

This creates:

> **Sacrifice โ†’ Rebuild โ†’ Transcend**

as the endgame progression.

---

# 59. ๐Ÿ”’ SECRET GATEWAY COMPLETION

Once Ascension is complete:

> The player cannot complete it again.

If they enter the Gateway afterward:

```text
...

You already crossed the gate.

There is nothing left for you here.
```

No second Codex.

No duplicate Ascension.

---

# 60. ๐Ÿ›ก EXPLOIT PROTECTION

Protect against:

* Item duplication
* Ability duplication
* Fake kills
* Fake Glitch Items
* Renamed-item exploits
* Reload duplication
* Death-event abuse
* Advancement abuse
* Logout abuse
* Chunk unloading
* Inventory rollback
* Warden abuse
* Wither abuse
* Lightning abuse
* Ender Pearl abuse
* Secret Gateway reset abuse
* Codex duplication
* Soul duplication
* Duplicate Glitch ownership
* Fragment overflow

All important progression must be persisted.

---

# 61. ๐Ÿ’พ DATA STORAGE

Store:

```text
UUID
fragments
max_fragments
ascended
achievement_menu_open_count
discovered_glitches
obtained_glitches
cooldowns
challenge_progress
acquisition_flags
pending_offline_events
secret_gateway_lockout
secret_gateway_completed
codex_uuid
codex_souls
active_soul
glitch_ownership
```

YAML/JSON is acceptable for a smaller SMP.

Architecture should allow future SQLite migration.

---

# 62. ๐ŸŽฌ DISCOVERY ANIMATIONS

Every Glitch discovery should feel like a server event.

Sequence:

1. Brief freeze/slow.
2. Visual distortion.
3. Particle formation.
4. Unique sound.
5. Large title.
6. Subtitle.
7. Item awarded.
8. Server broadcast.
9. Discovery saved permanently.

---

# 63. ๐Ÿ“ข DISCOVERY BROADCASTS

Every Glitch should have unique broadcast text.

System Zero should have the biggest.

Example:

```text
โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—

          โš  SYSTEM ERROR โš 

       THE GLITCH SYSTEM
          HAS CHANGED.

          

       HAS DISCOVERED

          SYSTEM ZERO

       GLITCH-010 ONLINE

โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•
```

---

# 64. โœจ VFX SYSTEM

Every Glitch needs a unique visual identity.

Use:

* Particles
* Rings
* Beams
* Shockwaves
* Lightning
* Floating symbols
* Entity outlines
* Screen effects where supported
* Custom models
* Resource-pack integration

Avoid thousands of particles every tick.

Use optimized batching.

---

# 65. ๐Ÿ”Š SOUND DESIGN

### Clock of Time

* Ticking
* Reverse ticking
* Bell
* Temporal rumble

### Reality Shard

* Enderman
* Nether
* Distortion

### Null Core

* Warden heartbeat
* Deep bass
* Echo

### Redline

* Lightning
* Heartbeat
* Pitch acceleration

### Desync Heart

* Static
* Glitch clicks
* Ender Pearl sounds

### Corrupted Eye

* Enderman
* Sculk
* Whispers

### Error-202

* Critical hits
* Lightning
* Netherite
* Digital error

### Paradox Key

* Reverse sounds
* Echo
* Distorted player sounds

### Void Eye

* Deep void rumble
* End ambience
* Portal distortion

### System Zero

* Silence
* Digital shutdown
* Deep bass
* Massive system error

---

# 66. ๐Ÿ›  ADMIN MENU

Command:

```text
/menu
```

Permission:

```text
enhancedglitch.admin
```

Admin GUI should allow:

* Set fragments
* Add fragments
* Remove fragments
* Reset fragments
* Give Glitch Items
* Remove Glitch Items
* Reset discoveries
* Trigger VFX
* Trigger discoveries
* Debug abilities
* Inspect player data
* View Codex Souls
* Manage Glitch ownership
* Reload config
* Test Secret Gateway
* Reset Gateway cooldown
* Force Ascension for testing

---

# 67. โš™ CONFIGURATION

Everything important should be configurable.

Example:

```yaml
fragments:
  starting: 3
  minimum: -5
  maximum: 10

  ascended_maximum: 15

  player_kill_reward: 1
  death_penalty: 1

glitches:

  clock_of_time:
    required_fragments: 0
    cooldown: 120

  reality_shard:
    required_fragments: 2
    cooldown: 180

  null_core:
    required_fragments: 0
    cooldown: 90

  redline_core:
    required_fragments: 1
    cooldown: 60

  desync_heart:
    required_fragments: 2
    cooldown: 120

  corrupted_eye:
    required_fragments: 1
    cooldown: 90

  error_202:
    required_fragments: 3
    cooldown: 75

  paradox_key:
    required_fragments: 4
    cooldown: 150

  void_eye:
    required_fragments: 5
    cooldown: 210

  system_zero:
    required_fragments: 8
    cooldown: 300

secret_gateway:
  required_menu_opens: 46
  failed_attempt_cooldown: 1800
  required_fragments: 10
  max_fragments_after_ascension: 15

  requirements:
    echo_shard: 1
    enchanted_golden_apples: 2
    book_and_quill: 1
    glitch_item: 1
```

---

# 68. ๐Ÿง‘โ€๐Ÿ’ป RECOMMENDED ARCHITECTURE

```text
EnhancedGlitchSMP/
โ”‚
โ”œโ”€โ”€ commands/
โ”‚   โ”œโ”€โ”€ AchievementCommand
โ”‚   โ”œโ”€โ”€ WithdrawCommand
โ”‚   โ”œโ”€โ”€ GlitchCommand
โ”‚   โ””โ”€โ”€ AdminMenuCommand
โ”‚
โ”œโ”€โ”€ fragments/
โ”‚   โ”œโ”€โ”€ FragmentManager
โ”‚   โ”œโ”€โ”€ FragmentListener
โ”‚   โ””โ”€โ”€ FragmentData
โ”‚
โ”œโ”€โ”€ glitches/
โ”‚   โ”œโ”€โ”€ GlitchManager
โ”‚   โ”œโ”€โ”€ GlitchItem
โ”‚   โ”œโ”€โ”€ ClockOfTime
โ”‚   โ”œโ”€โ”€ RealityShard
โ”‚   โ”œโ”€โ”€ NullCore
โ”‚   โ”œโ”€โ”€ RedlineCore
โ”‚   โ”œโ”€โ”€ DesyncHeart
โ”‚   โ”œโ”€โ”€ CorruptedEye
โ”‚   โ”œโ”€โ”€ Error202
โ”‚   โ”œโ”€โ”€ ParadoxKey
โ”‚   โ”œโ”€โ”€ VoidEye
โ”‚   โ””โ”€โ”€ SystemZero
โ”‚
โ”œโ”€โ”€ codex/
โ”‚   โ”œโ”€โ”€ CodexManager
โ”‚   โ”œโ”€โ”€ GlitchSoul
โ”‚   โ”œโ”€โ”€ SoulManager
โ”‚   โ””โ”€โ”€ SoulSelectionGUI
โ”‚
โ”œโ”€โ”€ secret/
โ”‚   โ”œโ”€โ”€ SecretGateway
โ”‚   โ”œโ”€โ”€ GatewayDialogue
โ”‚   โ”œโ”€โ”€ GatewayManager
โ”‚   โ””โ”€โ”€ AscensionManager
โ”‚
โ”œโ”€โ”€ abilities/
โ”‚   โ”œโ”€โ”€ AbilityManager
โ”‚   โ””โ”€โ”€ CooldownManager
โ”‚
โ”œโ”€โ”€ achievements/
โ”‚   โ”œโ”€โ”€ AchievementManager
โ”‚   โ””โ”€โ”€ DiscoveryManager
โ”‚
โ”œโ”€โ”€ gui/
โ”‚   โ”œโ”€โ”€ GlitchMenu
โ”‚   โ”œโ”€โ”€ GlitchInfoMenu
โ”‚   โ”œโ”€โ”€ SecretGatewayGUI
โ”‚   โ””โ”€โ”€ AdminMenu
โ”‚
โ”œโ”€โ”€ effects/
โ”‚   โ”œโ”€โ”€ ParticleManager
โ”‚   โ”œโ”€โ”€ SoundManager
โ”‚   โ””โ”€โ”€ VFXManager
โ”‚
โ”œโ”€โ”€ data/
โ”‚   โ””โ”€โ”€ PlayerDataManager
โ”‚
โ””โ”€โ”€ EnhancedGlitchSMP.java
```

Architecture must be modular.

Future:

> `GLITCH-011`

should be possible without rewriting the entire plugin.

---

# 69. โšก PERFORMANCE REQUIREMENTS

This is an SMP plugin.

Performance is critical.

Do NOT:

* Scan the entire world every tick.
* Scan every entity unnecessarily.
* Create huge particle counts.
* Store giant world snapshots.
* Continuously run expensive tasks.
* Attempt full-world rewinds.

Use:

* Bukkit/Paper events
* Scheduled tasks only when necessary
* Radius-limited entity searches
* Cached cooldowns
* Persistent data
* Cleanup tasks
* Event cancellation
* Safe async operations where appropriate

---

# 70. ๐Ÿงฉ FINAL PROGRESSION

The complete Glitch progression should feel like:

```text
NORMAL PLAYER
      โ”‚
      โ–ผ
GLITCH FRAGMENTS
      โ”‚
      โ–ผ
GLITCH ITEMS
      โ”‚
      โ–ผ
7 DISCOVERABLE GLITCHES
      โ”‚
      โ–ผ
3 CLASSIFIED GLITCHES
      โ”‚
      โ–ผ
PARADOX
      โ”‚
      โ–ผ
VOID
      โ”‚
      โ–ผ
SYSTEM ZERO
      โ”‚
      โ–ผ
????
      โ”‚
      โ–ผ
SECRET GATEWAY
      โ”‚
      โ–ผ
ASCENSION
      โ”‚
      โ–ผ
CODEX MASTERY
      โ”‚
      โ–ผ
GLITCH SOULS
      โ”‚
      โ–ผ
STEAL OTHER PLAYERS' GLITCHES
      โ”‚
      โ–ผ
REBUILD FROM 0
      โ”‚
      โ–ผ
15 FRAGMENT MAXIMUM
      โ”‚
      โ–ผ
ASCENDED ANOMALY
```

---

# 71. ๐ŸŒŒ THE TEN GLITCHES

The progression represents:

> **GLITCH-01 โ€” TIME**
> You break time.

> **GLITCH-02 โ€” REALITY**
> You break reality.

> **GLITCH-03 โ€” SPACE**
> You break position.

> **GLITCH-04 โ€” SPEED**
> You break movement.

> **GLITCH-05 โ€” DESYNC**
> You break synchronization.

> **GLITCH-06 โ€” VISION**
> You break perception.

> **GLITCH-07 โ€” COMBAT**
> You break combat rules.

> **GLITCH-08 โ€” SELF**
> You break causality.

> **GLITCH-09 โ€” VOID**
> You break the world's boundary.

> **GLITCH-10 โ€” SYSTEM**
> You break the rules themselves.

---

# 72. ๐Ÿœ THE SECRET GATEWAY LORE

The first ten Glitches are not the end.

They are only:

> **the surface.**

The Secret Gateway reveals that Glitch Items are not actually the source of power.

They are:

> **containers.**

The real power is:

> **the Glitch Soul.**

The Codex Mastery allows an Ascended player to steal those Souls from other players.

This creates a completely new endgame economy:

> **Glitches can disappear.**

> **Glitches can be stolen.**

> **Glitches can become extinct.**

> **Players can hunt one another for unique powers.**

And eventually:

> The entire server may have to fight over the remaining Glitch Souls.

---

# 73. ๐Ÿฉธ THE SECRET GATEWAY'S PURPOSE

The Secret Gateway should feel fundamentally different from normal progression.

Normal progression says:

> **"Become stronger."**

The Gateway asks:

> **"What are you willing to sacrifice?"**

The player gives up:

* 10 Glitch Fragments
* Their Glitch Items
* Their previous progression

and receives:

> **Codex Mastery**

The player then starts again.

But now:

> **they can steal the power of others.**

---

# 74. ๐Ÿง  FINAL EXPERIENCE

The plugin should create the feeling that players are uncovering something they were never meant to know about.

A player opens the Achievement Menu once.

Nothing.

Ten times.

Nothing.

Thirty times.

Nothing.

Forty-five times.

Nothing.

Then one day:

> **a paper appears.**

They click it.

Everything goes black.

A blue light appears.

And it says:

> **"Hmm..."**

> **"What a little creature you are."**

> **"Really."**

> **"An anomaly."**

> **"How did you get here?"**

The player answers.

Three questions.

Three decisions.

Then:

> **"Are you ready for pain and suffering?"**

They press:

> **YES.**

Everything they worked for disappears.

The server announces:

> **AN ASCENSION HAS OCCURRED.**

An innocent Amethyst Shard appears in their inventory.

> **CODEX MASTERY**

It appears useless.

Until they kill another player carrying a Glitch Item.

Then:

```text
[ CODEX ]

GLITCH SOUL ACQUIRED.

VESSEL:
DESTROYED.

POWER:
TRANSFERRED.
```

The victim's Glitch is gone.

The killer now possesses its ability.

And somewhere in the Achievement Database:

> **one Glitch has become extinct.**

---

# 75. ๐Ÿ”ฎ FUTURE EXPANSION

Leave the architecture open for:

> **GLITCH-011**

Do not reveal what it is.

Do not add it to the achievement menu yet.

Do not create a fake placeholder ability.

Only leave the system ready for it.

The future lore should suggest:

> The players thought they had broken the Glitch System.

But perhaps:

> **the Glitch System was waiting for someone to become strong enough to break it.**

---

# 76. ๐Ÿท FINAL IDENTITY

Every major interface should reinforce:

> **ENHANCED GLITCH SMP**

and:

> **Created by `markyt_`**

The plugin should never feel like a generic collection of Minecraft abilities.

It should feel like:

# **A SECRET SYSTEM HIDDEN INSIDE MINECRAFT.**

The desired experience is:

> **Mysterious.**

> **Powerful.**

> **Cinematic.**

> **Dangerous.**

> **Rare.**

> **Unpredictable.**

> **Polished.**

> **Extremely replayable.**

Most importantly:

> **Every discovery should make players ask what the hell they just found.**

# โš  ENHANCED GLITCH SMP

### **Reality is no longer behaving normally.**

### **Created by `markyt_`.**
Kodari AI
KodariOct 3 at 9:46 am 4
EnhancedGlitchSMP
EnhancedGlitchSMP is a comprehensive Minecraft SMP plugin that introduces a hidden glitch power system. Players start with 3 Glitch Fragments, gaining or losing them through PvP kills and deaths. The plugin features 10 unique Glitch Items, each with distinct abilities, cooldowns, VFX, sounds, and acquisition challenges. Players discover glitches through cinematic events, unlock abilities based on fragment levels, and access a secret Gateway system after opening the achievement menu 46 times. The Gateway leads to Ascension, granting Codex Mastery that allows stealing Glitch Souls from other players. Includes fragment withdrawal, achievement database, admin menu, and full configurable progression.
  1. Build the Paper plugin and persistent fragment, discovery, cooldown, and ownership data.

  2. Add glitch items, challenge-based discoveries, PvP progression, abilities, and their VFX.

  3. Add the achievement database, secret Gateway/Ascension, Codex, commands, and admin menu.

Created the Enhanced Glitch SMP Paper plugin with persistent fragment progression, PDC-identified items, ten challenge-based discoveries and abilities, cooldowns, and particle/sound VFX. It also includes the Glitch Database, hidden Gateway and Ascension, Codex soul extraction and selection, player/admin commands, and configurable progression settings.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
5 1,425
src/main/java/com/markyt/enhancedglitchsmp/EnhancedGlitchSMP.java
package com.markyt.enhancedglitchsmp;

import com.cryptomorin.xseries.XAttribute;
import com.cryptomorin.xseries.XEnchantment;
import com.cryptomorin.xseries.XMaterial;
import com.cryptomorin.xseries.XPotion;
import com.cryptomorin.xseries.XSound;
import com.cryptomorin.xseries.particles.XParticle;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.NamespacedKey;
import org.bukkit.World;
import org.bukkit.attribute.AttributeInstance;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.entity.Wither;
import org.bukkit.entity.WitherSkeleton;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPlaceEvent;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.entity.EntityPotionEffectEvent;
import org.bukkit.event.entity.EntityTargetLivingEntityEvent;
import org.bukkit.event.entity.ProjectileLaunchEvent;
import org.bukkit.event.player.PlayerChangedWorldEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.event.player.PlayerToggleSneakEvent;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataContainer;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.scheduler.BukkitTask;
import org.bukkit.util.Vector;
import org.bukkit.GameMode;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.player.PlayerTeleportEvent;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;

public final class EnhancedGlitchSMP extends org.bukkit.plugin.java.JavaPlugin implements Listener, CommandExecutor, TabCompleter {
    private static final String[] GLITCH_IDS = {"GLITCH-01", "GLITCH-02", "GLITCH-03", "GLITCH-04", "GLITCH-05", "GLITCH-06", "GLITCH-07", "GLITCH-08", "GLITCH-09", "GLITCH-10"};
    private static final String[] GLITCH_KEYS = {"clock_of_time", "reality_shard", "null_core", "redline_core", "desync_heart", "corrupted_eye", "error_202", "paradox_key", "void_eye", "system_zero"};
    private static final String[] GLITCH_NAMES = {"Clock of Time", "Reality Shard", "Null Core", "Redline Core", "Desync Heart", "Corrupted Eye", "Error-202", "Paradox Key", "Void Eye", "System Zero"};
    private static final String[] GLITCH_MATERIALS = {"CLOCK", "NETHER_STAR", "ECHO_SHARD", "REDSTONE_BLOCK", "HEART_OF_THE_SEA", "ENDER_EYE", "NETHERITE_AXE", "TRIPWIRE_HOOK", "ENDER_EYE", "NETHERITE_SCRAP"};
    private static final String[] GLITCH_TYPES = {"TEMPORAL", "REALITY", "SPATIAL", "SPEED", "DESYNC", "VISION", "COMBAT", "CAUSALITY", "VOID", "SYSTEM"};
    private static final String[] GLITCH_DISCOVERY = {
            "Clock in hand and offhand, underground at night; survive a fatal hit.",
            "Defeat five Withers, hold five Nether Stars, then survive a Wither Skeleton hit.",
            "Wear a Wither Skeleton Skull, hold an Echo Shard, and survive a Warden hit.",
            "Hold a Redstone Block and survive a lightning strike.",
            "Hold a Heart of the Sea, throw an Ender Pearl, then disconnect before it lands.",
            "Hold a Nether Star and defeat an Enderman during a thunderstorm.",
            "Hold a Netherite Axe and Nether Star, then survive lightning.",
            "Stand still for 60 seconds during a full moon with a player nearby, then throw a Pearl while holding a Tripwire Hook.",
            "In the End, hold an Eye, Respawn Anchor, and End Crystal; throw the Eye over the Void.",
            "In the End, hold a Nether Star near the Void for 30 seconds, then throw a Pearl with 8+ fragments."
    };

    private final Map<UUID, PlayerData> players = new ConcurrentHashMap<>();
    private final Map<UUID, TemporalField> temporalFields = new HashMap<>();
    private final Map<UUID, Long> stillSince = new HashMap<>();
    private final Map<UUID, Long> lastCodexSneak = new HashMap<>();
    private final Map<UUID, Long> zeroChargeSince = new HashMap<>();
    private final Map<UUID, Float> speedRestore = new HashMap<>();
    private final Map<UUID, GhostState> ghostStates = new HashMap<>();
    private final Map<UUID, UUID> guardianOwners = new HashMap<>();
    private final Map<UUID, BukkitTask> activeFields = new HashMap<>();
    private final Set<UUID> zeroState = new HashSet<>();
    private final Set<UUID> ascensionInProgress = new HashSet<>();
    private final Set<String> globallySealed = new HashSet<>();
    private File dataFile;
    private YamlConfiguration dataConfig;

    private NamespacedKey glitchKey;
    private NamespacedKey fragmentKey;
    private NamespacedKey actionKey;
    private NamespacedKey codexKey;
    private NamespacedKey soulKey;
    private NamespacedKey gatewayPaperKey;
    private NamespacedKey guiKey;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        glitchKey = new NamespacedKey(this, "glitch_id");
        fragmentKey = new NamespacedKey(this, "fragment_item");
        actionKey = new NamespacedKey(this, "gui_action");
        codexKey = new NamespacedKey(this, "codex_mastery");
        soulKey = new NamespacedKey(this, "codex_soul");
        gatewayPaperKey = new NamespacedKey(this, "gateway_paper");
        guiKey = new NamespacedKey(this, "glitch_gui");
        loadData();
        Bukkit.getPluginManager().registerEvents(this, this);
        for (String command : List.of("achievement", "withdraw", "glitch", "menu")) {
            if (getCommand(command) != null) {
                getCommand(command).setExecutor(this);
                getCommand(command).setTabCompleter(this);
            }
        }
        Bukkit.getScheduler().runTaskTimer(this, () -> {
            for (Player player : Bukkit.getOnlinePlayers()) {
                applyProgression(player);
                tickVoidCharge(player);
            }
        }, 20L, 200L);
        Bukkit.getScheduler().runTaskTimer(this, this::saveData, 1200L, 1200L);
        for (Player player : Bukkit.getOnlinePlayers()) loadPlayer(player);
    }

    @Override
    public void onDisable() {
        for (BukkitTask task : activeFields.values()) task.cancel();
        activeFields.clear();
        saveData();
    }

    private void loadData() {
        dataFile = new File(getDataFolder(), "players.yml");
        if (!getDataFolder().exists()) getDataFolder().mkdirs();
        dataConfig = YamlConfiguration.loadConfiguration(dataFile);
        for (String id : dataConfig.getStringList("global-sealed")) globallySealed.add(id);
        ConfigurationSection section = dataConfig.getConfigurationSection("players");
        if (section == null) return;
        for (String rawUuid : section.getKeys(false)) {
            try {
                UUID uuid = UUID.fromString(rawUuid);
                String path = "players." + rawUuid + ".";
                PlayerData data = new PlayerData();
                data.fragments = dataConfig.getInt(path + "fragments", getConfig().getInt("fragments.starting", 3));
                data.ascended = dataConfig.getBoolean(path + "ascended", false);
                data.menuOpens = dataConfig.getInt(path + "menu-opens", 0);
                data.gatewayCompleted = dataConfig.getBoolean(path + "gateway-completed", false);
                data.gatewayLockout = dataConfig.getLong(path + "gateway-lockout", 0L);
                data.baseHealth = dataConfig.getDouble(path + "base-health", 20.0);
                data.baseHealthSet = dataConfig.getBoolean(path + "base-health-set", dataConfig.contains(path + "base-health"));
                data.withersKilled = dataConfig.getInt(path + "withers-killed", 0);
                data.pearlThrown = dataConfig.getBoolean(path + "pearl-thrown", false);
                data.pendingPearl = dataConfig.getBoolean(path + "pending-pearl", false);
                data.discovered.addAll(dataConfig.getStringList(path + "discovered"));
                data.souls.addAll(dataConfig.getStringList(path + "souls"));
                data.activeSoul = dataConfig.getString(path + "active-soul", "");
                ConfigurationSection cooldowns = dataConfig.getConfigurationSection(path + "cooldowns");
                if (cooldowns != null) for (String key : cooldowns.getKeys(false)) data.cooldowns.put(key, cooldowns.getLong(key));
                players.put(uuid, data);
            } catch (IllegalArgumentException ignored) {
            }
        }
    }

    private synchronized void saveData() {
        if (dataConfig == null) return;
        dataConfig.set("global-sealed", new ArrayList<>(globallySealed));
        dataConfig.set("players", null);
        for (Map.Entry<UUID, PlayerData> entry : players.entrySet()) {
            String path = "players." + entry.getKey() + ".";
            PlayerData data = entry.getValue();
            dataConfig.set(path + "fragments", data.fragments);
            dataConfig.set(path + "ascended", data.ascended);
            dataConfig.set(path + "menu-opens", data.menuOpens);
            dataConfig.set(path + "gateway-completed", data.gatewayCompleted);
            dataConfig.set(path + "gateway-lockout", data.gatewayLockout);
            dataConfig.set(path + "base-health", data.baseHealth);
            dataConfig.set(path + "base-health-set", data.baseHealthSet);
            dataConfig.set(path + "withers-killed", data.withersKilled);
            dataConfig.set(path + "pearl-thrown", data.pearlThrown);
            dataConfig.set(path + "pending-pearl", data.pendingPearl);
            dataConfig.set(path + "discovered", new ArrayList<>(data.discovered));
            dataConfig.set(path + "souls", new ArrayList<>(data.souls));