[SPIGOT-7665] CraftThrownPotion getEffects() only returns customEffects Created: 09/May/24  Updated: 25/Dec/24  Resolved: 10/May/24

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Mersphydena Assignee: Doc
Resolution: Fixed Votes: 0
Labels: None

Version: 4156-Spigot-e2c1eee-428aefe (MC: 1.20.6) (Implementing API version 1.20.6-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

Pretty sure
 https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java#26

should be 
 

for (MobEffectInstance effect : this.getHandle().getItem().getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY).getAllEffects()) {

 

@EventHandler
public void onPotionSplash(PotionSplashEvent event) { 
ThrownPotion potion = event.getPotion();
Collection<PotionEffect> effects = event.getPotion().getEffects();
Bukkit.broadcastMessage("Potion effects: " + effects.size());
}

 
Example code prints 0 when throwing a strength potion on the ground



 Comments   
Comment by Doc [ 09/May/24 ]

Thanks PR created https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/1398/overview

Generated at Sat Dec 13 15:22:32 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.