Skip to content

Modify Item NBT Tag

Potato Destroyer / liuyipeng001 edited this page Feb 16, 2018 · 3 revisions

Modify Item NBT Tag

ItemStack(Material.WOOD_SWORD).modifyNBT {
        type = NBTModifier.NBTTagModifier.NBTType.AttackDamage
	amount = 233
	slot = NBTModifier.NBTTagModifier.Slot.MainHand
}
    .operateMeta {
  		isUnbreakable = true
  	    lore = lore.apply { add("super sword") }
  	    }

modifyNBT function provides DSL to create NBT Tag.
Here are some NBT Tag types you can choose, type can be assigned these values:

  • AttackDamage
  • AttackSpeed
  • MaxHealth
  • MovementSpeed
  • Armor
  • Luck
    slot can be assigned these values:
  • MainHand
  • OffHand
  • Feet
  • Legs
  • Chest
  • Head

Clone this wiki locally