真實的終界珍珠
原創2024年11月10日小於 1 分鐘
真實的終界珍珠
ItemEvents.rightClicked("ender_pearl", (event) => {
const { level, player, item } = event;
if (!player.cooldowns.isOnCooldown(item)) {
player.cooldowns.addCooldown(item, 20);
let thrownEnderpearl = level.createEntity("snowball");
thrownEnderpearl.item = item;
thrownEnderpearl.setPosition(player.x, player.y + 1, player.z);
thrownEnderpearl.deltaMovement = player.lookAngle.scale(1.5);
thrownEnderpearl.spawn();
player.startRiding(thrownEnderpearl);
}
event.cancel();
});