Lakatos Erik

Also add a command /Midnight Weapons To open the gui for all the custom weapons made, only op's can access this

๐Ÿ“Ž 1 file 13,092 chars
๐Ÿ“„
pasted-code-1795258398280.txt
txt 383 lines
โ–ถ
# Minecraft Plugin Development โ€“ Midnight

Create a fully functional Minecraft Paper plugin named **Midnight**.

**Technical requirements:**
- Minecraft version: Java 1.21.11
- Server software: Paper
- Java 21
- Plugin name: Midnight
- Main plugin command: `/Midnight`
- Package name and project structure should be clean and organized.
- Use efficient event handling and task scheduling.
- Avoid unnecessary repeating tasks that could cause server lag.
- All boss abilities, weapon abilities, particles, damage, cooldowns, and effects must actually work.
- Do not leave placeholder abilities or unfinished mechanics.

# 1. BOSS: THE KING OF HELL

**Appearance:** Wither Skeleton

**Base statistics:**
- Health: 1200 HP
- Regular attack damage: 9 HP
- Movement speed: Equivalent to a player sprinting with Speed II.
- Jump height: Approximately 6 blocks. The boss should jump regularly to prevent players from easily building above it.
- The boss must have a custom bossbar displaying its name, current health, and current phase.

**Phases:**

| Phase | Health |
|---|---|
| Phase 1 | 1200โ€“800 HP |
| Phase 2 | 799โ€“450 HP |
| Phase 3 | 449โ€“100 HP |
| Phase 4 | 99โ€“0 HP |

Phase transitions must happen automatically when the boss reaches the corresponding health threshold.

Make sure each phase activates only once. Abilities belonging to previous phases should stop being used when a new phase begins.

## PHASE 1

**Ability 1 โ€“ Lava Cast**
- Summon lava in a 5-block-wide circular area around the boss.
- Leave a 3x3 safe area in the center for the boss.
- Restore all affected blocks to their original states after 10 seconds.
- Do not permanently destroy or replace the arena.
- Cooldown: 50 seconds.

**Ability 2 โ€“ Ground Smash**
- Jump approximately 8 blocks into the air.
- At the peak of the jump, temporarily stop falling.
- Select a completely random player within 25 blocks.
- Fly towards that player.
- If there are no players within range, simply fall back to the ground.
- On landing, deal 12 damage to all enemies within a 6-block radius.
- Launch affected players approximately 20 blocks upwards and slightly sideways.
- Create impressive cool-gray landing particles.
- Cooldown: 60 seconds.

**Ability 3 โ€“ Tornado**
- The boss starts spinning.
- Create a tornado effect with particles surrounding the boss.
- Pull nearby enemies towards the boss.
- If a player touches the boss during this ability, launch them approximately 30 blocks away and deal 14 damage.
- Cooldown: 120 seconds.

## PHASE 2

**Ability 1 โ€“ Wither Attack**
- Summon 2 Withers next to the King of Hell.
- Each Wither has 100 HP.
- The Withers must not damage the King of Hell.
- The Withers should not drop any loot or experience.
- This ability activates ONLY ONCE, immediately when Phase 2 begins.
- Do not summon additional Withers through this ability.

**Ability 2 โ€“ Flying Skulls**
- Give every player within 100 blocks Levitation II for 20 seconds.
- Players must receive normal fall damage when they land.
- Create purple particles flying around every affected player for the entire duration of Levitation.
- Cooldown: 120 seconds.

**Ability 3 โ€“ Charge**
- Select a completely random player within 50 blocks.
- Charge directly towards that player.
- Give the boss Speed III while charging.
- On impact, deal 12 damage.
- Cooldown: 50 seconds.

## PHASE 3

**Ability 1 โ€“ Laser Beam**
- Shoot laser beams towards the 3 closest players.
- One separate laser for each player.
- Lasers should travel extremely quickly.
- Create impressive red laser particles.
- Deal 10 damage on impact.
- Knock affected players approximately 15 blocks away.
- Cooldown: 90 seconds.

**Ability 2 โ€“ Aggro**
- Teleport to a completely random player within 50 blocks.
- Focus attacks on that player for 10 seconds.
- After 10 seconds, teleport to another random player and repeat.
- Repeat this process 5 times in total.
- After the fifth teleport, the ability ends.
- Cooldown: 150 seconds.

**Ability 3 โ€“ Fireball**
- Shoot a fireball towards a random nearby player.
- Explosion strength equivalent to approximately 5 TNT.
- Deal 15 damage.
- Knock affected players approximately 15 blocks away.
- Cooldown: 240 seconds.

Make sure the explosion does not permanently destroy the arena. If necessary, simulate the explosion using custom damage and knockback instead of actual block destruction.

## PHASE 4

### Ability 1 โ€“ Twin

This ability activates ONLY ONCE when Phase 4 begins.

- Summon a Magma Cube with 300 HP.
- Give the Magma Cube its own bossbar.
- While the Magma Cube is alive, the King of Hell must be completely invulnerable.
- The Magma Cube deals 8 regular attack damage.
- Prevent the Magma Cube from splitting into smaller cubes when killed.
- When the Magma Cube dies, remove its bossbar and restore the King of Hell's normal damage vulnerability.

**Magma Cube abilities:**

