NovaItem

class NovaItem

Represents an item type in Nova.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val clientsideProvider: ItemProvider

An ItemProvider containing the client-side ItemStack of this NovaItem, intended for use in Guis.

Link copied to clipboard
val config: Provider<CommentedConfigurationNode>

The configuration for this NovaItem. May be an empty node if the config file does not exist.

Link copied to clipboard
val craftingRemainingItem: ItemStack?

The ItemStack that is left over after this NovaItem was used in a crafting recipe.

Link copied to clipboard
val id: Key
Link copied to clipboard
Link copied to clipboard
val lore: List<Component>
Link copied to clipboard
Link copied to clipboard
val name: Component?
Link copied to clipboard
val style: Style
Link copied to clipboard

Functions

Link copied to clipboard
fun createClientsideItemBuilder(): ItemBuilder

Creates an ItemBuilder for an ItemStack of this NovaItem, in client-side format, intended for use in Guis.

Link copied to clipboard
fun createItemBuilder(): ItemBuilder

Creates an ItemBuilder for an ItemStack of this NovaItem, in server-side format.

Link copied to clipboard
fun createItemStack(amount: Int = 1): ItemStack

Creates an ItemStack of this NovaItem with the given amount in server-side format.

Link copied to clipboard
inline fun <T : Any> getBehavior(): T

Gets the first ItemBehavior that is an instance of T, or throws an IllegalStateException if there is none.

fun <T : Any> getBehavior(behavior: KClass<T>): T

Gets the first ItemBehavior that is an instance of behavior, or throws an IllegalStateException if there is none.

Link copied to clipboard
inline fun <T : Any> getBehaviorOrNull(): T?

Gets the first ItemBehavior that is an instance of T, or null if there is none.

fun <T : Any> getBehaviorOrNull(type: KClass<T>): T?

Gets the first ItemBehavior that is an instance of type or a subclass, or null if there is none.

Link copied to clipboard
inline fun <T : Any> hasBehavior(): Boolean

Checks whether this NovaItem has an ItemBehavior of the reified type T, or a subclass of it.

fun <T : Any> hasBehavior(type: KClass<T>): Boolean

Checks whether this NovaItem has an ItemBehavior of the specified class type, or a subclass of it.

Checks whether this NovaItem has the specific behavior instance.

Link copied to clipboard
open override fun toString(): String