在草地上跳躍有機率將草地踩成泥土
原創2024年11月10日小於 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!");
}
}
});