TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ owner

int Terraria.Projectile.owner = 255

The index of the player who owns this projectile. In Multiplayer, Clients "own" projectiles that they shoot, while the Server "owns" projectiles spawned by NPCs and the World.
NPC never own projectiles, do not use owner to index into F:Terraria.Main.npc.
It is very important to check if (Projectile.owner == Main.myPlayer) for things like dropping items or spawning projectiles in M:Terraria.ModLoader.ModProjectile.AI and some other methods because AI runs simultaneously on all Clients and the Server. This check gates some of the code that should only run on the owners computer. ExamplePaperAirplaneProjectilechecks owner for spawning the recovered ammo item. If you don't do this, you will run into desync bugs in your mod.
Defaults to the owner parameter of Projectile.NewProjectile, which should always be set to F:Terraria.Main.myPlayer to correspond to the client that owns the projectile..

Definition at line 173 of file Projectile.cs.

Referenced by Terraria.Projectile.AI_047_MagnetSphere(), Terraria.Projectile.AI_149_GolfBall(), Terraria.Projectile.AI_150_GolfClubHelper(), Terraria.Projectile.AI_154_VoidLens(), Terraria.Projectile.AI_GetMyGroupIndexAndFillBlackList(), Terraria.Projectile.BombsHurtPlayers(), Terraria.Projectile.CanHitWithMeleeWeapon(), Terraria.Projectile.Colliding(), Terraria.Player.CommandForbiddenStorm(), Terraria.Projectile.CutTiles(), Terraria.Projectile.CutTilesAt(), Terraria.Projectile.Damage(), Terraria.GameContent.UI.EmoteBubble.DeserializeNetAnchor(), Terraria.Player.DestroyOldestProximityMinesOverMinesCap(), Terraria.Player.DropSelectedItem_InterruptActionsThatUseAnimations(), Terraria.Projectile.EmitEnchantmentVisualsAt(), Terraria.GameContent.Golf.GolfHelper.FindGolfBallForHelper(), Terraria.GameContent.Golf.GolfHelper.FindHelperFromGolfBall(), Terraria.DataStructures.TrackedProjectileReference.FindMatchingProjectile(), Terraria.Projectile.FindStardustDragonHeadOfOwner(), Terraria.Projectile.FishingCheck(), Terraria.Projectile.FishingCheck_ProbeForQuestFish(), Terraria.Projectile.FishingCheck_RollDropLevels(), Terraria.Projectile.FishingCheck_RollItemDrop(), Terraria.Player.FreeUpPetsAndMinions(), Terraria.Projectile.GetByUUID(), Terraria.Projectile.GetByUUID(), Terraria.Projectile.GetFairyQueenWeaponsColor(), Terraria.GameContent.Golf.GolfState.GetLastHitBall(), Terraria.Projectile.GetLastPrismHue(), Terraria.Projectile.ghostHeal(), Terraria.Projectile.ghostHurt(), Terraria.Projectile.HandleMovement(), Terraria.Player.ItemCheck_CheckFishingBobbers(), Terraria.Player.ItemCheck_CheckUsabilityOfProjectiles(), Terraria.Player.ItemCheck_Shoot(), Terraria.Player.ItemCheck_TryDestroyingDrones(), Terraria.Player.ItemCheck_TurretAltFeatureUse(), Terraria.ModLoader.ProjectileLoader.ModifyFishingLine(), Terraria.Projectile.NewProjectile(), Terraria.Player.OnHit_Inner(), Terraria.NPC.PopAllAttachedProjectilesAndTakeDamageForThem(), Terraria.Projectile.ProjectileFixDesperation(), Terraria.Player.QuickGrapple(), Terraria.Projectile.ReduceRemainingChumsInPool(), Terraria.GameContent.PortalHelper.RemoveIntersectingPortals(), Terraria.GameContent.PortalHelper.RemoveMyOldPortal(), Terraria.NetMessage.SendData(), Terraria.Projectile.SetDefaults(), Terraria.NPC.SpawnOnPlayer(), Terraria.Projectile.StatusNPC(), Terraria.Projectile.StatusPvP(), Terraria.Projectile.SummonMonkGhast(), Terraria.Projectile.SummonSuperStarSlash(), Terraria.Projectile.TryDoingOnHitEffects(), Terraria.Projectile.Update(), Terraria.Player.UpdateAbigailStatus(), Terraria.Player.UpdateForbiddenSetLock(), Terraria.GameContent.PortalHelper.UpdatePortalPoints(), Terraria.Player.UpdateStormTigerStatus(), Terraria.DataStructures.DroneCameraTracker.ValidateTrackedProjectile(), Terraria.Projectile.vampireHeal(), and Terraria.Projectile.VanillaAI().