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") }
  	    }

modify NBT

modifyNBT function provides DSL to create NBT Tag.
type can be assigned these values:

  • AttackDamage
  • AttackSpeed
  • MaxHealth
  • MovementSpeed
  • Armor
  • Luck

slot can be assigned these values:

  • MainHand
  • OffHand
  • Feet
  • Legs
  • Chest
  • Head

This DSL also has operation , uuidLesat , uuidMost option properties.
operation assigns false represents amount is a % value.

operate Meta

This function provides a scope to access class ItemMeta.

Clone this wiki locally