Cross-Play Between Minecraft and ROBLOX!

(thread now moved from creation-feedback to community-tutorial!)

The following creation was made within a single day, totaling 3 hours of work

The motivation behind this creation was made from 1 Tiktok Video

Direct to TikTok Reference Video

Twitter ROBLOX

⸻⸻⸻⸻⸻⸻⸻⸻⸻

REQUIREMENT

Made with IntelliJ Made with Python Made with Python

⸻⸻⸻⸻⸻⸻⸻⸻⸻

⚠ WARNING MAKING THIS AT YOUR OWN RISK! ⚠

If you own a low-end device and are considering attempting the following actions, be forewarned that it may lead to severe consequences, including potential damage to your laptop or PC. **If you're not low end device, You can skip this message.**

Attempting to run a Minecraft Server on a low-end device is strongly discouraged!
These applications demand a significant amount of RAM to function properly. Undertaking such tasks on a device with limited resources can result in critical performance issues, and in extreme cases, it may lead to the complete teardown of your device.

Unstable Performance: Running resource-intensive server operations without adequate RAM may lead to severe lag, crashes, and overall unstable performance.

⸻⸻⸻⸻⸻⸻⸻⸻⸻

How it Works

From my analysis of the TikTok video, it appears that they using a Plug-in (rather than a Modification Client) as a Recorder and a Self-Hosting API.

The Plug-In record player location upon executing a command and stores the data in JSON format within the Record Plug-In Directory every 20 ticks.

Since, by default, Minecraft runs on 20 ticks per second, the conversion from ticks to seconds is calculated something like this:

Seconds = ( 20 / DefaultTick ) = 1

Moving forward, Python’s FastAPI is employed to self-host the API in a Python script, which retrieves and returns JSON content from the Record Plug-In Directory. The JSON structure is as follows:


⸻⸻⸻⸻⸻⸻⸻⸻⸻

Json Breakdown

{
    "data": [{
        "nickibreeki": { // Minecraft Username
            "position": "x,y,z", // CLoc.getX(), CLoc.getY(), CLoc.getZ()
            "rotation": "x,y"      // CLoc.getYaw(), CLoc.getPitch()
        }
    }]
}

Why CSV and Not Separate Branches?

The decision to store data as CSV is primarily due to simplicity.

Upon extraction, the data can be easily converted from CSV format to a table.

Accessing Localhost Data without Direct Requests

Here's my hacky way to request localhost, a workaround involves using Ngrok to convert my public IP. After convert process Change the FastAPI port match with Ngrok's port.

⸻⸻⸻⸻⸻⸻⸻⸻⸻

Flowchart Diagram

If there are inaccuracies in the flowchart, I extend my apologies, as my flowchart skills are a work in progress on revive

Minecraft Record Plug-in Creation:
view - Documentation


Transmitting Data from Minecraft to ROBLOX:

Additional Information that not existed in flowchart diagram

We will use a for loop to iterate through the data table from server side. The index of the data table corresponds to the character name, as can be seen in the breakdown JSON section.

The for loop will execute every time the RemoteEvent is triggered.
The loop will ignore existing characters and create new characters if they do not already exist.

⸻⸻⸻⸻⸻⸻⸻⸻⸻

image

Any Suggestions or Feedback would help me a lot! Thanks for your time reading and reviewing this!
I wish and hope this information is useful and enough for you guys to do achieve like what i achieved!

54 Likes

You should try to get rid of the “easing” the Minecraft character has, it slows down before reaching the target, before then speeding up, which makes it look a little choppy.

8 Likes

I didn’t use TweenService for this since TweenService can cause a massive lag. I used Lerp to make the Easing Effect. The reason the character feels choppy, Is because of the HttpService network process, it Error, Sometimes Success.

7 Likes

WOW. This is one of the most mindblowing things I’ve seen in Roblox. Very creative!

10 Likes

are you the guy from tiktok?

30 letter limit

7 Likes

The minecraft character reminds me of this:

11 Likes

Nope. I am just another person, not the same person from tiktok.

9 Likes

That’s cool! Does it work in a live Roblox game, or just Roblox Studio?

6 Likes

I rather say it both. since you cannot send the localhost request.
So I have to come up and convert my IP to public so it can make a request.

6 Likes

If the lerp step is constant, then you’ll get non-linear motion (i.e. easing), without using TweenService. But, it’s just what it looks like on my end, slowing down before quickly speeding up again.

Also, perhaps you can use some buffering so that, even if the next update takes a little longer than expected, there’s still motion?

10 Likes

im the guy from tiktok
30 letter limit