SimpleMacrocosmBlock

open class SimpleMacrocosmBlock(id: String, val name: String, itemRarity: Rarity, hardness: Number, val steadiness: Int, baseExperience: Pair<Number, SkillType>, val suitableTools: List<ItemType>, pool: LootPool, val soundBank: BlockSoundBank, texture: String = id) : MacrocosmBlock, AutoRegister<MacrocosmItem> (source)

A wrapper over a MacrocosmBlock that allows to generate and register a PlaceableItem, as well as a model both for the block and the item using the HybridBlockModelGenerator.

This is an open class, so you may override it for further extending

Parameters

id

Unparsed ID of the block and item. It will further be parsed using Identifier.parse, so make sure to include your own namespace if needed!

name

Name of the block item. Supports MiniMessage formatting

hardness

The hardness of this block. Breaking speed depends on this value. Even though it supports a Number, the value will be rounded to an Int

steadiness

The steadiness of this block. Breaking power required to break this block depends on this value. Values below 0 are not supported

baseExperience

Base skill experience amount that is given after breaking this block

suitableTools

Tools, suitable for breaking this block.

pool

The static loot pool which will be used to determine the items to drop from this block. To generate a dynamic loot pool, override the pool method

soundBank

The sound bank containing events for this block, e.g. when it is broken/placed.

texture

Unparsed ID pointing to the texture of this block. By default, it is equal to id

Constructors

Link copied to clipboard
constructor(id: String, name: String, itemRarity: Rarity, hardness: Number, steadiness: Int, baseExperience: Pair<Number, SkillType>, suitableTools: List<ItemType>, pool: LootPool, soundBank: BlockSoundBank, texture: String = id)

Functions

Link copied to clipboard
open fun place(placer: Player, mc: MacrocosmPlayer, at: Location)

Places this block at provided location

Link copied to clipboard
open override fun pool(player: Player, mc: MacrocosmPlayer): LootPool

Builds a loot pool for this block, to drop for player

Link copied to clipboard
open override fun register(registry: Registry<MacrocosmItem>)

Properties

Link copied to clipboard
open override val baseExperience: Pair<Float, SkillType>

Base skill experience amount that is given after breaking this block

Link copied to clipboard
open override val hardness: Int

The hardness of this block. Breaking speed depends on this value.

Link copied to clipboard
open override val id: Identifier

The identifier of this block.

Link copied to clipboard
Link copied to clipboard
open override val soundBank: BlockSoundBank
Link copied to clipboard
open override val steadiness: Int
Link copied to clipboard
open override val suitableTools: List<ItemType>
Link copied to clipboard
open override val texture: Identifier

The identifier pointing to resource pack location of the texture for this block. Defaults to $id.namespace:block/$id.path