-
Notifications
You must be signed in to change notification settings - Fork 0
Modify Item NBT Tag
Potato Destroyer edited this page Mar 24, 2018
·
3 revisions
ItemStack(Material.PAPER).modifyNBT {
addTag {
type = NBTType.AttackDamage
amount = 233.0
}
removeTagByType(NBTType.MovementSpeed)
removeTagByIndex(0)
clearAllTags()
}.operateMeta {
displayName = "Banana"
}modifyNBT function provides dsl to modify NBT Tag.
addTag{} has these properties.
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 Multiplicative represents amount is a % value.
remove nbt tag by index.
clear all nbt tags.
remove all tags belong to this type.
This function provides a scope to access class ItemMeta. Meanwhile, we also have operateBookMeta and operateBannerMeta to operate item meta.