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

◆ CanBeCaughtBy()

virtual ? bool Terraria.ModLoader.ModNPC.CanBeCaughtBy ( Item item,
Player player )
inlinevirtual

Allows you to determine whether the given item can catch this NPC.
Return true or false to say this NPC can or cannot be caught, respectively, regardless of vanilla rules.
Returns null by default, which allows vanilla's NPC catching rules to decide the target's fate.
If this returns false, M:Terraria.ModLoader.CombinedHooks.OnCatchNPC(Terraria.Player,Terraria.NPC,Terraria.Item,System.Boolean) is never called.

NOTE: this does not classify the given item as an NPC-catching tool, which is necessary for catching NPCs in the first place.
To do that, you will need to use the "CatchingTool" set in ItemID.Sets.

Parameters
itemThe item with which the player is trying to catch this NPC.
playerThe player attempting to catch this NPC.
Returns

Definition at line 364 of file ModNPC.cs.

365 {
366 return null;
367 }