Skip to content

Instantly share code, notes, and snippets.

@tryashtar
Last active April 7, 2022 21:25
Show Gist options
  • Select an option

  • Save tryashtar/4e3917bbd59532463d280755a63705d0 to your computer and use it in GitHub Desktop.

Select an option

Save tryashtar/4e3917bbd59532463d280755a63705d0 to your computer and use it in GitHub Desktop.

Revisions

  1. tryashtar revised this gist Apr 7, 2022. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions max-enchant.md
    Original file line number Diff line number Diff line change
    @@ -49,6 +49,8 @@ Relevant pieces of code:

    `EnchantmentHelper.getEnchantmentModifierLiving`: Formula for increasing damage with damage enchantments.
    * Called by `EntityPlayer.attackTargetEntityWithCurrentItem`

    All of these EnchantmentHelper methods ultimately call `CompoundTag.getShort`.
    </details>

    Information for later versions will follow
  2. tryashtar revised this gist Apr 7, 2022. 1 changed file with 35 additions and 1 deletion.
    36 changes: 35 additions & 1 deletion max-enchant.md
    Original file line number Diff line number Diff line change
    @@ -16,6 +16,40 @@
    |Silk Touch|Take the first silk touch enchant on the tool. If greater than zero, broken blocks drop themselves instead of the normal drops.|**1**<ul><li>Lower levels do nothing</li><li>Higher levels are identical to 1</li></ul>|
    |Unbreaking|Take the first unbreaking enchant on the tool. If greater than zero, has a one in `level + 1` chance to still take durability damage when used.|**1** to **32767**<ul><li>Lower levels do nothing</li></ul>|
    |Fortune|Take the first fortune enchantment on the tool. Do something different for each block:<table><thead><tr><th>Block</th><th>Formula</th></tr></thead><tbody><tr><td>Melon</td><td>Drops between between 3 and 7 items,<br/>plus between 0 and `level` more.<br/>Can't drop more than 9.<br/>⚠️ Levels below zero crash Minecraft.</td></tr><tr><td>Tall Grass</td><td>Has a one in eight chance of dropping<br/>between 1 and `(level * 2) + 1` seeds.<br/>⚠️ Levels below zero crash Minecraft.</td></tr><tr><td><ul><li>Coal Ore</li><li>Diamond Ore</li><ul></td><td>If `level` is greater than zero, drop between<br/>0 and `1 + level` items, minimum of 1.</td></tr><tr><td>Lapis Ore</td><td>Drop between 4 and 8 items.<br/>If `level` is greater than zero, multiply<br/>the drops by between 0 and `1 + level`.<br/>Multiply by 1 instead of 0 if possible.</td></tr><tr><td>Gravel</td><td>Has a one in `10 - (level * 3)` chance<br/>of dropping flint, otherwise gravel.<br/>⚠️ Levels 4 and above crash Minecraft.</td></tr><tr><td>Nether Wart</td><td>Drop between 2 and 4 items.<br/>If `level` is greater than zero,<br/>add between 1 and `level` more.</td></tr><tr><td>Wheat</td><td>Pick `3 + level` random numbers between 0 and 15.<br/>For each one that's less than or equal to the<br/>crop's growth stage, drop one seed item.</td></tr></tbody></table>The only difference between negative levels is the difficulty in obtaining flint from gravel.|**-32768** to **32767**|

    Relevant pieces of code:

    `EnchantmentHelper.getEnchantmentLevel`: Finds the level of a specific enchantment on an item. If the item has multiple copies of the enchantment, it always takes the first one. It's used directly by these helper functions:
    * `getKnockbackModifier`
    * Called by `EntityPlayer.attackTargetEntityWithCurrentItem`
    * `getFireAspectModifier`
    * Called by `EntityPlayer.attackTargetEntityWithCurrentItem`
    * Ultimately passed to `Entity.setFire`
    * `getEfficiencyModifier`
    * Called by `EntityPlayer.getCurrentPlayerStrVsBlock`
    * `getUnbreakingModifier`
    * Called by `ItemStack.damageItem`
    * `getSilkTouchModifier` (boolean)
    * Called by `Block.harvestBlock` (overridden by many blocks)
    * `getFortuneModifier`
    * Called by `Block.harvestBlock` (overridden by many blocks)
    * Ultimately passed to `Block.dropBlockAsItemWithChance`, `Block.quantityDroppedWithBonus`, and `Block.idDropped` (each of which are overridden by some blocks)
    * `getLootingModifier`
    * Called by `EntityLiving.onDeath`
    * Ultimately passed to `EntityLiving.dropFewItems` (overridden by many entities)

    `EnchantmentHelper.getMaxEnchantmentLevel`: Takes multiple items, and finds the highest level of a specific enchantment present among those items. This ues `getEnchantmentLevel`, so again only the first copy of each enchantment is considered for each item. It's used directly by these helper functions:
    * `getRespiration`
    * Called by `EntityPlayer.decreaseAirSupply`
    * `getAquaAffinityModifier` (boolean)
    * Called by `EntityPlayer.getCurrentPlayerStrVsBlock`

    `EnchantmentHelper.getEnchantmentModifierDamage`: Formula for reducing damage with protection enchantments.
    * Called by `EntityPlayer.applyPotionDamageCalculations`

    `EnchantmentHelper.getEnchantmentModifierLiving`: Formula for increasing damage with damage enchantments.
    * Called by `EntityPlayer.attackTargetEntityWithCurrentItem`
    </details>

    Information for later versions will follow
    Information for later versions will follow

  3. tryashtar revised this gist Apr 7, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion max-enchant.md
    Original file line number Diff line number Diff line change
    @@ -12,7 +12,7 @@
    |Knockback|Take the first knockback enchant on the tool. Add `level` bonus knockback to the attack.<br/><br/>Bonus knockback is only applied when greater than zero. However, sprinting adds one bonus knockback. Therefore, negative levels can prevent sprinting knockback from working.|**-1** to **32767**<ul><li>Lower levels are identical to -1</li></ul>|
    |Fire Aspect|Take the first fire aspect enchant on the tool. If it's greater than zero, set the mob on fire for `level * 4` seconds (`level * 80` ticks).|**1** to **32767**<ul><li>Lower levels do nothing</li></ul>|
    |Looting|Take the first looting enchantment on the tool. Do something different for each mob:<table><thead><tr><th>Mob</th><th>Formula</th></tr></thead><tbody><tr><td>Skeleton</td><td>Drops between 0 and `2 + level` bones,<br/> and between 0 and `2 + level` arrows.<br/>⚠️ Levels -3 and below crash Minecraft.</td></tr><tr><td>Spider</td><td>If killed by a player, has a one in three chance or<br/>a one in `1 + level` chance to drop one spider eye.<br/>Also follow the steps below for string.<br/>⚠️ Levels below zero crash Minecraft.</td></tr><tr><td>Ghast</td><td>Drops between 0 and 1 ghast tears,<br/>plus between 0 and `level` more.<br/>Also drops between 0 and 2 gunpowder,<br/> plus between 0 and `level` more.<br/>⚠️ Levels below zero crash Minecraft.</td></tr><tr><td>Zombie Pigman</td><td>Drops between 0 and `2 + level` rotten flesh,<br/>and between 0 and `2 + level` gold nuggets.<br/>⚠️ Levels -3 and below crash Minecraft.</td></tr><tr><td>Enderman</td><td>Drops between 0 and `1 + level` ender pearls<br/>⚠️ Levels -2 and below crash Minecraft.</td></tr><tr><td>Blaze</td><td>Drops between 0 and `1 + level` blaze rods.<br/>⚠️ Levels -2 and below crash Minecraft.</td></tr><tr><td>Cow</td><td>Drops between 0 and `2 + level` leather,<br/>and between 1 and `3 + level` beef.<br/>⚠️ Levels -3 and below crash Minecraft.</td></tr><tr><td>Chicken</td><td>Drops between 0 and 2 feathers,<br/>plus between 0 and `level` more.<br/>Also drops one chicken.<br/>⚠️ Levels below zero crash Minecraft.</td></tr><tr><td>Squid</td><td>Drops between 1 and `3 + level` ink sacs.<br/>⚠️ Levels -3 and below crash Minecraft.</td></tr></tbody></table>For any other mobs that drop items, drop between 0 and 2 items. If `level` is greater than zero, drop between 0 and `level` more.|**-3** to **32767**<ul><li>Lower levels are identical to -3</li></ul>|
    |Efficiency|Take the first efficiency enchant on the tool. If greater than zero, add `level² + 1` to your mining speed.<br/><br/>Since the level gets squared, negative levels behave as their absolute value.|**1** to **32767**<ul><li>Lower levels are identical to their absolute value</li></ul>|
    |Efficiency|Take the first efficiency enchant on the tool. If greater than zero, add `level² + 1` to your mining speed.|**1** to **32767**<ul><li>Lower levels do nothing</li></ul>|
    |Silk Touch|Take the first silk touch enchant on the tool. If greater than zero, broken blocks drop themselves instead of the normal drops.|**1**<ul><li>Lower levels do nothing</li><li>Higher levels are identical to 1</li></ul>|
    |Unbreaking|Take the first unbreaking enchant on the tool. If greater than zero, has a one in `level + 1` chance to still take durability damage when used.|**1** to **32767**<ul><li>Lower levels do nothing</li></ul>|
    |Fortune|Take the first fortune enchantment on the tool. Do something different for each block:<table><thead><tr><th>Block</th><th>Formula</th></tr></thead><tbody><tr><td>Melon</td><td>Drops between between 3 and 7 items,<br/>plus between 0 and `level` more.<br/>Can't drop more than 9.<br/>⚠️ Levels below zero crash Minecraft.</td></tr><tr><td>Tall Grass</td><td>Has a one in eight chance of dropping<br/>between 1 and `(level * 2) + 1` seeds.<br/>⚠️ Levels below zero crash Minecraft.</td></tr><tr><td><ul><li>Coal Ore</li><li>Diamond Ore</li><ul></td><td>If `level` is greater than zero, drop between<br/>0 and `1 + level` items, minimum of 1.</td></tr><tr><td>Lapis Ore</td><td>Drop between 4 and 8 items.<br/>If `level` is greater than zero, multiply<br/>the drops by between 0 and `1 + level`.<br/>Multiply by 1 instead of 0 if possible.</td></tr><tr><td>Gravel</td><td>Has a one in `10 - (level * 3)` chance<br/>of dropping flint, otherwise gravel.<br/>⚠️ Levels 4 and above crash Minecraft.</td></tr><tr><td>Nether Wart</td><td>Drop between 2 and 4 items.<br/>If `level` is greater than zero,<br/>add between 1 and `level` more.</td></tr><tr><td>Wheat</td><td>Pick `3 + level` random numbers between 0 and 15.<br/>For each one that's less than or equal to the<br/>crop's growth stage, drop one seed item.</td></tr></tbody></table>The only difference between negative levels is the difficulty in obtaining flint from gravel.|**-32768** to **32767**|
  4. tryashtar revised this gist Feb 5, 2022. 1 changed file with 20 additions and 40 deletions.
    60 changes: 20 additions & 40 deletions max-enchant.md
    Original file line number Diff line number Diff line change
    @@ -1,41 +1,21 @@
    <details>
    <summary><b>Beta 1.9 Prerelease 5</b></summary>

    |Enchantment|Stackable|Effective Min|Effective Max|Notes|
    |-|-|-|-|-|
    |Aqua Affinity|Largest of first in armor|1|1||
    |Bane of Arthropods|Adds|Single:<br>-2147483648<br>Stacked:<br>-52241757371157708|Single:<br>2147483647<br>Stacked:<br>52241757371157708|Adds `2.5 * level` damage<br>Affects arthropods with slowness amplifier 3 for `1 + random(0, level / 2)` seconds|
    |Blast Protection|Adds|1|255|Reduces damage by a factor of `min(20, level * 2) / 25`<br>Reduces explosion knockback by a factor of `level * 0.15`<br>Higher levels are treated as 255|
    |Channeling|First|1|1||
    |Curse of Binding|First|1|1||
    |Curse of Vanishing|First|1|1||
    |Depth Strider|Largest of first in armor|1|3|Higher levels are treated as 3|
    |Efficiency|First|1|255|Increases mine speed by `level² + 1`<br>Higher levels are treated as 255|
    |Feather Falling|Adds|1|7|Reduces damage by a factor of `min(20, level * 3) / 25`|
    |Fire Aspect|First|1|255|Sets mobs on fire for `level * 4` seconds<br>Higher levels are treated as 255|
    |Fire Protection|Adds for damage reduction<br>Largest of first in armor for duration reduction|1|10|Reduces damage by a factor of `min(20, level * 2) / 25`<br>Reduces fire duration by a factor of `level * 0.15`|
    |Flame|First|1|1||
    |Fortune|First|1|255|Anything that uses the `apply_bonus` loot table function works like this<br>Higher levels are treated as 255|
    |Frost Walker|First|1|14|Higher levels are treated as 14|
    |Impaling|Adds|Single:<br>-2147483648<br>Stacked:<br>-52241757371157708|Single:<br>2147483647<br>Stacked:<br>52241757371157708|Adds `2.5 * level` damage|
    |Infinity|First|1|1||
    |Knockback|First|1|255|Adds `level` knockback strength<br>Higher levels are treated as 255|
    |Looting|First|1|255|Higher levels are treated as 255|
    |Loyalty|First|1|127|Increases return speed by `0.05 * level`<br>Higher levels are treated as 0|
    |Luck of the Sea|First|1|255|Adds `level` luck<br>Higher levels are treated as 255|
    |Lure|First|1|5|Reduces lure time by `5 * level` seconds<br>Higher levels prevent fish from appearing|
    |Mending|First|1|1||
    |Multishot|First|1|1||
    |Piercing|First|1|127|Higher levels are treated as 0|
    |Power|First|1|255|Increases damage by `0.5 * level + 0.5`<br>Higher levels are treated as 255|
    |Projectile Protection|Adds|1|10|Reduces damage by a factor of `min(20, level * 2) / 25`|
    |Protection|Adds|1|20|Reduces damage by a factor of `min(20, level) / 25`|
    |Punch|First|1|255|Adds `level * 0.6` knockback strength<br>Higher levels are treated as 255|
    |Quick Charge|First|1|5|Reduces draw time by `0.25 * level` seconds<br>Higher levels prevent charging of crossbow|
    |Respiration|Largest of first in armor|1|255|Causes a 1 in `level + 1` chance not to decrease air level<br>Higher levels are treated as 255|
    |Riptide|First|1|1||
    |Sharpness|Adds|0|Single:<br>2147483647<br>Stacked:<br>36028799149670399|Adds `0.5 * max(0, level - 1) + 1` damage|
    |Silk Touch|First|1|1||
    |Smite|Adds|Single:<br>-2147483648<br>Stacked:<br>-52241757371157708|Single:<br>2147483647<br>Stacked:<br>52241757371157708|Adds `2.5 * level` damage|
    |Soul Speed|First|1|255|Increases speed by `0.03 + (level * 0.0105)`<br>Higher levels are treated as 255|
    |Sweeping Edge|First|1|255|Increases sweeping damage by a factor of `level / (level + 1)` times the hit's damage<br>Higher levels are treated as 255|
    |Thorns|Individual Procs|1|2147483647|Chance of hitting is `0.15 * level`<br>Deals `level - 10` damage if `level` is 11 or greater, otherwise deals `random(0, 3) + 1`|
    |Unbreaking|First|1|255|Items have a 1 in `level + 1` chance to skip damage. Armor has a `0.6` chance to take damage even if it would otherwise skip it.<br>Higher levels are treated as 255|
    ⚠️ Any NBT tag type other than `short` for an item's enchantment level crashes Minecraft. Therefore, no enchantment can have a level above 32767 or below -32768.

    |Enchantment|Formula|Effective Range|
    |-|-|-|
    |<ul><li>Protection</li><li>Fire Protection</li><li>Feather Falling</li><li>Blast Protection</li><li>Projectile Protection</li></ul>|Start a running total. For each enchant, add `(level² + 6) / 2` if the enchant protects against the taken damage. For feather falling, add twice. Cap the total at 25. Add one, then divide by two. Now add a random number between 0 and the total. Cap the new total at 20. If the total is one or greater, set the new incoming damage equal to `(damage * (25 - total)) / 25`.<br/><br/>Since the level gets squared, negative levels behave as their absolute value.|**0** to **7**<ul><li>Lower levels are identical to their absolute value</li><li>Higher levels are identical to 7</li></ul>|
    |Respiration|Take the first respiration enchant on each piece of armor. If the largest one is greater than zero, has a one in `1 + level` chance to still decrease the air level each tick while in water.|**1** to **32767**<ul><li>Lower levels do nothing</li></ul>|
    |Aqua Affinity|Take the first aqua affinity enchant on each piece of armor. If the largest one is greater than zero, skip mining speed multiplier when underwater.|**1**<ul><li>Lower levels do nothing</li><li>Higher levels are identical to 1</li></ul>|
    |<ul><li>Sharpness</li><li>Smite</li><li>Bane of Arthropods</li></ul>|Start a running total. For each sharpness enchant, add `level * 3`. For each smite/bane enchant, add `level * 4` if the target is undead/arthropod, respectively. If the total is one or greater, deal a random amount of bonus damage between 1 and the total.<br/><br/>Negative levels can offset the total. For example, Sharpness 5 with Smite -5 will deal 1-15 bonus damage to non-undead monsters, but no bonus damage to undead ones. You can never do less than zero bonus damage, however.|<ul><li>Single: **-32768** to **32767**</li><li>Stacked: **-2147483648** to **2147483647**</li></ul>|
    |Knockback|Take the first knockback enchant on the tool. Add `level` bonus knockback to the attack.<br/><br/>Bonus knockback is only applied when greater than zero. However, sprinting adds one bonus knockback. Therefore, negative levels can prevent sprinting knockback from working.|**-1** to **32767**<ul><li>Lower levels are identical to -1</li></ul>|
    |Fire Aspect|Take the first fire aspect enchant on the tool. If it's greater than zero, set the mob on fire for `level * 4` seconds (`level * 80` ticks).|**1** to **32767**<ul><li>Lower levels do nothing</li></ul>|
    |Looting|Take the first looting enchantment on the tool. Do something different for each mob:<table><thead><tr><th>Mob</th><th>Formula</th></tr></thead><tbody><tr><td>Skeleton</td><td>Drops between 0 and `2 + level` bones,<br/> and between 0 and `2 + level` arrows.<br/>⚠️ Levels -3 and below crash Minecraft.</td></tr><tr><td>Spider</td><td>If killed by a player, has a one in three chance or<br/>a one in `1 + level` chance to drop one spider eye.<br/>Also follow the steps below for string.<br/>⚠️ Levels below zero crash Minecraft.</td></tr><tr><td>Ghast</td><td>Drops between 0 and 1 ghast tears,<br/>plus between 0 and `level` more.<br/>Also drops between 0 and 2 gunpowder,<br/> plus between 0 and `level` more.<br/>⚠️ Levels below zero crash Minecraft.</td></tr><tr><td>Zombie Pigman</td><td>Drops between 0 and `2 + level` rotten flesh,<br/>and between 0 and `2 + level` gold nuggets.<br/>⚠️ Levels -3 and below crash Minecraft.</td></tr><tr><td>Enderman</td><td>Drops between 0 and `1 + level` ender pearls<br/>⚠️ Levels -2 and below crash Minecraft.</td></tr><tr><td>Blaze</td><td>Drops between 0 and `1 + level` blaze rods.<br/>⚠️ Levels -2 and below crash Minecraft.</td></tr><tr><td>Cow</td><td>Drops between 0 and `2 + level` leather,<br/>and between 1 and `3 + level` beef.<br/>⚠️ Levels -3 and below crash Minecraft.</td></tr><tr><td>Chicken</td><td>Drops between 0 and 2 feathers,<br/>plus between 0 and `level` more.<br/>Also drops one chicken.<br/>⚠️ Levels below zero crash Minecraft.</td></tr><tr><td>Squid</td><td>Drops between 1 and `3 + level` ink sacs.<br/>⚠️ Levels -3 and below crash Minecraft.</td></tr></tbody></table>For any other mobs that drop items, drop between 0 and 2 items. If `level` is greater than zero, drop between 0 and `level` more.|**-3** to **32767**<ul><li>Lower levels are identical to -3</li></ul>|
    |Efficiency|Take the first efficiency enchant on the tool. If greater than zero, add `level² + 1` to your mining speed.<br/><br/>Since the level gets squared, negative levels behave as their absolute value.|**1** to **32767**<ul><li>Lower levels are identical to their absolute value</li></ul>|
    |Silk Touch|Take the first silk touch enchant on the tool. If greater than zero, broken blocks drop themselves instead of the normal drops.|**1**<ul><li>Lower levels do nothing</li><li>Higher levels are identical to 1</li></ul>|
    |Unbreaking|Take the first unbreaking enchant on the tool. If greater than zero, has a one in `level + 1` chance to still take durability damage when used.|**1** to **32767**<ul><li>Lower levels do nothing</li></ul>|
    |Fortune|Take the first fortune enchantment on the tool. Do something different for each block:<table><thead><tr><th>Block</th><th>Formula</th></tr></thead><tbody><tr><td>Melon</td><td>Drops between between 3 and 7 items,<br/>plus between 0 and `level` more.<br/>Can't drop more than 9.<br/>⚠️ Levels below zero crash Minecraft.</td></tr><tr><td>Tall Grass</td><td>Has a one in eight chance of dropping<br/>between 1 and `(level * 2) + 1` seeds.<br/>⚠️ Levels below zero crash Minecraft.</td></tr><tr><td><ul><li>Coal Ore</li><li>Diamond Ore</li><ul></td><td>If `level` is greater than zero, drop between<br/>0 and `1 + level` items, minimum of 1.</td></tr><tr><td>Lapis Ore</td><td>Drop between 4 and 8 items.<br/>If `level` is greater than zero, multiply<br/>the drops by between 0 and `1 + level`.<br/>Multiply by 1 instead of 0 if possible.</td></tr><tr><td>Gravel</td><td>Has a one in `10 - (level * 3)` chance<br/>of dropping flint, otherwise gravel.<br/>⚠️ Levels 4 and above crash Minecraft.</td></tr><tr><td>Nether Wart</td><td>Drop between 2 and 4 items.<br/>If `level` is greater than zero,<br/>add between 1 and `level` more.</td></tr><tr><td>Wheat</td><td>Pick `3 + level` random numbers between 0 and 15.<br/>For each one that's less than or equal to the<br/>crop's growth stage, drop one seed item.</td></tr></tbody></table>The only difference between negative levels is the difficulty in obtaining flint from gravel.|**-32768** to **32767**|
    </details>

    Information for later versions will follow
  5. tryashtar revised this gist May 11, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion max-enchant.md
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,7 @@
    |Fire Aspect|First|1|255|Sets mobs on fire for `level * 4` seconds<br>Higher levels are treated as 255|
    |Fire Protection|Adds for damage reduction<br>Largest of first in armor for duration reduction|1|10|Reduces damage by a factor of `min(20, level * 2) / 25`<br>Reduces fire duration by a factor of `level * 0.15`|
    |Flame|First|1|1||
    |Fortune|First|1|255|Anything that uses the `apply_bonus` loot table function works like thisz<br>Higher levels are treated as 255|
    |Fortune|First|1|255|Anything that uses the `apply_bonus` loot table function works like this<br>Higher levels are treated as 255|
    |Frost Walker|First|1|14|Higher levels are treated as 14|
    |Impaling|Adds|Single:<br>-2147483648<br>Stacked:<br>-52241757371157708|Single:<br>2147483647<br>Stacked:<br>52241757371157708|Adds `2.5 * level` damage|
    |Infinity|First|1|1||
  6. tryashtar revised this gist Aug 26, 2020. 1 changed file with 20 additions and 20 deletions.
    40 changes: 20 additions & 20 deletions max-enchant.md
    Original file line number Diff line number Diff line change
    @@ -3,39 +3,39 @@
    |-|-|-|-|-|
    |Aqua Affinity|Largest of first in armor|1|1||
    |Bane of Arthropods|Adds|Single:<br>-2147483648<br>Stacked:<br>-52241757371157708|Single:<br>2147483647<br>Stacked:<br>52241757371157708|Adds `2.5 * level` damage<br>Affects arthropods with slowness amplifier 3 for `1 + random(0, level / 2)` seconds|
    |Blast Protection|Adds|1|255|Reduces damage by a factor of `min(20, level * 2) / 25`<br>Reduces explosion knockback by a factor of `level * 0.15`|
    |Blast Protection|Adds|1|255|Reduces damage by a factor of `min(20, level * 2) / 25`<br>Reduces explosion knockback by a factor of `level * 0.15`<br>Higher levels are treated as 255|
    |Channeling|First|1|1||
    |Curse of Binding|First|1|1||
    |Curse of Vanishing|First|1|1||
    |Depth Strider|Largest of first in armor|1|3||
    |Efficiency|First|1|255|Increases mine speed by `level² + 1`|
    |Depth Strider|Largest of first in armor|1|3|Higher levels are treated as 3|
    |Efficiency|First|1|255|Increases mine speed by `level² + 1`<br>Higher levels are treated as 255|
    |Feather Falling|Adds|1|7|Reduces damage by a factor of `min(20, level * 3) / 25`|
    |Fire Aspect|First|1|255|Sets mobs on fire for `level * 4` seconds|
    |Fire Aspect|First|1|255|Sets mobs on fire for `level * 4` seconds<br>Higher levels are treated as 255|
    |Fire Protection|Adds for damage reduction<br>Largest of first in armor for duration reduction|1|10|Reduces damage by a factor of `min(20, level * 2) / 25`<br>Reduces fire duration by a factor of `level * 0.15`|
    |Flame|First|1|1||
    |Fortune|First|1|255|Anything that uses the `apply_bonus` loot table function works like this|
    |Frost Walker|First|1|14||
    |Fortune|First|1|255|Anything that uses the `apply_bonus` loot table function works like thisz<br>Higher levels are treated as 255|
    |Frost Walker|First|1|14|Higher levels are treated as 14|
    |Impaling|Adds|Single:<br>-2147483648<br>Stacked:<br>-52241757371157708|Single:<br>2147483647<br>Stacked:<br>52241757371157708|Adds `2.5 * level` damage|
    |Infinity|First|1|1||
    |Knockback|First|1|255|Adds `level` knockback strength|
    |Looting|First|1|255||
    |Loyalty|First|1|127|Increases return speed by `0.05 * level`|
    |Luck of the Sea|First|1|255|Adds `level` luck|
    |Lure|First|1|5|Reduces lure time by `5 * level` seconds|
    |Knockback|First|1|255|Adds `level` knockback strength<br>Higher levels are treated as 255|
    |Looting|First|1|255|Higher levels are treated as 255|
    |Loyalty|First|1|127|Increases return speed by `0.05 * level`<br>Higher levels are treated as 0|
    |Luck of the Sea|First|1|255|Adds `level` luck<br>Higher levels are treated as 255|
    |Lure|First|1|5|Reduces lure time by `5 * level` seconds<br>Higher levels prevent fish from appearing|
    |Mending|First|1|1||
    |Multishot|First|1|1||
    |Piercing|First|1|127||
    |Power|First|1|255|Increases damage by `0.5 * level + 0.5`|
    |Piercing|First|1|127|Higher levels are treated as 0|
    |Power|First|1|255|Increases damage by `0.5 * level + 0.5`<br>Higher levels are treated as 255|
    |Projectile Protection|Adds|1|10|Reduces damage by a factor of `min(20, level * 2) / 25`|
    |Protection|Adds|1|20|Reduces damage by a factor of `min(20, level) / 25`|
    |Punch|First|1|255|Adds `level * 0.6` knockback strength|
    |Quick Charge|First|1|5|Reduces draw time by `0.25 * level` seconds|
    |Respiration|Largest of first in armor|1|255|Causes a 1 in `level + 1` chance not to decrease air level|
    |Riptide|First|1|255|Causes a 1 in `level + 1` chance not to decrease air level|
    |Punch|First|1|255|Adds `level * 0.6` knockback strength<br>Higher levels are treated as 255|
    |Quick Charge|First|1|5|Reduces draw time by `0.25 * level` seconds<br>Higher levels prevent charging of crossbow|
    |Respiration|Largest of first in armor|1|255|Causes a 1 in `level + 1` chance not to decrease air level<br>Higher levels are treated as 255|
    |Riptide|First|1|1||
    |Sharpness|Adds|0|Single:<br>2147483647<br>Stacked:<br>36028799149670399|Adds `0.5 * max(0, level - 1) + 1` damage|
    |Silk Touch|First|1|1||
    |Smite|Adds|Single:<br>-2147483648<br>Stacked:<br>-52241757371157708|Single:<br>2147483647<br>Stacked:<br>52241757371157708|Adds `2.5 * level` damage|
    |Soul Speed|First|1|255|Increases speed by `0.03 + (level * 0.0105)`|
    |Sweeping Edge|First|1|255|Increases sweeping damage by a factor of `level / (level + 1)` times the hit's damage|
    |Soul Speed|First|1|255|Increases speed by `0.03 + (level * 0.0105)`<br>Higher levels are treated as 255|
    |Sweeping Edge|First|1|255|Increases sweeping damage by a factor of `level / (level + 1)` times the hit's damage<br>Higher levels are treated as 255|
    |Thorns|Individual Procs|1|2147483647|Chance of hitting is `0.15 * level`<br>Deals `level - 10` damage if `level` is 11 or greater, otherwise deals `random(0, 3) + 1`|
    |Unbreaking|First|1|255|Items have a 1 in `level + 1` chance to skip damage. Armor has a `0.6` chance to take damage even if it would otherwise skip it.|
    |Unbreaking|First|1|255|Items have a 1 in `level + 1` chance to skip damage. Armor has a `0.6` chance to take damage even if it would otherwise skip it.<br>Higher levels are treated as 255|
  7. tryashtar revised this gist Aug 19, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions max-enchant.md
    Original file line number Diff line number Diff line change
    @@ -2,8 +2,8 @@
    |Enchantment|Stackable|Effective Min|Effective Max|Notes|
    |-|-|-|-|-|
    |Aqua Affinity|Largest of first in armor|1|1||
    |Bane of Arthropods|Adds|Single:<br>-2147483648<br>Stacked:<br>-52241757371157708|Single:<br>2147483647<br>Stacked:<br>52241757371157708|Adds `2.5 * level` damage|
    |Blast Protection|Adds|1|10|Reduces damage by a factor of `min(20, level * 2) / 25`|
    |Bane of Arthropods|Adds|Single:<br>-2147483648<br>Stacked:<br>-52241757371157708|Single:<br>2147483647<br>Stacked:<br>52241757371157708|Adds `2.5 * level` damage<br>Affects arthropods with slowness amplifier 3 for `1 + random(0, level / 2)` seconds|
    |Blast Protection|Adds|1|255|Reduces damage by a factor of `min(20, level * 2) / 25`<br>Reduces explosion knockback by a factor of `level * 0.15`|
    |Channeling|First|1|1||
    |Curse of Binding|First|1|1||
    |Curse of Vanishing|First|1|1||
  8. tryashtar revised this gist Aug 19, 2020. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions max-enchant.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    |Enchantment|Stackable|Effective Min|Effective Max|Notes|
    |-|-|-|-|-|
    |Aqua Affinity|Largest of first in armor|1|1||
    |Bane of Arthropods|Adds|Single:<br>-2147483648<br>Stacked:<br>-144115188075855872|Single:<br>2147483647<br>Stacked:<br>144115188075855872|Adds `2.5 * level` damage|
    |Bane of Arthropods|Adds|Single:<br>-2147483648<br>Stacked:<br>-52241757371157708|Single:<br>2147483647<br>Stacked:<br>52241757371157708|Adds `2.5 * level` damage|
    |Blast Protection|Adds|1|10|Reduces damage by a factor of `min(20, level * 2) / 25`|
    |Channeling|First|1|1||
    |Curse of Binding|First|1|1||
    @@ -15,7 +15,7 @@
    |Flame|First|1|1||
    |Fortune|First|1|255|Anything that uses the `apply_bonus` loot table function works like this|
    |Frost Walker|First|1|14||
    |Impaling|Adds|Single:<br>-2147483648<br>Stacked:<br>-144115188075855872|Single:<br>2147483647<br>Stacked:<br>144115188075855872|Adds `2.5 * level` damage|
    |Impaling|Adds|Single:<br>-2147483648<br>Stacked:<br>-52241757371157708|Single:<br>2147483647<br>Stacked:<br>52241757371157708|Adds `2.5 * level` damage|
    |Infinity|First|1|1||
    |Knockback|First|1|255|Adds `level` knockback strength|
    |Looting|First|1|255||
    @@ -32,9 +32,9 @@
    |Quick Charge|First|1|5|Reduces draw time by `0.25 * level` seconds|
    |Respiration|Largest of first in armor|1|255|Causes a 1 in `level + 1` chance not to decrease air level|
    |Riptide|First|1|255|Causes a 1 in `level + 1` chance not to decrease air level|
    |Sharpness|Adds|0|Single:<br>2147483647<br>Stacked:<br>18014398509481984|Adds `0.5 * max(0, level - 1) + 1` damage|
    |Sharpness|Adds|0|Single:<br>2147483647<br>Stacked:<br>36028799149670399|Adds `0.5 * max(0, level - 1) + 1` damage|
    |Silk Touch|First|1|1||
    |Smite|Adds|Single:<br>-2147483648<br>Stacked:<br>-144115188075855872|Single:<br>2147483647<br>Stacked:<br>144115188075855872|Adds `2.5 * level` damage|
    |Smite|Adds|Single:<br>-2147483648<br>Stacked:<br>-52241757371157708|Single:<br>2147483647<br>Stacked:<br>52241757371157708|Adds `2.5 * level` damage|
    |Soul Speed|First|1|255|Increases speed by `0.03 + (level * 0.0105)`|
    |Sweeping Edge|First|1|255|Increases sweeping damage by a factor of `level / (level + 1)` times the hit's damage|
    |Thorns|Individual Procs|1|2147483647|Chance of hitting is `0.15 * level`<br>Deals `level - 10` damage if `level` is 11 or greater, otherwise deals `random(0, 3) + 1`|
  9. tryashtar revised this gist Aug 19, 2020. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions max-enchant.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    |Enchantment|Stackable|Effective Min|Effective Max|Notes|
    |-|-|-|-|-|
    |Aqua Affinity|Largest of first in armor|1|1||
    |Bane of Arthropods|Adds|Single:<br>-2147483648<br>Stacked:<br>-36028797018963968|Single:<br>2147483647<br>Stacked:<br>36028797018963968|Adds `2.5 * level` damage|
    |Bane of Arthropods|Adds|Single:<br>-2147483648<br>Stacked:<br>-144115188075855872|Single:<br>2147483647<br>Stacked:<br>144115188075855872|Adds `2.5 * level` damage|
    |Blast Protection|Adds|1|10|Reduces damage by a factor of `min(20, level * 2) / 25`|
    |Channeling|First|1|1||
    |Curse of Binding|First|1|1||
    @@ -15,7 +15,7 @@
    |Flame|First|1|1||
    |Fortune|First|1|255|Anything that uses the `apply_bonus` loot table function works like this|
    |Frost Walker|First|1|14||
    |Impaling|Adds|Single:<br>-2147483648<br>Stacked:<br>-36028797018963968|Single:<br>2147483647<br>Stacked:<br>36028797018963968|Adds `2.5 * level` damage|
    |Impaling|Adds|Single:<br>-2147483648<br>Stacked:<br>-144115188075855872|Single:<br>2147483647<br>Stacked:<br>144115188075855872|Adds `2.5 * level` damage|
    |Infinity|First|1|1||
    |Knockback|First|1|255|Adds `level` knockback strength|
    |Looting|First|1|255||
    @@ -32,9 +32,9 @@
    |Quick Charge|First|1|5|Reduces draw time by `0.25 * level` seconds|
    |Respiration|Largest of first in armor|1|255|Causes a 1 in `level + 1` chance not to decrease air level|
    |Riptide|First|1|255|Causes a 1 in `level + 1` chance not to decrease air level|
    |Sharpness|Adds|0|Single:<br>2147483647<br>Stacked:<br>36028797018963968|Adds `0.5 * max(0, level - 1) + 1` damage|
    |Sharpness|Adds|0|Single:<br>2147483647<br>Stacked:<br>18014398509481984|Adds `0.5 * max(0, level - 1) + 1` damage|
    |Silk Touch|First|1|1||
    |Smite|Adds|Single:<br>-2147483648<br>Stacked:<br>-36028797018963968|Single:<br>2147483647<br>Stacked:<br>36028797018963968|Adds `2.5 * level` damage|
    |Smite|Adds|Single:<br>-2147483648<br>Stacked:<br>-144115188075855872|Single:<br>2147483647<br>Stacked:<br>144115188075855872|Adds `2.5 * level` damage|
    |Soul Speed|First|1|255|Increases speed by `0.03 + (level * 0.0105)`|
    |Sweeping Edge|First|1|255|Increases sweeping damage by a factor of `level / (level + 1)` times the hit's damage|
    |Thorns|Individual Procs|1|2147483647|Chance of hitting is `0.15 * level`<br>Deals `level - 10` damage if `level` is 11 or greater, otherwise deals `random(0, 3) + 1`|
  10. tryashtar revised this gist Aug 19, 2020. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions max-enchant.md
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    |Enchantment|Stackable|Effective Min|Effective Max|Notes|
    |-|-|-|-|-|
    |Aqua Affinity|Largest of first in armor|1|1||
    |Bane of Arthropods|Adds|Single:<br>-2147483648<br>Stacked:<br>-Infinity|Single:<br>2147483647<br>Stacked:<br>Infinity|Adds `2.5 * level` damage|
    |Bane of Arthropods|Adds|Single:<br>-2147483648<br>Stacked:<br>-36028797018963968|Single:<br>2147483647<br>Stacked:<br>36028797018963968|Adds `2.5 * level` damage|
    |Blast Protection|Adds|1|10|Reduces damage by a factor of `min(20, level * 2) / 25`|
    |Channeling|First|1|1||
    |Curse of Binding|First|1|1||
    @@ -15,7 +15,7 @@
    |Flame|First|1|1||
    |Fortune|First|1|255|Anything that uses the `apply_bonus` loot table function works like this|
    |Frost Walker|First|1|14||
    |Impaling|Adds|Single:<br>-2147483648<br>Stacked:<br>-Infinity|Single:<br>2147483647<br>Stacked:<br>Infinity|Adds `2.5 * level` damage|
    |Impaling|Adds|Single:<br>-2147483648<br>Stacked:<br>-36028797018963968|Single:<br>2147483647<br>Stacked:<br>36028797018963968|Adds `2.5 * level` damage|
    |Infinity|First|1|1||
    |Knockback|First|1|255|Adds `level` knockback strength|
    |Looting|First|1|255||
    @@ -32,9 +32,9 @@
    |Quick Charge|First|1|5|Reduces draw time by `0.25 * level` seconds|
    |Respiration|Largest of first in armor|1|255|Causes a 1 in `level + 1` chance not to decrease air level|
    |Riptide|First|1|255|Causes a 1 in `level + 1` chance not to decrease air level|
    |Sharpness|Adds|0|Single:<br>2147483647<br>Stacked:<br>Infinity|Adds `0.5 * max(0, level - 1) + 1` damage|
    |Sharpness|Adds|0|Single:<br>2147483647<br>Stacked:<br>36028797018963968|Adds `0.5 * max(0, level - 1) + 1` damage|
    |Silk Touch|First|1|1||
    |Smite|Adds|Single:<br>-2147483648<br>Stacked:<br>-Infinity|Single:<br>2147483647<br>Stacked:<br>Infinity|Adds `2.5 * level` damage|
    |Smite|Adds|Single:<br>-2147483648<br>Stacked:<br>-36028797018963968|Single:<br>2147483647<br>Stacked:<br>36028797018963968|Adds `2.5 * level` damage|
    |Soul Speed|First|1|255|Increases speed by `0.03 + (level * 0.0105)`|
    |Sweeping Edge|First|1|255|Increases sweeping damage by a factor of `level / (level + 1)` times the hit's damage|
    |Thorns|Individual Procs|1|2147483647|Chance of hitting is `0.15 * level`<br>Deals `level - 10` damage if `level` is 11 or greater, otherwise deals `random(0, 3) + 1`|
  11. tryashtar revised this gist Aug 19, 2020. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion max-enchant.md
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,6 @@
    |Depth Strider|Largest of first in armor|1|3||
    |Efficiency|First|1|255|Increases mine speed by `level² + 1`|
    |Feather Falling|Adds|1|7|Reduces damage by a factor of `min(20, level * 3) / 25`|
    |Fire Aspect|Adds|1|7|Reduces damage by a factor of `min(20, level * 3) / 25`|
    |Fire Aspect|First|1|255|Sets mobs on fire for `level * 4` seconds|
    |Fire Protection|Adds for damage reduction<br>Largest of first in armor for duration reduction|1|10|Reduces damage by a factor of `min(20, level * 2) / 25`<br>Reduces fire duration by a factor of `level * 0.15`|
    |Flame|First|1|1||
  12. tryashtar renamed this gist Aug 19, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  13. tryashtar created this gist Aug 19, 2020.
    42 changes: 42 additions & 0 deletions max-enchant.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,42 @@

    |Enchantment|Stackable|Effective Min|Effective Max|Notes|
    |-|-|-|-|-|
    |Aqua Affinity|Largest of first in armor|1|1||
    |Bane of Arthropods|Adds|Single:<br>-2147483648<br>Stacked:<br>-Infinity|Single:<br>2147483647<br>Stacked:<br>Infinity|Adds `2.5 * level` damage|
    |Blast Protection|Adds|1|10|Reduces damage by a factor of `min(20, level * 2) / 25`|
    |Channeling|First|1|1||
    |Curse of Binding|First|1|1||
    |Curse of Vanishing|First|1|1||
    |Depth Strider|Largest of first in armor|1|3||
    |Efficiency|First|1|255|Increases mine speed by `level² + 1`|
    |Feather Falling|Adds|1|7|Reduces damage by a factor of `min(20, level * 3) / 25`|
    |Fire Aspect|Adds|1|7|Reduces damage by a factor of `min(20, level * 3) / 25`|
    |Fire Aspect|First|1|255|Sets mobs on fire for `level * 4` seconds|
    |Fire Protection|Adds for damage reduction<br>Largest of first in armor for duration reduction|1|10|Reduces damage by a factor of `min(20, level * 2) / 25`<br>Reduces fire duration by a factor of `level * 0.15`|
    |Flame|First|1|1||
    |Fortune|First|1|255|Anything that uses the `apply_bonus` loot table function works like this|
    |Frost Walker|First|1|14||
    |Impaling|Adds|Single:<br>-2147483648<br>Stacked:<br>-Infinity|Single:<br>2147483647<br>Stacked:<br>Infinity|Adds `2.5 * level` damage|
    |Infinity|First|1|1||
    |Knockback|First|1|255|Adds `level` knockback strength|
    |Looting|First|1|255||
    |Loyalty|First|1|127|Increases return speed by `0.05 * level`|
    |Luck of the Sea|First|1|255|Adds `level` luck|
    |Lure|First|1|5|Reduces lure time by `5 * level` seconds|
    |Mending|First|1|1||
    |Multishot|First|1|1||
    |Piercing|First|1|127||
    |Power|First|1|255|Increases damage by `0.5 * level + 0.5`|
    |Projectile Protection|Adds|1|10|Reduces damage by a factor of `min(20, level * 2) / 25`|
    |Protection|Adds|1|20|Reduces damage by a factor of `min(20, level) / 25`|
    |Punch|First|1|255|Adds `level * 0.6` knockback strength|
    |Quick Charge|First|1|5|Reduces draw time by `0.25 * level` seconds|
    |Respiration|Largest of first in armor|1|255|Causes a 1 in `level + 1` chance not to decrease air level|
    |Riptide|First|1|255|Causes a 1 in `level + 1` chance not to decrease air level|
    |Sharpness|Adds|0|Single:<br>2147483647<br>Stacked:<br>Infinity|Adds `0.5 * max(0, level - 1) + 1` damage|
    |Silk Touch|First|1|1||
    |Smite|Adds|Single:<br>-2147483648<br>Stacked:<br>-Infinity|Single:<br>2147483647<br>Stacked:<br>Infinity|Adds `2.5 * level` damage|
    |Soul Speed|First|1|255|Increases speed by `0.03 + (level * 0.0105)`|
    |Sweeping Edge|First|1|255|Increases sweeping damage by a factor of `level / (level + 1)` times the hit's damage|
    |Thorns|Individual Procs|1|2147483647|Chance of hitting is `0.15 * level`<br>Deals `level - 10` damage if `level` is 11 or greater, otherwise deals `random(0, 3) + 1`|
    |Unbreaking|First|1|255|Items have a 1 in `level + 1` chance to skip damage. Armor has a `0.6` chance to take damage even if it would otherwise skip it.|