How to implement a protocol in C++ w/ Unreal?

How would I go about creating a “protocol/interface” that looks like this:

   UFUNCTION(BlueprintImplementableEvent, Category = "Health")
	void OnHPZero();
	
	UFUNCTION(BlueprintImplementableEvent, Category = "Health")
	void OnTakeHitFromRaycast(const FHitResult Hit);

	UFUNCTION(BlueprintImplementableEvent, Category = "Health")
	void OnTakeHit();

	virtual void TakeHitFromRaycast(const int32 IncomingDamage, const FHitResult Hit);
	virtual void TakeHit(const int32 IncomingDamage);

The important thing is, I need to be able to use this on a Pawn AND a Character.

I can’t just make a pure C++ virtual class/function because I need the blueprint pieces.

My pawn must NOT be a Character, so it should be able to implement this separately.

What I am trying to solve is code reduction - so I don’t have to copy and paste these same functions/events in multiple classes.

In C++ it called interface, in fact C++ don’tr explicitly use that name, it simply support multi parenting. This documentation describe what to do

Note you only need to do this if you want interface to be usable in blueprint, if it’s only be C++ used you can just make extra non-UObject class and it a extra parent to the class, UHT won’t mind it.

lol this is exactly what i needed! “Interface classes are useful for ensuring that a set of (potentially) unrelated classes implement a common set of functions”. Thanks.