1. Wiki
  2. /方块
  3. /minecraft:random_offset

minecraft:random_offset

不想手写?在 GodCraft 里打开一个开关,就能帮你设置好 minecraft:random_offset。Get GodCraft

概览

minecraft:random_offset 是一个方块组件:写在自定义方块的 components 对象中。 根据方块的位置让它稍微偏离中心,就像排列得不那么整齐的花和草。偏移会同时移动轮廓线和碰撞箱,并且始终保持在方块空间内。

字段

字段类型默认值说明
xRange And Steps{"range":{"max":0,"min":0},"steps":0}沿 x 轴的水平偏移:最小值和最大值范围,以及两者之间的步数。
yRange And Steps{"range":{"max":0,"min":0},"steps":0}上下偏移:最小值和最大值范围,以及两者之间的步数。
zRange And Steps{"range":{"max":0,"min":0},"steps":0}沿 z 轴的水平偏移:最小值和最大值范围,以及两者之间的步数。

示例

写在 BP/blocks/<name>.json 的 components 对象中(值为默认值或占位值):

BP/blocks/<name>.json
{
  "minecraft:random_offset": {
    "x": {
      "range": {
        "max": 0,
        "min": 0
      },
      "steps": 0
    },
    "y": {
      "range": {
        "max": 0,
        "min": 0
      },
      "steps": 0
    },
    "z": {
      "range": {
        "max": 0,
        "min": 0
      },
      "steps": 0
    }
  }
}

方块: 行为包

We use cookies to improve your experience and analyse site traffic. Learn more