Bailey Barrett

keep all the current code but add the followign and then compile into a working jar

Kodari AI
KodariAug 28 at 7:53 am 1

Please provide the features or code changes you want added. I’ll preserve the existing code, implement the additions, and ensure the project compiles into a working JAR.

Bailey Barrett

Add a mythical weapon called "Abyssal Blade"

Abyssal Blade

"Wielding this sword comes with a lot of power, but at a cost of death around every corner"

Passives:

Permanent invisibility

Abilities:

Eye of the Storm

Strike Lighting every 1.5 seconds for 10 seconds doing 2 Hearts of True Damage per lighting strike

cooldown 150 seconds

Total Abyss

completely Freezes (No movement at ALL) all nearby players and blinds them for 12 seconds except for the user and all trusted allies

Cooldown 200 seconds

Make the Abyssal blade item description more clean and spaced out.

Make the Abyssal blade have its own texture ID Make it so if you do /abyssalblade you get the Abyssal blade (operator only command )

Kodari AI
KodariAug 28 at 7:59 am 5
  1. Inspect the existing weapon, command, listener, and configuration structure.

  2. Add the Abyssal Blade item, texture ID, passive, and operator-only /abyssalblade command.

  3. Implement Eye of the Storm and Total Abyss with cooldowns, damage, targeting, allies, and movement control.

  4. Update the item description cleanly and verify the project build configuration for a working JAR.

Implemented the Abyssal Blade.

  • Added /abyssalblade, restricted to operators.

  • Added Netherite sword with custom model/texture ID 42001.

  • Added permanent invisibility while held.

  • Added Eye of the Storm:

    • Lightning strikes nearby enemies every 1.5 seconds.

    • Lasts 10 seconds.

    • Deals 2 hearts of true damage per strike.

    • 150-second cooldown.

  • Added Total Abyss:

    • Freezes nearby non-trusted players completely.

    • Applies blindness for 12 seconds.

    • 200-second cooldown.

  • Trusted allies are excluded from both abilities.

  • Cleaned up and spaced out the item lore.

  • Registered the command and item identification metadata in the plugin.

Bailey Barrett

it isnt working

Kodari AI
KodariAug 28 at 8:05 am 3
  1. Fix the build layout so Maven can produce a real plugin JAR from the current flat project.

  2. Make the Abyssal Blade controls explicit in its lore and apply its passive immediately after equipping.

  3. Preserve the operator-only command and existing ability behavior.

Fixed the packaging issue that prevented the plugin from working:

  • Added a root Maven build configuration.

  • Ensured plugin.yml and config.yml are included in the generated JAR.

  • Updated the project to Java 21, required for Paper 1.21.11.

  • Updated the plugin version to 1.0.5.

  • Added clear controls to the Abyssal Blade lore:

    • Right-click: Eye of the Storm

    • Sneak + right-click: Total Abyss

  • Invisibility now applies immediately when equipping the blade.

Build the plugin with:

Shell
mvn clean package

The JAR will be generated in:

Plain Text
target/LightPowers-1.0.5.jar

Place that JAR in the server’s plugins folder and restart the server. The custom texture ID 42001 will only visibly change the sword if your resource pack has a model override for that custom model data value.

Kodari can make mistakes. Review important code before using.
Files
com
META-INF
config.yml
plugin.yml
pom.xml
Code
6 1,968
com/example/lightpowers/LightPowersPlugin.java
package com.example.lightpowers;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Stream;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.format.TextColor;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.Particle;
import org.bukkit.Sound;
import org.bukkit.World;
import org.bukkit.attribute.Attribute;
import org.bukkit.attribute.AttributeInstance;
import org.bukkit.attribute.AttributeModifier;
import org.bukkit.attribute.AttributeModifier.Operation;
import org.bukkit.block.Block;
import org.bukkit.boss.BarColor;
import org.bukkit.boss.BarFlag;
import org.bukkit.boss.BarStyle;
import org.bukkit.boss.BossBar;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.PluginCommand;
import org.bukkit.command.TabCompleter;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Fireball;
import org.bukkit.entity.HumanEntity;
import org.bukkit.entity.IronGolem;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.entity.Snowball;
import org.bukkit.entity.Warden;
import org.bukkit.entity.WitherSkeleton;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityTargetLivingEntityEvent;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerItemConsumeEvent;
import org.bukkit.event.player.PlayerItemHeldEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.projectiles.ProjectileSource;
import org.bukkit.util.Vector;