**Ability 1 โ€“ Meteor Jump**
- Jump approximately 50 blocks into the air.
- Target a player below.
- Land on the targeted player.
- Deal 15 damage on impact.
- Cooldown: 200 seconds.

**Ability 2 โ€“ Hellfire**
- Set every player within 100 blocks on fire for 10 seconds.
- Each fire damage tick should deal 5 damage.
- Apply one custom damage tick per second.
- Cooldown: 160 seconds.

**Ability 3 โ€“ Army of Hell**
- Summon 3 regular Blazes.
- Summon 5 regular Wither Skeletons.
- Cooldown: 90 seconds.

### Ability 2 โ€“ Dasher
- Dash towards random players.
- Perform 5 dashes in total.
- Each dash should deal 10 damage and approximately 5 blocks of knockback.
- Perform one dash every 3 seconds.
- Cooldown: 90 seconds.

### Ability 3 โ€“ Flight
- Fly approximately 30 blocks into the sky.
- Stay in the air for 15 seconds.
- After 15 seconds, drop towards a targeted player.
- The boss must not take fall damage.
- Deal 13 damage to the player hit on landing.
- Add appropriate particles during takeoff and landing.

# 2. BOSS DROP โ€“ HELL WAND

When the King of Hell is defeated, drop a custom weapon called **Hell Wand**.

The weapon must be a stick with a custom name, lore, and kill counter.

## Kill progression system

- The Hell Wand starts at 0 kills.
- When its owner gets a player kill while carrying the weapon anywhere in their inventory, increase its kill counter by 1.
- The weapon must remember its kill count.
- Abilities unlocked at previous kill milestones must NEVER disappear when reaching higher milestones.
- Store the kill count using persistent item data so it survives restarts, transfers, and inventory movements.
- Prevent duplicate kill registrations.

Display the weapon's current kill count and unlocked abilities in its lore.

## HELL WAND ABILITIES

### Ability 1 โ€“ Poison Cast
Unlocked at: 0 kills

- Find the closest untrusted player within 15 blocks.
- Apply Poison II for 10 seconds.
- Cooldown: 120 seconds.
- Activation: Shift + Right Click.

### Ability 2 โ€“ Tide Pull
Unlocked at: 0 kills

- Find the closest untrusted player within 15 blocks.
- Pull that player towards the weapon's owner.
- Apply Slowness III for 10 seconds after the pull.
- Cooldown: 240 seconds.
- Activation: Shift + Offhand Swap Key.

### Passive 1 โ€“ Strength of the Hell
Unlocked at: 0 kills

- Give the owner permanent Strength I while the Hell Wand is anywhere in their inventory.
- It must work even when the weapon is not in the main hand or offhand.

### Ability 3 โ€“ Health Cast
Unlocked at: 3 kills

- Give the owner 5 absorption hearts.
- Apply Regeneration IV for 10 seconds.
- Cooldown: 300 seconds.
- Activation: Offhand Swap Key.

### Passive 2 โ€“ Nature's Protection
Unlocked at: 3 kills

- When the Hell Wand is in the offhand, give the owner:
  - Regeneration I
  - Resistance I

### Passive 3 โ€“ Underworld Defence
Unlocked at: 4 kills

- Give permanent Fire Resistance while the Hell Wand is anywhere in the inventory.
- When the owner is in lava, additionally give Regeneration I.
- Make sure the passive works even when the weapon is not held.

### Ability 4 โ€“ Hellfire
Unlocked at: 6 kills

- Shoot a visual fireball.
- The fireball must NOT destroy blocks or cause a normal explosion.
- Use orange particles around the projectile.
- When the projectile lands, deal 10 damage to every player within its impact radius.
- Cooldown: 240 seconds.
- Activation: Right Click.

### Passive 4 โ€“ Redemption
Unlocked at: 12 kills

- Give the owner Resistance II while the Hell Wand is in their offhand.

# 3. TRUST SYSTEM

Implement a persistent trust system.

Commands:

`/Trust add [player]`
`/Trust remove [player]`

Requirements:
- Players can add and remove trusted players.
- Trusted players cannot be targeted by the Hell Wand's negative effects.
- Trusted players can still receive positive effects.
- All trust data must persist after server restarts.
- Players should not be able to trust themselves unnecessarily.
- Trust commands should work for non-OP players.

# 4. COMMANDS

All commands must work properly with tab completion and clear error messages.

**Boss commands (OP only):**

`/Midnight boss [BossName] summon`

Summons the specified boss.

`/Midnight boss [BossName] health set [Number]`

Sets the boss's current health.

`/Midnight boss [BossName] health add [Number]`

Adds health to the boss.

`/Midnight boss [BossName] health remove [Number]`

Removes health from the boss.

`/Midnight boss [BossName] teleport`

Teleports the specified boss to the command executor.

**Weapon commands (OP only):**

`/Killcount [weapon] add [number]`

Adds kills to a weapon.

`/Killcount [weapon] remove [number]`

Removes kills from a weapon.

Requirements:
- Killcount commands should modify the weapon held by the command executor.
- Make sure the weapon's lore updates immediately.
- Do not allow negative kill counts.
- Support the Hell Wand and future custom weapons.

**Permissions:**
- All Midnight boss and Killcount commands must be OP-only.
- Trust commands must be available to everyone.

# 5. CONFIGURATION

Create a comprehensive `config.yml`.

EVERY relevant value should be configurable without needing to edit Java code.

