Using the ItemBuilder with ItemMeta:
val itemStack: ItemStack = ItemBuilder.of(Material.DIAMOND_SWORD)
.specifics {
displayName(Component.text("sword"))
isUnbreakable = true
}
.build()
Using the ItemBuilder on different ItemMetas:
val itemStack: ItemStack = ItemBuilder.of(Material.PLAYER_HEAD, SkullMeta::class.java)
.specifics {
owningPlayer = player
}
.build()