Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Forge distinguishes between "onLivingAttack" and "onPlayerAttack" while patchwork doesn't. #114

Description

@kitlith

YarnForge's ForgeHooks:

publicstaticbooleanonLivingAttack(LivingEntityentity, DamageSourcesrc, floatamount) {
returnentityinstanceofPlayerEntity || !MinecraftForge.EVENT_BUS.post(newLivingAttackEvent(entity, src, amount));
}
publicstaticbooleanonPlayerAttack(LivingEntityentity, DamageSourcesrc, floatamount) {
return !MinecraftForge.EVENT_BUS.post(newLivingAttackEvent(entity, src, amount));
}

Patchwork's EntityEvents:

publicstaticbooleanonLivingAttack(LivingEntityentity, DamageSourcesrc, floatdamage) {
returnMinecraftForge.EVENT_BUS.post(newLivingAttackEvent(entity, src, damage));
}

The LivingEntity mixin ends up not checking if the entity is instanceof PlayerEntity while forge does. For all I know there's a reason for this, but it's not documented if there is a reason.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions