there is a event for when a portal is placed
https://github.com/MinecraftForge/MinecraftForge/blob/1.12.x/src/main/java/net/minecraftforge/event/world/BlockEvent.java#L492
you can cancel the event
you can get the player from the context
Supplier<NetworkEvent.Context> ctx
https://github.com/MinecraftForge/MinecraftForge/blob/1.14.x/src/main/java/net/minecraftforge/fml/network/NetworkEvent.java#L194