Source:
<code>public Entity sendEntitySpawn(Player player, EntityType entityType, Location location, ArrayList<Mechanism> mechanisms) { PlayerConnection conn = ((CraftPlayer) player).getHandle().playerConnection; net.minecraft.server.v1_15_R1.Entity nmsEntity = ((CraftWorld) location.getWorld()).createEntity(location, entityType.getEntityClass()); EntityTag entity = new EntityTag(nmsEntity.getBukkitEntity()); for (Mechanism mechanism : mechanisms) { entity.safeAdjust(mechanism); } <START> EntityTag.rememberEntity(entity.getBukkitEntity()); <END> if (nmsEntity instanceof EntityLiving) { EntityLiving nmsLivingEntity = (EntityLiving) nmsEntity; conn.sendPacket(new PacketPlayOutSpawnEntityLiving(nmsLivingEntity)); for (EnumItemSlot itemSlot : EnumItemSlot.values()) { ItemStack nmsItemStack = nmsLivingEntity.getEquipment(itemSlot); if (nmsItemStack != null && nmsItemStack.getItem() != Items.AIR) { conn.sendPacket(new PacketPlayOutEntityEquipment(nmsLivingEntity.getId(), itemSlot, nmsItemStack)); } } } else if (nmsEntity instanceof EntityExperienceOrb) { conn.sendPacket(new PacketPlayOutSpawnEntityExperienceOrb((EntityExperienceOrb) nmsEntity)); } else if (nmsEntity instanceof EntityPainting) { conn.sendPacket(new PacketPlayOutSpawnEntityPainting((EntityPainting) nmsEntity)); } else if (nmsEntity instanceof EntityLightning) { conn.sendPacket(new PacketPlayOutSpawnEntityWeather(nmsEntity)); } else { conn.sendPacket(new PacketPlayOutSpawnEntity(nmsEntity)); } conn.sendPacket(new PacketPlayOutEntityMetadata(nmsEntity.getId(), nmsEntity.getDataWatcher(), true)); return entity.getBukkitEntity(); }</code><technical_language>Remove that^</technical_language>

Target:
public Entity sendEntitySpawn(Player player, EntityType entityType, Location location, ArrayList<Mechanism> mechanisms) { PlayerConnection conn = ((CraftPlayer) player).getHandle().playerConnection; net.minecraft.server.v1_15_R1.Entity nmsEntity = ((CraftWorld) location.getWorld()).createEntity(location, entityType.getEntityClass()); EntityTag entity = new EntityTag(nmsEntity.getBukkitEntity()); for (Mechanism mechanism : mechanisms) { entity.safeAdjust(mechanism); } if (nmsEntity instanceof EntityLiving) { EntityLiving nmsLivingEntity = (EntityLiving) nmsEntity; conn.sendPacket(new PacketPlayOutSpawnEntityLiving(nmsLivingEntity)); for (EnumItemSlot itemSlot : EnumItemSlot.values()) { ItemStack nmsItemStack = nmsLivingEntity.getEquipment(itemSlot); if (nmsItemStack != null && nmsItemStack.getItem() != Items.AIR) { conn.sendPacket(new PacketPlayOutEntityEquipment(nmsLivingEntity.getId(), itemSlot, nmsItemStack)); } } } else if (nmsEntity instanceof EntityExperienceOrb) { conn.sendPacket(new PacketPlayOutSpawnEntityExperienceOrb((EntityExperienceOrb) nmsEntity)); } else if (nmsEntity instanceof EntityPainting) { conn.sendPacket(new PacketPlayOutSpawnEntityPainting((EntityPainting) nmsEntity)); } else if (nmsEntity instanceof EntityLightning) { conn.sendPacket(new PacketPlayOutSpawnEntityWeather(nmsEntity)); } else { conn.sendPacket(new PacketPlayOutSpawnEntity(nmsEntity)); } conn.sendPacket(new PacketPlayOutEntityMetadata(nmsEntity.getId(), nmsEntity.getDataWatcher(), true)); return entity.getBukkitEntity(); }