实现功能

在橙色混凝土上获得加速的效果,在淡蓝色混凝土上获得跳跃提升的效果。fc9dee410e5a173949360be3bc8b0e79.png

代码实现部分:

(sever_scripts)

//橙色混凝土加速、蓝色跳跃
PlayerEvents.tick(event => {
	//淡蓝色跳跃提升
	const { player, sever } = event
	let pos = player.block.offset(0, -1, 0)//将pos值设为玩家脚底下坐标
	if (pos.id == 'minecraft:light_blue_concrete')//判定pos值(即坐标处)是否为淡蓝色混凝土
	{
		event.player.potionEffects.add("minecraft:jump_boost", 10, 5, false, false)
	}
})
//橙色加速
PlayerEvents.tick(event => {
	const { player, sever } = event
	let pos = player.block.offset(0, -1, 0)
	if (pos.id == 'minecraft:orange_concrete') {
		event.player.potionEffects.add("minecraft:speed", 5, 10, false, false)
	}
})

同系列【跑酷套件】源码仓库

点我跳转至Github仓库

❥STAR❥拜托了~~~