**Boss configuration:**
- Boss maximum health.
- Boss phase health thresholds.
- Boss regular attack damage.
- Boss movement speed.
- Boss jump height.
- Every boss ability's damage.
- Every boss ability's cooldown.
- Every boss ability's range.
- Knockback strength.
- Particle types and amounts.
- Ability durations.
- Summoned minion health and damage.
- Bossbar names and colors.

**Weapon configuration:**
- Weapon names and descriptions.
- Weapon kill unlock requirements.
- Ability damage.
- Ability cooldowns.
- Ability ranges.
- Effect durations and amplifier levels.
- Activation methods.
- Passive activation requirements.
- Particle settings.

**Important:**
- Allow administrators to change weapon descriptions and lore directly in the config.
- Allow administrators to change an ability's activation method without modifying Java code.
- Make sure every ability has its own configurable settings.
- Include comments explaining what each configuration option does.
- Validate config values and use safe defaults if something is invalid.

# 6. IMPORTANT TECHNICAL REQUIREMENTS

1. Use Paper API compatible with Minecraft 1.21.11 and Java 21.
2. All bosses must have unique persistent identifiers so the plugin can recognize them.
3. Bosses must not accidentally damage themselves or their allied summoned mobs.
4. Boss health, phase transitions, cooldowns, and abilities must remain synchronized.
5. Prevent multiple abilities from activating simultaneously if they would conflict.
6. Properly clean up bossbars, particles, tasks, and summoned entities when bosses die or the server shuts down.
7. Prevent custom bosses from dropping regular mob loot unless explicitly configured.
8. Make all damage and knockback values consistent and configurable.
9. Protect the arena from permanent block destruction.
10. Make sure all custom weapons and their kill counts survive server restarts.
11. Ensure all abilities work in multiplayer environments.
12. Handle players disconnecting, dying, teleporting, or leaving the boss's range.
13. Do not let trusted players get affected by negative weapon abilities.
14. Make sure all cooldowns are tracked separately for each weapon owner.
15. Prevent abilities from being activated through unintended interactions.

# 7. DELIVERABLES

Generate the COMPLETE plugin project, including:

- All Java source files.
- `plugin.yml`.
- `config.yml`.
- Maven `pom.xml`.
- Any required resource files.
- A clear project structure.
- Instructions for compiling the plugin into a JAR.
- Instructions for installing it on a Paper 1.21.11 server.

**Do not just provide snippets or explanations. Generate the complete working plugin.**

Before finishing, review the entire codebase for compilation errors, missing event listeners, incorrect API usage, broken ability activations, and conflicts between boss abilities.

The final result must be a functional, ready-to-compile Minecraft plugin named **Midnight**.
Kodari AI
KodariYesterday at 10:56 am 10
MidnightWeaponsGUI
An OP-only GUI system for the Midnight plugin that displays all custom weapons in an interactive chest inventory. Players with operator permissions can open the weapon menu via the /Midnight Weapons command, browse available custom weapons with detailed lore and kill requirements, and click items to receive them. The GUI uses a button-based framework with lazy initialization, centralized inventory management, and automatic event handling for clicks, opens, and closes. Each weapon slot shows its name, description, and unlock requirements, with a decorative border for visual clarity. The system supports future weapon additions through a configurable weapon registry.
  • Build the boss encounter, phase abilities, and cleanup.

  • Add the Hell Wand, trust system, commands, and weapon GUI.

  • Expose encounter and weapon settings in config.yml.

Created Midnight with the boss encounter, Hell Wand, trust commands, configuration, and OP-only weapon GUI.

Limitations: Some movement and animation timings remain fixed in code, so not every requested value is configurable. Compilation and in-game behavior have not been verified.

To install:

  1. Click Compile in the top bar, then Compile in the window. On mobile, use โ‹ฎ โ†’ Compile Project.

  2. Download the resulting JAR and place it in your Paper serverโ€™s plugins folder.

  3. Restart the server, then use /midnight weapons or /midnight boss kingofhell summon as an operator.

Lakatos Erik

ADDITIONAL WEAPON โ€“ FROZEN SCYTHE

Add another custom weapon to the Midnight plugin.

Weapon details:

  • Name: Frozen Scythe
  • Base item: Diamond Axe
  • Implement the same kill progression system as the Hell Wand.
  • When the owner gets a player kill while carrying the weapon anywhere in their inventory, increase its kill count by 1.
  • Previously unlocked abilities and passives must never disappear when reaching higher kill milestones.
  • Display the current kill count and unlocked abilities in the weapon's lore.
  • Store kill progression using PersistentDataContainer.
  • All abilities must respect the Trust system. An enemy means an untrusted player.

Ability 1 โ€“ Freeze!

  • Obtainable from: 0 kills.
  • Shoot a projectile made of blue particles.
  • When the projectile hits an untrusted player:

- Deal 10 damage. - Freeze the player, preventing them from moving or jumping for 3 seconds.

  • The freeze effect must not prevent the player from looking around.
  • Make sure the player is unfrozen properly after 3 seconds, even if they disconnect or die.
  • Cooldown: 180 seconds.
  • Activation: Offhand Swap Key.

Ability 2 โ€“ Frost Dash

  • Obtainable from: 0 kills.
  • Dash forward approximately 10 blocks.
  • If the dash passes through an untrusted player:

