Open ghost opened 6 months ago
The knockback is based in the rules of NMS. In the case of the damage method with not DamageSource is handled by the generic DamageSource that not include knockback, the method with the DamageSource is "parsed" to the NMS DamageSource if you pass a entity making de damage (withDirect..) then this make a knockback, in NMS the logic for knockback (ignoring a thing about the last damage/invulnerability) is if the damage is not included in the tag for no_knockback and exists a entity making the damage. that is what i check unless i missing something.
The knockback is based in the rules of NMS. In the case of the damage method with not DamageSource is handled by the generic DamageSource that not include knockback, the method with the DamageSource is "parsed" to the NMS DamageSource if you pass a entity making de damage (withDirect..) then this make a knockback, in NMS the logic for knockback (ignoring a thing about the last damage/invulnerability) is if the damage is not included in the tag for no_knockback and exists a entity making the damage. that is what i check unless i missing something.
Im pretty sure you can do .damage(double, entity) to give the damage a cause but without giving knockback.
The knockback is based in the rules of NMS. In the case of the damage method with not DamageSource is handled by the generic DamageSource that not include knockback, the method with the DamageSource is "parsed" to the NMS DamageSource if you pass a entity making de damage (withDirect..) then this make a knockback, in NMS the logic for knockback (ignoring a thing about the last damage/invulnerability) is if the damage is not included in the tag for no_knockback and exists a entity making the damage. that is what i check unless i missing something.
Im pretty sure you can do .damage(double, entity) to give the damage a cause but without giving knockback.
can you provide a example? because that method works in the same way only change the DamageSource from generic if the entity passed is HumanEntity (PLAYER_ATTACK) or a simple LivingEntity (MOB_ATTACK)
Expected behavior
entity.damage() applies no knockback, .damage() with damagesource always applies knockback, even if you leave out location or set locaiton to entities location, there should be a way to have no knockback from it
Observed/Actual behavior
N/A
Steps/models to reproduce
livingEntity.damage(0.1);
.damage() with no damage source params, vs .damage() with damage source
livingEntity.damage(0.1, DamageSource.builder(DamageType.MOB_PROJECTILE) .withCausingEntity(shooter) .withDirectEntity(projectile) .build());
Plugin and Datapack List
N/A
Paper version
Paper 1.20.4
Other
No response