.domer_.

make a java 26.3 mod that when you kill a player a phonk song plays from the beatdrop for 15 seconds, make so theres much different phonk songs and that its randomized

Kodari AI
KodariNov 6 at 10:59 am 2
PhonkKillDrop
PhonkKillDrop is a Minecraft Fabric mod that triggers a randomized phonk music drop when a player kills another player. Upon each player kill, the mod selects from a library of distinct phonk tracks and plays the beat drop segment for exactly 15 seconds using Minecraft's sound system. The mod integrates with Fabric's event API to detect player kills, maintains a configurable track list, and ensures randomized selection to prevent repetition. It also handles sound volume, distance attenuation, and cleanup to stop playback after the duration expires. The mod is designed for multiplayer servers, providing an immersive audio reward for PvP combat encounters.
  1. Set up a Fabric 26.3 client/server mod with a player-kill trigger and client notification.

  2. Add randomized, original phonk-style instrumental playback built from synthesized beats, starting at the drop and lasting 15 seconds.

Created the Fabric 26.3 mod. When a player kills another player, the killer hears one of eight randomized, original phonk-style tracks, synthesized by the mod and starting immediately at the beat drop for 15 seconds. The mod needs to be installed on the server and the killer’s client.

.domer_.

can you make it so it ends after the beatdrop even if thats a bit longer or shorter then 15 seconds?

Kodari AI
KodariNov 6 at 10:59 am 1
  • Calculate each track’s length as a whole number of bars closest to 15 seconds.

  • Fade the final beat so playback ends cleanly on the bar boundary.

Updated playback to end on a complete bar, with each randomized track’s duration rounded to the nearest whole-bar length around 15 seconds. It now fades out over the final beat.

.domer_.

can you make it client side, a bit more then 8 songs and all songs have to be like aura edit phonks

Kodari AI
KodariNov 6 at 11:02 am 2
  1. Move kill detection/playback to the client where feasible, keeping the server trigger only if client-only detection cannot reliably identify kills.

  2. Expand the randomized track pool beyond eight and give the generated tracks a stronger high-energy “aura edit” phonk feel.The sound already plays locally on the killer’s client, but the server confirms who made the kill. Removing that server check would make client-only kill detection unreliable in multiplayer; I’ll keep that authoritative trigger and expand the local music pool next.

Expanded the randomized pool to 16 original generated tracks and gave them a more intense aura-edit phonk sound with punchier 808s, distorted metallic cowbell leads, sharper snares, and busier hi-hats.

The audio plays on the killer’s client, but multiplayer kill detection still needs server confirmation; a client-only mod can’t reliably know who got the kill.

.domer_.

can you possible make it 50 tracks?

Kodari AI
KodariNov 6 at 11:03 am 1
  • Expand the randomized track IDs to 50.

  • Generate 34 additional distinct synth-track variations from the existing patterns, keeping every ID matched to playable audio.

Expanded the randomized pool to 50 tracks. The existing 16 compositions now have 34 additional distinct variations, with altered melodies, tempo, bass, and drum patterns; each track ID is connected to its audio.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
11 465
src/main/java/com/kodari/phonkdrop/PhonkDropMod.java
package com.kodari.phonkdrop;

import java.util.concurrent.ThreadLocalRandom;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.entity.event.v1.ServerLivingEntityEvents;
import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry;
import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;

public class PhonkDropMod implements ModInitializer {
	@Override
	public void onInitialize() {
		PayloadTypeRegistry.clientboundPlay().register(PhonkPayload.TYPE, PhonkPayload.CODEC);

		ServerLivingEntityEvents.AFTER_DEATH.register((LivingEntity victim, DamageSource damageSource) -> {
			if (victim instanceof Player && damageSource.getEntity() instanceof ServerPlayer killer) {
				String trackId = PhonkPayload.TRACK_IDS.get(ThreadLocalRandom.current().nextInt(PhonkPayload.TRACK_IDS.size()));
				ServerPlayNetworking.send(killer, new PhonkPayload(trackId));
			}
		});
	}
}