- Deal 10 damage to them.

  • The dash should detect collisions with players along its entire path, not just at the endpoint.
  • Cooldown: 120 seconds.
  • Activation: Right Click.

Passive 1 โ€“ Frost Renewal

  • Obtainable from: 1 kill.
  • When standing on Ice, Packed Ice, or Blue Ice, give the owner Regeneration II.
  • Remove the effect when they stop standing on these blocks.

Passive 2 โ€“ Cryomania

  • Obtainable from: 2 kills.
  • Track critical hits against individual untrusted players.
  • When an untrusted player receives 5 critical hits from this weapon within 30 seconds:

- Apply Slowness IV for 10 seconds. - Reset that player's critical-hit counter.

  • Critical hits must only count when using the Frozen Scythe.
  • Track counters separately for each attacker and target.
  • Expire old hits after 30 seconds.

Ability 3 โ€“ Fidget Spinner

  • Obtainable from: 4 kills.
  • Summon a blue particle effect that spins rapidly around the owner in a circle.
  • While the ability is active, the owner cannot receive knockback.
  • Duration: 10 seconds.
  • Cooldown: 180 seconds.
  • Activation: Shift + Right Click.

Passive 3 โ€“ Snowy Run

  • Obtainable from: 5 kills.
  • When walking on Snow Blocks or Snow Layers, increase the owner's movement speed to approximately 2x normal speed.
  • Remove the speed bonus when they stop walking on snow.
  • Avoid stacking the speed bonus with itself or permanently changing the player's base movement speed.

Passive 4 โ€“ Wings of a Chicken

  • Obtainable from: 5 kills.
  • The owner takes no fall damage while carrying the Frozen Scythe anywhere in their inventory.

Ability 4 โ€“ Frozen Boom

  • Obtainable from: 8 kills.
  • Shoot out 3 white particles as a projectile.
  • When the projectile hits an untrusted player, pull them backwards, away from the weapon's owner.
  • The projectile must detect player collisions properly.
  • Cooldown: 300 seconds.
  • Activation: Shift + Offhand Swap Key.

Additional requirements

  • Every ability and passive must be configurable in config.yml.
  • Include configurable cooldowns, damage, ranges, durations, particle types, and unlock requirements.
  • All abilities must respect the existing Trust system.
  • Trusted players must never be affected by negative effects from this weapon.
  • Make sure all abilities work independently of the Hell Wand.
  • Make sure cooldowns are tracked separately for each weapon and player.
  • Update the Frozen Scythe's lore immediately when its kill count changes.

Be able to config everything about it in config

Kodari AI
KodariYesterday at 4:02 pm 13
  • Add Frozen Scythe progression, lore, GUI access, and /killcount support.

  • Implement its abilities and passives with independent cooldowns and trust checks.

  • Add configurable settings and cleanup for temporary effects.

Added the Frozen Scythe with its progression, abilities, passives, trust checks, and configurable settings.

Operators can obtain it through /midnight weapons and adjust its kills with /killcount frozenscythe add|remove <number>.

Compilation and in-game behavior have not been verified.

Lakatos Erik
๐Ÿ“Ž 1 file 6,656 chars
๐Ÿ“„
pasted-code-1795277365788.txt
txt 145 lines
โ–ถ
# ADDITIONAL FEATURES & BUG FIXES

## 1. FAKE PLAYER SYSTEM

Add a fake player system for testing custom weapon abilities.

**Commands:**

`/player spawn [Name]`
- Spawn a fake player with the specified name.
- The fake player must appear as a real player entity in the world.
- It must have a visible player model and be targetable by custom weapon abilities.
- It must be possible to hit the fake player with weapons.
- It must be possible to test all Frozen Scythe and Hell Wand abilities against it.
- Fake players must count as valid targets for ability collision detection, projectile hits, pulling, freezing, damage, knockback, and other player-targeted mechanics.
- Fake players must not need to be added to the Trust system.
- Make spawned fake players untrusted by default.
- They must not drop items or give kill progression when killed.
- They must not count as real player kills.

`/player remove [Name]`
- Remove the specified fake player from the world.
- Display an error if the fake player does not exist.

**Additional requirements:**
- Support multiple fake players at the same time.
- Keep track of spawned fake players.
- Clean up their data when removed.
- Prevent fake players from being mistaken for real players in kill progression.
- Make sure fake players work with every custom weapon ability, including abilities that specifically target the closest untrusted player.
- Commands should have tab completion.
- Only OP players can use `/player spawn` and `/player remove`.

**IMPORTANT TECHNICAL DETAIL:**

Do not create fake players as ordinary armor stands or mobs. They should have a proper player-like appearance and be recognized by the plugin's ability targeting system.

Use a compatible fake-player implementation for Paper 1.21.11. If a real server-side fake player is not supported by the Paper API, use a compatible NPC/player simulation library or a suitable alternative that supports visible player models, damage, targeting, and ability interactions.

## 2. FIX ABILITY ACTIVATION BUGS

There is currently a bug where abilities activated with Right Click and Shift + Right Click do not work.

Completely investigate and fix this issue.

**Required activation methods:**

- Right Click
- Shift + Right Click
- Offhand Swap Key
- Shift + Offhand Swap Key
- Offhand activation

Make sure every activation method works correctly for both the Hell Wand and Frozen Scythe.

**Specific requirements:**

