<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[[HELP] Converting Core scripts to Script API v2 scripts.]]></title><description><![CDATA[<p dir="auto">Hi, so I need help converting a Core script to the normal Script API version. I am using a custom build of Liquidbounce (Lint), so Core scripts don't work on it (From what I noticed). And I'm a complete noob at scripting.</p>
<p dir="auto">What do I need to do to convert this script from Core to the normal API v2 version?</p>
<p dir="auto">This script is by CzechHek</p>
<pre><code>///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()) &amp;&amp; e.setSafeWalk(!isAboveGround());
    }
}

function isAboveGround() {
    for (i = 0, bp = new BlockPos(mc.thePlayer); i++ &lt; maxfalldistance.get();) if (!mc.theWorld.isAirBlock(bp.down(i))) return true
}
</code></pre>
<p dir="auto">This is what I could figure out so far from studying the normal API v2 scripts. (No, it doesn't work after I tested it.)</p>
<pre><code>///api_version=2
var script = registerScript({
    name: "AutoSafeWalk",
    version: "1.3",
    authors: ["CzechHek"]
});

script.registerModule({
    name: "AutoSafeWalk"
    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()) &amp;&amp; e.setSafeWalk(!isAboveGround());
    }
});

function isAboveGround() {
    for (i = 0, bp = new BlockPos(mc.thePlayer); i++ &lt; maxfalldistance.get();) if (!mc.theWorld.isAirBlock(bp.down(i))) return true
}
</code></pre>
<p dir="auto">I apologize in advance if I sound stupid.</p>
]]></description><link>https://forum.liquidbounce.net/topic/2724/help-converting-core-scripts-to-script-api-v2-scripts</link><generator>RSS for Node</generator><lastBuildDate>Tue, 10 Mar 2026 00:23:18 GMT</lastBuildDate><atom:link href="https://forum.liquidbounce.net/topic/2724.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 23 Jul 2021 22:22:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [HELP] Converting Core scripts to Script API v2 scripts. on Sat, 24 Jul 2021 11:38:32 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/czechhek">@<bdi>czechhek</bdi></a> Oh okay, thanks.</p>
]]></description><link>https://forum.liquidbounce.net/post/21813</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/21813</guid><dc:creator><![CDATA[GolikeAzzis]]></dc:creator><pubDate>Sat, 24 Jul 2021 11:38:32 GMT</pubDate></item><item><title><![CDATA[Reply to [HELP] Converting Core scripts to Script API v2 scripts. on Sat, 24 Jul 2021 07:55:50 GMT]]></title><description><![CDATA[<p dir="auto">@nvinci what does events have to do with scriptapi</p>
]]></description><link>https://forum.liquidbounce.net/post/21804</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/21804</guid><dc:creator><![CDATA[CzechHek]]></dc:creator><pubDate>Sat, 24 Jul 2021 07:55:50 GMT</pubDate></item><item><title><![CDATA[Reply to [HELP] Converting Core scripts to Script API v2 scripts. on Sat, 24 Jul 2021 07:54:54 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/golikeazzis">@<bdi>golikeazzis</bdi></a> they work on it, however as far as I remember Lint had nothing special to offer, spammed errors of missing images in logs and its scriptapi somehow didn't fully work</p>
<p dir="auto">garbage</p>
]]></description><link>https://forum.liquidbounce.net/post/21802</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/21802</guid><dc:creator><![CDATA[CzechHek]]></dc:creator><pubDate>Sat, 24 Jul 2021 07:54:54 GMT</pubDate></item><item><title><![CDATA[Reply to [HELP] Converting Core scripts to Script API v2 scripts. on Sat, 24 Jul 2021 02:43:18 GMT]]></title><description><![CDATA[<p dir="auto">@sigma-bot  apparently its from api v1<br />
<a href="https://github.com/CCBlueX/LiquidScript/blob/master/ScriptAPI-v1%20Docs/module/event.md" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/CCBlueX/LiquidScript/blob/master/ScriptAPI-v1 Docs/module/event.md</a><br />
<img src="/assets/uploads/files/1627094525808-7b8a7ad3-ffd0-4b6a-b2f0-c008af8a365e-image.png" alt="7b8a7ad3-ffd0-4b6a-b2f0-c008af8a365e-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.liquidbounce.net/post/21792</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/21792</guid><dc:creator><![CDATA[vinci]]></dc:creator><pubDate>Sat, 24 Jul 2021 02:43:18 GMT</pubDate></item><item><title><![CDATA[Reply to [HELP] Converting Core scripts to Script API v2 scripts. on Sat, 24 Jul 2021 02:07:53 GMT]]></title><description><![CDATA[<p dir="auto">i just realized something</p>
<p dir="auto"><img src="/assets/uploads/files/1627092447646-chrome_qcsz62uzah.png" alt="chrome_QCsZ62uzah.png" class=" img-fluid img-markdown" /></p>
<p dir="auto"><img src="/assets/uploads/files/1627092461680-chrome_kgaa4hpbpw.png" alt="chrome_kGAA4HPbPW.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">cant find setSafeWalk in the docs idfk</p>
]]></description><link>https://forum.liquidbounce.net/post/21791</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/21791</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Sat, 24 Jul 2021 02:07:53 GMT</pubDate></item><item><title><![CDATA[Reply to [HELP] Converting Core scripts to Script API v2 scripts. on Sat, 24 Jul 2021 01:52:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/skiddermaster412">@<bdi>skiddermaster412</bdi></a> do you even remember how to add a setting<br />
edit: nvm im retarded, the reason why it doesnt work its bcz you didnt import BlockPos<br />
edit 2:nvm im too retarded</p>
]]></description><link>https://forum.liquidbounce.net/post/21790</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/21790</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Sat, 24 Jul 2021 01:52:40 GMT</pubDate></item><item><title><![CDATA[Reply to [HELP] Converting Core scripts to Script API v2 scripts. on Sat, 24 Jul 2021 01:29:01 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/skiddermaster412">@<bdi>skiddermaster412</bdi></a> After testing this, it did not work. I'm trying to fix it by reading more scripts. Thank you for your help though.</p>
]]></description><link>https://forum.liquidbounce.net/post/21789</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/21789</guid><dc:creator><![CDATA[GolikeAzzis]]></dc:creator><pubDate>Sat, 24 Jul 2021 01:29:01 GMT</pubDate></item><item><title><![CDATA[Reply to [HELP] Converting Core scripts to Script API v2 scripts. on Fri, 23 Jul 2021 23:56:09 GMT]]></title><description><![CDATA[<p dir="auto">i used to port CzechHek's scripts all of the time, i don't really like core</p>
]]></description><link>https://forum.liquidbounce.net/post/21788</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/21788</guid><dc:creator><![CDATA[skiddermaster412]]></dc:creator><pubDate>Fri, 23 Jul 2021 23:56:09 GMT</pubDate></item><item><title><![CDATA[Reply to [HELP] Converting Core scripts to Script API v2 scripts. on Fri, 23 Jul 2021 23:54:37 GMT]]></title><description><![CDATA[<p dir="auto">you nearly in the right path,<br />
see how the other scripts work.<br />
you are far away from converting the script<br />
here take it, just to educate you and not to steal it.</p>
<pre><code>///api_version=2
var script = registerScript({
    name: "AutoSafeWalk",
    version: "1.3",
    authors: ["CzechHek"]
});
var airsafe = Setting.boolean({
    name: "AirSafe",
    default: true
});
var maxfalldistance = Setting.integer({
    name:"MaxFallDistance",
    default: 5,
    min: 0,
    max: 255
});
script.registerModule({
    name: "AutoSafeWalk"
    category: "Movement",
    description: "SafeWalk that activates if there is a gap exceeding maximal fall distance.",
    settings: {
        airsafe: airsafe,
        maxfalldistance: maxfalldistance
    }
}, function (module){
    module.on("move", function(e){
        (mc.thePlayer.onGround || airsafe.get()) &amp;&amp; e.setSafeWalk(!isAboveGround());
    });
});

function isAboveGround() {
    var BlockPos = Java.type("net.minecraft.util.BlockPos");
    for (i = 0, bp = new BlockPos(mc.thePlayer); i++ &lt; maxfalldistance.get();) if (!mc.theWorld.isAirBlock(bp.down(i))) return true
}
</code></pre>
<p dir="auto">compare and see what errors you had.<br />
(btw i made this without testing so if it works it works)</p>
]]></description><link>https://forum.liquidbounce.net/post/21787</link><guid isPermaLink="true">https://forum.liquidbounce.net/post/21787</guid><dc:creator><![CDATA[skiddermaster412]]></dc:creator><pubDate>Fri, 23 Jul 2021 23:54:37 GMT</pubDate></item></channel></rss>