forked from Hirohiko360/LiquidBounceScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAutoSafeWalk.js
More file actions
22 lines (20 loc) · 707 Bytes
/
AutoSafeWalk.js
File metadata and controls
22 lines (20 loc) · 707 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
///api_version=2
(script = registerScript({
name: "AutoSafeWalk",
version: "1.3",
authors: ["CzechHek"]
})).import("Core.lib");
module = {
category: "Movement",
description: "SafeWalk that activates if there is a gap exceeding maximal fall distance.",
values: [
airsafe = value.createBoolean("AirSafe", true),
maxfalldistance = value.createInteger("MaxFallDistance", 5, 0, 255)
],
onMove: function (e) {
(mc.thePlayer.onGround || airsafe.get()) && e.setSafeWalk(!isAboveGround());
}
}
function isAboveGround() {
for (i = 0, bp = new BlockPos(mc.thePlayer); i++ < maxfalldistance.get();) if (!mc.theWorld.isAirBlock(bp.down(i))) return true
}