package com.github.rmsy.bukkitpotdebug;

import org.bukkit.Bukkit;
import org.bukkit.entity.ThrownPotion;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PotionSplashEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;

import java.util.Collection;

public class PotDebugPlugin extends JavaPlugin implements Listener {
    @Override
    public void onDisable() {
        HandlerList.unregisterAll((JavaPlugin) this);
    }

    @Override
    public void onEnable() {
        Bukkit.getPluginManager().registerEvents(this, this);
    }

    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    public void onPotionSplash(final PotionSplashEvent event) {
        ThrownPotion potion = event.getPotion();
        Collection<PotionEffect> effects = potion.getEffects();
        Bukkit.broadcastMessage("A " + event.getEntity().getType().getName() + " splashed a potion with " + effects.size() + " effects attached:");
        for (PotionEffect effect : effects) {
            Bukkit.broadcastMessage("Type: " + effect.getType().getName() + ", Level: " + (effect.getAmplifier() + 1) + ", Duration: " + effect.getDuration());
        }
    }
}

@@ -297,16 +297,61 @@
 hEvent;%0A
+import org.bukkit.inventory.meta.PotionMeta;%0A
 import o
@@ -976,18 +976,63 @@
 s = 
-potion.get
+((PotionMeta) potion.getItem().getItemMeta()).getCustom
 Effe

Use PotionMeta instead of ThrownPotion