feat: BlackKnife DeltaMine v1.0.0 - Paper 1.21.1 SWOON/Stars/Sword/Diamond/Lunge/Snipe/Tri/Overhead + Magic 4commons Parry chat 400words +12h updates

This commit is contained in:
SashegDev
2026-08-27 01:55:05 +03:00
commit 10faf5679f
29 changed files with 2681 additions and 0 deletions
@@ -0,0 +1,65 @@
package me.sashegdev.blackknife;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.Sound;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
public class SwoonHandler implements Listener {
private final BlackKnifePlugin plugin;
public static final NamespacedKey SWOONED = new NamespacedKey("blackknife", "swooned");
public static final NamespacedKey MAGIC_DAMAGE = new NamespacedKey("blackknife", "magic_damage");
public SwoonHandler(BlackKnifePlugin plugin) { this.plugin = plugin; }
@EventHandler(priority = EventPriority.HIGHEST)
public void onHit(EntityDamageByEntityEvent e) {
if (!(e.getDamager() instanceof Player p)) return;
if (!BlackKnifeItem.is(p.getInventory().getItemInMainHand()) && !BlackKnifeItem.is(p.getInventory().getItemInOffHand())) return;
if (!(e.getEntity() instanceof LivingEntity target)) return;
if (target.getPersistentDataContainer().has(MAGIC_DAMAGE, PersistentDataType.BYTE)) {
target.getPersistentDataContainer().remove(MAGIC_DAMAGE);
return;
}
if (p.hasCooldown(Material.NETHERITE_SWORD)) return;
e.setCancelled(true);
plugin.getTension().setTP(p, Math.max(0, plugin.getTension().getTP(p) - 125f));
if (target instanceof Player tp) {
tp.setHealth(1.0);
tp.getPersistentDataContainer().set(SWOONED, PersistentDataType.BYTE, (byte) 1);
tp.addPotionEffect(new PotionEffect(PotionEffectType.SLOWNESS, 100, 2));
tp.addPotionEffect(new PotionEffect(PotionEffectType.WEAKNESS, 100, 1));
tp.addPotionEffect(new PotionEffect(PotionEffectType.DARKNESS, 60, 0));
tp.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 20, 0));
p.sendActionBar(Component.text("SWOON! " + tp.getName() + " -999 HP").color(NamedTextColor.DARK_RED));
tp.sendActionBar(Component.text("SWOONED! -999 HP").color(NamedTextColor.DARK_RED));
tp.getWorld().playSound(tp.getLocation(), Sound.ENTITY_WARDEN_SONIC_BOOM, 1f, 0.5f);
if (Math.random() < 0.1) tp.getWorld().dropItemNaturally(tp.getLocation(), BlackKnifeItem.create());
} else {
target.getPersistentDataContainer().set(MAGIC_DAMAGE, PersistentDataType.BYTE, (byte) 1);
target.damage(999.0, p);
target.getPersistentDataContainer().remove(MAGIC_DAMAGE);
target.getWorld().spawnParticle(org.bukkit.Particle.EXPLOSION, target.getLocation().add(0, 1, 0), 1);
target.getWorld().playSound(target.getLocation(), Sound.ENTITY_WARDEN_SONIC_BOOM, 1f, 0.5f);
p.sendActionBar(Component.text("SWOON! " + target.getName() + " -999").color(NamedTextColor.DARK_RED));
}
target.getWorld().spawnParticle(org.bukkit.Particle.SWEEP_ATTACK, target.getLocation().add(0, 1, 0), 1);
target.getWorld().spawnParticle(org.bukkit.Particle.SOUL, target.getLocation().add(0, 1, 0), 20, 0.5, 0.5, 0.5, 0.02);
p.setCooldown(Material.NETHERITE_SWORD, 160);
p.playSound(p.getLocation(), Sound.ITEM_TRIDENT_THUNDER, 1f, 0.7f);
}
public static boolean isSwooned(LivingEntity e) {
return e.getPersistentDataContainer().has(SWOONED, PersistentDataType.BYTE);
}
}