setTarget

public void setTarget(Entity target)

Set the entity that you want the mob to target instead.

It is possible to be null, null will cause the entity to be target-less.

This is different from cancelling the event. Cancelling the event will cause the entity to keep an original target, while setting to be null will cause the entity to be reset.

Parameters

target

The entity to target