public final class LightPowersPlugin extends JavaPlugin implements Listener, CommandExecutor, TabCompleter {
   private static final UUID REACH_MODIFIER = UUID.fromString("d1c3a9e7-2d5f-4d67-a3fb-8d2d1d5f1e21");
   private final Map<UUID, LightType> lights = new ConcurrentHashMap();
   private final Map<String, Long> cooldowns = new ConcurrentHashMap();
   private final Map<UUID, Integer> hitCounters = new ConcurrentHashMap();
   private final Set<UUID> immortals = ConcurrentHashMap.newKeySet();
   private final Map<UUID, UUID> golemOwners = new ConcurrentHashMap();
   private final Map<UUID, UUID> invasionOwners = new ConcurrentHashMap();
   private final Map<UUID, UUID> wardenOwners = new ConcurrentHashMap();
   private final Set<UUID> fireballs = ConcurrentHashMap.newKeySet();
   private final Set<UUID> cherryPetals = ConcurrentHashMap.newKeySet();
   private final Set<UUID> suppressedExplosionDamage = ConcurrentHashMap.newKeySet();
   private final Set<UUID> starStrikeFallProtection = ConcurrentHashMap.newKeySet();
   private final Map<UUID, Long> abyssalFrozenUntil = new ConcurrentHashMap();
   private final Map<String, BossBar> abilityBars = new ConcurrentHashMap();
   private final Map<String, UUID> abilityBarOwners = new ConcurrentHashMap();
   private final Map<String, Long> abilityActiveUntil = new ConcurrentHashMap();
   private final Map<String, Long> abilityCooldownUntil = new ConcurrentHashMap();
   private final Map<String, Integer> abilityDurationSeconds = new ConcurrentHashMap();
   private final Map<String, Integer> abilityCooldownSeconds = new ConcurrentHashMap();
   private final Map<String, String> abilityBarNames = new ConcurrentHashMap();
   private NamespacedKey starCrusherKey;
   private NamespacedKey sculkCleaverKey;
   private NamespacedKey abyssalBladeKey;
   private boolean started;
   private static final int ABYSSAL_BLADE_TEXTURE_ID = 42001;

   public void onEnable() {
      this.starCrusherKey = new NamespacedKey(this, "star_crusher");
      this.sculkCleaverKey = new NamespacedKey(this, "sculk_cleaver");
      this.abyssalBladeKey = new NamespacedKey(this, "abyssal_blade");
      this.saveDefaultConfig();
      this.loadLights();
      this.getServer().getPluginManager().registerEvents(this, this);
      this.registerCommand("light");
      this.registerCommand("trust");
      this.registerCommand("starcrusher");
      this.registerCommand("sculkcleaver");
      this.registerCommand("abyssalblade");
      this.startPlugin();
      this.getLogger().info("Light Powers enabled with " + LightType.values().length + " Lights.");
      this.getLogger().info("Light Powers is active. New players receive a random Light on first join.");
   }

   private void startPlugin() {
      if (!this.started) {
         this.started = true;
         this.getServer().getScheduler().runTaskTimer(this, this::applyPassives, 20L, 20L);
         this.getServer().getScheduler().runTaskTimer(this, this::directGolems, 20L, 10L);
         this.getServer().getScheduler().runTaskTimer(this, this::directInvasions, 20L, 10L);
         this.getServer().getScheduler().runTaskTimer(this, this::directWardens, 20L, 10L);
         this.getServer().getScheduler().runTaskTimer(this, this::trailFireballs, 1L, 1L);
         this.getServer().getScheduler().runTaskTimer(this, this::trailCherryPetals, 1L, 1L);
         this.getServer().getScheduler().runTaskTimer(this, this::updateAbilityBars, 1L, 1L);
      }
   }

   private void registerCommand(String var1) {
      PluginCommand var2 = this.getCommand(var1);
      if (var2 != null) {
         var2.setExecutor(this);
         var2.setTabCompleter(this);
      }

   }

   public void onDisable() {
      for(BossBar var2 : this.abilityBars.values()) {
         var2.removeAll();
      }

      for(UUID var5 : this.wardenOwners.keySet()) {
         Entity var3 = Bukkit.getEntity(var5);
         if (var3 != null && var3.isValid()) {
            var3.remove();
         }
      }

      this.abilityBars.clear();
      this.wardenOwners.clear();
      this.suppressedExplosionDamage.clear();
      this.starStrikeFallProtection.clear();
      this.abyssalFrozenUntil.clear();
      this.saveLights();
   }

   @EventHandler
   public void onFirstJoin(PlayerJoinEvent var1) {
      Player var2 = var1.getPlayer();
      if (!this.lights.containsKey(var2.getUniqueId())) {
         this.assign(var2, LightType.random(), true);
         this.rerollAnimation(var2, (LightType)this.lights.get(var2.getUniqueId()));
      }

   }

   @EventHandler
   public void onHostileTarget(EntityTargetLivingEntityEvent var1) {
      if (this.started) {
         UUID var3;
         if (var1.getTarget() != null && var1.getTarget().getUniqueId() != null && (var3 = (UUID)this.golemOwners.get(var1.getEntity().getUniqueId())) != null && var1.getTarget().getUniqueId().equals(var3)) {
            var1.setCancelled(true);
         } else {
            UUID var4 = (UUID)this.invasionOwners.get(var1.getEntity().getUniqueId());
            if (var4 == null || var1.getTarget() == null || !var1.getTarget().getUniqueId().equals(var4) && !this.isTrusted((UUID)var4, var1.getTarget())) {
               UUID var5 = (UUID)this.wardenOwners.get(var1.getEntity().getUniqueId());
               if (var5 == null || var1.getTarget() == null || !var1.getTarget().getUniqueId().equals(var5) && !this.isTrusted((UUID)var5, var1.getTarget())) {
                  LivingEntity var6 = var1.getTarget();
                  if (var6 instanceof Player) {
                     Player var2 = (Player)var6;
                     if (!(var1.getEntity() instanceof Player)) {
                        if (this.lights.get(var2.getUniqueId()) == LightType.MOON) {
                           var1.setCancelled(true);
                        }

                        return;
                     }
                  }

               } else {
                  var1.setCancelled(true);
               }
            } else {
               var1.setCancelled(true);