Applied Energistics 2

Applied Energistics 2

156M Downloads

The guide says that ammo weight affects damage, but it only affects weight

ChiefArug opened this issue ยท 8 comments

commented

The guidebook says that ammo weight affects damage, but that is untrue. It only affects penetration.
See code:

var ammoStack = itemKey.toStack();
var penetration = getPenetration(ammoStack) * shotPower; // 196.96655f;

depends on the item being fired, with "heavier" items like gold nuggets (10 damage) doing more damage than light items like matter balls (2 damage).

commented

final int dmg = getDamageFromPenetration(penetration);
if (entityHit instanceof LivingEntity el) {
penetration -= dmg;
el.knockback(0, -direction.x, -direction.z);
// el.knockBack( p, 0, Vector3d.x,
// Vector3d.z );
el.hurt(dmgSrc, dmg);

public static int getDamageFromPenetration(float penetration) {
return (int) Math.ceil(penetration / 20.0f);
}

commented

Huh.. I tested this in game with custom ammo (weight of 1000) and that took 20 hits to kill a creeper.

commented

Huh.. I tested this in game with custom ammo (weight of 1000) and that took 20 hits to kill a creeper.

Are you exaggerating with 20 hits? ๐Ÿ‘€

commented

Are you exaggerating with 20 hits? ๐Ÿ‘€

Nope, I counted.
It may of been an issue with the incredibly custom KubeJS scripts I was using to add the ammo recipe, if the weight fields is optional and defaults to 1 damage. I can check tomorrow.

commented

Which version was it on, anyway?

commented

1.20.1

commented

Tried again today.. and it worked?? No idea why it wasn't working before