Combat Enchantments[Fabric]

Combat Enchantments[Fabric]

258k Downloads

Enchantment misinterpretation

Laifsyn opened this issue ยท 3 comments

commented

image

@Override public int getMinPower(int level) { return 10 + 20 * (level - 1); }
So according to what's in the source code, the formula is 10+20(Level-1) instead of 10(Level) %

commented

image
Combo also has a mis-interpretation on its description.

    @Override
    public int getMinPower(int level) {
        return 5 + (level - 1) * 8;
    }

The result should be Each hit will apply the mark effect for 5 + (level -1) * 8 seconds

commented

Well, according to what's I'm seeing. Idk of any other backend code that further edits the results

commented

the get min power level method determines the minimum power level required by the enchanting table for the enchantment to appear. The code for the actual deflection is handled in the living entity mixin

if(source.isProjectile()) {
int deflectLevel = EnchantmentHelper.getLevel(CombatEnchants.DEFLECT, this.getEquippedStack(EquipmentSlot.CHEST));
if (deflectLevel != 0 && this.random.nextInt(100) < deflectLevel * 10) {
if(this.world instanceof ServerWorld)
{
((ServerWorld) this.world).spawnParticles(ParticleTypes.POOF, this.getX(), this.getBodyY(0.5D), this.getZ(), 5, 0.3, 0.5, 0.3, 0.0D);
}
cir.cancel();
}
}