1. Use the appropriate Paper interaction events and swap-hand events.
2. Correctly detect whether the player is sneaking.
3. Make sure right-click abilities work with both air clicks and block clicks where appropriate.
4. Prevent Minecraft's normal item interaction from interfering with custom abilities.
5. Prevent one activation from triggering multiple abilities.
6. Make sure abilities cannot accidentally activate when using another item.
7. Check that the player actually owns the required weapon.
8. Check kill requirements before allowing activation.
9. Check cooldowns before activating.
10. Give clear feedback when an ability is unavailable, locked, or on cooldown.

**IMPORTANT:**
- Shift + Right Click and normal Right Click must be treated as two separate activation methods.
- Shift + Offhand Swap Key and normal Offhand Swap Key must also be treated separately.
- Do not simply change the activation methods of the weapons to work around the bug. Fix the underlying activation system.
- Test every ability individually.

## 3. VERY NOTICEABLE PARTICLES FOR EVERY ABILITY

Currently, abilities need much more noticeable visual effects.

Give EVERY boss ability, weapon ability, and passive ability its own distinctive and highly visible particle effects.

Do not use tiny, barely visible particle effects.

**Particle requirements:**
- Use larger particle formations.
- Use multiple particle types together where appropriate.
- Use trails, rings, spirals, explosions, beams, and other recognizable shapes.
- Make particles visible from a reasonable distance.
- Make projectile trails clearly visible throughout their flight.
- Make impact effects especially noticeable.
- Use particles that match each ability's theme and color.
- Ensure particle effects do not cause excessive server lag.

**Frozen Scythe particle themes:**

- Freeze!: Bright blue projectile trail with a large icy explosion when hitting a player.
- Frost Dash: Visible blue trail following the dash, with an icy burst when hitting an enemy.
- Frost Renewal: Small blue ice particles around the player's feet.
- Cryomania: Noticeable icy particles appearing on the affected player when Slowness activates.
- Fidget Spinner: Large, rapidly spinning blue particle circle surrounding the player.
- Snowy Run: Snowflake particles around the player's feet while running.
- Wings of a Chicken: White feather particles when falling.
- Frozen Boom: Three clearly visible white projectiles with a large icy impact effect.

**Hell Wand particle themes:**

- Poison Cast: Green projectile trail and green impact particles.
- Tide Pull: Purple particles forming a visible pulling trail between the owner and target.
- Strength of the Hell: Subtle red particles.
- Health Cast: Red and pink particles surrounding the owner.
- Nature's Protection: Green particles surrounding the owner.
- Underworld Defence: Orange and red flame particles.
- Hellfire: Large orange fireball trail and noticeable orange explosion particles.
- Redemption: Dark red particles surrounding the owner.

**Boss particle themes:**

Make every King of Hell and Magma Cube ability visually distinctive.

Use:
- Lava particles for Lava Cast.
- Large gray shockwave particles for Ground Smash.
- Spiraling particles for Tornado.
- Purple particles for Flying Skulls.
- Red laser trails for Laser Beam.
- Orange fire particles for Fireball.
- Large blue/orange particles for Magma Cube abilities.
- Distinctive particles for every other ability as well.

## 4. FINAL TESTING REQUIREMENTS

Before considering these changes complete:

- Spawn multiple fake players.
- Test every Hell Wand ability against fake players.
- Test every Frozen Scythe ability against fake players.
- Test all Right Click abilities.
- Test all Shift + Right Click abilities.
- Test all Offhand abilities.
- Test all Shift + Offhand abilities.
- Verify that cooldowns work.
- Verify that trusted players are not affected by negative abilities.
- Verify that fake players do not increase weapon kill counts.
- Verify that every ability has clearly visible particles.

Do not just add the features without testing them. Fix the underlying bugs and make sure everything works on Paper 1.21.11 with Java 21.
Kodari AI
KodariYesterday at 4:10 pm 2
  1. Add OP-only test-player commands and integrate NPCs with weapon targeting.

  2. Fix weapon activation and feedback.

  3. Improve ability particles, then report what could and could not be tested.

[Generation stopped]

Lakatos Erik
๐Ÿ“Ž 1 file 6,385 chars
๐Ÿ“„
pasted-code-1795277458250.txt
txt 142 lines
โ–ถ
# ADDITIONAL FEATURES & BUG FIXES

## 1. FAKE PLAYER SYSTEM

Add a fake player system for testing custom weapon abilities.

**Commands:**

`/player spawn [Name]`
- Spawn a fake player with the specified name.
- The fake player must have a visible player model and be targetable by custom weapon abilities.
- It must be possible to hit the fake player with weapons.
- It must be possible to test all Hell Wand and Frozen Scythe abilities against it.
- Fake players must count as valid targets for ability collision detection, projectile hits, pulling, freezing, damage, knockback, and other player-targeted mechanics.
- Fake players must be untrusted by default.
- They must not drop items or give kill progression when killed.
- They must not count as real player kills.

`/player remove [Name]`
- Remove the specified fake player from the world.
- Display an error if the fake player does not exist.

**Additional requirements:**
- Support multiple fake players simultaneously.
- Keep track of spawned fake players.
- Clean up their data when removed.
- Prevent fake players from being mistaken for real players in kill progression.
- Make sure fake players work with every custom weapon ability.
- Commands must have tab completion.
- Only OP players can use these commands.

