What are you searching for?

MS Extras

MS Extras

This mod is an Pathfinding API for general usage

download 2 Downloads · favorite 0 Followers · Updated 3 days ago
Fabric Technology Utility 1.21.11

Versions

inventory_2
MS Extras 0.2

0.2 · 3 days ago · 39.02 KB

Fabric 1.21.11

About

This mod is disigned as an API for scripting mods like Minescript.

How to use it

( Minescript Example )

from minescript import echo

# Import the API
PathfinderAPI = JavaClass("gamchu.pathfinder.api.PathfinderAPI")
GoalBlock = JavaClass("gamchu.pathfinder.goals.GoalBlock")

# Get pathfinder instance
pathfinder = PathfinderAPI.getProvider().getPathfinder()

# Create a goal and find a smoothed path
goal = GoalBlock(100, 64, 200)
future = pathfinder.findSmoothedPathAsync(goal)

# Wait for result
result = future.get()

if result.getSuccess():
    echo(f"Path found with {result.getPathSize()} waypoints")
else:
    echo("No path found")

Checking Pathfinding Status

# Check if pathfinding is currently running
if pathfinder.isPathing():
    echo("Pathfinding in progress...")
else:
    echo("No pathfinding running")

Cancelling Pathfinding

# Cancel the current pathfinding operation
if pathfinder.isPathing():
    pathfinder.cancel()
    echo("Pathfinding cancelled")

Regular vs. Smoothed Paths

Compare the difference:

# Regular A* path (all waypoints)
regularFuture = pathfinder.findPathAsync(goal)
regularResult = regularFuture.get()

# Smoothed path (optimized waypoints)
smoothedFuture = pathfinder.findSmoothedPathAsync(goal)
smoothedResult = smoothedFuture.get()

echo(f"Regular: {regularResult.getPathSize()} waypoints")
echo(f"Smoothed: {smoothedResult.getPathSize()} waypoints")
echo(f"Reduction: {100 - (smoothedResult.getPathSize() * 100 / regularResult.getPathSize()):.1f}%")

open_in_new View on Modrinth
Compatibility
Client: Required Server: Unsupported
gavel LicenseRef-All-Rights-Reserved

Conversation

What are your thoughts?

Related projects

Optimization Utility
FerriteCore
FerriteCore

by malte0811

Memory usage optimizations

download 87.1M
favorite 12,856
Utility
Mod Menu
Mod Menu

by Prospector

Adds a mod menu to view the list of mods you have installed.

download 80.3M
favorite 22,309
Library Management Utility
YetAnotherConfigLib (YACL)
YetAnotherConfigLib (YACL)

by isxander

A builder-based configuration library for Minecraft!

download 68.2M
favorite 7,680
Adventure Transportation Utility
Xaero's Minimap
Xaero's Minimap

by thexaero

Displays a map of the nearby world terrain, players, mobs, entities in the corner of your screen. Lets you create waypoints which help you find the locations you've marked.

download 63.0M
favorite 13,862
lock Cookie consent

SkinMC uses cookies to provide functionality and features.