--- a/net/minecraft/world/entity/monster/Phantom.java
+++ b/net/minecraft/world/entity/monster/Phantom.java
@@ -46,8 +_,13 @@
     private static final EntityDataAccessor<Integer> ID_SIZE = SynchedEntityData.defineId(Phantom.class, EntityDataSerializers.INT);
     Vec3 moveTargetPoint = Vec3.ZERO;
     @Nullable
-    BlockPos anchorPoint;
+    public BlockPos anchorPoint;
     Phantom.AttackPhase attackPhase = Phantom.AttackPhase.CIRCLE;
+    // Paper start
+    @Nullable
+    public java.util.UUID spawningEntity;
+    public boolean shouldBurnInDay = true;
+    // Paper end
 
     public Phantom(EntityType<? extends Phantom> entityType, Level level) {
         super(entityType, level);
@@ -142,7 +_,7 @@
 
     @Override
     public void aiStep() {
-        if (this.isAlive() && this.isSunBurnTick()) {
+        if (this.isAlive() && this.shouldBurnInDay && this.isSunBurnTick()) { // Paper - shouldBurnInDay API
             this.igniteForSeconds(8.0F);
         }
 
@@ -163,6 +_,10 @@
         super.readAdditionalSaveData(compound);
         this.anchorPoint = compound.read("anchor_pos", BlockPos.CODEC).orElse(null);
         this.setPhantomSize(compound.getIntOr("size", 0));
+        // Paper start
+        this.spawningEntity = compound.read("Paper.SpawningEntity", net.minecraft.core.UUIDUtil.CODEC).orElse(null);
+        this.shouldBurnInDay = compound.getBooleanOr("Paper.ShouldBurnInDay", true);
+        // Paper end
     }
 
     @Override
@@ -170,6 +_,10 @@
         super.addAdditionalSaveData(compound);
         compound.storeNullable("anchor_pos", BlockPos.CODEC, this.anchorPoint);
         compound.putInt("size", this.getPhantomSize());
+        // Paper start
+        compound.storeNullable("Paper.SpawningEntity", net.minecraft.core.UUIDUtil.CODEC, this.spawningEntity);
+        compound.putBoolean("Paper.ShouldBurnInDay", this.shouldBurnInDay);
+        // Paper end
     }
 
     @Override
@@ -183,22 +_,22 @@
     }
 
     @Override
-    protected SoundEvent getAmbientSound() {
+    public SoundEvent getAmbientSound() {
         return SoundEvents.PHANTOM_AMBIENT;
     }
 
     @Override
-    protected SoundEvent getHurtSound(DamageSource damageSource) {
+    public SoundEvent getHurtSound(DamageSource damageSource) {
         return SoundEvents.PHANTOM_HURT;
     }
 
     @Override
-    protected SoundEvent getDeathSound() {
+    public SoundEvent getDeathSound() {
         return SoundEvents.PHANTOM_DEATH;
     }
 
     @Override
-    protected float getSoundVolume() {
+    public float getSoundVolume() {
         return 1.0F;
     }
 
@@ -243,7 +_,8 @@
 
                     for (Player player : nearbyPlayers) {
                         if (Phantom.this.canAttack(serverLevel, player, TargetingConditions.DEFAULT)) {
-                            Phantom.this.setTarget(player);
+                            if (!level().paperConfig().entities.behavior.phantomsOnlyAttackInsomniacs || EntitySelector.IS_INSOMNIAC.test(player)) // Paper - Add phantom creative and insomniac controls
+                            Phantom.this.setTarget(player, org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER); // CraftBukkit - reason
                             return true;
                         }
                     }