**IMPORTANT:**
Do not use ordinary armor stands or mobs as substitutes. Use a compatible fake-player or NPC implementation that supports visible player models, damage, targeting, and ability interactions.

## 2. FIX RIGHT CLICK ABILITY ACTIVATION

There is a specific bug in the current ability activation system.

**Current behavior:**
- Right Click abilities DO work when the player is looking at a block.
- However, they DO NOT work when the player is looking into the air.
- This needs to be fixed.

**Expected behavior:**
- Right Click abilities must activate whether the player is looking at a block or looking into the air.
- Shift + Right Click abilities must also work in both situations.
- The player should not need to aim at a block to activate an ability.

**Technical requirements:**
1. Investigate the current Bukkit/Paper interaction event handling.
2. Handle both `RIGHT_CLICK_AIR` and `RIGHT_CLICK_BLOCK` events.
3. Make sure the activation system does not depend exclusively on `RIGHT_CLICK_BLOCK`.
4. Correctly detect whether the player is sneaking.
5. Prevent Minecraft's normal item interaction from interfering with custom abilities.
6. Prevent one click from activating multiple abilities.
7. Make sure abilities only activate when the correct custom weapon is being used.
8. Check kill requirements and cooldowns before activation.
9. Provide feedback when an ability is locked or on cooldown.
10. Ensure all changes work on Paper 1.21.11 and Java 21.

**Test these activation methods individually:**
- Right Click while looking at a block.
- Right Click while looking into the air.
- Shift + Right Click while looking at a block.
- Shift + Right Click while looking into the air.
- Offhand Swap Key.
- Shift + Offhand Swap Key.
- Offhand activation.

**IMPORTANT:**
Do not change the weapon activation methods just to work around this bug. Fix the underlying event handling so both air clicks and block clicks work properly.

## 3. VERY NOTICEABLE PARTICLES FOR EVERY ABILITY

Give EVERY boss ability, weapon ability, and passive ability its own distinctive and highly visible particle effects.

Do not use tiny, barely visible particle effects.

**Particle requirements:**
- Use large particle formations.
- Combine multiple particle types where appropriate.
- Use trails, rings, spirals, explosions, beams, and recognizable shapes.
- Make projectile trails visible throughout their flight.
- Make impact effects especially noticeable.
- Match particle colors to each ability's theme.
- Ensure effects are optimized to avoid excessive server lag.

### Frozen Scythe particle themes

- Freeze!: Bright blue projectile trail and a large icy explosion on impact.
- Frost Dash: Visible blue trail following the dash, with an icy burst when hitting an enemy.
- Frost Renewal: Small blue ice particles around the player's feet.
- Cryomania: Noticeable icy particles around the affected player when Slowness activates.
- Fidget Spinner: Large, rapidly spinning blue particle circle surrounding the player.
- Snowy Run: Snowflake particles around the player's feet while running.
- Wings of a Chicken: White feather particles when falling.
- Frozen Boom: Three clearly visible white projectiles with a large icy impact effect.

### Hell Wand particle themes

- Poison Cast: Green projectile trail and green impact particles.
- Tide Pull: Purple particles forming a visible pulling trail between the owner and target.
- Strength of the Hell: Subtle red particles.
- Health Cast: Red and pink particles surrounding the owner.
- Nature's Protection: Green particles surrounding the owner.
- Underworld Defence: Orange and red flame particles.
- Hellfire: Large orange fireball trail and noticeable orange impact particles.
- Redemption: Dark red particles surrounding the owner.

### Boss particle themes

Make every King of Hell and Magma Cube ability visually distinctive.

Use:
- Lava particles for Lava Cast.
- Large gray shockwave particles for Ground Smash.
- Spiraling particles for Tornado.
- Purple particles for Flying Skulls.
- Red laser trails for Laser Beam.
- Orange fire particles for Fireball.
- Large, distinctive particles for all Magma Cube abilities.
- Unique particle effects for every other boss ability.

## 4. FINAL TESTING REQUIREMENTS

Before considering the changes complete:

- Spawn multiple fake players.
- Test every Hell Wand ability against fake players.
- Test every Frozen Scythe ability against fake players.
- Test Right Click abilities while looking at blocks.
- Test Right Click abilities while looking into the air.
- Test Shift + Right Click abilities in both situations.
- Test all Offhand activation methods.
- Verify that cooldowns work correctly.
- Verify that trusted players are unaffected by negative abilities.
- Verify that fake players do not increase weapon kill counts.
- Verify that every ability has clearly visible particles.

Do not simply add the features without testing them. Fix the underlying bugs and ensure everything works on Paper 1.21.11 with Java 21.

Do not remove, replace, or break any existing Midnight plugin features.
Kodari AI
KodariYesterday at 4:15 pm 10
  • Added OP-only /player spawn <name> and /player remove <name> test-player commands. They require a compatible Citizens installation.

  • Fixed right-click-in-air handling and added offhand weapon activation.

  • Added particle effects across weapon and boss abilities.

Not yet verified: I couldnโ€™t run a Paper server here, so compilation and the requested in-game tests remain unverified. Frozen Boom renders three trails but still uses one collision path, rather than three independently colliding projectiles.

Lakatos Erik
๐Ÿ“Ž 1 file 1,982 chars
๐Ÿ“„
pasted-code-1795277908332.txt
txt 40 lines
โ–ถ
## 3. PARTICLES FOR ABILITIES ONLY

