Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local m = peripheral.wrap "back"
- function groundDistance(meta)
- local blocks = m.scan()
- for y = 0, -8, -1 do
- local block = blocks[1 + (8 + (8 + y)*17 + 8*17^2)]
- if block.name ~= "minecraft:air" then
- return -y
- end
- end
- return 8
- end
- function normalFly(meta)
- m.launch(meta.yaw, meta.pitch, 3)
- end
- while true do
- local meta = m.getMetaOwner()
- if groundDistance(meta) < 8 and meta.motionY < -0.1 then
- m.launch(0, 270, math.min(4, math.abs(meta.motionY)))
- end
- if meta.isSneaking then
- normalFly(meta)
- end
- end
Add Comment
Please, Sign In to add comment