@@ -57,58 +57,58 @@ public class ${name}Item extends ${data.toolType?replace("Spade", "Shovel")?repl
5757 <#else >
5858 properties
5959 </#if >
60- <#if data.toolType == "Pickaxe" >
61- .pickaxe(TOOL_MATERIAL, ${data.damageVsEntity - 1 } f, ${data.attackSpeed - 4 } f)
62- <#elseif data.toolType == "Sword" >
63- .sword(TOOL_MATERIAL, ${data.damageVsEntity - 1 } f, ${data.attackSpeed - 4 } f)
64- <#elseif data.toolType == "MultiTool" >
65- .attributes(<@itemAttributeModifiers true/ >)
66- <#elseif data.toolType == "Shield" >
60+ <#if data.toolType == "Pickaxe" >
61+ .pickaxe(TOOL_MATERIAL, ${data.damageVsEntity - 1 } f, ${data.attackSpeed - 4 } f)
62+ <#elseif data.toolType == "Sword" >
63+ .sword(TOOL_MATERIAL, ${data.damageVsEntity - 1 } f, ${data.attackSpeed - 4 } f)
64+ <#elseif data.toolType == "MultiTool" >
65+ .attributes(<@itemAttributeModifiers true/ >)
66+ <#elseif data.toolType == "Shield" >
67+ .repairable(TagKey.create(Registries.ITEM, ResourceLocation.parse("${modid} :${registryname} _repair_items")))
68+ .component(DataComponents.BREAK_SOUND, SoundEvents.SHIELD_BREAK)
69+ .equippableUnswappable(EquipmentSlot.OFFHAND)
70+ .component(DataComponents.BLOCKS_ATTACKS, new BlocksAttacks(
71+ 0.25f,
72+ 1,
73+ List.of(new BlocksAttacks.DamageReduction(90.0f, Optional.empty(), 0, 1)),
74+ new BlocksAttacks.ItemDamageFunction(3, 1, 1),
75+ Optional.of(DamageTypeTags.BYPASSES_SHIELD),
76+ Optional.of(SoundEvents.SHIELD_BLOCK),
77+ Optional.of(SoundEvents.SHIELD_BREAK)
78+ ))
79+ <#elseif data.toolType == "Shears" >
80+ .component(DataComponents.TOOL, ShearsItem.createToolProperties())
81+ <#if data.repairItems?has_content >
6782 .repairable(TagKey.create(Registries.ITEM, ResourceLocation.parse("${modid} :${registryname} _repair_items")))
68- .component(DataComponents.BREAK_SOUND, SoundEvents.SHIELD_BREAK)
69- .equippableUnswappable(EquipmentSlot.OFFHAND)
70- .component(DataComponents.BLOCKS_ATTACKS, new BlocksAttacks(
71- 0.25f,
72- 1,
73- List.of(new BlocksAttacks.DamageReduction(90.0f, Optional.empty(), 0, 1)),
74- new BlocksAttacks.ItemDamageFunction(3, 1, 1),
75- Optional.of(DamageTypeTags.BYPASSES_SHIELD),
76- Optional.of(SoundEvents.SHIELD_BLOCK),
77- Optional.of(SoundEvents.SHIELD_BREAK)
78- ))
79- <#elseif data.toolType == "Shears" >
80- .component(DataComponents.TOOL, ShearsItem.createToolProperties())
81- <#if data.repairItems?has_content >
82- .repairable(TagKey.create(Registries.ITEM, ResourceLocation.parse("${modid} :${registryname} _repair_items")))
83- </#if >
84- </#if >
85- <#if data.toolType == "Shears" || data.toolType == "Shield" >
86- <#if data.usageCount != 0 >
87- .durability(${data.usageCount} )
88- <#else >
89- .stacksTo(1)
90- </#if >
91- </#if >
92- <#if data.immuneToFire >
93- .fireResistant()
94- </#if >
95- <#if data.rarity != "COMMON" >
96- .rarity(Rarity.${data.rarity} )
9783 </#if >
98- <#if data.enchantability != 0 && data.toolType=="Shears" >
99- .enchantable(${data.enchantability} )
100- </#if >
101- <#if modifiesDefaultComponents(data.toolType) >
102- <#if data.usageCount == 0 >
103- .component(DataComponents.MAX_DAMAGE, null)
104- </#if >
105- <#if data.attributeModifiers?size gt 0 && (data.toolType == "Axe" || data.toolType == "Spade" || data.toolType == "Hoe") >
106- .component(DataComponents.ATTRIBUTE_MODIFIERS, <@itemAttributeModifiers true/ >)
107- </#if >
108- </#if >
109- <#if (data.attributeModifiers?size gt 0) && (data.toolType == "Pickaxe" || data.toolType == "Sword" || data.toolType == "Shears" || data.toolType == "Shield") >
110- .attributes(<@itemAttributeModifiers (data.toolType == "Pickaxe" || data.toolType == "Sword")/ >)
84+ </#if >
85+ <#if data.toolType == "Shears" || data.toolType == "Shield" >
86+ <#if data.usageCount != 0 >
87+ .durability(${data.usageCount} )
88+ <#else >
89+ .stacksTo(1)
11190 </#if >
91+ </#if >
92+ <#if data.rarity != "COMMON" >
93+ .rarity(Rarity.${data.rarity} )
94+ </#if >
95+ <#if data.immuneToFire >
96+ .fireResistant()
97+ </#if >
98+ <#if data.enchantability != 0 && data.toolType=="Shears" >
99+ .enchantable(${data.enchantability} )
100+ </#if >
101+ <#if (data.attributeModifiers?size gt 0) && (data.toolType == "Pickaxe" || data.toolType == "Sword" || data.toolType == "Shears" || data.toolType == "Shield") >
102+ .attributes(<@itemAttributeModifiers (data.toolType == "Pickaxe" || data.toolType == "Sword")/ >)
103+ </#if >
104+ <#if modifiesDefaultComponents(data.toolType) >
105+ <#if data.usageCount == 0 >
106+ .component(DataComponents.MAX_DAMAGE, null)
107+ </#if >
108+ <#if data.attributeModifiers?size gt 0 && (data.toolType == "Axe" || data.toolType == "Spade" || data.toolType == "Hoe") >
109+ .component(DataComponents.ATTRIBUTE_MODIFIERS, <@itemAttributeModifiers true/ >)
110+ </#if >
111+ </#if >
112112 );
113113 }
114114
@@ -175,12 +175,12 @@ public class ${name}Item extends Item {
175175 <#else >
176176 .stacksTo(1)
177177 </#if >
178- <#if data.immuneToFire >
179- .fireResistant()
180- </#if >
181178 <#if data.rarity != "COMMON" >
182179 .rarity(Rarity.${data.rarity} )
183180 </#if >
181+ <#if data.immuneToFire >
182+ .fireResistant()
183+ </#if >
184184 <#if data.repairItems?has_content >
185185 .repairable(TagKey.create(Registries.ITEM, ResourceLocation.parse("${modid} :${registryname} _repair_items")))
186186 </#if >
@@ -326,16 +326,16 @@ public class ${name}Item extends FishingRodItem {
326326
327327 <@onItemUsedOnBlock data.onRightClickedOnBlock/ >
328328
329- <@onDroppedByPlayer data.onDroppedByPlayer/ >
330-
331- <@onItemEntityDestroyed data.onItemEntityDestroyed/ >
332-
333329 <@onCrafted data.onCrafted/ >
334330
335331 <@onEntitySwing data.onEntitySwing/ >
336332
337333 <@onItemTick data.onItemInUseTick, data.onItemInInventoryTick/ >
338334
335+ <@onDroppedByPlayer data.onDroppedByPlayer/ >
336+
337+ <@onItemEntityDestroyed data.onItemEntityDestroyed/ >
338+
339339 <@hasGlow data.glowCondition/ >
340340
341341</#macro >
0 commit comments