From ec1316251153b65245503e6064889c23ff258d06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?DrSeek=20=28David=20B=C3=A9rub=C3=A9=29?= <75817900+dreamy32@users.noreply.github.com> Date: Mon, 30 Mar 2026 13:16:00 -0400 Subject: [PATCH] fix ThrownPotion#splash NPE when called from API splash(null) is passed from CraftThrownPotion when plugins call the method programmatically, but onHitAsPotion tries to call getLocation() on the result which blows up. default to the entity's own position so the splash area is centered on the potion. fixes #13611 --- .../throwableitemprojectile/AbstractThrownPotion.java.patch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paper-server/patches/sources/net/minecraft/world/entity/projectile/throwableitemprojectile/AbstractThrownPotion.java.patch b/paper-server/patches/sources/net/minecraft/world/entity/projectile/throwableitemprojectile/AbstractThrownPotion.java.patch index 69d4e6502d60..81cc670d275d 100644 --- a/paper-server/patches/sources/net/minecraft/world/entity/projectile/throwableitemprojectile/AbstractThrownPotion.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/entity/projectile/throwableitemprojectile/AbstractThrownPotion.java.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/world/entity/projectile/throwableitemprojectile/AbstractThrownPotion.java +++ b/net/minecraft/world/entity/projectile/throwableitemprojectile/AbstractThrownPotion.java -@@ -68,56 +_,97 @@ +@@ -68,56 +_,98 @@ @Override protected void onHit(HitResult result) { super.onHit(result); @@ -10,6 +10,7 @@ + + public void splash(HitResult result) { + // Paper end - More projectile API ++ if (result == null) result = BlockHitResult.miss(this.position(), Direction.UP, this.blockPosition()); // Paper - More projectile API; default to entity position for API calls if (this.level() instanceof ServerLevel serverLevel) { ItemStack item = this.getItem(); PotionContents potionContents = item.getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY);