跳至主要內容

在草地上跳躍有機率將草地踩成泥土

芒果凍布丁原創2025年5月25日小於 1 分鐘

const inputBlock = "minecraft:grass_block";
const outputBlock = "minecraft:dirt";

PlayerEvents.tick((event) => {
  const { player } = event;

  if (player.fallDistance > 1 && player.block.down.id === inputBlock) {
    player.tell("You fell on grass block!");
    if (Math.random() < 0.25) {
      player.block.down.set(outputBlock);
      player.tell(" The grass turned into dirt!");
    }
  }
});
上次編輯於: 2025/5/25 上午2:00:55
貢獻者: Mango