BlueprintImplementableEvents should not be virtual

LogCompile:Error: BlueprintImplementableEvents should not be virtual. Use BlueprintNativeEvent instead.

But, it compiles even with this error.

Here is the function"
UFUNCTION(BlueprintImplementableEvent, Category = “AI”)
virtual void SetupAI(const TArray &pillers, UBehaviorTree* Tree);

On switching the tag to BlueprintNativeEvent the project then doesn’t compile.

The class extends from ACharacter.

Any insight into this would help. Thank you.

BlueprintImplementableEvent are for functions that will be only implemented blueprint. They must not be virtual and should not have any implementation in C++. You just call the function.

BlueprintNativeEvent are for functions that will have a C++ implementation. Theses C++ functions are auto-generated and will have the name of the function + “_Implementation”.
It allows the system to call just the SetupAI function, that will call SetupAI_Implementation (function that is virtual and overridable), then the blueprint function.

You have to setup things like this :

// header
UFUNCTION(BlueprintNativeEvent, Category = "AI")
void SetupAI(const TArray &pillers, UBehaviorTree* Tree);

// cpp
void MyClass::SetupAI_Implementation(const TArray &pillers, UBehaviorTree* Tree);

Edit : @staticvoidlol, thanks to point this detail out. I should have been more accurate with the words I used.

Minor correction though:

The “BlueprintImplementableEvent” decorator specifies that the function body will be implemented in Blueprints - it’s not about calling the event from Blueprints. There’s a separate decorator for that called “BlueprintCallable”. As far as I recall I actually have functions with the following decorators:

UFUNCTION(BlueprintImplementableEvent, BlueprintCallable, Category = "PWNGame-General")
// Can implement behaviour in Blueprints as well as call it from a Blueprint

UFUNCTION(BlueprintCallable, Category = "PWNGame-General")
// Can NOT implement behaviour in Blueprints, but can call it from a Blueprint - requires C++ implementation

UFUNCTION(BlueprintImplementableEvent, Category = "PWNGame-General")
// Can implement behaviour in Blueprints, but can NOT call it from a Blueprint - no C++ implementation

As for “BlueprintNativeEvent”, I agree.