KattonItemProperties

class KattonItemProperties(val id: Identifier) : Item.Properties, Identifiable

Extended Item.Properties that supports custom name and model with hot-reload capabilities.

This class extends Minecraft's Item.Properties to provide additional functionality for defining custom item names and models. It is designed to work with Katton's hot-reload system by deferring the intrusive holder creation until registration time.

Does not call setId() in constructor to avoid triggering intrusive holder creation. The resource key is set during registration time instead.

Parameters

id

The identifier for this item, used for registration and default naming

See also

for registration

Constructors

Link copied to clipboard
constructor(id: Identifier)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
var componentInitializer: DataComponentInitializers.Initializer<Item>
Link copied to clipboard
open override val id: Identifier
Link copied to clipboard
var model: Identifier

The model identifier for the item.

Link copied to clipboard
var name: Component

The display name of the item.

Functions

Link copied to clipboard
open fun attributes(attributes: ItemAttributeModifiers): Item.Properties
Link copied to clipboard
open fun axe(material: ToolMaterial, attackDamageBaseline: Float, attackSpeedBaseline: Float): Item.Properties
Link copied to clipboard
open fun <T : Any> component(type: DataComponentType<T>, value: T): Item.Properties
Link copied to clipboard
open fun craftRemainder(craftingRemainingItem: Item): Item.Properties
open fun craftRemainder(craftingRemainingItem: ItemStackTemplate): Item.Properties
Link copied to clipboard
open fun customDamage(handler: CustomDamageHandler): Item.Properties
Link copied to clipboard
open fun <T : Any> delayedComponent(type: DataComponentType<T>, initializer: DataComponentInitializers.SingleComponentInitializer<T>): Item.Properties
Link copied to clipboard
open fun <T : Any> delayedHolderComponent(type: DataComponentType<Holder<T>>, valueKey: ResourceKey<T>): Item.Properties
Link copied to clipboard
open fun durability(maxDamage: Int): Item.Properties
Link copied to clipboard
open fun effectiveModel(): Identifier
Link copied to clipboard
open fun enchantable(value: Int): Item.Properties
Link copied to clipboard
open fun equipmentSlot(equipmentSlotProvider: EquipmentSlotProvider): Item.Properties
Link copied to clipboard
open fun equippable(slot: EquipmentSlot): Item.Properties
Link copied to clipboard
open fun equippableUnswappable(slot: EquipmentSlot): Item.Properties
Link copied to clipboard
open fun fireResistant(): Item.Properties
Link copied to clipboard
open fun food(foodProperties: FoodProperties): Item.Properties
open fun food(foodProperties: FoodProperties, consumable: Consumable): Item.Properties
Link copied to clipboard
open fun hoe(material: ToolMaterial, attackDamageBaseline: Float, attackSpeedBaseline: Float): Item.Properties
Link copied to clipboard
open fun horseArmor(material: ArmorMaterial): Item.Properties
Link copied to clipboard
open fun humanoidArmor(material: ArmorMaterial, type: ArmorType): Item.Properties
Link copied to clipboard
open fun itemId(): @Nullable ResourceKey<Item>?
Link copied to clipboard
fun itemIdOrThrow(): ResourceKey<Item>
Link copied to clipboard
open fun jukeboxPlayable(song: ResourceKey<JukeboxSong>): Item.Properties
Link copied to clipboard
open fun modelId(modelId: Identifier): Item.Properties
Link copied to clipboard
open fun nautilusArmor(material: ArmorMaterial): Item.Properties
Link copied to clipboard
open fun overrideDescription(descriptionId: String): Item.Properties
Link copied to clipboard
open fun pickaxe(material: ToolMaterial, attackDamageBaseline: Float, attackSpeedBaseline: Float): Item.Properties
Link copied to clipboard
open fun rarity(rarity: Rarity): Item.Properties
Link copied to clipboard
open fun repairable(repairItems: TagKey<Item>): Item.Properties
open fun repairable(repairItem: Item): Item.Properties
Link copied to clipboard
open fun requiredFeatures(vararg flags: FeatureFlag): Item.Properties
Link copied to clipboard
open fun setId(id: ResourceKey<Item>): Item.Properties
Link copied to clipboard
fun setModel(model: Identifier): KattonItemProperties

Sets the model identifier for the item.

Link copied to clipboard
fun setName(name: Component): KattonItemProperties

Sets the display name of the item.

Link copied to clipboard
open fun shovel(material: ToolMaterial, attackDamageBaseline: Float, attackSpeedBaseline: Float): Item.Properties
Link copied to clipboard
open fun spawnEgg(type: EntityType<*>): Item.Properties
Link copied to clipboard
open fun spear(material: ToolMaterial, attackDuration: Float, damageMultiplier: Float, delay: Float, dismountTime: Float, dismountThreshold: Float, knockbackTime: Float, knockbackThreshold: Float, damageTime: Float, damageThreshold: Float): Item.Properties
Link copied to clipboard
open fun stacksTo(max: Int): Item.Properties
Link copied to clipboard
open fun sword(material: ToolMaterial, attackDamageBaseline: Float, attackSpeedBaseline: Float): Item.Properties
Link copied to clipboard
open fun tool(material: ToolMaterial, minesEfficiently: TagKey<Block>, attackDamageBaseline: Float, attackSpeedBaseline: Float, disableBlockingSeconds: Float): Item.Properties
Link copied to clipboard
open fun trimMaterial(material: ResourceKey<TrimMaterial>): Item.Properties
Link copied to clipboard
open fun useBlockDescriptionPrefix(): Item.Properties
Link copied to clipboard
open fun useCooldown(seconds: Float): Item.Properties
Link copied to clipboard
open fun useItemDescriptionPrefix(): Item.Properties
Link copied to clipboard
open fun usingConvertsTo(item: Item): Item.Properties
Link copied to clipboard
open fun wolfArmor(material: ArmorMaterial): Item.Properties