How are you rendering them? Also, switching between different subclasses would definitely cause an issue with some of the additional transformations applied.
I wanna say you would use something along the lines of:
@SubscribeEvent
public void onJoin(EntityJoinWorldEvent event) {
if (event.getEntity() instanceof Player && !event.getWorld().isClient()) {
Player player = (Player) event.getEntity();
player.getInventory().add(new ItemStack(Items.CARROT));
player.sendMessage(Component.nullToEmpty("Hello!"));
}
}
I may be wrong though.