RenderType

预计阅读时间: 小于 1 分钟

概述

RenderType 定义了方块的渲染类型,决定了方块在游戏中的视觉表现方式。

常用渲染类型

// 实体渲染类型
RenderType.solid()           // 实心方块
RenderType.cutout()          // 镂空方块(如树叶)
RenderType.cutoutMipped()    // 带 mipmap 的镂空
RenderType.translucent()     // 半透明方块
RenderType.translucentMoving() // 动态半透明(如水流)

在方块注册中使用

StartupEvents.registry('block', event => {
  event.create('custom_glass')
    .displayName('Custom Glass')
    .material('glass')
    .renderType('translucent')
})