entityBacked

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.

If eraseSelectedVanillaModels is enabled, the states selected by stateSelector will be made invisible, making the vanilla blocks entity-backed as well.

Entity-backed custom block models are less performant than state-backed models, but a lot more flexible:

  • They can display transparent- and oversized (larger than 3x3x3) models.

  • There is no limit to the amount of different models.

  • Every vanilla block type can be used as the base block inside the display entity. This allows for very customizable colliders.

  • The item display entities can be accessed and updated at runtime.

Exclusive with stateBacked and modelLess.