How might I connect to Minecraft from Snap?

Oh, here's my fork of mojangs official scratchx extension for code connection.

It might have some useful things. I'll also try to see if I can extract some javascript from it when I get on my computer.

https://github.com/PojavLauncherTeam/PojavLauncher

PojavLauncher is a Minecraft: Java Edition launcher for Android and iOS based on Boardwalk. [my emphasis]

I've made a server, I'll see if I can connect to it.

Now how do I use this?:
untitled script pic - 2021-12-13T214312.154

Cant you make a repl that does the work?

I could, but I have no idea how do connect to MC in Python.

It might be possible with /wsserver (also see: GitHub - Sandertv/mcwss: A websocket server for Minecraft Bedrock Edition and GitHub - sidious38/wsserver-bedrock: A wsserver for bedrock). I imagine that there would be a websocket used to communicate with the server from Snap, which forwards the data to Minecraft (in a separate connection).
[scratchblocks]
set [session id v] to (create websocket connection :: grey)
send chat message [Hello!] :: grey
[/scratchblocks]

Check this out: GitHub - BluCodeGH/bedrock: A simply python library to access Minecraft: Bedrock Edition worlds.

Just two ses.

Ok.

Nevermind. I'm done arguing with you. I'm just going to mute this topic.

I want it in Python, not Go or Javascript.

Unfortunately, I can't pip install that.

I'm trying, but I can't seem to.
I have this, but it isn't working, probably because it isn't doing anything on localhost, but I can't figure out where it is.

If you had it in JS, maybe you could make a Snap! version using JS Function.

And then make it an extension for the primitive block, that way, you guys can whitelist it, and then people could use it without turning on js

You need to run /wsserver minecraft-server.warpedwartwars.repl.co

You can: pip install git+https://github.com/BluCodeGH/bedrock

You can write your own websocket server (those links are provided as a reference), the protocol isn't the most complicated...

The problem is that JSFunction runs cilentside code, not serverside. You can't create a server with that.

If you're modifying the world level file while the game is running, that'll probably create some interesting race conditions. If the game saves the file at the end, then your new save probably won't even register. If you want to edit it it while the game isn't running though, that could work.

As jens said:

JuicyRaspberryPie

You can get Java edition for free:use PCL and LittleSkin.

Thanks!

Would that work if I don't have Git?

Well, technically, I have: the repl I made.

Can you remove the tag from the quote?

If you're on Replit, Git is already installed. If you're on your own computer, you need to install it.

Fixed.

That doesn't work either:

Could not connect to server: ws://minecraft-server.warpedwartwars.repl.co