Add noticeable, distinctive particle effects to **every active ability** of the King of Hell, Magma Cube, Hell Wand, and Frozen Scythe.

**Important restrictions:**
- ONLY active abilities should have custom particle effects.
- REMOVE all particle effects from passive abilities.
- Do not add particles simply because a player has a passive effect.
- Do not create constant decorative particles around players.
- Keep particles noticeable and visually impressive without causing excessive server lag.

### Frozen Scythe
- Freeze!: Bright blue projectile trail and large icy impact explosion.
- Frost Dash: Blue dash trail and icy impact burst.
- Fidget Spinner: Large, rapidly spinning blue particle circle.
- Frozen Boom: Three visible white projectiles and a noticeable impact effect.

### Hell Wand
- Poison Cast: Green projectile trail and impact particles.
- Tide Pull: Purple particles forming a visible pulling trail.
- Health Cast: Red and pink activation particles.
- Hellfire: Large orange fireball trail and impact explosion.

### King of Hell and Magma Cube
- Lava Cast: Lava particles.
- Ground Smash: Large gray shockwave.
- Tornado: Spiraling particles around the boss.
- Wither Attack: Dark purple summoning particles.
- Flying Skulls: Purple particles around affected players.
- Charge: Visible charging trail.
- Laser Beam: Bright red laser trails.
- Aggro: Purple teleportation particles.
- Fireball: Orange fireball trail and explosion particles.
- Meteor Jump: Large particles during takeoff and landing.
- Magma Cube Hellfire: Orange and red flame particles.
- Army of Hell: Distinctive summoning particles.
- Dasher: Visible dash trails.
- Flight: Particles during takeoff and landing.

**Final requirement:** No custom particles for Strength of the Hell, Frost Renewal, Cryomania, Snowy Run, Wings of a Chicken, Nature's Protection, Underworld Defence, or Redemption. Only active abilities receive custom particle effects.
Kodari AI
KodariYesterday at 4:20 pm 4
  • Remove passive particle emissions while preserving their gameplay effects.

  • Strengthen the active-ability visuals, including boss summoning and impact effects.

Removed passive particle effects while preserving their gameplay effects. Enhanced active-ability visuals, including icy trails, a gray smash shockwave, wither summoning, meteor takeoff, and fireball impact effects.

Compilation and in-game visuals have not been verified.

Lakatos Erik
๐Ÿ“Ž 1 file 2,089 chars
๐Ÿ“„
pasted-code-1795278426898.txt
txt 45 lines
โ–ถ
# ADDITIONAL WEAPON โ€“ CHICKEN BOOTS

Add a new custom item to the Midnight plugin called **Chicken Boots**.

**Item details:**
- Base item: Netherite Boots.
- Custom name: Chicken Boots.
- Give the item custom lore displaying its abilities.
- The abilities are always unlocked; no kill progression is required.
- All abilities and passives must work independently of the Hell Wand and Frozen Scythe.

## Passive 1 โ€“ Wings of a Chicken
- Completely remove all fall damage while the Chicken Boots are equipped in the player's feet armor slot.
- This must work regardless of fall distance.
- Do not prevent other types of damage.

## Ability 1 โ€“ Double Jump
- When wearing the Chicken Boots, allow the player to jump a second time while airborne.
- The second jump should give the player an additional upward boost.
- Only allow one additional jump per time the player leaves the ground.
- Reset the double jump when the player touches the ground.
- Add noticeable particles when the second jump activates.
- Make sure normal jumping still works.
- Prevent the ability from activating if the player is not wearing the Chicken Boots.

## Passive 2 โ€“ Speed
- Give the player permanent Speed II while wearing the Chicken Boots.
- Remove the effect when the boots are unequipped.
- Make sure the effect does not stack with itself.
- Avoid permanently modifying the player's base movement speed.

## Additional requirements
- The Chicken Boots must only provide their abilities while equipped in the feet armor slot.
- Abilities must work correctly in multiplayer.
- Handle jumping, landing, death, disconnecting, and changing armor properly.
- Store the item's custom identity using PersistentDataContainer so renamed ordinary Netherite Boots cannot imitate it.
- Add all relevant settings to config.yml:
  - Fall damage immunity.
  - Double jump strength.
  - Double jump activation.
  - Double jump particles.
  - Speed amplifier.
  - Ability descriptions and lore.

**IMPORTANT:** Do not modify the Hell Wand, Frozen Scythe, King of Hell, or Magma Cube mechanics when adding the Chicken Boots.
Kodari AI
KodariYesterday at 4:28 pm 4
  • Add Chicken Boots to the operator item menu with a persistent identity and configurable lore.

  • Implement equipped-only fall protection, Speed II, and double jump, with cleanup on unequip and disconnect.

Added Chicken Boots to /midnight weapons, with configurable lore, fall protection, Speed II, and a particle-emitting double jump.

Compilation and in-game behavior have not been verified.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
10 1,921
src/main/java/com/kodari/midnight/Midnight.java
package com.kodari.midnight;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Entity;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.world.ChunkLoadEvent;
import org.bukkit.NamespacedKey;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;
import java.io.IOException;
import java.util.UUID;

