Architectury API

Architectury API

234M Downloads

EntityEvent.LIVING_HURT Failed on client-side

wellcoming opened this issue ยท 1 comments

commented

Description

Since 24w40a, the EntityEvent.LIVING_HURT event in Architectury API on client-side fails to detect damage to players, while the following work normally:

  • Server-side detection of player damage
  • Client-side detection for non-player entities
  • Functioned correctly in 1.20.x and earlier versions

Reproduction Code

// In common init
EntityEvent.LIVING_HURT.register((LivingEntity entity, DamageSource source, float amount) -> {
    if (entity.getType() == EntityType.PLAYER) {
        LOGGER.info("Player hurt in {} side",
                entity.level().isClientSide ? "client" : "server");
    }
    return EventResult.pass();
});

Log

Single player:

[23:33:54] [Server thread/INFO] (test) Player hurt in server side

And No output in multiplayer.

commented

New Finding: The issue only affects the player that we controlled. Other players' damage events are detected correctly on the client.