Skip to content

mariusdkm/UltraSonic

Repository files navigation

¡WIP! UltraSonic

Platform Minecraft version GitHub issues GitHub license

UltraSonic is going to be a pathing extension for the macros mod JsMacros.
3d pathing is now possible;

example.mp4

Installation

  1. Download and run the Fabric installer.
    • Click the "vanilla" button, leave the other settings as they are, and click "download installer".
    • Note: this step may vary if you aren't using the vanilla launcher or an old version of Minecraft.
  2. Download the Fabric API and move it to the mods folder (.minecraft/mods).
  3. Download the newest JsMacros release and move it to the mods folder (.minecraft/mods).
  4. Download UltraSonic from the releases page and move it to the mods folder (.minecraft/mods).

Releases

None yet... come back in a couple of months if you want a fully working version or try one of the betas.

Beta builds beta builds badge

For (possibly unstable) beta builds click here, go to the most recent action and download the Zip-file at the bottom.
Then use the jar without dev or sources in the filename as your mod jar.
(Note: You have to be logged in to be able to download the Zip-file.)

Usage

This mod currently adds the Pathing object for the usage use in macros.
It can be used in any language just like for example the Player object.

Example

1st script; pathfind to the block targeted by the crosshair

// Whether to draw the yellow points that show where the player will move
Player.setDrawPredictions(true);
// Whether the player doesn't take damage(like in creative)
Player.setImmuneToDamage(false);
// Set goal here
const goal = Player.rayTraceBlock(20, false).getBlockPos(); 
Chat.log("Goal: " + goal);

if (Pathing.pathTo(goal.getX(), goal.getY(), goal.getZ(), true)) {
    Pathing.visualizePath();
    var inputs = Pathing.getInputs();
    
    // In order to execute the inputs directly use this code
    // Player.predictInputs(inputs, true);
    // Player.addInputs(inputs);
    
    const file = FS.open("inputs.csv");
    file.write("movementForward,movementSideways,yaw,pitch,jumping,sneaking,sprinting\n")
    Chat.log("Saving inputs")
    for (const input of inputs) {  
        file.append(input.toString(false) + "\n")
    }
} else {
    Chat.log("No path found")
}

2nd script; execute inputs

const PlayerInput = Java.type("xyz.wagyourtail.jsmacros.client.api.classes.PlayerInput")

Chat.log("Reading inputs from file")
let csv = FS.open("inputs.csv").read()
let inputs = PlayerInput.fromCsv(csv)
Player.addInputs(inputs)

Contributing and Issues

If you expierence any issues or have a question or a feature request, please open an issue.

Contributions are also very welcome, feel free to open a pull request.

Dev Environment

If you want to use a real minecraft account to test something on a server, you can use DevAuth by DJtheRedstoner.

FAQ

Does it work yet?

NO

Why is it called UltraSonic?

It's the opposite of baritone.
And this mod's goal is it to be Ultra fast like Sonic from the video games.

About

WIP pathing in minecraft

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages