NovaBlockBuilder

Properties

Link copied to clipboard
abstract val entry: RegistryEntry.Paper<BlockType>

The entry of the element being built.

Functions

Link copied to clipboard
abstract fun behaviors(vararg behaviors: BlockBehaviorHolder)

Adds to the behaviors of this block to behaviors.

Link copied to clipboard
abstract fun breakable(hardness: Double = 1.0, toolCategories: Set<Key> = emptySet(), toolTier: Key? = null, requiresToolForDrops: Boolean = false, hitParticles: RegistryEntry.Paper<ItemType>? = null, breakParticles: RegistryEntry.Paper<BlockType>? = null, showBreakAnimation: Boolean = true)

Makes this block breakable. Higher hardness values increase the time required to break it, while requiresToolForDrops determines whether an appropriate tool is needed for drops.

Link copied to clipboard
abstract fun config(name: String)

Configures the name of the config file in this addon's namespace.

Link copied to clipboard
abstract fun entityBacked(stateSelector: BlockSelectorScope.() -> BlockData = DEFAULT_BLOCK_STATE_SELECTOR, eraseSelectedVanillaModels: Boolean = false, extraColliderSelector: BlockSelectorScope.() -> List<ColliderCube> = DEFAULT_EXTRA_COLLIDER_SELECTOR, extraHitboxSelector: BlockSelectorScope.() -> List<HitboxCuboid> = { extraColliderSelector().map(HitboxCuboid::fromCollider) }, modelSelector: BlockModelSelectorScope.() -> ModelBuilder = DEFAULT_BLOCK_MODEL_SELECTOR)

Configures the model, hitboxes and colliders of this entity-based block model via modelSelector, stateSelector, extraColliderSelector and extraHitboxSelector.

Link copied to clipboard
abstract fun entityItemBacked(stateSelector: BlockSelectorScope.() -> BlockData = DEFAULT_BLOCK_STATE_SELECTOR, eraseSelectedVanillaModels: Boolean = false, extraColliderSelector: BlockSelectorScope.() -> List<ColliderCube> = DEFAULT_EXTRA_COLLIDER_SELECTOR, extraHitboxSelector: BlockSelectorScope.() -> List<HitboxCuboid> = { extraColliderSelector().map(HitboxCuboid::fromCollider) }, itemSelector: ItemModelDefinitionBuilder<BlockModelSelectorScope>.() -> Unit = DEFAULT_CONFIGURE_BLOCK_MODEL_SELECTOR)

Configures the model and hitboxes and colliders of this entity-based block model via itemSelector, stateSelector, extraColliderSelector and extraHitboxSelector.

Link copied to clipboard
abstract fun explosionResistance(explosionResistance: Float)

Configures this block's resistance to explosions. Higher values make the block harder to destroy.

Link copied to clipboard
abstract fun flammable(igniteOdds: Int, burnOdds: Int, ignitedByLava: Boolean)

Configures how this block interacts with vanilla fire.

Link copied to clipboard
abstract fun fluidFlowMode(selectFluidFlowMode: BlockSelectorScope.() -> FluidFlowMode)

Configures how fluids flow into and out of each block state.

Configures how fluids flow into and out of all states of this block.

Link copied to clipboard
abstract fun item(item: RegistryEntry.Paper<ItemType>)

Sets the item type of this block. Used in, for example, block drops via BlockDrops.

Link copied to clipboard
abstract fun lightEmission(selectLightEmission: BlockSelectorScope.() -> Int)

Configures the emitted light level for each block state. Selected values must be between 0 and 15.

open fun lightEmission(level: Int)

Configures the light level emitted by all states of this block. Must be between 0 and 15.

Link copied to clipboard
open fun localizedName(localizedName: String)

Sets the localization key.

Link copied to clipboard
abstract fun mapColor(mapColor: Color)

Configures this block's color on maps. The closest color available in Minecraft's map palette is used.

Link copied to clipboard
abstract fun modelLess(stateSelector: BlockSelectorScope.() -> BlockData)

Configures this block to not use any custom models, but instead use the given stateSelector.

Link copied to clipboard
abstract fun name(name: Component)

Sets the name.

Link copied to clipboard
abstract fun noteBlockInstrument(instrument: NoteBlockInstrument)

Configures the instrument used by nearby note blocks. Normal instruments require this block to be below the note block, while mob-head instruments require this block to be above the note block. Defaults to NoteBlockInstrument.HARP.

Link copied to clipboard
abstract fun pistonReaction(pistonReaction: PistonMoveReaction)

Configures how pistons interact with this block. Defaults to PistonMoveReaction.MOVE. Tile Entities can never be moved.

Link copied to clipboard
abstract fun rawConfig(id: String)
open fun rawConfig(id: Key)

Configures the id of this config file in the format namespace:name.

Link copied to clipboard
abstract fun sounds(selectSoundGroup: BlockSelectorScope.() -> SoundGroup)

Configures the sounds made by each block state. Defaults to SoundGroup.EMPTY.

open fun sounds(soundGroup: SoundGroup)

Configures the sounds made by all states of this block. Defaults to SoundGroup.EMPTY.

Link copied to clipboard
open fun stateBacked(category: BackingStateCategory, vararg categories: BackingStateCategory, modelSelector: BlockModelSelectorScope.() -> ModelBuilder = DEFAULT_BLOCK_MODEL_SELECTOR)
abstract fun stateBacked(priority: Int, category: BackingStateCategory, vararg categories: BackingStateCategory, modelSelector: BlockModelSelectorScope.() -> ModelBuilder = DEFAULT_BLOCK_MODEL_SELECTOR)

Configures the backing state types of this block model via the given (category, categories), then selects the corresponding block models via the given modelSelector.

Link copied to clipboard
abstract fun stateProperties(vararg stateProperties: BlockStateProperty<*>)

Adds the stateProperties to the properties of this block.

Link copied to clipboard
abstract fun style(style: Style)
open fun style(color: TextColor)
open fun style(decoration: TextDecoration)
open fun style(vararg decorations: TextDecoration)
open fun style(color: TextColor, vararg decorations: TextDecoration)

Sets the style of the name.

Link copied to clipboard
abstract fun tags(vararg tags: RegistryEntrySet.Paper.Tag<BlockType>)

Adds the entry of the element being build to the given tags.