public final class Midnight extends JavaPlugin implements Listener {
    private File trustFile;
    private YamlConfiguration trust;
    private BossManager bosses;
    private WeaponManager weapons;
    private ChickenBoots chickenBoots;
    private FakePlayers fakePlayers;
    private NamespacedKey entityKey;

    @Override public void onEnable() {
        saveDefaultConfig();
        if (!getConfig().contains("frozen-scythe", true) && getConfig().getDefaults() != null) {
            org.bukkit.configuration.ConfigurationSection defaults = getConfig().getDefaults().getConfigurationSection("frozen-scythe");
            if (defaults != null) {
                defaults.getValues(true).forEach((key, value) -> {
                    if (!(value instanceof org.bukkit.configuration.ConfigurationSection)) getConfig().set("frozen-scythe." + key, value);
                });
                saveConfig();
            }
        }
        if (!getConfig().contains("chicken-boots", true) && getConfig().getDefaults() != null) {
            org.bukkit.configuration.ConfigurationSection defaults = getConfig().getDefaults().getConfigurationSection("chicken-boots");
            if (defaults != null) {
                defaults.getValues(true).forEach((key, value) -> {
                    if (!(value instanceof org.bukkit.configuration.ConfigurationSection)) getConfig().set("chicken-boots." + key, value);
                });
                saveConfig();
            }
        }
        entityKey = new NamespacedKey(this, "encounter_entity");
        trustFile = new File(getDataFolder(), "trust.yml");
        trust = YamlConfiguration.loadConfiguration(trustFile);
        bosses = new BossManager(this);
        weapons = new WeaponManager(this);
        chickenBoots = new ChickenBoots(this);
        if (Bukkit.getPluginManager().isPluginEnabled("Citizens")) {
            fakePlayers = new FakePlayers(this);
            Bukkit.getPluginManager().registerEvents(fakePlayers, this);
        }
        Commands commands = new Commands(this, bosses, weapons);
        for (String name : new String[]{"midnight", "killcount", "trust", "player"}) {
            getCommand(name).setExecutor(commands);
            getCommand(name).setTabCompleter(commands);
        }
        Bukkit.getPluginManager().registerEvents(this, this);
        Bukkit.getPluginManager().registerEvents(bosses, this);
        Bukkit.getPluginManager().registerEvents(weapons, this);
        Bukkit.getPluginManager().registerEvents(weapons.scythe(), this);
        Bukkit.getPluginManager().registerEvents(chickenBoots, this);
        for (org.bukkit.World world : Bukkit.getWorlds()) for (Entity entity : world.getEntities()) cleanStale(entity);
        Bukkit.getScheduler().runTaskTimer(this, bosses::tick, 1L, 1L);
        Bukkit.getScheduler().runTaskTimer(this, weapons::tickPassives, 1L, 20L);
        Bukkit.getScheduler().runTaskTimer(this, weapons.scythe()::tick, 1L, 1L);
        Bukkit.getScheduler().runTaskTimer(this, chickenBoots::tick, 1L, 1L);
    }

    @Override public void onDisable() {
        if (fakePlayers != null) fakePlayers.shutdown();
        if (bosses != null) bosses.shutdown();
        if (weapons != null) weapons.scythe().shutdown();
        if (chickenBoots != null) chickenBoots.shutdown();
        saveTrust();
    }

    @EventHandler public void onChunkLoad(ChunkLoadEvent event) {
        for (Entity entity : event.getChunk().getEntities()) cleanStale(entity);
    }

    private void cleanStale(Entity entity) {
        if (entity.getPersistentDataContainer().has(entityKey, PersistentDataType.STRING) && !bosses.isManaged(entity)) entity.remove();
    }

    public NamespacedKey entityKey() { return entityKey; }
    public ChickenBoots chickenBoots() { return chickenBoots; }
    public FakePlayers fakePlayers() { return fakePlayers; }
    public boolean isTestPlayer(org.bukkit.entity.Player player) { return fakePlayers != null && fakePlayers.contains(player); }
    public java.util.List<org.bukkit.entity.Player> targets(org.bukkit.World world) {
        java.util.List<org.bukkit.entity.Player> players = new java.util.ArrayList<>(world.getPlayers());
        if (fakePlayers != null) for (org.bukkit.entity.Player player : fakePlayers.players(world)) if (!players.contains(player)) players.add(player);
        return players;
    }
    public boolean trusted(UUID owner, UUID target) { return trust.getStringList(owner.toString()).contains(target.toString()); }
    public boolean changeTrust(UUID owner, UUID target, boolean add) {
        java.util.List<String> list = trust.getStringList(owner.toString());
        boolean changed = add ? (!list.contains(target.toString()) && list.add(target.toString())) : list.remove(target.toString());
        if (changed) { trust.set(owner.toString(), list); saveTrust(); }
        return changed;
    }
    private void saveTrust() {
        if (trust == null) return;
        try { trust.save(trustFile); } catch (IOException e) { getLogger().severe("Could not save trust data: " + e.getMessage()); }
    }
    public double number(String path, double fallback, double min, double max) {
        double n = getConfig().getDouble(path, fallback);
        return Double.isFinite(n) && n >= min && n <= max ? n : fallback;
    }
    public int integer(String path, int fallback, int min, int max) {
        int n = getConfig().getInt(path, fallback);
        return n >= min && n <= max ? n : fallback;
    }
    public String color(String text) { return ChatColor.translateAlternateColorCodes('&', text == null ? "" : text); }
}