Checking entity instanceof instead of type, to avoid issues with plugins that set the wrong type for custom entities