import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Particle; import org.bukkit.Sound; import org.bukkit.entity.Entity; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.util.Vector; public class MasterYiAlphaStrikePlugin extends JavaPlugin implements Listener { @Override public void onEnable() { Bukkit.getPluginManager().registerEvents(this, this); } @EventHandler public void onPlayerInteractEntity(PlayerInteractEntityEvent event) { Player player = event.getPlayer(); Entity clickedEntity = event.getRightClicked(); ItemStack item = player.getInventory().getItemInMainHand(); if (clickedEntity instanceof LivingEntity && item.getType() == Material.STICK && item.getItemMeta().hasDisplayName() && item.getItemMeta().getDisplayName().equals("Dagger")) { LivingEntity targetEntity = (LivingEntity) clickedEntity; simulateAlphaStrike(player, targetEntity); } } private void simulateAlphaStrike(Player player, LivingEntity targetEntity) { Location initialLocation = player.getLocation(); Location targetLocation = targetEntity.getLocation(); // Hedefe doğru bak player.teleport(new Location(initialLocation.getWorld(), initialLocation.getX(), initialLocation.getY(), initialLocation.getZ(), targetLocation.getYaw(), targetLocation.getPitch())); // Işınlanma efekti player.getWorld().playSound(initialLocation, Sound.ENTITY_ENDERMAN_TELEPORT, 1.0f, 1.0f); player.getWorld().spawnParticle(Particle.PORTAL, initialLocation, 50, 0.5, 0.5, 0.5, 0.1); // Hedefin arkasına ışınlan Location behindLocation = targetLocation.clone().add(targetLocation.getDirection().multiply(-2)); player.teleport(behindLocation); // Hasar ver targetEntity.damage(1.0); // Görünmezlik player.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 40, 0)); // Hedefin sağına ışınlan Location rightLocation = behindLocation.clone().add(behindLocation.getRight().multiply(2)); player.teleport(rightLocation); // Partikül efekti player.getWorld().spawnParticle(Particle.CRIT_MAGIC, rightLocation, 100, 0.5, 0.5, 0.5, 0.0); // Belirli bir süre sonra görünmezliği kaldır Bukkit.getScheduler().runTaskLater(this, () -> { player.removePotionEffect(PotionEffectType.INVISIBILITY); }, 40L); // 2 saniye (40 tick) } }