'Minecraft datapack check if in block (portal)

So this is 100% a minecraft data pack thing... (programming languages are not similar at all) I have a function to detect if I am in a portal

execute at @a if block ~ ~ ~ blue_stained_glass_pane run say inPortal

Which looks like enter image description here

So I was wondering if it would be possible to somehow either change this function into a predicate

Or if there is a way to change this into a seperate function and write

execute as @a if function???:inportal run...

A comment on any other ways to detect if they are in the portal would be cool too.



Solution 1:[1]

Setting into a predicate is not very practical and will just cause more issues! Doing it this way is simpler and will work fine for you!

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 RoyalQuack