Skip to main content

Item modification

Item modification is a startup event.

ItemEvents.modification is a startup script event used to modify various properties of existing items.

ItemEvents.modification(event => {
  event.modify('minecraft:ender_pearl', item => {
    item.maxStackSize = 64
    item.fireResistant = true
    item.rarity = "UNCOMMON"
  })
  event.modify('minecraft:ancient_debris', item => {
    item.rarity = "RARE"
    item.fireResistant = false
    item.burnTime = 16000
  })
  event.modify('minecraft:turtle_helmet', item => {
    item.rarity = "EPIC"
    item.maxDamage = 481
    item.craftingRemainder = Item.of('minecraft:scute').item
  })
})

Available properties:

PropertyValue typeDescription
maxStackSizeintSets the maximum stack size for items. Default is 64 for most items.
maxDamageintSets the maximum damage an item can take before it is broken.
craftingRemainderItemSets the item left behind in the crafting grid when this item is used as a crafting ingredient (like milk buckets in the cake recipe). Most items do not have one.
fireResistantbooleanIf this item burns in fire and lava. Most items are false by default, but Ancient Debris and Netherite things are not.
rarityRaritySets the items rarity. This is mainly used for the name colour. COMMON by default. Nether Stars and Elytra are UNCOMMON, Golden Apples are RARE and Enchanted Golden Apples are EPIC. 
burnTimeintSets the burn time (in ticks) in a regular furnace for this item. Note that Smokers and Blast Furnaces burn fuel twice as fast. Coal is 1600.
foodPropertiesFoodPropertiesSets the items food properties to the provided properties. Can be null to remove food properties.
foodProperties
Consumer<FoodBuilder>
Sets the properties according to the consumer. See example below //TODO ADD LINK
digSpeedfloatSets the items digging speed to the number provided. See table below for defaults.
tier
Consumer<MutableToolTier>
Sets the items tier according to the consumer. See example below //TODO ADD LINK
attackDamagedoubleAdds an attack damage bonus. If this is a tool-type item then you should modify the tier instead. Can be negative.
attackSpeeddoubleAdds an attack speed bonus. If this is a tool-type item then you should modify the tier instead. Can be negative.
armorProtectiondoubleAdds an armor protection bonus. Can be negative.
armorToughnessdoubleAdds an armor toughness bonus. Can be negative.
armorKnockbackResistance
doubleAdd an armor knockback resistance bonus. Can be negative. 1 is full knockback resistance.

 

Tool defaults
TiermaxDamagedigSpeedattackDamage (this is a bonus, not the final value)

Wood

5920
Stone13141
Iron25062
Diamond156183
Gold32120
Netherite203194
Armor defaults

All boxes with multiple values are formatted [head, chest, legs, feet]. Boxes with single values are the same for every piece.

Tier

maxDamage 

armourProtection

armorToughnessarmorKnockbackResistance
Leather[65, 75, 80, 55][1, 2, 3, 1]00
Chain[195, 225, 240, 165]
[1, 4, 5, 2]
00
Iron[195, 225, 240, 165]
[2, 5, 6, 2]
00
Gold[91 ,105, 112, 77]
[1, 3, 5, 2]
00
Diamond[429, 495, 528, 363]
[3, 6, 8, 3]
20
Turtle (only has helmet)[325, nil, nil. nil]
[2, nil, nil, nil]
00
Netherite[481, 555, 592, 407]
[3, 6, 8, 3]
30.1
Elytra (not actually armor)[nil, 432, nil, nil]000

Tier


Food