Effects
Effects is the celebration vocabulary every minigame ends up needing — round-start chime, “you’re safe” chime, elimination knell, win fanfare, countdown tick — plus a firework spawner that picks a random shape and colour palette. All sounds use SoundSource.PLAYERS so server-side volume mixers don’t drop them, and play at each recipient’s own location so distance attenuation matches vanilla behaviour.
When to use it
Section titled “When to use it”- You’re announcing a round start to a lobby and want the standard bell.
- A player just got eliminated and you want the standard anvil + wither hurt double-tap.
- The game ended and you want a celebratory firework burst at the winner.
package me.zlex.conduit.fx;
public final class Effects { // Sounds public static void roundStartChime(Collection<ServerPlayer> players); public static void safeChime(ServerPlayer player); public static void eliminationKnell(ServerPlayer player); public static void winFanfare(Collection<ServerPlayer> players); public static void countdownTick(Collection<ServerPlayer> players);
// Fireworks public static void spawnCelebrationFirework(ServerLevel level, Vec3 pos, RandomSource rand); public static void celebrationBurst(MinecraftServer server, ServerLevel level, Vec3 center, int count, RandomSource rand);}Fireworks self-fly and self-detonate via vanilla FireworkRocketEntity — no per-tick driving on the caller’s side.
Example
Section titled “Example”import me.zlex.conduit.fx.Effects;import net.minecraft.server.MinecraftServer;import net.minecraft.server.level.ServerLevel;import net.minecraft.server.level.ServerPlayer;import net.minecraft.util.RandomSource;import net.minecraft.world.phys.Vec3;
public final class MyRound {
public static void announceStart(Collection<ServerPlayer> players) { Effects.roundStartChime(players); }
public static void onEliminated(ServerPlayer p) { Effects.eliminationKnell(p); }
public static void onWin(MinecraftServer server, ServerPlayer winner) { Effects.winFanfare(java.util.List.of(winner));
ServerLevel level = (ServerLevel) winner.level(); Vec3 above = winner.position().add(0, 2, 0); Effects.celebrationBurst(server, level, above, 6, RandomSource.create()); }}countdownTickis whatCountdown.tickcalls under the hood — use the higher-level helper unless you specifically want the audio without the chat.celebrationBurstscatters the fireworks within a 4×4 horizontal area aroundcenter; spawn yours individually if you want tighter control.- Sound pitches are tuned per-effect — don’t change them lightly. The “elimination” tone is the anvil + low-pitched wither hurt double, picked because both clear other audio.