Mahd Rafan

build a paper plugin that hides everyyyyyyyyy potion effect particles no matter what only potion particle should be shown in hud only the potion particles ok give me .jar for 26.3 mc java

Kodari AI
KodariNov 14 at 9:46 am 1
PotionParticleHider
A Paper plugin for Minecraft 1.26.3 that completely suppresses all ambient potion effect particles from rendering in the world, while preserving the potion status icons in the player's HUD. The plugin hooks into the server's particle packet system, intercepting and canceling any particle packets associated with potion effects (such as swirling colored particles around entities). It achieves this through a packet listener on the ProtocolLib or native Paper API, filtering out particles with specific particle types and data related to potion effects. The HUD icons remain untouched since they are rendered client-side independently of server particle packets. The plugin is lightweight, configurable, and ensures a clean visual experience without distracting effect particles.

Created the Paper plugin to hide potion-effect particles while preserving their HUD icons. It does not hide unrelated particles, such as particles from thrown potions.

To get the JAR, click Compile in the top bar (on mobile: ⋮ → Compile Project), then click Compile and Download when the build succeeds.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
4 78
src/main/java/com/kodari/hiddenpotionparticles/HiddenPotionParticles.java
package com.kodari.hiddenpotionparticles;

import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.entity.LivingEntity;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityPotionEffectEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;

import java.util.ArrayList;

public final class HiddenPotionParticles extends JavaPlugin implements Listener {
    @Override
    public void onEnable() {
        Bukkit.getPluginManager().registerEvents(this, this);
        Bukkit.getScheduler().runTaskTimer(this, this::hideLoadedParticles, 1L, 20L);
    }

    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    public void onPotionEffect(EntityPotionEffectEvent event) {
        if (event.getNewEffect() == null || !event.getNewEffect().hasParticles()) {
            return;
        }
        LivingEntity entity = event.getEntity();
        Bukkit.getScheduler().runTask(this, () -> hideParticles(entity));
    }

    private void hideLoadedParticles() {
        for (World world : Bukkit.getWorlds()) {
            for (LivingEntity entity : world.getLivingEntities()) {
                hideParticles(entity);
            }
        }
    }

    private void hideParticles(LivingEntity entity) {
        if (!entity.isValid()) {
            return;
        }
        for (PotionEffect effect : new ArrayList<>(entity.getActivePotionEffects())) {
            if (!effect.hasParticles()) {
                continue;
            }
            PotionEffect hidden = new PotionEffect(effect.getType(), effect.getDuration(),
                    effect.getAmplifier(), effect.isAmbient(), false, effect.hasIcon());
            entity.removePotionEffect(effect.getType());
            entity.addPotionEffect(hidden);
        }
    }
}