diff --git a/src/main/kotlin/club/mcscrims/speedhg/kit/listener/KitEventDispatcher.kt b/src/main/kotlin/club/mcscrims/speedhg/kit/listener/KitEventDispatcher.kt index f02d77d..f37a890 100644 --- a/src/main/kotlin/club/mcscrims/speedhg/kit/listener/KitEventDispatcher.kt +++ b/src/main/kotlin/club/mcscrims/speedhg/kit/listener/KitEventDispatcher.kt @@ -174,11 +174,18 @@ class KitEventDispatcher( val itemInHand = player.inventory.itemInMainHand val active = kit.getActiveAbility( playstyle ) + // Allow throwable items (potions, ender pearls, etc.) to pass through, + // UNLESS the item is the player's own kit item. + val isKitAbilityItem = kit.cachedItems[ player.uniqueId ] + ?.any { it.isSimilar( itemInHand ) } == true + // Allow throwable items (potions, ender pearls, etc.) to pass through - if ( itemInHand.type == Material.SPLASH_POTION || - itemInHand.type == Material.LINGERING_POTION || - itemInHand.type == Material.MILK_BUCKET || - itemInHand.type == Material.ENDER_PEARL ) return + if ( !isKitAbilityItem && ( + itemInHand.type == Material.SPLASH_POTION || + itemInHand.type == Material.LINGERING_POTION || + itemInHand.type == Material.MILK_BUCKET || + itemInHand.type == Material.ENDER_PEARL + )) return if ( itemInHand.type != active.triggerMaterial ) return