ItemStackBuilder

Helper class for creating an ItemStack with various properties. Includes methods for creating PylonItem stacks, and gui items.

Implements InvUI's ItemProvider, so can be used instead of an ItemStack in GUIs.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun addAttributeModifier(attribute: Attribute, modifier: AttributeModifier, replaceExisting: Boolean = true): ItemStackBuilder
Link copied to clipboard

Adds a color to the item's custom model data, used in resource packs.

Link copied to clipboard

Adds a boolean to the item's custom model data, used in resource packs.

Link copied to clipboard

Adds a float to the item's custom model data, used in resource packs.

Link copied to clipboard

Adds a string to the item's custom model data, used in resource packs.

Link copied to clipboard
Link copied to clipboard
fun armor(slot: EquipmentSlotGroup, armor: Double, armorToughness: Double): ItemStackBuilder
Link copied to clipboard
Link copied to clipboard
fun axe(miningSpeed: Float, miningDurabilityDamage: Int): ItemStackBuilder
Link copied to clipboard
fun boots(armor: Double, armorToughness: Double): ItemStackBuilder
Link copied to clipboard
Link copied to clipboard
fun chestplate(armor: Double, armorToughness: Double): ItemStackBuilder
Link copied to clipboard

Sets the item's lore to the default language file key (for example pylon.pyloncore.item.my_dumb_item.lore), based on the item key given.

Link copied to clipboard

Sets the item's name to the default language file key (for example pylon.pyloncore.item.my_dumb_item.name), based on the item key given.

Link copied to clipboard

In order to get around potions and player heads overriding item_name, Pylon by default does unspeakable things to the item to get it to work. This method disables those hacks, which may have unintended side effects.

Link copied to clipboard
fun durability(durability: Int): ItemStackBuilder
fun durability(durability: Int, damage: Int): ItemStackBuilder
Link copied to clipboard
fun <T : Any> editData(type: DataComponentType.Valued<T>, block: (T) -> T): ItemStackBuilder
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@NotNull
open override fun get(): @NotNull ItemStack
Link copied to clipboard
fun helmet(armor: Double, armorToughness: Double): ItemStackBuilder
Link copied to clipboard
Link copied to clipboard
fun hoe(miningSpeed: Float, miningDurabilityDamage: Int): ItemStackBuilder
Link copied to clipboard
fun leggings(armor: Double, armorToughness: Double): ItemStackBuilder
Link copied to clipboard
fun lore(vararg lore: String): ItemStackBuilder
fun lore(vararg loreToAdd: ComponentLike): ItemStackBuilder
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun pickaxe(miningSpeed: Float, miningDurabilityDamage: Int): ItemStackBuilder
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun shovel(miningSpeed: Float, miningDurabilityDamage: Int): ItemStackBuilder
Link copied to clipboard
fun tool(blocks: RegistryKeySet<BlockType>, miningSpeed: Float, miningDurabilityDamage: Int): ItemStackBuilder
Link copied to clipboard
Link copied to clipboard
fun useCooldown(cooldownTicks: Int, cooldownGroup: Key?): ItemStackBuilder
Link copied to clipboard
fun weapon(attackDamage: Double, attackSpeed: Double, attackDurabilityDamage: Int, disableShieldSeconds: Float): ItemStackBuilder