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

◆ CanCollideWithPlayerMeleeAttack()

virtual ? bool Terraria.ModLoader.ModNPC.CanCollideWithPlayerMeleeAttack ( Player player,
Item item,
Rectangle meleeAttackHitbox )
inlinevirtual

Allows you to determine whether an NPC can be collided with the player melee weapon when swung.
Use M:Terraria.ModLoader.ModNPC.CanBeHitByItem(Terraria.Player,Terraria.Item) instead for Guide Voodoo Doll-type effects.

Parameters
playerThe player wielding this item.
itemThe weapon item the player is holding.
meleeAttackHitboxHitbox of melee attack.
Returns
Return true to allow colliding with the melee attack, return false to block the weapon from colliding with the NPC, and return null to use the vanilla code for whether the attack can be colliding. Returns null by default.

Definition at line 490 of file ModNPC.cs.

491 {
492 return null;
493 }