ewewukek / mc-musketmod

Mod that adds craftable flintlock weapons
MIT License
13 stars 22 forks source link

Team Damage #43

Closed talhanation closed 1 month ago

talhanation commented 2 months ago

Minecraft Version

No response

ModLoader

No response

Request information

add friendly fire support, by adding this line to onHitEntityMethod(Hitresult)

Entity hitEntity = hitResult.getEntity(); Entity ownerEntity = this.getOwner();

if(ownerEntity.getTeam() != null && ownerEntity.getTeam().isAlliedTo(hitEntity.getTeam()) && !ownerEntity.getTeam().isAllowFriendlyFire()) return;

Other information

No response

talhanation commented 2 months ago

*to be compatible with recruits mod as the entities are not players

ewewukek commented 2 months ago

sure, that looks reasonable

ewewukek commented 1 month ago

done. I also added mobReload helper method to complement mobUse and aimAt that hopefully should make integrating guns in other mods easier. RangedGunAttackGoal can serve as example