diff --git a/wiki/tutorials/custom-tiers/page.kubedoc b/wiki/tutorials/custom-tiers/page.kubedoc index fa8a78d1..f871e2bf 100644 --- a/wiki/tutorials/custom-tiers/page.kubedoc +++ b/wiki/tutorials/custom-tiers/page.kubedoc @@ -3,33 +3,70 @@ They are not reloadable without restarting the game. # Tool Tiers +|> 1.21.1 ```js ItemEvents.toolTierRegistry(event => { - event.add('tier_id', tier => { - tier.uses = 250 - tier.speed = 6 - tier.attackDamageBonus = 2 - tier.level = 2 - tier.enchantmentValue = 14 - tier.repairIngredient = '#forge:ingots/iron' - }) + event.add('tier_id', tier => { + tier.uses = 250 + tier.speed = 6 + tier.attackDamageBonus = 2 + tier.incorrectBlocksForDropsTag = 'minecraft:incorrect_for_iron_tool' + tier.enchantmentValue = 14 + tier.repairIngredient = '#forge:ingots/iron' + }) }) ``` +<||> 1.19.2 - 1.20.1 +```js +ItemEvents.toolTierRegistry(event => { + event.add('tier_id', tier => { + tier.uses = 250 + tier.speed = 6 + tier.attackDamageBonus = 2 + tier.level = 2 + tier.enchantmentValue = 14 + tier.repairIngredient = '#forge:ingots/iron' + }) +}) +``` +<| # Armor Tiers +|> 1.21.1 +```js +StartupEvents.registry('armor_material', event => { + event + .create('tier_id') + // How many armor points does each piece of armor contribute. You can also use 'body' to create a piece of armor + // which gives armor points regardless of where it is worn. + .defense({ boots: 2, leggings: 5, chestplate: 6, helmet: 2 }) + // The enchantment value. + .enchantmentValue(9) + // The equip sound. It may be a string representing a sound. + .equipSound('minecraft:item.armor.equip_iron') + // A **supplier** of the repair ingredient to use. It's a function that returns an Ingredient. + .repairIngredient(() => Ingredient.of('#forge:ingots/iron')) + // Armor toughness. Diamond has 2, Netherite has 3. + .toughness(0) + // Knockback resistance. Netherite has 0.1. + .knockbackResistance(0) +}) +``` +<||> 1.19.2 - 1.20.1 ```js ItemEvents.armorTierRegistry(event => { - event.add('tier_id', tier => { - tier.durabilityMultiplier = 15 // Each slot will be multiplied with [13, 15, 16, 11] - tier.slotProtections = [2, 5, 6, 2] // Slot indicies are [FEET, LEGS, BODY, HEAD] - tier.enchantmentValue = 9 - tier.equipSound = 'minecraft:item.armor.equip_iron' - tier.repairIngredient = '#forge:ingots/iron' - tier.toughness = 0 // diamond has 2, netherite 3 - tier.knockbackResistance = 0 - }) + event.add('tier_id', tier => { + tier.durabilityMultiplier = 15 // Each slot will be multiplied with [13, 15, 16, 11] + tier.slotProtections = [2, 5, 6, 2] // Slot indicies are [FEET, LEGS, BODY, HEAD] + tier.enchantmentValue = 9 + tier.equipSound = 'minecraft:item.armor.equip_iron' + tier.repairIngredient = '#forge:ingots/iron' + tier.toughness = 0 // diamond has 2, netherite 3 + tier.knockbackResistance = 0 + }) }) ``` +<| -For default values see [[/tutorials/item-modification|item modification tutorial]]. \ No newline at end of file +For default values see [[/tutorials/item-modification|item modification tutorial]].