Items
Overview
API
// Constant air item, should be used instead of 'null
ItemStack air = ItemStack.AIR;
// Item with amount sets to 1
ItemStack stone = ItemStack.of(Material.STONE);
// Item with custom amount
ItemStack stoneStack = ItemStack.of(Material.STONE, 64);ItemStack item = ItemStack.builder(Material.STONE)
.displayName(Component.text("Display name!", NamedTextColor.GREEN))
.lore(Component.text("Line 1"), Component.text("Line 2"))
.meta(metaBuilder ->
metaBuilder.enchantment(Enchantment.EFFICIENCY, (short) 10)
.hideFlag(ItemHideFlag.HIDE_ENCHANTS))
.build();Last updated
Was this helpful?
